From b8368c704ce55b61adfc37894e6786d47b5aedac Mon Sep 17 00:00:00 2001 From: ReleaseHelper Date: Mon, 1 Jan 2024 01:09:56 +0000 Subject: [PATCH 1/3] [Release] sdk/resourcemanager/cosmos/armcosmos/2.7.0 generation from spec commit: 41e4538ed7bb3ceac3c1322c9455a0812ed110ac --- .../cosmos/armcosmos/CHANGELOG.md | 35 + .../cosmos/armcosmos/README.md | 6 +- .../cosmos/armcosmos/autorest.md | 8 +- .../armcosmos/cassandraclusters_client.go | 188 +- .../cassandraclusters_client_example_test.go | 107 +- .../armcosmos/cassandradatacenters_client.go | 26 +- ...assandradatacenters_client_example_test.go | 20 +- .../armcosmos/cassandraresources_client.go | 743 +- .../cassandraresources_client_example_test.go | 333 +- .../cosmos/armcosmos/client_factory.go | 18 - .../cosmos/armcosmos/collection_client.go | 12 +- .../collection_client_example_test.go | 8 +- .../armcosmos/collectionpartition_client.go | 8 +- ...collectionpartition_client_example_test.go | 6 +- .../collectionpartitionregion_client.go | 4 +- ...tionpartitionregion_client_example_test.go | 4 +- .../armcosmos/collectionregion_client.go | 4 +- .../collectionregion_client_example_test.go | 4 +- .../cosmos/armcosmos/constants.go | 153 +- .../cosmos/armcosmos/database_client.go | 12 +- .../armcosmos/database_client_example_test.go | 8 +- .../armcosmos/databaseaccountregion_client.go | 4 +- ...tabaseaccountregion_client_example_test.go | 4 +- .../armcosmos/databaseaccounts_client.go | 86 +- .../databaseaccounts_client_example_test.go | 149 +- .../armcosmos/datatransferjobs_client.go | 457 - .../datatransferjobs_client_example_test.go | 286 - .../fake/cassandraclusters_server.go | 89 - .../fake/cassandraresources_server.go | 452 - .../armcosmos/fake/datatransferjobs_server.go | 332 - .../armcosmos/fake/graphresources_server.go | 268 - .../armcosmos/fake/mongoclusters_server.go | 639 -- .../armcosmos/fake/mongodbresources_server.go | 452 +- .../cosmos/armcosmos/fake/server_factory.go | 21 - .../armcosmos/fake/sqlresources_server.go | 496 +- sdk/resourcemanager/cosmos/armcosmos/go.mod | 3 +- sdk/resourcemanager/cosmos/armcosmos/go.sum | 2 + .../cosmos/armcosmos/graphresources_client.go | 344 - .../graphresources_client_example_test.go | 160 - .../armcosmos/gremlinresources_client.go | 90 +- .../gremlinresources_client_example_test.go | 40 +- .../cosmos/armcosmos/interfaces.go | 10 - .../cosmos/armcosmos/locations_client.go | 8 +- .../locations_client_example_test.go | 6 +- .../cosmos/armcosmos/models.go | 1075 +-- .../cosmos/armcosmos/models_serde.go | 8192 ++++++----------- .../cosmos/armcosmos/mongoclusters_client.go | 898 -- .../mongoclusters_client_example_test.go | 784 -- .../armcosmos/mongodbresources_client.go | 663 +- .../mongodbresources_client_example_test.go | 555 +- .../armcosmos/notebookworkspaces_client.go | 36 +- .../notebookworkspaces_client_example_test.go | 16 +- .../cosmos/armcosmos/operations_client.go | 4 +- .../operations_client_example_test.go | 4 +- .../cosmos/armcosmos/options.go | 277 - .../armcosmos/partitionkeyrangeid_client.go | 4 +- ...partitionkeyrangeid_client_example_test.go | 4 +- .../partitionkeyrangeidregion_client.go | 4 +- ...ionkeyrangeidregion_client_example_test.go | 4 +- .../cosmos/armcosmos/percentile_client.go | 4 +- .../percentile_client_example_test.go | 4 +- .../percentilesourcetarget_client.go | 4 +- ...centilesourcetarget_client_example_test.go | 4 +- .../armcosmos/percentiletarget_client.go | 4 +- .../percentiletarget_client_example_test.go | 4 +- .../cosmos/armcosmos/polymorphic_helpers.go | 27 - .../privateendpointconnections_client.go | 20 +- ...endpointconnections_client_example_test.go | 10 +- .../armcosmos/privatelinkresources_client.go | 8 +- ...rivatelinkresources_client_example_test.go | 6 +- .../cosmos/armcosmos/response_types.go | 260 - .../restorabledatabaseaccounts_client.go | 12 +- ...bledatabaseaccounts_client_example_test.go | 16 +- .../restorablegremlindatabases_client.go | 4 +- ...blegremlindatabases_client_example_test.go | 7 +- .../restorablegremlingraphs_client.go | 4 +- ...orablegremlingraphs_client_example_test.go | 21 +- .../restorablegremlinresources_client.go | 4 +- ...blegremlinresources_client_example_test.go | 4 +- .../restorablemongodbcollections_client.go | 4 +- ...emongodbcollections_client_example_test.go | 21 +- .../restorablemongodbdatabases_client.go | 4 +- ...blemongodbdatabases_client_example_test.go | 7 +- .../restorablemongodbresources_client.go | 4 +- ...blemongodbresources_client_example_test.go | 4 +- .../restorablesqlcontainers_client.go | 4 +- ...orablesqlcontainers_client_example_test.go | 6 +- .../restorablesqldatabases_client.go | 4 +- ...torablesqldatabases_client_example_test.go | 8 +- .../restorablesqlresources_client.go | 4 +- ...torablesqlresources_client_example_test.go | 4 +- .../restorabletableresources_client.go | 4 +- ...rabletableresources_client_example_test.go | 4 +- .../armcosmos/restorabletables_client.go | 4 +- .../restorabletables_client_example_test.go | 21 +- .../cosmos/armcosmos/service_client.go | 20 +- .../armcosmos/service_client_example_test.go | 28 +- .../cosmos/armcosmos/sqlresources_client.go | 735 +- .../sqlresources_client_example_test.go | 982 +- .../cosmos/armcosmos/tableresources_client.go | 48 +- .../tableresources_client_example_test.go | 22 +- 101 files changed, 4173 insertions(+), 16821 deletions(-) delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/fake/datatransferjobs_server.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/fake/graphresources_server.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/fake/mongoclusters_server.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/graphresources_client.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/graphresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client_example_test.go diff --git a/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md b/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md index fc2224a709a1..ed7883a67897 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md +++ b/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md @@ -1,5 +1,40 @@ # Release History +## 2.7.0 (2024-01-26) +### Features Added + +- New value `OperationTypeRecreate` added to enum type `OperationType` +- New struct `ComputedProperty` +- New struct `ResourceRestoreParameters` +- New struct `RestoreParametersBase` +- New field `CustomerManagedKeyStatus`, `EnableBurstCapacity` in struct `DatabaseAccountCreateUpdateProperties` +- New field `CustomerManagedKeyStatus`, `EnableBurstCapacity` in struct `DatabaseAccountGetProperties` +- New field `CustomerManagedKeyStatus`, `EnableBurstCapacity` in struct `DatabaseAccountUpdateProperties` +- New field `CreateMode`, `RestoreParameters` in struct `GremlinDatabaseGetPropertiesResource` +- New field `CreateMode`, `RestoreParameters` in struct `GremlinDatabaseResource` +- New field `CreateMode`, `RestoreParameters` in struct `GremlinGraphGetPropertiesResource` +- New field `CreateMode`, `RestoreParameters` in struct `GremlinGraphResource` +- New field `CreateMode`, `RestoreParameters` in struct `MongoDBCollectionGetPropertiesResource` +- New field `CreateMode`, `RestoreParameters` in struct `MongoDBCollectionResource` +- New field `CreateMode`, `RestoreParameters` in struct `MongoDBDatabaseGetPropertiesResource` +- New field `CreateMode`, `RestoreParameters` in struct `MongoDBDatabaseResource` +- New field `CanUndelete`, `CanUndeleteReason` in struct `RestorableGremlinDatabasePropertiesResource` +- New field `CanUndelete`, `CanUndeleteReason` in struct `RestorableGremlinGraphPropertiesResource` +- New field `CanUndelete`, `CanUndeleteReason` in struct `RestorableMongodbCollectionPropertiesResource` +- New field `CanUndelete`, `CanUndeleteReason` in struct `RestorableMongodbDatabasePropertiesResource` +- New field `CanUndelete`, `CanUndeleteReason` in struct `RestorableSQLContainerPropertiesResource` +- New field `ComputedProperties`, `CreateMode`, `RestoreParameters` in struct `RestorableSQLContainerPropertiesResourceContainer` +- New field `CanUndelete`, `CanUndeleteReason` in struct `RestorableSQLDatabasePropertiesResource` +- New field `CreateMode`, `RestoreParameters` in struct `RestorableSQLDatabasePropertiesResourceDatabase` +- New field `CanUndelete`, `CanUndeleteReason` in struct `RestorableTablePropertiesResource` +- New field `ComputedProperties`, `CreateMode`, `RestoreParameters` in struct `SQLContainerGetPropertiesResource` +- New field `ComputedProperties`, `CreateMode`, `RestoreParameters` in struct `SQLContainerResource` +- New field `CreateMode`, `RestoreParameters` in struct `SQLDatabaseGetPropertiesResource` +- New field `CreateMode`, `RestoreParameters` in struct `SQLDatabaseResource` +- New field `CreateMode`, `RestoreParameters` in struct `TableGetPropertiesResource` +- New field `CreateMode`, `RestoreParameters` in struct `TableResource` + + ## 3.0.0-beta.2 (2023-11-30) ### Features Added diff --git a/sdk/resourcemanager/cosmos/armcosmos/README.md b/sdk/resourcemanager/cosmos/armcosmos/README.md index 7df535e6e85d..cd957b5eae0c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/README.md +++ b/sdk/resourcemanager/cosmos/armcosmos/README.md @@ -1,6 +1,6 @@ # Azure Cosmos DB Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2) The `armcosmos` module provides operations for working with Azure Cosmos DB. @@ -20,7 +20,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Cosmos DB module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2 ``` ## Authorization @@ -57,7 +57,7 @@ clientFactory, err := armcosmos.NewClientFactory(, cred, &optio A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewDatabaseClient() +client := clientFactory.NewCassandraClustersClient() ``` ## Fakes diff --git a/sdk/resourcemanager/cosmos/armcosmos/autorest.md b/sdk/resourcemanager/cosmos/armcosmos/autorest.md index 8e930c179e24..947adf092c61 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/autorest.md +++ b/sdk/resourcemanager/cosmos/armcosmos/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.0.0-beta.2 -tag: package-preview-2023-03-15 +module-version: 2.7.0 +tag: package-2023-11 ``` \ 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 9b5ce9869278..990bc73286f8 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client.go @@ -47,7 +47,7 @@ func NewCassandraClustersClient(subscriptionID string, credential azcore.TokenCr // To update only some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -74,7 +74,7 @@ func (client *CassandraClustersClient) BeginCreateUpdate(ctx context.Context, re // update only some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraClustersClient) createUpdate(ctx context.Context, resourceGroupName string, clusterName string, body ClusterResource, options *CassandraClustersClientBeginCreateUpdateOptions) (*http.Response, error) { var err error const operationName = "CassandraClustersClient.BeginCreateUpdate" @@ -116,7 +116,7 @@ func (client *CassandraClustersClient) createUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -130,7 +130,7 @@ func (client *CassandraClustersClient) createUpdateCreateRequest(ctx context.Con // already deallocated cluster. Use Start to restart the cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -157,7 +157,7 @@ func (client *CassandraClustersClient) BeginDeallocate(ctx context.Context, reso // already deallocated cluster. Use Start to restart the cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraClustersClient) deallocate(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientBeginDeallocateOptions) (*http.Response, error) { var err error const operationName = "CassandraClustersClient.BeginDeallocate" @@ -199,7 +199,7 @@ func (client *CassandraClustersClient) deallocateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -208,7 +208,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 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -233,7 +233,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CassandraClustersClient.BeginDelete" @@ -275,7 +275,7 @@ func (client *CassandraClustersClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -330,7 +330,7 @@ func (client *CassandraClustersClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,80 +345,10 @@ 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 2023-03-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) { - var err error - const operationName = "CassandraClustersClient.GetBackup" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getBackupCreateRequest(ctx, resourceGroupName, clusterName, backupID, options) - if err != nil { - return CassandraClustersClientGetBackupResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CassandraClustersClientGetBackupResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CassandraClustersClientGetBackupResponse{}, err - } - resp, err := client.getBackupHandleResponse(httpResp) - return resp, err -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -444,7 +374,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraClustersClient) invokeCommand(ctx context.Context, resourceGroupName string, clusterName string, body CommandPostBody, options *CassandraClustersClientBeginInvokeCommandOptions) (*http.Response, error) { var err error const operationName = "CassandraClustersClient.BeginInvokeCommand" @@ -486,7 +416,7 @@ func (client *CassandraClustersClient) invokeCommandCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -495,75 +425,9 @@ func (client *CassandraClustersClient) invokeCommandCreateRequest(ctx context.Co return req, nil } -// NewListBackupsPager - List the backups of this cluster that are available to restore. -// -// Generated from API version 2023-03-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.NewListBackupsPager -// 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) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CassandraClustersClient.NewListBackupsPager") - req, err := client.listBackupsCreateRequest(ctx, resourceGroupName, clusterName, options) - if err != nil { - return CassandraClustersClientListBackupsResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CassandraClustersClientListBackupsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CassandraClustersClientListBackupsResponse{}, runtime.NewResponseError(resp) - } - return client.listBackupsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CassandraClustersClientListByResourceGroupOptions contains the optional parameters for the CassandraClustersClient.NewListByResourceGroupPager // method. @@ -607,7 +471,7 @@ func (client *CassandraClustersClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -624,7 +488,7 @@ func (client *CassandraClustersClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - List all managed Cassandra clusters in this subscription. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - options - CassandraClustersClientListBySubscriptionOptions contains the optional parameters for the CassandraClustersClient.NewListBySubscriptionPager // method. func (client *CassandraClustersClient) NewListBySubscriptionPager(options *CassandraClustersClientListBySubscriptionOptions) *runtime.Pager[CassandraClustersClientListBySubscriptionResponse] { @@ -663,7 +527,7 @@ func (client *CassandraClustersClient) listBySubscriptionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -683,7 +547,7 @@ func (client *CassandraClustersClient) listBySubscriptionHandleResponse(resp *ht // cluster. Use Deallocate to deallocate the cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -710,7 +574,7 @@ func (client *CassandraClustersClient) BeginStart(ctx context.Context, resourceG // cluster. Use Deallocate to deallocate the cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraClustersClient) start(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "CassandraClustersClient.BeginStart" @@ -752,7 +616,7 @@ func (client *CassandraClustersClient) startCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -761,7 +625,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 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -808,7 +672,7 @@ func (client *CassandraClustersClient) statusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -826,7 +690,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -852,7 +716,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraClustersClient) update(ctx context.Context, resourceGroupName string, clusterName string, body ClusterResource, options *CassandraClustersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CassandraClustersClient.BeginUpdate" @@ -894,7 +758,7 @@ func (client *CassandraClustersClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client_example_test.go index 92e5fb15bb3d..5190dd29c159 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json func ExampleCassandraClustersClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleCassandraClustersClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("cassandra-prod"), // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/cassandraClusters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/cassandraClusters"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // }, @@ -103,7 +103,7 @@ func ExampleCassandraClustersClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json func ExampleCassandraClustersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExampleCassandraClustersClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("cassandra-prod"), // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // }, @@ -188,7 +188,7 @@ func ExampleCassandraClustersClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraClusterGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraClusterGet.json func ExampleCassandraClustersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -209,7 +209,7 @@ func ExampleCassandraClustersClient_Get() { // res.ClusterResource = armcosmos.ClusterResource{ // Name: to.Ptr("cassandra-prod"), // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // }, @@ -265,7 +265,7 @@ func ExampleCassandraClustersClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraClusterDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraClusterDelete.json func ExampleCassandraClustersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -286,7 +286,7 @@ func ExampleCassandraClustersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraClusterCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraClusterCreate.json func ExampleCassandraClustersClient_BeginCreateUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -396,7 +396,7 @@ func ExampleCassandraClustersClient_BeginCreateUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraClusterPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraClusterPatch.json func ExampleCassandraClustersClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -455,7 +455,7 @@ func ExampleCassandraClustersClient_BeginUpdate() { // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), // }}, // ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"), - // DelegatedManagementSubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"), + // 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-----"), @@ -499,7 +499,7 @@ func ExampleCassandraClustersClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraCommand.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraCommand.json func ExampleCassandraClustersClient_BeginInvokeCommand() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -511,10 +511,7 @@ func ExampleCassandraClustersClient_BeginInvokeCommand() { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCassandraClustersClient().BeginInvokeCommand(ctx, "cassandra-prod-rg", "cassandra-prod", armcosmos.CommandPostBody{ - Arguments: map[string]*string{ - "status": to.Ptr(""), - }, - Command: to.Ptr("nodetool"), + Command: to.Ptr("nodetool status"), Host: to.Ptr("10.0.1.12"), }, nil) if err != nil { @@ -526,79 +523,7 @@ func ExampleCassandraClustersClient_BeginInvokeCommand() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCassandraClustersClient().NewListBackupsPager("cassandra-prod-rg", "cassandra-prod", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListBackups = armcosmos.ListBackups{ - // Value: []*armcosmos.BackupResource{ - // { - // Name: to.Ptr("1611250348"), - // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters/backups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/backups/1611250348"), - // Properties: &armcosmos.BackupResourceProperties{ - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-21T17:32:28.000Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("1611214220"), - // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters/backups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/backups/1611214220"), - // Properties: &armcosmos.BackupResourceProperties{ - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-21T07:30:20.000Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCassandraClustersClient().GetBackup(ctx, "cassandra-prod-rg", "cassandra-prod", "1611250348", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupResource = armcosmos.BackupResource{ - // Name: to.Ptr("1611250348"), - // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters/backups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/backups/1611250348"), - // Properties: &armcosmos.BackupResourceProperties{ - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-21T17:32:28.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraClusterDeallocate.json func ExampleCassandraClustersClient_BeginDeallocate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -619,7 +544,7 @@ func ExampleCassandraClustersClient_BeginDeallocate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraClusterStart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraClusterStart.json func ExampleCassandraClustersClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -640,7 +565,7 @@ func ExampleCassandraClustersClient_BeginStart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraStatus.json func ExampleCassandraClustersClient_Status() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client.go b/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client.go index 379823f4d53c..7e5c1a555536 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client.go @@ -47,7 +47,7 @@ func NewCassandraDataCentersClient(subscriptionID string, credential azcore.Toke // only some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -75,7 +75,7 @@ func (client *CassandraDataCentersClient) BeginCreateUpdate(ctx context.Context, // some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraDataCentersClient) createUpdate(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body DataCenterResource, options *CassandraDataCentersClientBeginCreateUpdateOptions) (*http.Response, error) { var err error const operationName = "CassandraDataCentersClient.BeginCreateUpdate" @@ -121,7 +121,7 @@ func (client *CassandraDataCentersClient) createUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -133,7 +133,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -159,7 +159,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraDataCentersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, options *CassandraDataCentersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CassandraDataCentersClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *CassandraDataCentersClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -266,7 +266,7 @@ func (client *CassandraDataCentersClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *CassandraDataCentersClient) getHandleResponse(resp *http.Response) // NewListPager - List all data centers in a particular managed Cassandra cluster. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListPager @@ -332,7 +332,7 @@ func (client *CassandraDataCentersClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +350,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -377,7 +377,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraDataCentersClient) update(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body DataCenterResource, options *CassandraDataCentersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CassandraDataCentersClient.BeginUpdate" @@ -423,7 +423,7 @@ func (client *CassandraDataCentersClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client_example_test.go index 4585fc4689b7..ce74a05a6b01 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraDataCenterList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraDataCenterList.json func ExampleCassandraDataCentersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleCassandraDataCentersClient_NewListPager() { // { // Name: to.Ptr("dc1"), // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters/dataCenters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/dataCenters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/dataCenters"), // Properties: &armcosmos.DataCenterResourceProperties{ // Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="), // DataCenterLocation: to.Ptr("West US 2"), @@ -68,7 +68,7 @@ func ExampleCassandraDataCentersClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraDataCenterGet.json func ExampleCassandraDataCentersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -89,7 +89,7 @@ func ExampleCassandraDataCentersClient_Get() { // res.DataCenterResource = armcosmos.DataCenterResource{ // Name: to.Ptr("dc1"), // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters/dataCenters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/dataCenters/dc1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/dataCenters/dc1"), // Properties: &armcosmos.DataCenterResourceProperties{ // Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="), // DataCenterLocation: to.Ptr("West US 2"), @@ -110,7 +110,7 @@ func ExampleCassandraDataCentersClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraDataCenterDelete.json func ExampleCassandraDataCentersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -131,7 +131,7 @@ func ExampleCassandraDataCentersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraDataCenterCreate.json func ExampleCassandraDataCentersClient_BeginCreateUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -163,7 +163,7 @@ func ExampleCassandraDataCentersClient_BeginCreateUpdate() { // res.DataCenterResource = armcosmos.DataCenterResource{ // Name: to.Ptr("dc1"), // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters/dataCenters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/dataCenters/dc1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/dataCenters/dc1"), // Properties: &armcosmos.DataCenterResourceProperties{ // 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"), @@ -183,7 +183,7 @@ func ExampleCassandraDataCentersClient_BeginCreateUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBManagedCassandraDataCenterPatch.json func ExampleCassandraDataCentersClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -219,7 +219,7 @@ func ExampleCassandraDataCentersClient_BeginUpdate() { // Properties: &armcosmos.DataCenterResourceProperties{ // Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="), // DataCenterLocation: to.Ptr("West US 2"), - // DelegatedSubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1"), + // DelegatedSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1"), // NodeCount: to.Ptr[int32](9), // ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded), // SeedNodes: []*armcosmos.SeedNode{ diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client.go index 13fe841e8ede..5d3bac03f62e 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client.go @@ -46,7 +46,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -73,7 +73,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraResourcesClient) createUpdateCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters CassandraKeyspaceCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraKeyspaceOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginCreateUpdateCassandraKeyspace" @@ -119,7 +119,7 @@ func (client *CassandraResourcesClient) createUpdateCassandraKeyspaceCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateCassandraKeyspaceParameters); err != nil { @@ -131,7 +131,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -159,7 +159,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraResourcesClient) createUpdateCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters CassandraTableCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraTableOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginCreateUpdateCassandraTable" @@ -209,7 +209,7 @@ func (client *CassandraResourcesClient) createUpdateCassandraTableCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateCassandraTableParameters); err != nil { @@ -218,100 +218,10 @@ func (client *CassandraResourcesClient) createUpdateCassandraTableCreateRequest( return req, nil } -// BeginCreateUpdateCassandraView - Create or update an Azure Cosmos DB Cassandra View -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CassandraResourcesClientCreateUpdateCassandraViewResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CassandraResourcesClientCreateUpdateCassandraViewResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateUpdateCassandraView - Create or update an Azure Cosmos DB Cassandra View -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *CassandraResourcesClient) createUpdateCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters CassandraViewCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (*http.Response, error) { - var err error - const operationName = "CassandraResourcesClient.BeginCreateUpdateCassandraView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createUpdateCassandraViewCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, createUpdateCassandraViewParameters); err != nil { - return nil, err - } - return req, nil -} - // BeginDeleteCassandraKeyspace - Deletes an existing Azure Cosmos DB Cassandra keyspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -337,7 +247,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraResourcesClient) deleteCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginDeleteCassandraKeyspace" @@ -383,7 +293,7 @@ func (client *CassandraResourcesClient) deleteCassandraKeyspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -391,7 +301,7 @@ func (client *CassandraResourcesClient) deleteCassandraKeyspaceCreateRequest(ctx // BeginDeleteCassandraTable - Deletes an existing Azure Cosmos DB Cassandra table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -418,7 +328,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraResourcesClient) deleteCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientBeginDeleteCassandraTableOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginDeleteCassandraTable" @@ -468,92 +378,7 @@ func (client *CassandraResourcesClient) deleteCassandraTableCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CassandraResourcesClientDeleteCassandraViewResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CassandraResourcesClientDeleteCassandraViewResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// DeleteCassandraView - Deletes an existing Azure Cosmos DB Cassandra view. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *CassandraResourcesClient) deleteCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginDeleteCassandraViewOptions) (*http.Response, error) { - var err error - const operationName = "CassandraResourcesClient.BeginDeleteCassandraView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCassandraViewCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -562,7 +387,7 @@ func (client *CassandraResourcesClient) deleteCassandraViewCreateRequest(ctx con // name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -614,7 +439,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -633,7 +458,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceHandleResponse(resp // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -685,7 +510,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -703,7 +528,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -760,7 +585,7 @@ func (client *CassandraResourcesClient) getCassandraTableCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -779,7 +604,7 @@ func (client *CassandraResourcesClient) getCassandraTableHandleResponse(resp *ht // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -836,7 +661,7 @@ func (client *CassandraResourcesClient) getCassandraTableThroughputCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -851,160 +676,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 2023-03-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) { - var err error - const operationName = "CassandraResourcesClient.GetCassandraView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCassandraViewCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return CassandraResourcesClientGetCassandraViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CassandraResourcesClientGetCassandraViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CassandraResourcesClientGetCassandraViewResponse{}, err - } - resp, err := client.getCassandraViewHandleResponse(httpResp) - return resp, err -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 2023-03-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) { - var err error - const operationName = "CassandraResourcesClient.GetCassandraViewThroughput" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCassandraViewThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return CassandraResourcesClientGetCassandraViewThroughputResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CassandraResourcesClientGetCassandraViewThroughputResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CassandraResourcesClientGetCassandraViewThroughputResponse{}, err - } - resp, err := client.getCassandraViewThroughputHandleResponse(httpResp) - return resp, err -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListCassandraKeyspacesPager @@ -1053,7 +727,7 @@ func (client *CassandraResourcesClient) listCassandraKeyspacesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1070,7 +744,7 @@ func (client *CassandraResourcesClient) listCassandraKeyspacesHandleResponse(res // NewListCassandraTablesPager - Lists the Cassandra table under an existing Azure Cosmos DB database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1124,7 +798,7 @@ func (client *CassandraResourcesClient) listCassandraTablesCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1139,81 +813,10 @@ func (client *CassandraResourcesClient) listCassandraTablesHandleResponse(resp * return result, nil } -// NewListCassandraViewsPager - Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. -// -// Generated from API version 2023-03-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.NewListCassandraViewsPager -// 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) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CassandraResourcesClient.NewListCassandraViewsPager") - req, err := client.listCassandraViewsCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, options) - if err != nil { - return CassandraResourcesClientListCassandraViewsResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CassandraResourcesClientListCassandraViewsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CassandraResourcesClientListCassandraViewsResponse{}, runtime.NewResponseError(resp) - } - return client.listCassandraViewsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1239,7 +842,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraResourcesClient) migrateCassandraKeyspaceToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginMigrateCassandraKeyspaceToAutoscale" @@ -1285,7 +888,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToAutoscaleCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1295,7 +898,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToAutoscaleCreat // throughput // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1321,7 +924,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraResourcesClient) migrateCassandraKeyspaceToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientBeginMigrateCassandraKeyspaceToManualThroughputOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginMigrateCassandraKeyspaceToManualThroughput" @@ -1367,7 +970,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToManualThroughp return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1376,7 +979,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1403,7 +1006,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraResourcesClient) migrateCassandraTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientBeginMigrateCassandraTableToAutoscaleOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginMigrateCassandraTableToAutoscale" @@ -1453,7 +1056,7 @@ func (client *CassandraResourcesClient) migrateCassandraTableToAutoscaleCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1462,7 +1065,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1489,7 +1092,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraResourcesClient) migrateCassandraTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientBeginMigrateCassandraTableToManualThroughputOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginMigrateCassandraTableToManualThroughput" @@ -1539,179 +1142,7 @@ func (client *CassandraResourcesClient) migrateCassandraTableToManualThroughputC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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 2023-03-15-preview -func (client *CassandraResourcesClient) migrateCassandraViewToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions) (*http.Response, error) { - var err error - const operationName = "CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.migrateCassandraViewToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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 2023-03-15-preview -func (client *CassandraResourcesClient) migrateCassandraViewToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions) (*http.Response, error) { - var err error - const operationName = "CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.migrateCassandraViewToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1720,7 +1151,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1747,7 +1178,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraResourcesClient) updateCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginUpdateCassandraKeyspaceThroughput" @@ -1793,7 +1224,7 @@ func (client *CassandraResourcesClient) updateCassandraKeyspaceThroughputCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { @@ -1805,7 +1236,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1833,7 +1264,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *CassandraResourcesClient) updateCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraTableThroughputOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginUpdateCassandraTableThroughput" @@ -1883,97 +1314,7 @@ func (client *CassandraResourcesClient) updateCassandraTableThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { - return nil, err - } - return req, nil -} - -// 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 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CassandraResourcesClientUpdateCassandraViewThroughputResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CassandraResourcesClientUpdateCassandraViewThroughputResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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 2023-03-15-preview -func (client *CassandraResourcesClient) updateCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (*http.Response, error) { - var err error - const operationName = "CassandraResourcesClient.BeginUpdateCassandraViewThroughput" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCassandraViewThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client_example_test.go index 84cef8803994..c40903936a3d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraKeyspaceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraKeyspaceList.json func ExampleCassandraResourcesClient_NewListCassandraKeyspacesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -59,7 +59,7 @@ func ExampleCassandraResourcesClient_NewListCassandraKeyspacesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraKeyspaceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraKeyspaceGet.json func ExampleCassandraResourcesClient_GetCassandraKeyspace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -95,7 +95,7 @@ func ExampleCassandraResourcesClient_GetCassandraKeyspace() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraKeyspace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -141,7 +141,7 @@ func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraKeyspace() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraKeyspaceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraKeyspaceDelete.json func ExampleCassandraResourcesClient_BeginDeleteCassandraKeyspace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -162,7 +162,7 @@ func ExampleCassandraResourcesClient_BeginDeleteCassandraKeyspace() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json func ExampleCassandraResourcesClient_GetCassandraKeyspaceThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -192,15 +192,17 @@ func ExampleCassandraResourcesClient_GetCassandraKeyspaceThroughput() { // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), // Rid: to.Ptr("PD5DALigDgw="), // Ts: to.Ptr[float32](1459200611), + // InstantMaximumThroughput: to.Ptr("10000"), // MinimumThroughput: to.Ptr("400"), // OfferReplacePending: to.Ptr("true"), + // SoftAllowedMaximumThroughput: to.Ptr("1000000"), // Throughput: to.Ptr[int32](400), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json func ExampleCassandraResourcesClient_BeginUpdateCassandraKeyspaceThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -250,7 +252,7 @@ func ExampleCassandraResourcesClient_BeginUpdateCassandraKeyspaceThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -289,7 +291,7 @@ func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToAutoscale() // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -325,7 +327,7 @@ func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToManualThroug // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraTableList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraTableList.json func ExampleCassandraResourcesClient_NewListCassandraTablesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -374,7 +376,6 @@ func ExampleCassandraResourcesClient_NewListCassandraTablesPager() { // Name: to.Ptr("columnA"), // }}, // }, - // AnalyticalStorageTTL: to.Ptr[int32](500), // DefaultTTL: to.Ptr[int32](100), // ID: to.Ptr("tableName"), // }, @@ -384,7 +385,7 @@ func ExampleCassandraResourcesClient_NewListCassandraTablesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraTableGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraTableGet.json func ExampleCassandraResourcesClient_GetCassandraTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -427,7 +428,6 @@ func ExampleCassandraResourcesClient_GetCassandraTable() { // Name: to.Ptr("columnA"), // }}, // }, - // AnalyticalStorageTTL: to.Ptr[int32](500), // DefaultTTL: to.Ptr[int32](100), // ID: to.Ptr("tableName"), // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), @@ -438,7 +438,7 @@ func ExampleCassandraResourcesClient_GetCassandraTable() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraTableCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraTableCreateUpdate.json func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -471,9 +471,8 @@ func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraTable() { Name: to.Ptr("columnA"), }}, }, - AnalyticalStorageTTL: to.Ptr[int32](500), - DefaultTTL: to.Ptr[int32](100), - ID: to.Ptr("tableName"), + DefaultTTL: to.Ptr[int32](100), + ID: to.Ptr("tableName"), }, }, }, nil) @@ -512,7 +511,6 @@ func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraTable() { // Name: to.Ptr("columnA"), // }}, // }, - // AnalyticalStorageTTL: to.Ptr[int32](500), // DefaultTTL: to.Ptr[int32](100), // ID: to.Ptr("tableName"), // }, @@ -520,7 +518,7 @@ func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraTable() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraTableDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraTableDelete.json func ExampleCassandraResourcesClient_BeginDeleteCassandraTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -541,7 +539,7 @@ func ExampleCassandraResourcesClient_BeginDeleteCassandraTable() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraTableThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraTableThroughputGet.json func ExampleCassandraResourcesClient_GetCassandraTableThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -571,15 +569,17 @@ func ExampleCassandraResourcesClient_GetCassandraTableThroughput() { // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), // Rid: to.Ptr("PD5DALigDgw="), // Ts: to.Ptr[float32](1459200611), + // InstantMaximumThroughput: to.Ptr("10000"), // MinimumThroughput: to.Ptr("400"), // OfferReplacePending: to.Ptr("true"), + // SoftAllowedMaximumThroughput: to.Ptr("1000000"), // Throughput: to.Ptr[int32](400), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraTableThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraTableThroughputUpdate.json func ExampleCassandraResourcesClient_BeginUpdateCassandraTableThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -626,7 +626,7 @@ func ExampleCassandraResourcesClient_BeginUpdateCassandraTableThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -665,7 +665,7 @@ func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToAutoscale() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -700,290 +700,3 @@ func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToManualThroughpu // }, // } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCassandraResourcesClient().NewListCassandraViewsPager("rgName", "ddb1", "keyspacename", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CassandraViewListResult = armcosmos.CassandraViewListResult{ - // Value: []*armcosmos.CassandraViewGetResults{ - // { - // Name: to.Ptr("viewname"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspacename/views/viewname"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.CassandraViewGetProperties{ - // Resource: &armcosmos.CassandraViewGetPropertiesResource{ - // 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 KEY (columnc, columna)"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCassandraResourcesClient().GetCassandraView(ctx, "rg1", "ddb1", "keyspacename", "viewname", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CassandraViewGetResults = armcosmos.CassandraViewGetResults{ - // Name: to.Ptr("viewname"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspacename/views/viewname"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.CassandraViewGetProperties{ - // Resource: &armcosmos.CassandraViewGetPropertiesResource{ - // 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 KEY (columnc, columna)"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CassandraViewGetResults = armcosmos.CassandraViewGetResults{ - // Name: to.Ptr("viewname"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspacename/views/viewname"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.CassandraViewGetProperties{ - // Resource: &armcosmos.CassandraViewGetPropertiesResource{ - // 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 KEY (columnc, columna)"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().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/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCassandraResourcesClient().GetCassandraViewThroughput(ctx, "rg1", "ddb1", "keyspacename", "viewname", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/views/viewName/throughputSettings/default"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // MinimumThroughput: to.Ptr("400"), - // OfferReplacePending: to.Ptr("true"), - // Throughput: to.Ptr[int32](400), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/views/viewName/throughputSettings/default"), - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // MinimumThroughput: to.Ptr("400"), - // OfferReplacePending: to.Ptr("true"), - // Throughput: to.Ptr[int32](400), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{ - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // AutoscaleSettings: &armcosmos.AutoscaleSettingsResource{ - // MaxThroughput: to.Ptr[int32](4000), - // }, - // MinimumThroughput: to.Ptr("4000"), - // OfferReplacePending: to.Ptr("false"), - // Throughput: to.Ptr[int32](400), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{ - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // MinimumThroughput: to.Ptr("400"), - // OfferReplacePending: to.Ptr("false"), - // Throughput: to.Ptr[int32](400), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/client_factory.go b/sdk/resourcemanager/cosmos/armcosmos/client_factory.go index 3ba01944a426..690c780e00e6 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/client_factory.go +++ b/sdk/resourcemanager/cosmos/armcosmos/client_factory.go @@ -79,12 +79,6 @@ func (c *ClientFactory) NewCollectionRegionClient() *CollectionRegionClient { return subClient } -// NewDataTransferJobsClient creates a new instance of DataTransferJobsClient. -func (c *ClientFactory) NewDataTransferJobsClient() *DataTransferJobsClient { - subClient, _ := NewDataTransferJobsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - // NewDatabaseAccountRegionClient creates a new instance of DatabaseAccountRegionClient. func (c *ClientFactory) NewDatabaseAccountRegionClient() *DatabaseAccountRegionClient { subClient, _ := NewDatabaseAccountRegionClient(c.subscriptionID, c.credential, c.options) @@ -103,12 +97,6 @@ func (c *ClientFactory) NewDatabaseClient() *DatabaseClient { return subClient } -// NewGraphResourcesClient creates a new instance of GraphResourcesClient. -func (c *ClientFactory) NewGraphResourcesClient() *GraphResourcesClient { - subClient, _ := NewGraphResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient -} - // NewGremlinResourcesClient creates a new instance of GremlinResourcesClient. func (c *ClientFactory) NewGremlinResourcesClient() *GremlinResourcesClient { subClient, _ := NewGremlinResourcesClient(c.subscriptionID, c.credential, c.options) @@ -121,12 +109,6 @@ func (c *ClientFactory) NewLocationsClient() *LocationsClient { return subClient } -// NewMongoClustersClient creates a new instance of MongoClustersClient. -func (c *ClientFactory) NewMongoClustersClient() *MongoClustersClient { - subClient, _ := NewMongoClustersClient(c.subscriptionID, c.credential, c.options) - return subClient -} - // NewMongoDBResourcesClient creates a new instance of MongoDBResourcesClient. func (c *ClientFactory) NewMongoDBResourcesClient() *MongoDBResourcesClient { subClient, _ := NewMongoDBResourcesClient(c.subscriptionID, c.credential, c.options) diff --git a/sdk/resourcemanager/cosmos/armcosmos/collection_client.go b/sdk/resourcemanager/cosmos/armcosmos/collection_client.go index 58c3680f97d4..d12f21106551 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collection_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collection_client.go @@ -45,7 +45,7 @@ func NewCollectionClient(subscriptionID string, credential azcore.TokenCredentia // NewListMetricDefinitionsPager - Retrieves metric definitions for the given collection. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -104,7 +104,7 @@ func (client *CollectionClient) listMetricDefinitionsCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -121,7 +121,7 @@ func (client *CollectionClient) listMetricDefinitionsHandleResponse(resp *http.R // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and collection. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -183,7 +183,7 @@ func (client *CollectionClient) listMetricsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -201,7 +201,7 @@ func (client *CollectionClient) listMetricsHandleResponse(resp *http.Response) ( // NewListUsagesPager - Retrieves the usages (most recent storage data) for the given collection. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -260,7 +260,7 @@ func (client *CollectionClient) listUsagesCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 952c54685d38..de6553bfd18c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collection_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collection_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCollectionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCollectionGetMetrics.json func ExampleCollectionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -81,7 +81,7 @@ func ExampleCollectionClient_NewListMetricsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCollectionGetUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCollectionGetUsages.json func ExampleCollectionClient_NewListUsagesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -119,7 +119,7 @@ func ExampleCollectionClient_NewListUsagesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCollectionGetMetricDefinitions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCollectionGetMetricDefinitions.json func ExampleCollectionClient_NewListMetricDefinitionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client.go b/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client.go index c27930769e95..2cc7e17e75ad 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client.go @@ -45,7 +45,7 @@ func NewCollectionPartitionClient(subscriptionID string, credential azcore.Token // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given collection, split by partition. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -107,7 +107,7 @@ func (client *CollectionPartitionClient) listMetricsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -125,7 +125,7 @@ func (client *CollectionPartitionClient) listMetricsHandleResponse(resp *http.Re // NewListUsagesPager - Retrieves the usages (most recent storage data) for the given collection, split by partition. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -184,7 +184,7 @@ func (client *CollectionPartitionClient) listUsagesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 34365ddd242d..352ab5d8da48 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCollectionPartitionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCollectionPartitionGetMetrics.json func ExampleCollectionPartitionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -83,7 +83,7 @@ func ExampleCollectionPartitionClient_NewListMetricsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCollectionPartitionGetUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCollectionPartitionGetUsages.json func ExampleCollectionPartitionClient_NewListUsagesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client.go index 2a1d1884a4b5..64b6024fd140 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client.go @@ -46,7 +46,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. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -113,7 +113,7 @@ func (client *CollectionPartitionRegionClient) listMetricsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 1c1a6f77f25a..911cc66c3f99 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json func ExampleCollectionPartitionRegionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client.go index 33e74da8c905..4aa435426db4 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client.go @@ -46,7 +46,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. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -113,7 +113,7 @@ func (client *CollectionRegionClient) listMetricsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index ff46da0dcecb..b0f70016b203 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRegionCollectionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRegionCollectionGetMetrics.json func ExampleCollectionRegionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/constants.go b/sdk/resourcemanager/cosmos/armcosmos/constants.go index 6aa929c3fdd5..6dc6756a8949 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/constants.go +++ b/sdk/resourcemanager/cosmos/armcosmos/constants.go @@ -10,7 +10,7 @@ package armcosmos const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" - moduleVersion = "v3.0.0-beta.2" + moduleVersion = "v2.7.0" ) // APIType - Enum to indicate the API type of the restorable database account. @@ -127,22 +127,6 @@ func PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy { } } -// CheckNameAvailabilityReason - The reason why the given name is not available. -type CheckNameAvailabilityReason string - -const ( - CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists" - CheckNameAvailabilityReasonInvalid CheckNameAvailabilityReason = "Invalid" -) - -// PossibleCheckNameAvailabilityReasonValues returns the possible values for the CheckNameAvailabilityReason const type. -func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { - return []CheckNameAvailabilityReason{ - CheckNameAvailabilityReasonAlreadyExists, - CheckNameAvailabilityReasonInvalid, - } -} - // CompositePathSortOrder - Sort order for composite paths. type CompositePathSortOrder string @@ -233,16 +217,14 @@ func PossibleContinuousTierValues() []ContinuousTier { type CreateMode string const ( - CreateModeDefault CreateMode = "Default" - CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" - CreateModeRestore CreateMode = "Restore" + CreateModeDefault CreateMode = "Default" + CreateModeRestore CreateMode = "Restore" ) // PossibleCreateModeValues returns the possible values for the CreateMode const type. func PossibleCreateModeValues() []CreateMode { return []CreateMode{ CreateModeDefault, - CreateModePointInTimeRestore, CreateModeRestore, } } @@ -267,25 +249,6 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -type DataTransferComponent string - -const ( - DataTransferComponentAzureBlobStorage DataTransferComponent = "AzureBlobStorage" - DataTransferComponentCosmosDBCassandra DataTransferComponent = "CosmosDBCassandra" - DataTransferComponentCosmosDBMongo DataTransferComponent = "CosmosDBMongo" - DataTransferComponentCosmosDBSQL DataTransferComponent = "CosmosDBSql" -) - -// PossibleDataTransferComponentValues returns the possible values for the DataTransferComponent const type. -func PossibleDataTransferComponentValues() []DataTransferComponent { - return []DataTransferComponent{ - DataTransferComponentAzureBlobStorage, - DataTransferComponentCosmosDBCassandra, - DataTransferComponentCosmosDBMongo, - DataTransferComponentCosmosDBSQL, - } -} - // DataType - The datatype for which the indexing behavior is applied to. type DataType string @@ -350,24 +313,6 @@ func PossibleDefaultConsistencyLevelValues() []DefaultConsistencyLevel { } } -// EnableFullTextQuery - Describe the level of detail with which queries are to be logged. -type EnableFullTextQuery string - -const ( - EnableFullTextQueryFalse EnableFullTextQuery = "False" - EnableFullTextQueryNone EnableFullTextQuery = "None" - EnableFullTextQueryTrue EnableFullTextQuery = "True" -) - -// PossibleEnableFullTextQueryValues returns the possible values for the EnableFullTextQuery const type. -func PossibleEnableFullTextQueryValues() []EnableFullTextQuery { - return []EnableFullTextQuery{ - EnableFullTextQueryFalse, - EnableFullTextQueryNone, - EnableFullTextQueryTrue, - } -} - // IndexKind - Indicates the type of index. type IndexKind string @@ -484,8 +429,8 @@ func PossibleManagedCassandraResourceIdentityTypeValues() []ManagedCassandraReso } } -// MinimalTLSVersion - Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, -// which only work with Tls 1.2. +// MinimalTLSVersion - Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only +// work with Tls 1.2. type MinimalTLSVersion string const ( @@ -503,32 +448,6 @@ func PossibleMinimalTLSVersionValues() []MinimalTLSVersion { } } -// MongoClusterStatus - The status of the resource at the time the operation was called. -type MongoClusterStatus string - -const ( - MongoClusterStatusDropping MongoClusterStatus = "Dropping" - MongoClusterStatusProvisioning MongoClusterStatus = "Provisioning" - MongoClusterStatusReady MongoClusterStatus = "Ready" - MongoClusterStatusStarting MongoClusterStatus = "Starting" - MongoClusterStatusStopped MongoClusterStatus = "Stopped" - MongoClusterStatusStopping MongoClusterStatus = "Stopping" - MongoClusterStatusUpdating MongoClusterStatus = "Updating" -) - -// PossibleMongoClusterStatusValues returns the possible values for the MongoClusterStatus const type. -func PossibleMongoClusterStatusValues() []MongoClusterStatus { - return []MongoClusterStatus{ - MongoClusterStatusDropping, - MongoClusterStatusProvisioning, - MongoClusterStatusReady, - MongoClusterStatusStarting, - MongoClusterStatusStopped, - MongoClusterStatusStopping, - MongoClusterStatusUpdating, - } -} - // MongoRoleDefinitionType - Indicates whether the Role Definition was built-in or user created. type MongoRoleDefinitionType string @@ -561,20 +480,6 @@ func PossibleNetworkACLBypassValues() []NetworkACLBypass { } } -// NodeKind - The kind of a node in the mongo cluster. -type NodeKind string - -const ( - NodeKindShard NodeKind = "Shard" -) - -// PossibleNodeKindValues returns the possible values for the NodeKind const type. -func PossibleNodeKindValues() []NodeKind { - return []NodeKind{ - NodeKindShard, - } -} - // NodeState - The state of the node in Cassandra ring. type NodeState string @@ -691,36 +596,13 @@ func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { } } -// ProvisioningState - The provisioning state of the resource. -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateDropping ProvisioningState = "Dropping" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateInProgress ProvisioningState = "InProgress" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ - ProvisioningStateCanceled, - ProvisioningStateDropping, - ProvisioningStateFailed, - ProvisioningStateInProgress, - ProvisioningStateSucceeded, - ProvisioningStateUpdating, - } -} - // PublicNetworkAccess - Whether requests from Public Network are allowed type PublicNetworkAccess string const ( - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" ) // PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. @@ -728,6 +610,7 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { return []PublicNetworkAccess{ PublicNetworkAccessDisabled, PublicNetworkAccessEnabled, + PublicNetworkAccessSecuredByPerimeter, } } @@ -907,24 +790,6 @@ func PossibleStatusValues() []Status { } } -// 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 59f031efdfab..a884462ef848 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/database_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/database_client.go @@ -45,7 +45,7 @@ func NewDatabaseClient(subscriptionID string, credential azcore.TokenCredential, // NewListMetricDefinitionsPager - Retrieves metric definitions for the given database. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -99,7 +99,7 @@ func (client *DatabaseClient) listMetricDefinitionsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *DatabaseClient) listMetricDefinitionsHandleResponse(resp *http.Res // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and database. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -173,7 +173,7 @@ func (client *DatabaseClient) listMetricsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -191,7 +191,7 @@ func (client *DatabaseClient) listMetricsHandleResponse(resp *http.Response) (Da // NewListUsagesPager - Retrieves the usages (most recent data) for the given database. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -244,7 +244,7 @@ func (client *DatabaseClient) listUsagesCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 122783b3158d..8e37b7370e75 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/database_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/database_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseGetMetrics.json func ExampleDatabaseClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -81,7 +81,7 @@ func ExampleDatabaseClient_NewListMetricsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseGetUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseGetUsages.json func ExampleDatabaseClient_NewListUsagesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -119,7 +119,7 @@ func ExampleDatabaseClient_NewListUsagesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseGetMetricDefinitions.json func ExampleDatabaseClient_NewListMetricDefinitionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client.go index 4c62bbea931a..665127d0d60c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client.go @@ -45,7 +45,7 @@ func NewDatabaseAccountRegionClient(subscriptionID string, credential azcore.Tok // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and region. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -102,7 +102,7 @@ func (client *DatabaseAccountRegionClient) listMetricsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 89796e9a8cfc..4a3febf182e0 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json func ExampleDatabaseAccountRegionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client.go b/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client.go index af53af228410..c0fc16796da2 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client.go @@ -46,7 +46,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - accountName - Cosmos DB database account name. // - options - DatabaseAccountsClientCheckNameExistsOptions contains the optional parameters for the DatabaseAccountsClient.CheckNameExists // method. @@ -83,7 +83,7 @@ func (client *DatabaseAccountsClient) checkNameExistsCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -92,7 +92,7 @@ func (client *DatabaseAccountsClient) checkNameExistsCreateRequest(ctx context.C // updates on an account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -119,7 +119,7 @@ func (client *DatabaseAccountsClient) BeginCreateOrUpdate(ctx context.Context, r // updates on an account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *DatabaseAccountsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, createUpdateParameters DatabaseAccountCreateUpdateParameters, options *DatabaseAccountsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DatabaseAccountsClient.BeginCreateOrUpdate" @@ -161,7 +161,7 @@ func (client *DatabaseAccountsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateParameters); err != nil { @@ -173,7 +173,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 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -198,7 +198,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *DatabaseAccountsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, options *DatabaseAccountsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DatabaseAccountsClient.BeginDelete" @@ -240,7 +240,7 @@ func (client *DatabaseAccountsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -250,7 +250,7 @@ func (client *DatabaseAccountsClient) deleteCreateRequest(ctx context.Context, r // 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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -278,7 +278,7 @@ func (client *DatabaseAccountsClient) BeginFailoverPriorityChange(ctx context.Co // 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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *DatabaseAccountsClient) failoverPriorityChange(ctx context.Context, resourceGroupName string, accountName string, failoverParameters FailoverPolicies, options *DatabaseAccountsClientBeginFailoverPriorityChangeOptions) (*http.Response, error) { var err error const operationName = "DatabaseAccountsClient.BeginFailoverPriorityChange" @@ -320,7 +320,7 @@ func (client *DatabaseAccountsClient) failoverPriorityChangeCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, failoverParameters); err != nil { return nil, err @@ -331,7 +331,7 @@ func (client *DatabaseAccountsClient) failoverPriorityChangeCreateRequest(ctx co // 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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -377,7 +377,7 @@ func (client *DatabaseAccountsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -395,7 +395,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 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -442,7 +442,7 @@ func (client *DatabaseAccountsClient) getReadOnlyKeysCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -459,7 +459,7 @@ func (client *DatabaseAccountsClient) getReadOnlyKeysHandleResponse(resp *http.R // NewListPager - Lists all the Azure Cosmos DB database accounts available under the subscription. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - options - DatabaseAccountsClientListOptions contains the optional parameters for the DatabaseAccountsClient.NewListPager // method. func (client *DatabaseAccountsClient) NewListPager(options *DatabaseAccountsClientListOptions) *runtime.Pager[DatabaseAccountsClientListResponse] { @@ -498,7 +498,7 @@ func (client *DatabaseAccountsClient) listCreateRequest(ctx context.Context, opt return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -515,7 +515,7 @@ func (client *DatabaseAccountsClient) listHandleResponse(resp *http.Response) (D // NewListByResourceGroupPager - Lists all the Azure Cosmos DB database accounts available under the given resource group. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - DatabaseAccountsClientListByResourceGroupOptions contains the optional parameters for the DatabaseAccountsClient.NewListByResourceGroupPager // method. @@ -559,7 +559,7 @@ func (client *DatabaseAccountsClient) listByResourceGroupCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -577,7 +577,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 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -624,7 +624,7 @@ func (client *DatabaseAccountsClient) listConnectionStringsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -642,7 +642,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 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -689,7 +689,7 @@ func (client *DatabaseAccountsClient) listKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -706,7 +706,7 @@ func (client *DatabaseAccountsClient) listKeysHandleResponse(resp *http.Response // NewListMetricDefinitionsPager - Retrieves metric definitions for the given database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListMetricDefinitionsPager @@ -755,7 +755,7 @@ func (client *DatabaseAccountsClient) listMetricDefinitionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -772,7 +772,7 @@ func (client *DatabaseAccountsClient) listMetricDefinitionsHandleResponse(resp * // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -824,7 +824,7 @@ func (client *DatabaseAccountsClient) listMetricsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -843,7 +843,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 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -890,7 +890,7 @@ func (client *DatabaseAccountsClient) listReadOnlyKeysCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -907,7 +907,7 @@ func (client *DatabaseAccountsClient) listReadOnlyKeysHandleResponse(resp *http. // NewListUsagesPager - Retrieves the usages (most recent data) for the given database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListUsagesPager @@ -956,7 +956,7 @@ func (client *DatabaseAccountsClient) listUsagesCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -977,7 +977,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -1003,7 +1003,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *DatabaseAccountsClient) offlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOffline RegionForOnlineOffline, options *DatabaseAccountsClientBeginOfflineRegionOptions) (*http.Response, error) { var err error const operationName = "DatabaseAccountsClient.BeginOfflineRegion" @@ -1045,7 +1045,7 @@ func (client *DatabaseAccountsClient) offlineRegionCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regionParameterForOffline); err != nil { @@ -1057,7 +1057,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -1083,7 +1083,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *DatabaseAccountsClient) onlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOnline RegionForOnlineOffline, options *DatabaseAccountsClientBeginOnlineRegionOptions) (*http.Response, error) { var err error const operationName = "DatabaseAccountsClient.BeginOnlineRegion" @@ -1125,7 +1125,7 @@ func (client *DatabaseAccountsClient) onlineRegionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regionParameterForOnline); err != nil { @@ -1137,7 +1137,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -1163,7 +1163,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *DatabaseAccountsClient) regenerateKey(ctx context.Context, resourceGroupName string, accountName string, keyToRegenerate DatabaseAccountRegenerateKeyParameters, options *DatabaseAccountsClientBeginRegenerateKeyOptions) (*http.Response, error) { var err error const operationName = "DatabaseAccountsClient.BeginRegenerateKey" @@ -1205,7 +1205,7 @@ func (client *DatabaseAccountsClient) regenerateKeyCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, keyToRegenerate); err != nil { return nil, err @@ -1216,7 +1216,7 @@ func (client *DatabaseAccountsClient) regenerateKeyCreateRequest(ctx context.Con // 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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -1242,7 +1242,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *DatabaseAccountsClient) update(ctx context.Context, resourceGroupName string, accountName string, updateParameters DatabaseAccountUpdateParameters, options *DatabaseAccountsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "DatabaseAccountsClient.BeginUpdate" @@ -1284,7 +1284,7 @@ func (client *DatabaseAccountsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateParameters); err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client_example_test.go index f192353536c9..5c1da9fc5082 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client_example_test.go @@ -17,10 +17,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountGet.json func ExampleDatabaseAccountsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,6 +42,9 @@ func ExampleDatabaseAccountsClient_Get() { // Name: to.Ptr("ddb1"), // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), + // Location: to.Ptr("West US"), + // Tags: map[string]*string{ + // }, // Identity: &armcosmos.ManagedServiceIdentity{ // Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), // PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"), @@ -53,9 +56,6 @@ func ExampleDatabaseAccountsClient_Get() { // }, // }, // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, // Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB), // Properties: &armcosmos.DatabaseAccountGetProperties{ // AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ @@ -86,15 +86,11 @@ func ExampleDatabaseAccountsClient_Get() { // CreateMode: to.Ptr(armcosmos.CreateModeDefault), // DatabaseAccountOfferType: to.Ptr("Standard"), // DefaultIdentity: to.Ptr("FirstPartyIdentity"), - // DiagnosticLogSettings: &armcosmos.DiagnosticLogSettings{ - // EnableFullTextQuery: to.Ptr(armcosmos.EnableFullTextQueryFalse), - // }, // DisableKeyBasedMetadataWriteAccess: to.Ptr(false), // DocumentEndpoint: to.Ptr("https://ddb1.documents.azure.com:443/"), // EnableAnalyticalStorage: to.Ptr(true), // EnableBurstCapacity: to.Ptr(true), // EnableFreeTier: to.Ptr(false), - // EnableMaterializedViews: to.Ptr(false), // EnablePartitionMerge: to.Ptr(true), // FailoverPolicies: []*armcosmos.FailoverPolicy{ // { @@ -168,7 +164,7 @@ func ExampleDatabaseAccountsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountPatch.json func ExampleDatabaseAccountsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -196,7 +192,7 @@ func ExampleDatabaseAccountsClient_BeginUpdate() { PeriodicModeProperties: &armcosmos.PeriodicModeProperties{ BackupIntervalInMinutes: to.Ptr[int32](240), BackupRetentionIntervalInHours: to.Ptr[int32](720), - BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo), + BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyLocal), }, }, Capacity: &armcosmos.Capacity{ @@ -207,10 +203,7 @@ func ExampleDatabaseAccountsClient_BeginUpdate() { MaxIntervalInSeconds: to.Ptr[int32](10), MaxStalenessPrefix: to.Ptr[int64](200), }, - DefaultIdentity: to.Ptr("FirstPartyIdentity"), - DiagnosticLogSettings: &armcosmos.DiagnosticLogSettings{ - EnableFullTextQuery: to.Ptr(armcosmos.EnableFullTextQueryTrue), - }, + DefaultIdentity: to.Ptr("FirstPartyIdentity"), EnableAnalyticalStorage: to.Ptr(true), EnableBurstCapacity: to.Ptr(true), EnableFreeTier: to.Ptr(false), @@ -251,6 +244,10 @@ func ExampleDatabaseAccountsClient_BeginUpdate() { // Name: to.Ptr("ddb1"), // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), + // Location: to.Ptr("West US"), + // Tags: map[string]*string{ + // "dept": to.Ptr("finance"), + // }, // Identity: &armcosmos.ManagedServiceIdentity{ // Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), // PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"), @@ -258,14 +255,10 @@ func ExampleDatabaseAccountsClient_BeginUpdate() { // UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ // "/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ // ClientID: to.Ptr("fbe75b66-01c5-4f87-a220-233af3270436"), - // PrincipalID: to.Ptr("075a0ca6-43f6-4434-9abf-c9b1b79f9219"), + // PrincipalID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"), // }, // }, // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "dept": to.Ptr("finance"), - // }, // Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB), // Properties: &armcosmos.DatabaseAccountGetProperties{ // AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ @@ -278,7 +271,7 @@ func ExampleDatabaseAccountsClient_BeginUpdate() { // PeriodicModeProperties: &armcosmos.PeriodicModeProperties{ // BackupIntervalInMinutes: to.Ptr[int32](240), // BackupRetentionIntervalInHours: to.Ptr[int32](720), - // BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo), + // BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyLocal), // }, // }, // Capacity: &armcosmos.Capacity{ @@ -291,25 +284,20 @@ func ExampleDatabaseAccountsClient_BeginUpdate() { // }, // Cors: []*armcosmos.CorsPolicy{ // }, - // CreateMode: to.Ptr(armcosmos.CreateModeDefault), // DatabaseAccountOfferType: to.Ptr("Standard"), // DefaultIdentity: to.Ptr("FirstPartyIdentity"), - // DiagnosticLogSettings: &armcosmos.DiagnosticLogSettings{ - // EnableFullTextQuery: to.Ptr(armcosmos.EnableFullTextQueryTrue), - // }, // DisableKeyBasedMetadataWriteAccess: to.Ptr(false), // DocumentEndpoint: to.Ptr("https://ddb1.documents.azure.com:443/"), // EnableAnalyticalStorage: to.Ptr(true), // EnableBurstCapacity: to.Ptr(true), // EnableFreeTier: to.Ptr(false), - // EnableMaterializedViews: to.Ptr(false), + // EnablePartitionMerge: to.Ptr(true), // FailoverPolicies: []*armcosmos.FailoverPolicy{ // { // FailoverPriority: to.Ptr[int32](0), // ID: to.Ptr("ddb1-eastus"), // LocationName: to.Ptr("East US"), // }}, - // InstanceID: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"), // IPRules: []*armcosmos.IPAddressOrRange{ // { // IPAddressOrRange: to.Ptr("23.43.230.120"), @@ -380,13 +368,10 @@ func ExampleDatabaseAccountsClient_BeginUpdate() { // ProvisioningState: to.Ptr("Succeeded"), // }}, // }, - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), - // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountCreateMax.json func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCreateMax() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -398,15 +383,15 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCr log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDatabaseAccountsClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", armcosmos.DatabaseAccountCreateUpdateParameters{ + Location: to.Ptr("westus"), + Tags: map[string]*string{}, 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), + Kind: to.Ptr(armcosmos.DatabaseAccountKindMongoDB), Properties: &armcosmos.DatabaseAccountCreateUpdateProperties{ AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined), @@ -440,7 +425,6 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCr EnableAnalyticalStorage: to.Ptr(true), EnableBurstCapacity: to.Ptr(true), EnableFreeTier: to.Ptr(false), - EnableMaterializedViews: to.Ptr(false), IPRules: []*armcosmos.IPAddressOrRange{ { IPAddressOrRange: to.Ptr("23.43.230.120"), @@ -487,6 +471,9 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCr // Name: to.Ptr("ddb1"), // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), + // Location: to.Ptr("West US"), + // Tags: map[string]*string{ + // }, // Identity: &armcosmos.ManagedServiceIdentity{ // Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), // PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"), @@ -494,13 +481,10 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCr // UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ // "/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ // ClientID: to.Ptr("fbe75b66-01c5-4f87-a220-233af3270436"), - // PrincipalID: to.Ptr("075a0ca6-43f6-4434-9abf-c9b1b79f9219"), + // PrincipalID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"), // }, // }, // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, // Kind: to.Ptr(armcosmos.DatabaseAccountKindMongoDB), // Properties: &armcosmos.DatabaseAccountGetProperties{ // AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ @@ -536,7 +520,6 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCr // EnableAnalyticalStorage: to.Ptr(true), // EnableBurstCapacity: to.Ptr(true), // EnableFreeTier: to.Ptr(false), - // EnableMaterializedViews: to.Ptr(false), // FailoverPolicies: []*armcosmos.FailoverPolicy{ // { // FailoverPriority: to.Ptr[int32](0), @@ -560,16 +543,16 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCr // KeyVaultKeyURI: to.Ptr("https://myKeyVault.vault.azure.net"), // KeysMetadata: &armcosmos.DatabaseAccountKeysMetadata{ // PrimaryMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), + // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), // }, // PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), + // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), // }, // SecondaryMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), + // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), // }, // SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), + // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), // }, // }, // Locations: []*armcosmos.Location{ @@ -627,7 +610,7 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCr // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountCreateMin.json func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCreateMin() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -692,7 +675,6 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCr // DisableKeyBasedMetadataWriteAccess: to.Ptr(false), // EnableAnalyticalStorage: to.Ptr(false), // EnableFreeTier: to.Ptr(false), - // EnableMaterializedViews: to.Ptr(false), // FailoverPolicies: []*armcosmos.FailoverPolicy{ // { // FailoverPriority: to.Ptr[int32](0), @@ -704,16 +686,16 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCr // }, // KeysMetadata: &armcosmos.DatabaseAccountKeysMetadata{ // PrimaryMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), + // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), // }, // PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), + // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), // }, // SecondaryMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), + // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), // }, // SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), + // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), // }, // }, // Locations: []*armcosmos.Location{ @@ -752,7 +734,7 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCr // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbRestoreDatabaseAccountCreateUpdateJson() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -786,7 +768,6 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbRestoreDatabaseAc DatabaseAccountOfferType: to.Ptr("Standard"), EnableAnalyticalStorage: to.Ptr(true), EnableFreeTier: to.Ptr(false), - EnableMaterializedViews: to.Ptr(false), KeyVaultKeyURI: to.Ptr("https://myKeyVault.vault.azure.net"), Locations: []*armcosmos.Location{ { @@ -811,8 +792,7 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbRestoreDatabaseAc to.Ptr("collection4")}, DatabaseName: to.Ptr("db2"), }}, - RestoreMode: to.Ptr(armcosmos.RestoreModePointInTime), - SourceBackupLocation: to.Ptr("westus"), + RestoreMode: to.Ptr(armcosmos.RestoreModePointInTime), }, }, }, nil) @@ -853,7 +833,6 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbRestoreDatabaseAc // DisableKeyBasedMetadataWriteAccess: to.Ptr(false), // EnableAnalyticalStorage: to.Ptr(false), // EnableFreeTier: to.Ptr(false), - // EnableMaterializedViews: to.Ptr(false), // FailoverPolicies: []*armcosmos.FailoverPolicy{ // { // FailoverPriority: to.Ptr[int32](0), @@ -886,9 +865,6 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbRestoreDatabaseAc // ProvisioningState: to.Ptr("Succeeded"), // }}, // MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS), - // NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassNone), - // NetworkACLBypassResourceIDs: []*string{ - // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadLocations: []*armcosmos.Location{ // { @@ -913,7 +889,7 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbRestoreDatabaseAc // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountDelete.json func ExampleDatabaseAccountsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -934,7 +910,7 @@ func ExampleDatabaseAccountsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json func ExampleDatabaseAccountsClient_BeginFailoverPriorityChange() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -965,7 +941,7 @@ func ExampleDatabaseAccountsClient_BeginFailoverPriorityChange() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountList.json func ExampleDatabaseAccountsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -993,6 +969,9 @@ func ExampleDatabaseAccountsClient_NewListPager() { // Name: to.Ptr("ddb1"), // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), + // Location: to.Ptr("West US"), + // Tags: map[string]*string{ + // }, // Identity: &armcosmos.ManagedServiceIdentity{ // Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), // PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"), @@ -1004,9 +983,6 @@ func ExampleDatabaseAccountsClient_NewListPager() { // }, // }, // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, // Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB), // Properties: &armcosmos.DatabaseAccountGetProperties{ // AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ @@ -1037,7 +1013,6 @@ func ExampleDatabaseAccountsClient_NewListPager() { // EnableAnalyticalStorage: to.Ptr(true), // EnableBurstCapacity: to.Ptr(true), // EnableFreeTier: to.Ptr(false), - // EnableMaterializedViews: to.Ptr(false), // EnablePartitionMerge: to.Ptr(true), // FailoverPolicies: []*armcosmos.FailoverPolicy{ // { @@ -1113,7 +1088,7 @@ func ExampleDatabaseAccountsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json func ExampleDatabaseAccountsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1141,6 +1116,9 @@ func ExampleDatabaseAccountsClient_NewListByResourceGroupPager() { // Name: to.Ptr("ddb1"), // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), + // Location: to.Ptr("West US"), + // Tags: map[string]*string{ + // }, // Identity: &armcosmos.ManagedServiceIdentity{ // Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), // PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"), @@ -1152,19 +1130,8 @@ func ExampleDatabaseAccountsClient_NewListByResourceGroupPager() { // }, // }, // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, // Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB), // Properties: &armcosmos.DatabaseAccountGetProperties{ - // 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), - // }, - // }, // ConsistencyPolicy: &armcosmos.ConsistencyPolicy{ // DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelSession), // MaxIntervalInSeconds: to.Ptr[int32](5), @@ -1172,20 +1139,17 @@ func ExampleDatabaseAccountsClient_NewListByResourceGroupPager() { // }, // Cors: []*armcosmos.CorsPolicy{ // }, - // CreateMode: to.Ptr(armcosmos.CreateModeDefault), // DatabaseAccountOfferType: to.Ptr("Standard"), // DefaultIdentity: to.Ptr("FirstPartyIdentity"), // DisableKeyBasedMetadataWriteAccess: to.Ptr(false), // DocumentEndpoint: to.Ptr("https://ddb1.documents.azure.com:443/"), // EnableFreeTier: to.Ptr(false), - // EnableMaterializedViews: to.Ptr(false), // FailoverPolicies: []*armcosmos.FailoverPolicy{ // { // FailoverPriority: to.Ptr[int32](0), // ID: to.Ptr("ddb1-eastus"), // LocationName: to.Ptr("East US"), // }}, - // InstanceID: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"), // IPRules: []*armcosmos.IPAddressOrRange{ // }, // KeysMetadata: &armcosmos.DatabaseAccountKeysMetadata{ @@ -1232,15 +1196,12 @@ func ExampleDatabaseAccountsClient_NewListByResourceGroupPager() { // ProvisioningState: to.Ptr("Succeeded"), // }}, // }, - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), - // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountListKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountListKeys.json func ExampleDatabaseAccountsClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1266,7 +1227,7 @@ func ExampleDatabaseAccountsClient_ListKeys() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json func ExampleDatabaseAccountsClient_ListConnectionStrings_cosmosDbDatabaseAccountListConnectionStrings() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1295,7 +1256,7 @@ func ExampleDatabaseAccountsClient_ListConnectionStrings_cosmosDbDatabaseAccount // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json func ExampleDatabaseAccountsClient_ListConnectionStrings_cosmosDbDatabaseAccountListConnectionStringsMongo() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1322,7 +1283,7 @@ func ExampleDatabaseAccountsClient_ListConnectionStrings_cosmosDbDatabaseAccount // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountOfflineRegion.json func ExampleDatabaseAccountsClient_BeginOfflineRegion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1343,7 +1304,7 @@ func ExampleDatabaseAccountsClient_BeginOfflineRegion() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountOnlineRegion.json func ExampleDatabaseAccountsClient_BeginOnlineRegion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1364,7 +1325,7 @@ func ExampleDatabaseAccountsClient_BeginOnlineRegion() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json func ExampleDatabaseAccountsClient_GetReadOnlyKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1388,7 +1349,7 @@ func ExampleDatabaseAccountsClient_GetReadOnlyKeys() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountRegenerateKey.json func ExampleDatabaseAccountsClient_BeginRegenerateKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1411,7 +1372,7 @@ func ExampleDatabaseAccountsClient_BeginRegenerateKey() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountCheckNameExists.json func ExampleDatabaseAccountsClient_CheckNameExists() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1428,7 +1389,7 @@ func ExampleDatabaseAccountsClient_CheckNameExists() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountGetMetrics.json func ExampleDatabaseAccountsClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1491,7 +1452,7 @@ func ExampleDatabaseAccountsClient_NewListMetricsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountGetUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountGetUsages.json func ExampleDatabaseAccountsClient_NewListUsagesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1529,7 +1490,7 @@ func ExampleDatabaseAccountsClient_NewListUsagesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json func ExampleDatabaseAccountsClient_NewListMetricDefinitionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client.go b/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client.go deleted file mode 100644 index 33e720bb08a8..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client.go +++ /dev/null @@ -1,457 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "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 { - internal *arm.Client - subscriptionID string -} - -// 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) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DataTransferJobsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Cancel - Cancels a Data Transfer Job. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-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) { - var err error - const operationName = "DataTransferJobsClient.Cancel" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.cancelCreateRequest(ctx, resourceGroupName, accountName, jobName, options) - if err != nil { - return DataTransferJobsClientCancelResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DataTransferJobsClientCancelResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DataTransferJobsClientCancelResponse{}, err - } - resp, err := client.cancelHandleResponse(httpResp) - return resp, err -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 2023-03-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) { - var err error - const operationName = "DataTransferJobsClient.Create" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, jobName, jobCreateParameters, options) - if err != nil { - return DataTransferJobsClientCreateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DataTransferJobsClientCreateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DataTransferJobsClientCreateResponse{}, err - } - resp, err := client.createHandleResponse(httpResp) - return resp, err -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, jobCreateParameters); err != nil { - return nil, err - } - return req, nil -} - -// 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 2023-03-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) { - var err error - const operationName = "DataTransferJobsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, jobName, options) - if err != nil { - return DataTransferJobsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DataTransferJobsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DataTransferJobsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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. -// -// Generated from API version 2023-03-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.NewListByDatabaseAccountPager -// 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) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DataTransferJobsClient.NewListByDatabaseAccountPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByDatabaseAccountCreateRequest(ctx, resourceGroupName, accountName, options) - }, nil) - if err != nil { - return DataTransferJobsClientListByDatabaseAccountResponse{}, err - } - return client.listByDatabaseAccountHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 2023-03-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) { - var err error - const operationName = "DataTransferJobsClient.Pause" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.pauseCreateRequest(ctx, resourceGroupName, accountName, jobName, options) - if err != nil { - return DataTransferJobsClientPauseResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DataTransferJobsClientPauseResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DataTransferJobsClientPauseResponse{}, err - } - resp, err := client.pauseHandleResponse(httpResp) - return resp, err -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 2023-03-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) { - var err error - const operationName = "DataTransferJobsClient.Resume" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.resumeCreateRequest(ctx, resourceGroupName, accountName, jobName, options) - if err != nil { - return DataTransferJobsClientResumeResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DataTransferJobsClientResumeResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DataTransferJobsClientResumeResponse{}, err - } - resp, err := client.resumeHandleResponse(httpResp) - return resp, err -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 9f8eb025ec68..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client_example_test.go +++ /dev/null @@ -1,286 +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_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/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTransferJobsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataTransferJobGetResults = armcosmos.DataTransferJobGetResults{ - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"), - // ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"), - // Properties: &armcosmos.DataTransferJobProperties{ - // Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage), - // ContainerName: to.Ptr("blob_container"), - // EndpointURL: to.Ptr("https://blob.windows.net"), - // }, - // JobName: to.Ptr("j1"), - // LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T11:10:55.278Z"); return t}()), - // ProcessedCount: to.Ptr[int64](0), - // Source: &armcosmos.CassandraDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra), - // KeyspaceName: to.Ptr("keyspace"), - // TableName: to.Ptr("table"), - // }, - // Status: to.Ptr("Running"), - // TotalCount: to.Ptr[int64](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTransferJobsClient().Get(ctx, "rg1", "ddb1", "j1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataTransferJobGetResults = armcosmos.DataTransferJobGetResults{ - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"), - // ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"), - // Properties: &armcosmos.DataTransferJobProperties{ - // Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage), - // ContainerName: to.Ptr("blob_container"), - // EndpointURL: to.Ptr("https://blob.windows.net"), - // }, - // JobName: to.Ptr("j1"), - // LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T12:04:23.153Z"); return t}()), - // ProcessedCount: to.Ptr[int64](50), - // Source: &armcosmos.CassandraDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra), - // KeyspaceName: to.Ptr("keyspace"), - // TableName: to.Ptr("table"), - // }, - // Status: to.Ptr("Completed"), - // TotalCount: to.Ptr[int64](50), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTransferJobsClient().Pause(ctx, "rg1", "ddb1", "j1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataTransferJobGetResults = armcosmos.DataTransferJobGetResults{ - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"), - // ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"), - // Properties: &armcosmos.DataTransferJobProperties{ - // Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage), - // ContainerName: to.Ptr("blob_container"), - // EndpointURL: to.Ptr("https://blob.windows.net"), - // }, - // JobName: to.Ptr("j1"), - // LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T11:10:55.278Z"); return t}()), - // ProcessedCount: to.Ptr[int64](20), - // Source: &armcosmos.CassandraDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra), - // KeyspaceName: to.Ptr("keyspace"), - // TableName: to.Ptr("table"), - // }, - // Status: to.Ptr("Paused"), - // TotalCount: to.Ptr[int64](100), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTransferJobsClient().Resume(ctx, "rg1", "ddb1", "j1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataTransferJobGetResults = armcosmos.DataTransferJobGetResults{ - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"), - // ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"), - // Properties: &armcosmos.DataTransferJobProperties{ - // Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage), - // ContainerName: to.Ptr("blob_container"), - // EndpointURL: to.Ptr("https://blob.windows.net"), - // }, - // JobName: to.Ptr("j1"), - // LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T11:10:55.278Z"); return t}()), - // ProcessedCount: to.Ptr[int64](20), - // Source: &armcosmos.CassandraDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra), - // KeyspaceName: to.Ptr("keyspace"), - // TableName: to.Ptr("table"), - // }, - // Status: to.Ptr("Pending"), - // TotalCount: to.Ptr[int64](100), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTransferJobsClient().Cancel(ctx, "rg1", "ddb1", "j1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataTransferJobGetResults = armcosmos.DataTransferJobGetResults{ - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"), - // ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"), - // Properties: &armcosmos.DataTransferJobProperties{ - // Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage), - // ContainerName: to.Ptr("blob_container"), - // EndpointURL: to.Ptr("https://blob.windows.net"), - // }, - // JobName: to.Ptr("j1"), - // LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T11:10:55.278Z"); return t}()), - // ProcessedCount: to.Ptr[int64](20), - // Source: &armcosmos.CassandraDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra), - // KeyspaceName: to.Ptr("keyspace"), - // TableName: to.Ptr("table"), - // }, - // Status: to.Ptr("Cancelled"), - // TotalCount: to.Ptr[int64](100), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataTransferJobsClient().NewListByDatabaseAccountPager("rg1", "ddb1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataTransferJobFeedResults = armcosmos.DataTransferJobFeedResults{ - // Value: []*armcosmos.DataTransferJobGetResults{ - // { - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"), - // ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"), - // Properties: &armcosmos.DataTransferJobProperties{ - // Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage), - // ContainerName: to.Ptr("blob_container"), - // EndpointURL: to.Ptr("https://blob.windows.net"), - // }, - // JobName: to.Ptr("j1"), - // LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T12:04:23.153Z"); return t}()), - // ProcessedCount: to.Ptr[int64](100), - // Source: &armcosmos.CassandraDataTransferDataSourceSink{ - // Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra), - // KeyspaceName: to.Ptr("keyspace"), - // TableName: to.Ptr("table"), - // }, - // Status: to.Ptr("Completed"), - // TotalCount: to.Ptr[int64](100), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraclusters_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraclusters_server.go index 15cc7a23d8d0..df83f25b3dc1 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraclusters_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraclusters_server.go @@ -39,18 +39,10 @@ type CassandraClustersServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, clusterName string, options *armcosmos.CassandraClustersClientGetOptions) (resp azfake.Responder[armcosmos.CassandraClustersClientGetResponse], errResp azfake.ErrorResponder) - // GetBackup is the fake for method CassandraClustersClient.GetBackup - // HTTP status codes to indicate success: http.StatusOK - GetBackup func(ctx context.Context, resourceGroupName string, clusterName string, backupID string, options *armcosmos.CassandraClustersClientGetBackupOptions) (resp azfake.Responder[armcosmos.CassandraClustersClientGetBackupResponse], errResp azfake.ErrorResponder) - // BeginInvokeCommand is the fake for method CassandraClustersClient.BeginInvokeCommand // HTTP status codes to indicate success: http.StatusAccepted BeginInvokeCommand func(ctx context.Context, resourceGroupName string, clusterName string, body armcosmos.CommandPostBody, options *armcosmos.CassandraClustersClientBeginInvokeCommandOptions) (resp azfake.PollerResponder[armcosmos.CassandraClustersClientInvokeCommandResponse], errResp azfake.ErrorResponder) - // NewListBackupsPager is the fake for method CassandraClustersClient.NewListBackupsPager - // HTTP status codes to indicate success: http.StatusOK - NewListBackupsPager func(resourceGroupName string, clusterName string, options *armcosmos.CassandraClustersClientListBackupsOptions) (resp azfake.PagerResponder[armcosmos.CassandraClustersClientListBackupsResponse]) - // NewListByResourceGroupPager is the fake for method CassandraClustersClient.NewListByResourceGroupPager // HTTP status codes to indicate success: http.StatusOK NewListByResourceGroupPager func(resourceGroupName string, options *armcosmos.CassandraClustersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armcosmos.CassandraClustersClientListByResourceGroupResponse]) @@ -82,7 +74,6 @@ func NewCassandraClustersServerTransport(srv *CassandraClustersServer) *Cassandr beginDeallocate: newTracker[azfake.PollerResponder[armcosmos.CassandraClustersClientDeallocateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armcosmos.CassandraClustersClientDeleteResponse]](), beginInvokeCommand: newTracker[azfake.PollerResponder[armcosmos.CassandraClustersClientInvokeCommandResponse]](), - newListBackupsPager: newTracker[azfake.PagerResponder[armcosmos.CassandraClustersClientListBackupsResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcosmos.CassandraClustersClientListByResourceGroupResponse]](), newListBySubscriptionPager: newTracker[azfake.PagerResponder[armcosmos.CassandraClustersClientListBySubscriptionResponse]](), beginStart: newTracker[azfake.PollerResponder[armcosmos.CassandraClustersClientStartResponse]](), @@ -98,7 +89,6 @@ type CassandraClustersServerTransport struct { beginDeallocate *tracker[azfake.PollerResponder[armcosmos.CassandraClustersClientDeallocateResponse]] beginDelete *tracker[azfake.PollerResponder[armcosmos.CassandraClustersClientDeleteResponse]] beginInvokeCommand *tracker[azfake.PollerResponder[armcosmos.CassandraClustersClientInvokeCommandResponse]] - newListBackupsPager *tracker[azfake.PagerResponder[armcosmos.CassandraClustersClientListBackupsResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armcosmos.CassandraClustersClientListByResourceGroupResponse]] newListBySubscriptionPager *tracker[azfake.PagerResponder[armcosmos.CassandraClustersClientListBySubscriptionResponse]] beginStart *tracker[azfake.PollerResponder[armcosmos.CassandraClustersClientStartResponse]] @@ -125,12 +115,8 @@ func (c *CassandraClustersServerTransport) Do(req *http.Request) (*http.Response resp, err = c.dispatchBeginDelete(req) case "CassandraClustersClient.Get": resp, err = c.dispatchGet(req) - case "CassandraClustersClient.GetBackup": - resp, err = c.dispatchGetBackup(req) case "CassandraClustersClient.BeginInvokeCommand": resp, err = c.dispatchBeginInvokeCommand(req) - case "CassandraClustersClient.NewListBackupsPager": - resp, err = c.dispatchNewListBackupsPager(req) case "CassandraClustersClient.NewListByResourceGroupPager": resp, err = c.dispatchNewListByResourceGroupPager(req) case "CassandraClustersClient.NewListBySubscriptionPager": @@ -321,43 +307,6 @@ func (c *CassandraClustersServerTransport) dispatchGet(req *http.Request) (*http return resp, nil } -func (c *CassandraClustersServerTransport) dispatchGetBackup(req *http.Request) (*http.Response, error) { - if c.srv.GetBackup == nil { - return nil, &nonRetriableError{errors.New("fake for method GetBackup not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/cassandraClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - backupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupId")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.GetBackup(req.Context(), resourceGroupNameParam, clusterNameParam, backupIDParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BackupResource, req) - if err != nil { - return nil, err - } - return resp, nil -} - func (c *CassandraClustersServerTransport) dispatchBeginInvokeCommand(req *http.Request) (*http.Response, error) { if c.srv.BeginInvokeCommand == nil { return nil, &nonRetriableError{errors.New("fake for method BeginInvokeCommand not implemented")} @@ -406,44 +355,6 @@ func (c *CassandraClustersServerTransport) dispatchBeginInvokeCommand(req *http. return resp, nil } -func (c *CassandraClustersServerTransport) dispatchNewListBackupsPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListBackupsPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListBackupsPager not implemented")} - } - newListBackupsPager := c.newListBackupsPager.get(req) - if newListBackupsPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/cassandraClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListBackupsPager(resourceGroupNameParam, clusterNameParam, nil) - newListBackupsPager = &resp - c.newListBackupsPager.add(req, newListBackupsPager) - } - resp, err := server.PagerResponderNext(newListBackupsPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListBackupsPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListBackupsPager) { - c.newListBackupsPager.remove(req) - } - return resp, nil -} - func (c *CassandraClustersServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { if c.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraresources_server.go index 18734fff0adc..b68f6c1bff8e 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraresources_server.go @@ -31,10 +31,6 @@ type CassandraResourcesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginCreateUpdateCassandraTable func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters armcosmos.CassandraTableCreateUpdateParameters, options *armcosmos.CassandraResourcesClientBeginCreateUpdateCassandraTableOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientCreateUpdateCassandraTableResponse], errResp azfake.ErrorResponder) - // BeginCreateUpdateCassandraView is the fake for method CassandraResourcesClient.BeginCreateUpdateCassandraView - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreateUpdateCassandraView func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters armcosmos.CassandraViewCreateUpdateParameters, options *armcosmos.CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientCreateUpdateCassandraViewResponse], errResp azfake.ErrorResponder) - // BeginDeleteCassandraKeyspace is the fake for method CassandraResourcesClient.BeginDeleteCassandraKeyspace // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent BeginDeleteCassandraKeyspace func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *armcosmos.CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientDeleteCassandraKeyspaceResponse], errResp azfake.ErrorResponder) @@ -43,10 +39,6 @@ type CassandraResourcesServer struct { // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent BeginDeleteCassandraTable func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *armcosmos.CassandraResourcesClientBeginDeleteCassandraTableOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientDeleteCassandraTableResponse], errResp azfake.ErrorResponder) - // BeginDeleteCassandraView is the fake for method CassandraResourcesClient.BeginDeleteCassandraView - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDeleteCassandraView func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *armcosmos.CassandraResourcesClientBeginDeleteCassandraViewOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientDeleteCassandraViewResponse], errResp azfake.ErrorResponder) - // GetCassandraKeyspace is the fake for method CassandraResourcesClient.GetCassandraKeyspace // HTTP status codes to indicate success: http.StatusOK GetCassandraKeyspace func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *armcosmos.CassandraResourcesClientGetCassandraKeyspaceOptions) (resp azfake.Responder[armcosmos.CassandraResourcesClientGetCassandraKeyspaceResponse], errResp azfake.ErrorResponder) @@ -63,14 +55,6 @@ type CassandraResourcesServer struct { // HTTP status codes to indicate success: http.StatusOK GetCassandraTableThroughput func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *armcosmos.CassandraResourcesClientGetCassandraTableThroughputOptions) (resp azfake.Responder[armcosmos.CassandraResourcesClientGetCassandraTableThroughputResponse], errResp azfake.ErrorResponder) - // GetCassandraView is the fake for method CassandraResourcesClient.GetCassandraView - // HTTP status codes to indicate success: http.StatusOK - GetCassandraView func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *armcosmos.CassandraResourcesClientGetCassandraViewOptions) (resp azfake.Responder[armcosmos.CassandraResourcesClientGetCassandraViewResponse], errResp azfake.ErrorResponder) - - // GetCassandraViewThroughput is the fake for method CassandraResourcesClient.GetCassandraViewThroughput - // HTTP status codes to indicate success: http.StatusOK - GetCassandraViewThroughput func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *armcosmos.CassandraResourcesClientGetCassandraViewThroughputOptions) (resp azfake.Responder[armcosmos.CassandraResourcesClientGetCassandraViewThroughputResponse], errResp azfake.ErrorResponder) - // NewListCassandraKeyspacesPager is the fake for method CassandraResourcesClient.NewListCassandraKeyspacesPager // HTTP status codes to indicate success: http.StatusOK NewListCassandraKeyspacesPager func(resourceGroupName string, accountName string, options *armcosmos.CassandraResourcesClientListCassandraKeyspacesOptions) (resp azfake.PagerResponder[armcosmos.CassandraResourcesClientListCassandraKeyspacesResponse]) @@ -79,10 +63,6 @@ type CassandraResourcesServer struct { // HTTP status codes to indicate success: http.StatusOK NewListCassandraTablesPager func(resourceGroupName string, accountName string, keyspaceName string, options *armcosmos.CassandraResourcesClientListCassandraTablesOptions) (resp azfake.PagerResponder[armcosmos.CassandraResourcesClientListCassandraTablesResponse]) - // NewListCassandraViewsPager is the fake for method CassandraResourcesClient.NewListCassandraViewsPager - // HTTP status codes to indicate success: http.StatusOK - NewListCassandraViewsPager func(resourceGroupName string, accountName string, keyspaceName string, options *armcosmos.CassandraResourcesClientListCassandraViewsOptions) (resp azfake.PagerResponder[armcosmos.CassandraResourcesClientListCassandraViewsResponse]) - // BeginMigrateCassandraKeyspaceToAutoscale is the fake for method CassandraResourcesClient.BeginMigrateCassandraKeyspaceToAutoscale // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginMigrateCassandraKeyspaceToAutoscale func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *armcosmos.CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse], errResp azfake.ErrorResponder) @@ -99,14 +79,6 @@ type CassandraResourcesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginMigrateCassandraTableToManualThroughput func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *armcosmos.CassandraResourcesClientBeginMigrateCassandraTableToManualThroughputOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraTableToManualThroughputResponse], errResp azfake.ErrorResponder) - // BeginMigrateCassandraViewToAutoscale is the fake for method CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginMigrateCassandraViewToAutoscale func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *armcosmos.CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse], errResp azfake.ErrorResponder) - - // BeginMigrateCassandraViewToManualThroughput is the fake for method CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginMigrateCassandraViewToManualThroughput func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *armcosmos.CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse], errResp azfake.ErrorResponder) - // BeginUpdateCassandraKeyspaceThroughput is the fake for method CassandraResourcesClient.BeginUpdateCassandraKeyspaceThroughput // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginUpdateCassandraKeyspaceThroughput func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters armcosmos.ThroughputSettingsUpdateParameters, options *armcosmos.CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse], errResp azfake.ErrorResponder) @@ -114,10 +86,6 @@ type CassandraResourcesServer struct { // BeginUpdateCassandraTableThroughput is the fake for method CassandraResourcesClient.BeginUpdateCassandraTableThroughput // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginUpdateCassandraTableThroughput func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters armcosmos.ThroughputSettingsUpdateParameters, options *armcosmos.CassandraResourcesClientBeginUpdateCassandraTableThroughputOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientUpdateCassandraTableThroughputResponse], errResp azfake.ErrorResponder) - - // BeginUpdateCassandraViewThroughput is the fake for method CassandraResourcesClient.BeginUpdateCassandraViewThroughput - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdateCassandraViewThroughput func(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters armcosmos.ThroughputSettingsUpdateParameters, options *armcosmos.CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (resp azfake.PollerResponder[armcosmos.CassandraResourcesClientUpdateCassandraViewThroughputResponse], errResp azfake.ErrorResponder) } // NewCassandraResourcesServerTransport creates a new instance of CassandraResourcesServerTransport with the provided implementation. @@ -128,22 +96,16 @@ func NewCassandraResourcesServerTransport(srv *CassandraResourcesServer) *Cassan srv: srv, beginCreateUpdateCassandraKeyspace: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientCreateUpdateCassandraKeyspaceResponse]](), beginCreateUpdateCassandraTable: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientCreateUpdateCassandraTableResponse]](), - beginCreateUpdateCassandraView: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientCreateUpdateCassandraViewResponse]](), beginDeleteCassandraKeyspace: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientDeleteCassandraKeyspaceResponse]](), beginDeleteCassandraTable: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientDeleteCassandraTableResponse]](), - beginDeleteCassandraView: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientDeleteCassandraViewResponse]](), newListCassandraKeyspacesPager: newTracker[azfake.PagerResponder[armcosmos.CassandraResourcesClientListCassandraKeyspacesResponse]](), newListCassandraTablesPager: newTracker[azfake.PagerResponder[armcosmos.CassandraResourcesClientListCassandraTablesResponse]](), - newListCassandraViewsPager: newTracker[azfake.PagerResponder[armcosmos.CassandraResourcesClientListCassandraViewsResponse]](), beginMigrateCassandraKeyspaceToAutoscale: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse]](), beginMigrateCassandraKeyspaceToManualThroughput: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraKeyspaceToManualThroughputResponse]](), beginMigrateCassandraTableToAutoscale: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraTableToAutoscaleResponse]](), beginMigrateCassandraTableToManualThroughput: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraTableToManualThroughputResponse]](), - beginMigrateCassandraViewToAutoscale: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse]](), - beginMigrateCassandraViewToManualThroughput: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse]](), beginUpdateCassandraKeyspaceThroughput: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse]](), beginUpdateCassandraTableThroughput: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientUpdateCassandraTableThroughputResponse]](), - beginUpdateCassandraViewThroughput: newTracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientUpdateCassandraViewThroughputResponse]](), } } @@ -153,22 +115,16 @@ type CassandraResourcesServerTransport struct { srv *CassandraResourcesServer beginCreateUpdateCassandraKeyspace *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientCreateUpdateCassandraKeyspaceResponse]] beginCreateUpdateCassandraTable *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientCreateUpdateCassandraTableResponse]] - beginCreateUpdateCassandraView *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientCreateUpdateCassandraViewResponse]] beginDeleteCassandraKeyspace *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientDeleteCassandraKeyspaceResponse]] beginDeleteCassandraTable *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientDeleteCassandraTableResponse]] - beginDeleteCassandraView *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientDeleteCassandraViewResponse]] newListCassandraKeyspacesPager *tracker[azfake.PagerResponder[armcosmos.CassandraResourcesClientListCassandraKeyspacesResponse]] newListCassandraTablesPager *tracker[azfake.PagerResponder[armcosmos.CassandraResourcesClientListCassandraTablesResponse]] - newListCassandraViewsPager *tracker[azfake.PagerResponder[armcosmos.CassandraResourcesClientListCassandraViewsResponse]] beginMigrateCassandraKeyspaceToAutoscale *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse]] beginMigrateCassandraKeyspaceToManualThroughput *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraKeyspaceToManualThroughputResponse]] beginMigrateCassandraTableToAutoscale *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraTableToAutoscaleResponse]] beginMigrateCassandraTableToManualThroughput *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraTableToManualThroughputResponse]] - beginMigrateCassandraViewToAutoscale *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse]] - beginMigrateCassandraViewToManualThroughput *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse]] beginUpdateCassandraKeyspaceThroughput *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse]] beginUpdateCassandraTableThroughput *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientUpdateCassandraTableThroughputResponse]] - beginUpdateCassandraViewThroughput *tracker[azfake.PollerResponder[armcosmos.CassandraResourcesClientUpdateCassandraViewThroughputResponse]] } // Do implements the policy.Transporter interface for CassandraResourcesServerTransport. @@ -187,14 +143,10 @@ func (c *CassandraResourcesServerTransport) Do(req *http.Request) (*http.Respons resp, err = c.dispatchBeginCreateUpdateCassandraKeyspace(req) case "CassandraResourcesClient.BeginCreateUpdateCassandraTable": resp, err = c.dispatchBeginCreateUpdateCassandraTable(req) - case "CassandraResourcesClient.BeginCreateUpdateCassandraView": - resp, err = c.dispatchBeginCreateUpdateCassandraView(req) case "CassandraResourcesClient.BeginDeleteCassandraKeyspace": resp, err = c.dispatchBeginDeleteCassandraKeyspace(req) case "CassandraResourcesClient.BeginDeleteCassandraTable": resp, err = c.dispatchBeginDeleteCassandraTable(req) - case "CassandraResourcesClient.BeginDeleteCassandraView": - resp, err = c.dispatchBeginDeleteCassandraView(req) case "CassandraResourcesClient.GetCassandraKeyspace": resp, err = c.dispatchGetCassandraKeyspace(req) case "CassandraResourcesClient.GetCassandraKeyspaceThroughput": @@ -203,16 +155,10 @@ func (c *CassandraResourcesServerTransport) Do(req *http.Request) (*http.Respons resp, err = c.dispatchGetCassandraTable(req) case "CassandraResourcesClient.GetCassandraTableThroughput": resp, err = c.dispatchGetCassandraTableThroughput(req) - case "CassandraResourcesClient.GetCassandraView": - resp, err = c.dispatchGetCassandraView(req) - case "CassandraResourcesClient.GetCassandraViewThroughput": - resp, err = c.dispatchGetCassandraViewThroughput(req) case "CassandraResourcesClient.NewListCassandraKeyspacesPager": resp, err = c.dispatchNewListCassandraKeyspacesPager(req) case "CassandraResourcesClient.NewListCassandraTablesPager": resp, err = c.dispatchNewListCassandraTablesPager(req) - case "CassandraResourcesClient.NewListCassandraViewsPager": - resp, err = c.dispatchNewListCassandraViewsPager(req) case "CassandraResourcesClient.BeginMigrateCassandraKeyspaceToAutoscale": resp, err = c.dispatchBeginMigrateCassandraKeyspaceToAutoscale(req) case "CassandraResourcesClient.BeginMigrateCassandraKeyspaceToManualThroughput": @@ -221,16 +167,10 @@ func (c *CassandraResourcesServerTransport) Do(req *http.Request) (*http.Respons resp, err = c.dispatchBeginMigrateCassandraTableToAutoscale(req) case "CassandraResourcesClient.BeginMigrateCassandraTableToManualThroughput": resp, err = c.dispatchBeginMigrateCassandraTableToManualThroughput(req) - case "CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale": - resp, err = c.dispatchBeginMigrateCassandraViewToAutoscale(req) - case "CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput": - resp, err = c.dispatchBeginMigrateCassandraViewToManualThroughput(req) case "CassandraResourcesClient.BeginUpdateCassandraKeyspaceThroughput": resp, err = c.dispatchBeginUpdateCassandraKeyspaceThroughput(req) case "CassandraResourcesClient.BeginUpdateCassandraTableThroughput": resp, err = c.dispatchBeginUpdateCassandraTableThroughput(req) - case "CassandraResourcesClient.BeginUpdateCassandraViewThroughput": - resp, err = c.dispatchBeginUpdateCassandraViewThroughput(req) default: err = fmt.Errorf("unhandled API %s", method) } @@ -350,62 +290,6 @@ func (c *CassandraResourcesServerTransport) dispatchBeginCreateUpdateCassandraTa return resp, nil } -func (c *CassandraResourcesServerTransport) dispatchBeginCreateUpdateCassandraView(req *http.Request) (*http.Response, error) { - if c.srv.BeginCreateUpdateCassandraView == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateUpdateCassandraView not implemented")} - } - beginCreateUpdateCassandraView := c.beginCreateUpdateCassandraView.get(req) - if beginCreateUpdateCassandraView == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cassandraKeyspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/views/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.CassandraViewCreateUpdateParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - keyspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("keyspaceName")]) - if err != nil { - return nil, err - } - viewNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("viewName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginCreateUpdateCassandraView(req.Context(), resourceGroupNameParam, accountNameParam, keyspaceNameParam, viewNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateUpdateCassandraView = &respr - c.beginCreateUpdateCassandraView.add(req, beginCreateUpdateCassandraView) - } - - resp, err := server.PollerResponderNext(beginCreateUpdateCassandraView, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginCreateUpdateCassandraView.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateUpdateCassandraView) { - c.beginCreateUpdateCassandraView.remove(req) - } - - return resp, nil -} - func (c *CassandraResourcesServerTransport) dispatchBeginDeleteCassandraKeyspace(req *http.Request) (*http.Response, error) { if c.srv.BeginDeleteCassandraKeyspace == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDeleteCassandraKeyspace not implemented")} @@ -506,58 +390,6 @@ func (c *CassandraResourcesServerTransport) dispatchBeginDeleteCassandraTable(re return resp, nil } -func (c *CassandraResourcesServerTransport) dispatchBeginDeleteCassandraView(req *http.Request) (*http.Response, error) { - if c.srv.BeginDeleteCassandraView == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDeleteCassandraView not implemented")} - } - beginDeleteCassandraView := c.beginDeleteCassandraView.get(req) - if beginDeleteCassandraView == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cassandraKeyspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/views/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - keyspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("keyspaceName")]) - if err != nil { - return nil, err - } - viewNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("viewName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginDeleteCassandraView(req.Context(), resourceGroupNameParam, accountNameParam, keyspaceNameParam, viewNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDeleteCassandraView = &respr - c.beginDeleteCassandraView.add(req, beginDeleteCassandraView) - } - - resp, err := server.PollerResponderNext(beginDeleteCassandraView, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - c.beginDeleteCassandraView.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDeleteCassandraView) { - c.beginDeleteCassandraView.remove(req) - } - - return resp, nil -} - func (c *CassandraResourcesServerTransport) dispatchGetCassandraKeyspace(req *http.Request) (*http.Response, error) { if c.srv.GetCassandraKeyspace == nil { return nil, &nonRetriableError{errors.New("fake for method GetCassandraKeyspace not implemented")} @@ -714,88 +546,6 @@ func (c *CassandraResourcesServerTransport) dispatchGetCassandraTableThroughput( return resp, nil } -func (c *CassandraResourcesServerTransport) dispatchGetCassandraView(req *http.Request) (*http.Response, error) { - if c.srv.GetCassandraView == nil { - return nil, &nonRetriableError{errors.New("fake for method GetCassandraView not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cassandraKeyspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/views/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - keyspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("keyspaceName")]) - if err != nil { - return nil, err - } - viewNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("viewName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.GetCassandraView(req.Context(), resourceGroupNameParam, accountNameParam, keyspaceNameParam, viewNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CassandraViewGetResults, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *CassandraResourcesServerTransport) dispatchGetCassandraViewThroughput(req *http.Request) (*http.Response, error) { - if c.srv.GetCassandraViewThroughput == nil { - return nil, &nonRetriableError{errors.New("fake for method GetCassandraViewThroughput not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cassandraKeyspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/views/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - keyspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("keyspaceName")]) - if err != nil { - return nil, err - } - viewNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("viewName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.GetCassandraViewThroughput(req.Context(), resourceGroupNameParam, accountNameParam, keyspaceNameParam, viewNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ThroughputSettingsGetResults, req) - if err != nil { - return nil, err - } - return resp, nil -} - func (c *CassandraResourcesServerTransport) dispatchNewListCassandraKeyspacesPager(req *http.Request) (*http.Response, error) { if c.srv.NewListCassandraKeyspacesPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListCassandraKeyspacesPager not implemented")} @@ -876,48 +626,6 @@ func (c *CassandraResourcesServerTransport) dispatchNewListCassandraTablesPager( return resp, nil } -func (c *CassandraResourcesServerTransport) dispatchNewListCassandraViewsPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListCassandraViewsPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListCassandraViewsPager not implemented")} - } - newListCassandraViewsPager := c.newListCassandraViewsPager.get(req) - if newListCassandraViewsPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cassandraKeyspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/views` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - keyspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("keyspaceName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListCassandraViewsPager(resourceGroupNameParam, accountNameParam, keyspaceNameParam, nil) - newListCassandraViewsPager = &resp - c.newListCassandraViewsPager.add(req, newListCassandraViewsPager) - } - resp, err := server.PagerResponderNext(newListCassandraViewsPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListCassandraViewsPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListCassandraViewsPager) { - c.newListCassandraViewsPager.remove(req) - } - return resp, nil -} - func (c *CassandraResourcesServerTransport) dispatchBeginMigrateCassandraKeyspaceToAutoscale(req *http.Request) (*http.Response, error) { if c.srv.BeginMigrateCassandraKeyspaceToAutoscale == nil { return nil, &nonRetriableError{errors.New("fake for method BeginMigrateCassandraKeyspaceToAutoscale not implemented")} @@ -1118,110 +826,6 @@ func (c *CassandraResourcesServerTransport) dispatchBeginMigrateCassandraTableTo return resp, nil } -func (c *CassandraResourcesServerTransport) dispatchBeginMigrateCassandraViewToAutoscale(req *http.Request) (*http.Response, error) { - if c.srv.BeginMigrateCassandraViewToAutoscale == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginMigrateCassandraViewToAutoscale not implemented")} - } - beginMigrateCassandraViewToAutoscale := c.beginMigrateCassandraViewToAutoscale.get(req) - if beginMigrateCassandraViewToAutoscale == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cassandraKeyspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/views/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default/migrateToAutoscale` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - keyspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("keyspaceName")]) - if err != nil { - return nil, err - } - viewNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("viewName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginMigrateCassandraViewToAutoscale(req.Context(), resourceGroupNameParam, accountNameParam, keyspaceNameParam, viewNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginMigrateCassandraViewToAutoscale = &respr - c.beginMigrateCassandraViewToAutoscale.add(req, beginMigrateCassandraViewToAutoscale) - } - - resp, err := server.PollerResponderNext(beginMigrateCassandraViewToAutoscale, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginMigrateCassandraViewToAutoscale.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginMigrateCassandraViewToAutoscale) { - c.beginMigrateCassandraViewToAutoscale.remove(req) - } - - return resp, nil -} - -func (c *CassandraResourcesServerTransport) dispatchBeginMigrateCassandraViewToManualThroughput(req *http.Request) (*http.Response, error) { - if c.srv.BeginMigrateCassandraViewToManualThroughput == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginMigrateCassandraViewToManualThroughput not implemented")} - } - beginMigrateCassandraViewToManualThroughput := c.beginMigrateCassandraViewToManualThroughput.get(req) - if beginMigrateCassandraViewToManualThroughput == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cassandraKeyspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/views/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default/migrateToManualThroughput` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - keyspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("keyspaceName")]) - if err != nil { - return nil, err - } - viewNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("viewName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginMigrateCassandraViewToManualThroughput(req.Context(), resourceGroupNameParam, accountNameParam, keyspaceNameParam, viewNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginMigrateCassandraViewToManualThroughput = &respr - c.beginMigrateCassandraViewToManualThroughput.add(req, beginMigrateCassandraViewToManualThroughput) - } - - resp, err := server.PollerResponderNext(beginMigrateCassandraViewToManualThroughput, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginMigrateCassandraViewToManualThroughput.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginMigrateCassandraViewToManualThroughput) { - c.beginMigrateCassandraViewToManualThroughput.remove(req) - } - - return resp, nil -} - func (c *CassandraResourcesServerTransport) dispatchBeginUpdateCassandraKeyspaceThroughput(req *http.Request) (*http.Response, error) { if c.srv.BeginUpdateCassandraKeyspaceThroughput == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdateCassandraKeyspaceThroughput not implemented")} @@ -1329,59 +933,3 @@ func (c *CassandraResourcesServerTransport) dispatchBeginUpdateCassandraTableThr return resp, nil } - -func (c *CassandraResourcesServerTransport) dispatchBeginUpdateCassandraViewThroughput(req *http.Request) (*http.Response, error) { - if c.srv.BeginUpdateCassandraViewThroughput == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdateCassandraViewThroughput not implemented")} - } - beginUpdateCassandraViewThroughput := c.beginUpdateCassandraViewThroughput.get(req) - if beginUpdateCassandraViewThroughput == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cassandraKeyspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/views/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.ThroughputSettingsUpdateParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - keyspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("keyspaceName")]) - if err != nil { - return nil, err - } - viewNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("viewName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginUpdateCassandraViewThroughput(req.Context(), resourceGroupNameParam, accountNameParam, keyspaceNameParam, viewNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdateCassandraViewThroughput = &respr - c.beginUpdateCassandraViewThroughput.add(req, beginUpdateCassandraViewThroughput) - } - - resp, err := server.PollerResponderNext(beginUpdateCassandraViewThroughput, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginUpdateCassandraViewThroughput.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdateCassandraViewThroughput) { - c.beginUpdateCassandraViewThroughput.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/datatransferjobs_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/datatransferjobs_server.go deleted file mode 100644 index 6d7b09e00623..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/datatransferjobs_server.go +++ /dev/null @@ -1,332 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" - "net/http" - "net/url" - "regexp" -) - -// DataTransferJobsServer is a fake server for instances of the armcosmos.DataTransferJobsClient type. -type DataTransferJobsServer struct { - // Cancel is the fake for method DataTransferJobsClient.Cancel - // HTTP status codes to indicate success: http.StatusOK - Cancel func(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *armcosmos.DataTransferJobsClientCancelOptions) (resp azfake.Responder[armcosmos.DataTransferJobsClientCancelResponse], errResp azfake.ErrorResponder) - - // Create is the fake for method DataTransferJobsClient.Create - // HTTP status codes to indicate success: http.StatusOK - Create func(ctx context.Context, resourceGroupName string, accountName string, jobName string, jobCreateParameters armcosmos.CreateJobRequest, options *armcosmos.DataTransferJobsClientCreateOptions) (resp azfake.Responder[armcosmos.DataTransferJobsClientCreateResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method DataTransferJobsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *armcosmos.DataTransferJobsClientGetOptions) (resp azfake.Responder[armcosmos.DataTransferJobsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByDatabaseAccountPager is the fake for method DataTransferJobsClient.NewListByDatabaseAccountPager - // HTTP status codes to indicate success: http.StatusOK - NewListByDatabaseAccountPager func(resourceGroupName string, accountName string, options *armcosmos.DataTransferJobsClientListByDatabaseAccountOptions) (resp azfake.PagerResponder[armcosmos.DataTransferJobsClientListByDatabaseAccountResponse]) - - // Pause is the fake for method DataTransferJobsClient.Pause - // HTTP status codes to indicate success: http.StatusOK - Pause func(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *armcosmos.DataTransferJobsClientPauseOptions) (resp azfake.Responder[armcosmos.DataTransferJobsClientPauseResponse], errResp azfake.ErrorResponder) - - // Resume is the fake for method DataTransferJobsClient.Resume - // HTTP status codes to indicate success: http.StatusOK - Resume func(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *armcosmos.DataTransferJobsClientResumeOptions) (resp azfake.Responder[armcosmos.DataTransferJobsClientResumeResponse], errResp azfake.ErrorResponder) -} - -// NewDataTransferJobsServerTransport creates a new instance of DataTransferJobsServerTransport with the provided implementation. -// The returned DataTransferJobsServerTransport instance is connected to an instance of armcosmos.DataTransferJobsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewDataTransferJobsServerTransport(srv *DataTransferJobsServer) *DataTransferJobsServerTransport { - return &DataTransferJobsServerTransport{ - srv: srv, - newListByDatabaseAccountPager: newTracker[azfake.PagerResponder[armcosmos.DataTransferJobsClientListByDatabaseAccountResponse]](), - } -} - -// DataTransferJobsServerTransport connects instances of armcosmos.DataTransferJobsClient to instances of DataTransferJobsServer. -// Don't use this type directly, use NewDataTransferJobsServerTransport instead. -type DataTransferJobsServerTransport struct { - srv *DataTransferJobsServer - newListByDatabaseAccountPager *tracker[azfake.PagerResponder[armcosmos.DataTransferJobsClientListByDatabaseAccountResponse]] -} - -// Do implements the policy.Transporter interface for DataTransferJobsServerTransport. -func (d *DataTransferJobsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "DataTransferJobsClient.Cancel": - resp, err = d.dispatchCancel(req) - case "DataTransferJobsClient.Create": - resp, err = d.dispatchCreate(req) - case "DataTransferJobsClient.Get": - resp, err = d.dispatchGet(req) - case "DataTransferJobsClient.NewListByDatabaseAccountPager": - resp, err = d.dispatchNewListByDatabaseAccountPager(req) - case "DataTransferJobsClient.Pause": - resp, err = d.dispatchPause(req) - case "DataTransferJobsClient.Resume": - resp, err = d.dispatchResume(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (d *DataTransferJobsServerTransport) dispatchCancel(req *http.Request) (*http.Response, error) { - if d.srv.Cancel == nil { - return nil, &nonRetriableError{errors.New("fake for method Cancel not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dataTransferJobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - jobNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("jobName")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.Cancel(req.Context(), resourceGroupNameParam, accountNameParam, jobNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DataTransferJobGetResults, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (d *DataTransferJobsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { - if d.srv.Create == nil { - return nil, &nonRetriableError{errors.New("fake for method Create not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dataTransferJobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.CreateJobRequest](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - jobNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("jobName")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.Create(req.Context(), resourceGroupNameParam, accountNameParam, jobNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DataTransferJobGetResults, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (d *DataTransferJobsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if d.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dataTransferJobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - jobNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("jobName")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, accountNameParam, jobNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DataTransferJobGetResults, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (d *DataTransferJobsServerTransport) dispatchNewListByDatabaseAccountPager(req *http.Request) (*http.Response, error) { - if d.srv.NewListByDatabaseAccountPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByDatabaseAccountPager not implemented")} - } - newListByDatabaseAccountPager := d.newListByDatabaseAccountPager.get(req) - if newListByDatabaseAccountPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dataTransferJobs` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - resp := d.srv.NewListByDatabaseAccountPager(resourceGroupNameParam, accountNameParam, nil) - newListByDatabaseAccountPager = &resp - d.newListByDatabaseAccountPager.add(req, newListByDatabaseAccountPager) - server.PagerResponderInjectNextLinks(newListByDatabaseAccountPager, req, func(page *armcosmos.DataTransferJobsClientListByDatabaseAccountResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByDatabaseAccountPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - d.newListByDatabaseAccountPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByDatabaseAccountPager) { - d.newListByDatabaseAccountPager.remove(req) - } - return resp, nil -} - -func (d *DataTransferJobsServerTransport) dispatchPause(req *http.Request) (*http.Response, error) { - if d.srv.Pause == nil { - return nil, &nonRetriableError{errors.New("fake for method Pause not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dataTransferJobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/pause` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - jobNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("jobName")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.Pause(req.Context(), resourceGroupNameParam, accountNameParam, jobNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DataTransferJobGetResults, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (d *DataTransferJobsServerTransport) dispatchResume(req *http.Request) (*http.Response, error) { - if d.srv.Resume == nil { - return nil, &nonRetriableError{errors.New("fake for method Resume not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dataTransferJobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resume` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - jobNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("jobName")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.Resume(req.Context(), resourceGroupNameParam, accountNameParam, jobNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DataTransferJobGetResults, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/graphresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/graphresources_server.go deleted file mode 100644 index aa747a3f17f0..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/graphresources_server.go +++ /dev/null @@ -1,268 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" - "net/http" - "net/url" - "regexp" -) - -// GraphResourcesServer is a fake server for instances of the armcosmos.GraphResourcesClient type. -type GraphResourcesServer struct { - // BeginCreateUpdateGraph is the fake for method GraphResourcesClient.BeginCreateUpdateGraph - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreateUpdateGraph func(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters armcosmos.GraphResourceCreateUpdateParameters, options *armcosmos.GraphResourcesClientBeginCreateUpdateGraphOptions) (resp azfake.PollerResponder[armcosmos.GraphResourcesClientCreateUpdateGraphResponse], errResp azfake.ErrorResponder) - - // BeginDeleteGraphResource is the fake for method GraphResourcesClient.BeginDeleteGraphResource - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDeleteGraphResource func(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *armcosmos.GraphResourcesClientBeginDeleteGraphResourceOptions) (resp azfake.PollerResponder[armcosmos.GraphResourcesClientDeleteGraphResourceResponse], errResp azfake.ErrorResponder) - - // GetGraph is the fake for method GraphResourcesClient.GetGraph - // HTTP status codes to indicate success: http.StatusOK - GetGraph func(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *armcosmos.GraphResourcesClientGetGraphOptions) (resp azfake.Responder[armcosmos.GraphResourcesClientGetGraphResponse], errResp azfake.ErrorResponder) - - // NewListGraphsPager is the fake for method GraphResourcesClient.NewListGraphsPager - // HTTP status codes to indicate success: http.StatusOK - NewListGraphsPager func(resourceGroupName string, accountName string, options *armcosmos.GraphResourcesClientListGraphsOptions) (resp azfake.PagerResponder[armcosmos.GraphResourcesClientListGraphsResponse]) -} - -// NewGraphResourcesServerTransport creates a new instance of GraphResourcesServerTransport with the provided implementation. -// The returned GraphResourcesServerTransport instance is connected to an instance of armcosmos.GraphResourcesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewGraphResourcesServerTransport(srv *GraphResourcesServer) *GraphResourcesServerTransport { - return &GraphResourcesServerTransport{ - srv: srv, - beginCreateUpdateGraph: newTracker[azfake.PollerResponder[armcosmos.GraphResourcesClientCreateUpdateGraphResponse]](), - beginDeleteGraphResource: newTracker[azfake.PollerResponder[armcosmos.GraphResourcesClientDeleteGraphResourceResponse]](), - newListGraphsPager: newTracker[azfake.PagerResponder[armcosmos.GraphResourcesClientListGraphsResponse]](), - } -} - -// GraphResourcesServerTransport connects instances of armcosmos.GraphResourcesClient to instances of GraphResourcesServer. -// Don't use this type directly, use NewGraphResourcesServerTransport instead. -type GraphResourcesServerTransport struct { - srv *GraphResourcesServer - beginCreateUpdateGraph *tracker[azfake.PollerResponder[armcosmos.GraphResourcesClientCreateUpdateGraphResponse]] - beginDeleteGraphResource *tracker[azfake.PollerResponder[armcosmos.GraphResourcesClientDeleteGraphResourceResponse]] - newListGraphsPager *tracker[azfake.PagerResponder[armcosmos.GraphResourcesClientListGraphsResponse]] -} - -// Do implements the policy.Transporter interface for GraphResourcesServerTransport. -func (g *GraphResourcesServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "GraphResourcesClient.BeginCreateUpdateGraph": - resp, err = g.dispatchBeginCreateUpdateGraph(req) - case "GraphResourcesClient.BeginDeleteGraphResource": - resp, err = g.dispatchBeginDeleteGraphResource(req) - case "GraphResourcesClient.GetGraph": - resp, err = g.dispatchGetGraph(req) - case "GraphResourcesClient.NewListGraphsPager": - resp, err = g.dispatchNewListGraphsPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (g *GraphResourcesServerTransport) dispatchBeginCreateUpdateGraph(req *http.Request) (*http.Response, error) { - if g.srv.BeginCreateUpdateGraph == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateUpdateGraph not implemented")} - } - beginCreateUpdateGraph := g.beginCreateUpdateGraph.get(req) - if beginCreateUpdateGraph == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/graphs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.GraphResourceCreateUpdateParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - graphNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("graphName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.BeginCreateUpdateGraph(req.Context(), resourceGroupNameParam, accountNameParam, graphNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateUpdateGraph = &respr - g.beginCreateUpdateGraph.add(req, beginCreateUpdateGraph) - } - - resp, err := server.PollerResponderNext(beginCreateUpdateGraph, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - g.beginCreateUpdateGraph.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateUpdateGraph) { - g.beginCreateUpdateGraph.remove(req) - } - - return resp, nil -} - -func (g *GraphResourcesServerTransport) dispatchBeginDeleteGraphResource(req *http.Request) (*http.Response, error) { - if g.srv.BeginDeleteGraphResource == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDeleteGraphResource not implemented")} - } - beginDeleteGraphResource := g.beginDeleteGraphResource.get(req) - if beginDeleteGraphResource == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/graphs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - graphNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("graphName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.BeginDeleteGraphResource(req.Context(), resourceGroupNameParam, accountNameParam, graphNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDeleteGraphResource = &respr - g.beginDeleteGraphResource.add(req, beginDeleteGraphResource) - } - - resp, err := server.PollerResponderNext(beginDeleteGraphResource, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - g.beginDeleteGraphResource.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDeleteGraphResource) { - g.beginDeleteGraphResource.remove(req) - } - - return resp, nil -} - -func (g *GraphResourcesServerTransport) dispatchGetGraph(req *http.Request) (*http.Response, error) { - if g.srv.GetGraph == nil { - return nil, &nonRetriableError{errors.New("fake for method GetGraph not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/graphs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - graphNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("graphName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.GetGraph(req.Context(), resourceGroupNameParam, accountNameParam, graphNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).GraphResourceGetResults, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (g *GraphResourcesServerTransport) dispatchNewListGraphsPager(req *http.Request) (*http.Response, error) { - if g.srv.NewListGraphsPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListGraphsPager not implemented")} - } - newListGraphsPager := g.newListGraphsPager.get(req) - if newListGraphsPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/graphs` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - resp := g.srv.NewListGraphsPager(resourceGroupNameParam, accountNameParam, nil) - newListGraphsPager = &resp - g.newListGraphsPager.add(req, newListGraphsPager) - } - resp, err := server.PagerResponderNext(newListGraphsPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - g.newListGraphsPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListGraphsPager) { - g.newListGraphsPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/mongoclusters_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/mongoclusters_server.go deleted file mode 100644 index a7b94eed4cc8..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/mongoclusters_server.go +++ /dev/null @@ -1,639 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" - "net/http" - "net/url" - "regexp" -) - -// MongoClustersServer is a fake server for instances of the armcosmos.MongoClustersClient type. -type MongoClustersServer struct { - // CheckNameAvailability is the fake for method MongoClustersClient.CheckNameAvailability - // HTTP status codes to indicate success: http.StatusOK - CheckNameAvailability func(ctx context.Context, location string, parameters armcosmos.CheckNameAvailabilityRequest, options *armcosmos.MongoClustersClientCheckNameAvailabilityOptions) (resp azfake.Responder[armcosmos.MongoClustersClientCheckNameAvailabilityResponse], errResp azfake.ErrorResponder) - - // BeginCreateOrUpdate is the fake for method MongoClustersClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, mongoClusterName string, parameters armcosmos.MongoCluster, options *armcosmos.MongoClustersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armcosmos.MongoClustersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginCreateOrUpdateFirewallRule is the fake for method MongoClustersClient.BeginCreateOrUpdateFirewallRule - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdateFirewallRule func(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, parameters armcosmos.FirewallRule, options *armcosmos.MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions) (resp azfake.PollerResponder[armcosmos.MongoClustersClientCreateOrUpdateFirewallRuleResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method MongoClustersClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, mongoClusterName string, options *armcosmos.MongoClustersClientBeginDeleteOptions) (resp azfake.PollerResponder[armcosmos.MongoClustersClientDeleteResponse], errResp azfake.ErrorResponder) - - // BeginDeleteFirewallRule is the fake for method MongoClustersClient.BeginDeleteFirewallRule - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDeleteFirewallRule func(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *armcosmos.MongoClustersClientBeginDeleteFirewallRuleOptions) (resp azfake.PollerResponder[armcosmos.MongoClustersClientDeleteFirewallRuleResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method MongoClustersClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, mongoClusterName string, options *armcosmos.MongoClustersClientGetOptions) (resp azfake.Responder[armcosmos.MongoClustersClientGetResponse], errResp azfake.ErrorResponder) - - // GetFirewallRule is the fake for method MongoClustersClient.GetFirewallRule - // HTTP status codes to indicate success: http.StatusOK - GetFirewallRule func(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *armcosmos.MongoClustersClientGetFirewallRuleOptions) (resp azfake.Responder[armcosmos.MongoClustersClientGetFirewallRuleResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method MongoClustersClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(options *armcosmos.MongoClustersClientListOptions) (resp azfake.PagerResponder[armcosmos.MongoClustersClientListResponse]) - - // NewListByResourceGroupPager is the fake for method MongoClustersClient.NewListByResourceGroupPager - // HTTP status codes to indicate success: http.StatusOK - NewListByResourceGroupPager func(resourceGroupName string, options *armcosmos.MongoClustersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armcosmos.MongoClustersClientListByResourceGroupResponse]) - - // ListConnectionStrings is the fake for method MongoClustersClient.ListConnectionStrings - // HTTP status codes to indicate success: http.StatusOK - ListConnectionStrings func(ctx context.Context, resourceGroupName string, mongoClusterName string, options *armcosmos.MongoClustersClientListConnectionStringsOptions) (resp azfake.Responder[armcosmos.MongoClustersClientListConnectionStringsResponse], errResp azfake.ErrorResponder) - - // NewListFirewallRulesPager is the fake for method MongoClustersClient.NewListFirewallRulesPager - // HTTP status codes to indicate success: http.StatusOK - NewListFirewallRulesPager func(resourceGroupName string, mongoClusterName string, options *armcosmos.MongoClustersClientListFirewallRulesOptions) (resp azfake.PagerResponder[armcosmos.MongoClustersClientListFirewallRulesResponse]) - - // BeginUpdate is the fake for method MongoClustersClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceGroupName string, mongoClusterName string, parameters armcosmos.MongoClusterUpdate, options *armcosmos.MongoClustersClientBeginUpdateOptions) (resp azfake.PollerResponder[armcosmos.MongoClustersClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewMongoClustersServerTransport creates a new instance of MongoClustersServerTransport with the provided implementation. -// The returned MongoClustersServerTransport instance is connected to an instance of armcosmos.MongoClustersClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewMongoClustersServerTransport(srv *MongoClustersServer) *MongoClustersServerTransport { - return &MongoClustersServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcosmos.MongoClustersClientCreateOrUpdateResponse]](), - beginCreateOrUpdateFirewallRule: newTracker[azfake.PollerResponder[armcosmos.MongoClustersClientCreateOrUpdateFirewallRuleResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armcosmos.MongoClustersClientDeleteResponse]](), - beginDeleteFirewallRule: newTracker[azfake.PollerResponder[armcosmos.MongoClustersClientDeleteFirewallRuleResponse]](), - newListPager: newTracker[azfake.PagerResponder[armcosmos.MongoClustersClientListResponse]](), - newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcosmos.MongoClustersClientListByResourceGroupResponse]](), - newListFirewallRulesPager: newTracker[azfake.PagerResponder[armcosmos.MongoClustersClientListFirewallRulesResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armcosmos.MongoClustersClientUpdateResponse]](), - } -} - -// MongoClustersServerTransport connects instances of armcosmos.MongoClustersClient to instances of MongoClustersServer. -// Don't use this type directly, use NewMongoClustersServerTransport instead. -type MongoClustersServerTransport struct { - srv *MongoClustersServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armcosmos.MongoClustersClientCreateOrUpdateResponse]] - beginCreateOrUpdateFirewallRule *tracker[azfake.PollerResponder[armcosmos.MongoClustersClientCreateOrUpdateFirewallRuleResponse]] - beginDelete *tracker[azfake.PollerResponder[armcosmos.MongoClustersClientDeleteResponse]] - beginDeleteFirewallRule *tracker[azfake.PollerResponder[armcosmos.MongoClustersClientDeleteFirewallRuleResponse]] - newListPager *tracker[azfake.PagerResponder[armcosmos.MongoClustersClientListResponse]] - newListByResourceGroupPager *tracker[azfake.PagerResponder[armcosmos.MongoClustersClientListByResourceGroupResponse]] - newListFirewallRulesPager *tracker[azfake.PagerResponder[armcosmos.MongoClustersClientListFirewallRulesResponse]] - beginUpdate *tracker[azfake.PollerResponder[armcosmos.MongoClustersClientUpdateResponse]] -} - -// Do implements the policy.Transporter interface for MongoClustersServerTransport. -func (m *MongoClustersServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "MongoClustersClient.CheckNameAvailability": - resp, err = m.dispatchCheckNameAvailability(req) - case "MongoClustersClient.BeginCreateOrUpdate": - resp, err = m.dispatchBeginCreateOrUpdate(req) - case "MongoClustersClient.BeginCreateOrUpdateFirewallRule": - resp, err = m.dispatchBeginCreateOrUpdateFirewallRule(req) - case "MongoClustersClient.BeginDelete": - resp, err = m.dispatchBeginDelete(req) - case "MongoClustersClient.BeginDeleteFirewallRule": - resp, err = m.dispatchBeginDeleteFirewallRule(req) - case "MongoClustersClient.Get": - resp, err = m.dispatchGet(req) - case "MongoClustersClient.GetFirewallRule": - resp, err = m.dispatchGetFirewallRule(req) - case "MongoClustersClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - case "MongoClustersClient.NewListByResourceGroupPager": - resp, err = m.dispatchNewListByResourceGroupPager(req) - case "MongoClustersClient.ListConnectionStrings": - resp, err = m.dispatchListConnectionStrings(req) - case "MongoClustersClient.NewListFirewallRulesPager": - resp, err = m.dispatchNewListFirewallRulesPager(req) - case "MongoClustersClient.BeginUpdate": - resp, err = m.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) { - if m.srv.CheckNameAvailability == nil { - return nil, &nonRetriableError{errors.New("fake for method CheckNameAvailability not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkMongoClusterNameAvailability` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.CheckNameAvailabilityRequest](req) - if err != nil { - return nil, err - } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.CheckNameAvailability(req.Context(), locationParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CheckNameAvailabilityResponse, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if m.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := m.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.MongoCluster](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - mongoClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("mongoClusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, mongoClusterNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - m.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - m.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - m.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchBeginCreateOrUpdateFirewallRule(req *http.Request) (*http.Response, error) { - if m.srv.BeginCreateOrUpdateFirewallRule == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdateFirewallRule not implemented")} - } - beginCreateOrUpdateFirewallRule := m.beginCreateOrUpdateFirewallRule.get(req) - if beginCreateOrUpdateFirewallRule == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.FirewallRule](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - mongoClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("mongoClusterName")]) - if err != nil { - return nil, err - } - firewallRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("firewallRuleName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginCreateOrUpdateFirewallRule(req.Context(), resourceGroupNameParam, mongoClusterNameParam, firewallRuleNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdateFirewallRule = &respr - m.beginCreateOrUpdateFirewallRule.add(req, beginCreateOrUpdateFirewallRule) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdateFirewallRule, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - m.beginCreateOrUpdateFirewallRule.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdateFirewallRule) { - m.beginCreateOrUpdateFirewallRule.remove(req) - } - - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if m.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := m.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - mongoClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("mongoClusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginDelete(req.Context(), resourceGroupNameParam, mongoClusterNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - m.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - m.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - m.beginDelete.remove(req) - } - - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchBeginDeleteFirewallRule(req *http.Request) (*http.Response, error) { - if m.srv.BeginDeleteFirewallRule == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDeleteFirewallRule not implemented")} - } - beginDeleteFirewallRule := m.beginDeleteFirewallRule.get(req) - if beginDeleteFirewallRule == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - mongoClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("mongoClusterName")]) - if err != nil { - return nil, err - } - firewallRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("firewallRuleName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginDeleteFirewallRule(req.Context(), resourceGroupNameParam, mongoClusterNameParam, firewallRuleNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDeleteFirewallRule = &respr - m.beginDeleteFirewallRule.add(req, beginDeleteFirewallRule) - } - - resp, err := server.PollerResponderNext(beginDeleteFirewallRule, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - m.beginDeleteFirewallRule.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDeleteFirewallRule) { - m.beginDeleteFirewallRule.remove(req) - } - - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if m.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - mongoClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("mongoClusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, mongoClusterNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MongoCluster, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchGetFirewallRule(req *http.Request) (*http.Response, error) { - if m.srv.GetFirewallRule == nil { - return nil, &nonRetriableError{errors.New("fake for method GetFirewallRule not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - mongoClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("mongoClusterName")]) - if err != nil { - return nil, err - } - firewallRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("firewallRuleName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.GetFirewallRule(req.Context(), resourceGroupNameParam, mongoClusterNameParam, firewallRuleNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FirewallRule, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := m.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resp := m.srv.NewListPager(nil) - newListPager = &resp - m.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcosmos.MongoClustersClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - m.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - m.newListPager.remove(req) - } - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListByResourceGroupPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} - } - newListByResourceGroupPager := m.newListByResourceGroupPager.get(req) - if newListByResourceGroupPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resp := m.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) - newListByResourceGroupPager = &resp - m.newListByResourceGroupPager.add(req, newListByResourceGroupPager) - server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcosmos.MongoClustersClientListByResourceGroupResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - m.newListByResourceGroupPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByResourceGroupPager) { - m.newListByResourceGroupPager.remove(req) - } - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchListConnectionStrings(req *http.Request) (*http.Response, error) { - if m.srv.ListConnectionStrings == nil { - return nil, &nonRetriableError{errors.New("fake for method ListConnectionStrings not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listConnectionStrings` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - mongoClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("mongoClusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.ListConnectionStrings(req.Context(), resourceGroupNameParam, mongoClusterNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ListConnectionStringsResult, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchNewListFirewallRulesPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListFirewallRulesPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListFirewallRulesPager not implemented")} - } - newListFirewallRulesPager := m.newListFirewallRulesPager.get(req) - if newListFirewallRulesPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - mongoClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("mongoClusterName")]) - if err != nil { - return nil, err - } - resp := m.srv.NewListFirewallRulesPager(resourceGroupNameParam, mongoClusterNameParam, nil) - newListFirewallRulesPager = &resp - m.newListFirewallRulesPager.add(req, newListFirewallRulesPager) - server.PagerResponderInjectNextLinks(newListFirewallRulesPager, req, func(page *armcosmos.MongoClustersClientListFirewallRulesResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListFirewallRulesPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - m.newListFirewallRulesPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListFirewallRulesPager) { - m.newListFirewallRulesPager.remove(req) - } - return resp, nil -} - -func (m *MongoClustersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if m.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := m.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/mongoClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.MongoClusterUpdate](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - mongoClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("mongoClusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginUpdate(req.Context(), resourceGroupNameParam, mongoClusterNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - m.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - m.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - m.beginUpdate.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/mongodbresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/mongodbresources_server.go index d3b8c3670d42..43c14652a385 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/mongodbresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/mongodbresources_server.go @@ -79,10 +79,6 @@ type MongoDBResourcesServer struct { // HTTP status codes to indicate success: http.StatusOK GetMongoUserDefinition func(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, options *armcosmos.MongoDBResourcesClientGetMongoUserDefinitionOptions) (resp azfake.Responder[armcosmos.MongoDBResourcesClientGetMongoUserDefinitionResponse], errResp azfake.ErrorResponder) - // BeginListMongoDBCollectionPartitionMerge is the fake for method MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginListMongoDBCollectionPartitionMerge func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, mergeParameters armcosmos.MergeParameters, options *armcosmos.MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (resp azfake.PollerResponder[armcosmos.MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse], errResp azfake.ErrorResponder) - // NewListMongoDBCollectionsPager is the fake for method MongoDBResourcesClient.NewListMongoDBCollectionsPager // HTTP status codes to indicate success: http.StatusOK NewListMongoDBCollectionsPager func(resourceGroupName string, accountName string, databaseName string, options *armcosmos.MongoDBResourcesClientListMongoDBCollectionsOptions) (resp azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoDBCollectionsResponse]) @@ -115,26 +111,6 @@ type MongoDBResourcesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginMigrateMongoDBDatabaseToManualThroughput func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *armcosmos.MongoDBResourcesClientBeginMigrateMongoDBDatabaseToManualThroughputOptions) (resp azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBDatabaseToManualThroughputResponse], errResp azfake.ErrorResponder) - // BeginMongoDBContainerRedistributeThroughput is the fake for method MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginMongoDBContainerRedistributeThroughput func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, redistributeThroughputParameters armcosmos.RedistributeThroughputParameters, options *armcosmos.MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (resp azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse], errResp azfake.ErrorResponder) - - // BeginMongoDBContainerRetrieveThroughputDistribution is the fake for method MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginMongoDBContainerRetrieveThroughputDistribution func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, retrieveThroughputParameters armcosmos.RetrieveThroughputParameters, options *armcosmos.MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (resp azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse], errResp azfake.ErrorResponder) - - // BeginMongoDBDatabasePartitionMerge is the fake for method MongoDBResourcesClient.BeginMongoDBDatabasePartitionMerge - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginMongoDBDatabasePartitionMerge func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, mergeParameters armcosmos.MergeParameters, options *armcosmos.MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions) (resp azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse], errResp azfake.ErrorResponder) - - // BeginMongoDBDatabaseRedistributeThroughput is the fake for method MongoDBResourcesClient.BeginMongoDBDatabaseRedistributeThroughput - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginMongoDBDatabaseRedistributeThroughput func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, redistributeThroughputParameters armcosmos.RedistributeThroughputParameters, options *armcosmos.MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions) (resp azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse], errResp azfake.ErrorResponder) - - // BeginMongoDBDatabaseRetrieveThroughputDistribution is the fake for method MongoDBResourcesClient.BeginMongoDBDatabaseRetrieveThroughputDistribution - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginMongoDBDatabaseRetrieveThroughputDistribution func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, retrieveThroughputParameters armcosmos.RetrieveThroughputParameters, options *armcosmos.MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions) (resp azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse], errResp azfake.ErrorResponder) - // BeginRetrieveContinuousBackupInformation is the fake for method MongoDBResourcesClient.BeginRetrieveContinuousBackupInformation // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginRetrieveContinuousBackupInformation func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, location armcosmos.ContinuousBackupRestoreLocation, options *armcosmos.MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions) (resp azfake.PollerResponder[armcosmos.MongoDBResourcesClientRetrieveContinuousBackupInformationResponse], errResp azfake.ErrorResponder) @@ -153,64 +129,52 @@ type MongoDBResourcesServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewMongoDBResourcesServerTransport(srv *MongoDBResourcesServer) *MongoDBResourcesServerTransport { return &MongoDBResourcesServerTransport{ - srv: srv, - beginCreateUpdateMongoDBCollection: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoDBCollectionResponse]](), - beginCreateUpdateMongoDBDatabase: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoDBDatabaseResponse]](), - beginCreateUpdateMongoRoleDefinition: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse]](), - beginCreateUpdateMongoUserDefinition: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse]](), - beginDeleteMongoDBCollection: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoDBCollectionResponse]](), - beginDeleteMongoDBDatabase: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoDBDatabaseResponse]](), - beginDeleteMongoRoleDefinition: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoRoleDefinitionResponse]](), - beginDeleteMongoUserDefinition: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoUserDefinitionResponse]](), - beginListMongoDBCollectionPartitionMerge: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse]](), - newListMongoDBCollectionsPager: newTracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoDBCollectionsResponse]](), - newListMongoDBDatabasesPager: newTracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoDBDatabasesResponse]](), - newListMongoRoleDefinitionsPager: newTracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoRoleDefinitionsResponse]](), - newListMongoUserDefinitionsPager: newTracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoUserDefinitionsResponse]](), - beginMigrateMongoDBCollectionToAutoscale: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBCollectionToAutoscaleResponse]](), - beginMigrateMongoDBCollectionToManualThroughput: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBCollectionToManualThroughputResponse]](), - beginMigrateMongoDBDatabaseToAutoscale: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBDatabaseToAutoscaleResponse]](), - beginMigrateMongoDBDatabaseToManualThroughput: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBDatabaseToManualThroughputResponse]](), - beginMongoDBContainerRedistributeThroughput: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse]](), - beginMongoDBContainerRetrieveThroughputDistribution: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse]](), - beginMongoDBDatabasePartitionMerge: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse]](), - beginMongoDBDatabaseRedistributeThroughput: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse]](), - beginMongoDBDatabaseRetrieveThroughputDistribution: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse]](), - beginRetrieveContinuousBackupInformation: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientRetrieveContinuousBackupInformationResponse]](), - beginUpdateMongoDBCollectionThroughput: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientUpdateMongoDBCollectionThroughputResponse]](), - beginUpdateMongoDBDatabaseThroughput: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientUpdateMongoDBDatabaseThroughputResponse]](), + srv: srv, + beginCreateUpdateMongoDBCollection: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoDBCollectionResponse]](), + beginCreateUpdateMongoDBDatabase: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoDBDatabaseResponse]](), + beginCreateUpdateMongoRoleDefinition: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse]](), + beginCreateUpdateMongoUserDefinition: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse]](), + beginDeleteMongoDBCollection: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoDBCollectionResponse]](), + beginDeleteMongoDBDatabase: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoDBDatabaseResponse]](), + beginDeleteMongoRoleDefinition: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoRoleDefinitionResponse]](), + beginDeleteMongoUserDefinition: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoUserDefinitionResponse]](), + newListMongoDBCollectionsPager: newTracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoDBCollectionsResponse]](), + newListMongoDBDatabasesPager: newTracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoDBDatabasesResponse]](), + newListMongoRoleDefinitionsPager: newTracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoRoleDefinitionsResponse]](), + newListMongoUserDefinitionsPager: newTracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoUserDefinitionsResponse]](), + beginMigrateMongoDBCollectionToAutoscale: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBCollectionToAutoscaleResponse]](), + beginMigrateMongoDBCollectionToManualThroughput: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBCollectionToManualThroughputResponse]](), + beginMigrateMongoDBDatabaseToAutoscale: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBDatabaseToAutoscaleResponse]](), + beginMigrateMongoDBDatabaseToManualThroughput: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBDatabaseToManualThroughputResponse]](), + beginRetrieveContinuousBackupInformation: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientRetrieveContinuousBackupInformationResponse]](), + beginUpdateMongoDBCollectionThroughput: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientUpdateMongoDBCollectionThroughputResponse]](), + beginUpdateMongoDBDatabaseThroughput: newTracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientUpdateMongoDBDatabaseThroughputResponse]](), } } // MongoDBResourcesServerTransport connects instances of armcosmos.MongoDBResourcesClient to instances of MongoDBResourcesServer. // Don't use this type directly, use NewMongoDBResourcesServerTransport instead. type MongoDBResourcesServerTransport struct { - srv *MongoDBResourcesServer - beginCreateUpdateMongoDBCollection *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoDBCollectionResponse]] - beginCreateUpdateMongoDBDatabase *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoDBDatabaseResponse]] - beginCreateUpdateMongoRoleDefinition *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse]] - beginCreateUpdateMongoUserDefinition *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse]] - beginDeleteMongoDBCollection *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoDBCollectionResponse]] - beginDeleteMongoDBDatabase *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoDBDatabaseResponse]] - beginDeleteMongoRoleDefinition *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoRoleDefinitionResponse]] - beginDeleteMongoUserDefinition *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoUserDefinitionResponse]] - beginListMongoDBCollectionPartitionMerge *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse]] - newListMongoDBCollectionsPager *tracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoDBCollectionsResponse]] - newListMongoDBDatabasesPager *tracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoDBDatabasesResponse]] - newListMongoRoleDefinitionsPager *tracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoRoleDefinitionsResponse]] - newListMongoUserDefinitionsPager *tracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoUserDefinitionsResponse]] - beginMigrateMongoDBCollectionToAutoscale *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBCollectionToAutoscaleResponse]] - beginMigrateMongoDBCollectionToManualThroughput *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBCollectionToManualThroughputResponse]] - beginMigrateMongoDBDatabaseToAutoscale *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBDatabaseToAutoscaleResponse]] - beginMigrateMongoDBDatabaseToManualThroughput *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBDatabaseToManualThroughputResponse]] - beginMongoDBContainerRedistributeThroughput *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse]] - beginMongoDBContainerRetrieveThroughputDistribution *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse]] - beginMongoDBDatabasePartitionMerge *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse]] - beginMongoDBDatabaseRedistributeThroughput *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse]] - beginMongoDBDatabaseRetrieveThroughputDistribution *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse]] - beginRetrieveContinuousBackupInformation *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientRetrieveContinuousBackupInformationResponse]] - beginUpdateMongoDBCollectionThroughput *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientUpdateMongoDBCollectionThroughputResponse]] - beginUpdateMongoDBDatabaseThroughput *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientUpdateMongoDBDatabaseThroughputResponse]] + srv *MongoDBResourcesServer + beginCreateUpdateMongoDBCollection *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoDBCollectionResponse]] + beginCreateUpdateMongoDBDatabase *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoDBDatabaseResponse]] + beginCreateUpdateMongoRoleDefinition *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse]] + beginCreateUpdateMongoUserDefinition *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse]] + beginDeleteMongoDBCollection *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoDBCollectionResponse]] + beginDeleteMongoDBDatabase *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoDBDatabaseResponse]] + beginDeleteMongoRoleDefinition *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoRoleDefinitionResponse]] + beginDeleteMongoUserDefinition *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientDeleteMongoUserDefinitionResponse]] + newListMongoDBCollectionsPager *tracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoDBCollectionsResponse]] + newListMongoDBDatabasesPager *tracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoDBDatabasesResponse]] + newListMongoRoleDefinitionsPager *tracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoRoleDefinitionsResponse]] + newListMongoUserDefinitionsPager *tracker[azfake.PagerResponder[armcosmos.MongoDBResourcesClientListMongoUserDefinitionsResponse]] + beginMigrateMongoDBCollectionToAutoscale *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBCollectionToAutoscaleResponse]] + beginMigrateMongoDBCollectionToManualThroughput *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBCollectionToManualThroughputResponse]] + beginMigrateMongoDBDatabaseToAutoscale *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBDatabaseToAutoscaleResponse]] + beginMigrateMongoDBDatabaseToManualThroughput *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientMigrateMongoDBDatabaseToManualThroughputResponse]] + beginRetrieveContinuousBackupInformation *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientRetrieveContinuousBackupInformationResponse]] + beginUpdateMongoDBCollectionThroughput *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientUpdateMongoDBCollectionThroughputResponse]] + beginUpdateMongoDBDatabaseThroughput *tracker[azfake.PollerResponder[armcosmos.MongoDBResourcesClientUpdateMongoDBDatabaseThroughputResponse]] } // Do implements the policy.Transporter interface for MongoDBResourcesServerTransport. @@ -253,8 +217,6 @@ func (m *MongoDBResourcesServerTransport) Do(req *http.Request) (*http.Response, resp, err = m.dispatchGetMongoRoleDefinition(req) case "MongoDBResourcesClient.GetMongoUserDefinition": resp, err = m.dispatchGetMongoUserDefinition(req) - case "MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge": - resp, err = m.dispatchBeginListMongoDBCollectionPartitionMerge(req) case "MongoDBResourcesClient.NewListMongoDBCollectionsPager": resp, err = m.dispatchNewListMongoDBCollectionsPager(req) case "MongoDBResourcesClient.NewListMongoDBDatabasesPager": @@ -271,16 +233,6 @@ func (m *MongoDBResourcesServerTransport) Do(req *http.Request) (*http.Response, resp, err = m.dispatchBeginMigrateMongoDBDatabaseToAutoscale(req) case "MongoDBResourcesClient.BeginMigrateMongoDBDatabaseToManualThroughput": resp, err = m.dispatchBeginMigrateMongoDBDatabaseToManualThroughput(req) - case "MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput": - resp, err = m.dispatchBeginMongoDBContainerRedistributeThroughput(req) - case "MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution": - resp, err = m.dispatchBeginMongoDBContainerRetrieveThroughputDistribution(req) - case "MongoDBResourcesClient.BeginMongoDBDatabasePartitionMerge": - resp, err = m.dispatchBeginMongoDBDatabasePartitionMerge(req) - case "MongoDBResourcesClient.BeginMongoDBDatabaseRedistributeThroughput": - resp, err = m.dispatchBeginMongoDBDatabaseRedistributeThroughput(req) - case "MongoDBResourcesClient.BeginMongoDBDatabaseRetrieveThroughputDistribution": - resp, err = m.dispatchBeginMongoDBDatabaseRetrieveThroughputDistribution(req) case "MongoDBResourcesClient.BeginRetrieveContinuousBackupInformation": resp, err = m.dispatchBeginRetrieveContinuousBackupInformation(req) case "MongoDBResourcesClient.BeginUpdateMongoDBCollectionThroughput": @@ -936,62 +888,6 @@ func (m *MongoDBResourcesServerTransport) dispatchGetMongoUserDefinition(req *ht return resp, nil } -func (m *MongoDBResourcesServerTransport) dispatchBeginListMongoDBCollectionPartitionMerge(req *http.Request) (*http.Response, error) { - if m.srv.BeginListMongoDBCollectionPartitionMerge == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginListMongoDBCollectionPartitionMerge not implemented")} - } - beginListMongoDBCollectionPartitionMerge := m.beginListMongoDBCollectionPartitionMerge.get(req) - if beginListMongoDBCollectionPartitionMerge == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/mongodbDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/collections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/partitionMerge` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.MergeParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - collectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("collectionName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginListMongoDBCollectionPartitionMerge(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, collectionNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginListMongoDBCollectionPartitionMerge = &respr - m.beginListMongoDBCollectionPartitionMerge.add(req, beginListMongoDBCollectionPartitionMerge) - } - - resp, err := server.PollerResponderNext(beginListMongoDBCollectionPartitionMerge, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - m.beginListMongoDBCollectionPartitionMerge.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginListMongoDBCollectionPartitionMerge) { - m.beginListMongoDBCollectionPartitionMerge.remove(req) - } - - return resp, nil -} - func (m *MongoDBResourcesServerTransport) dispatchNewListMongoDBCollectionsPager(req *http.Request) (*http.Response, error) { if m.srv.NewListMongoDBCollectionsPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListMongoDBCollectionsPager not implemented")} @@ -1348,274 +1244,6 @@ func (m *MongoDBResourcesServerTransport) dispatchBeginMigrateMongoDBDatabaseToM return resp, nil } -func (m *MongoDBResourcesServerTransport) dispatchBeginMongoDBContainerRedistributeThroughput(req *http.Request) (*http.Response, error) { - if m.srv.BeginMongoDBContainerRedistributeThroughput == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginMongoDBContainerRedistributeThroughput not implemented")} - } - beginMongoDBContainerRedistributeThroughput := m.beginMongoDBContainerRedistributeThroughput.get(req) - if beginMongoDBContainerRedistributeThroughput == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/mongodbDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/collections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default/redistributeThroughput` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.RedistributeThroughputParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - collectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("collectionName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginMongoDBContainerRedistributeThroughput(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, collectionNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginMongoDBContainerRedistributeThroughput = &respr - m.beginMongoDBContainerRedistributeThroughput.add(req, beginMongoDBContainerRedistributeThroughput) - } - - resp, err := server.PollerResponderNext(beginMongoDBContainerRedistributeThroughput, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - m.beginMongoDBContainerRedistributeThroughput.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginMongoDBContainerRedistributeThroughput) { - m.beginMongoDBContainerRedistributeThroughput.remove(req) - } - - return resp, nil -} - -func (m *MongoDBResourcesServerTransport) dispatchBeginMongoDBContainerRetrieveThroughputDistribution(req *http.Request) (*http.Response, error) { - if m.srv.BeginMongoDBContainerRetrieveThroughputDistribution == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginMongoDBContainerRetrieveThroughputDistribution not implemented")} - } - beginMongoDBContainerRetrieveThroughputDistribution := m.beginMongoDBContainerRetrieveThroughputDistribution.get(req) - if beginMongoDBContainerRetrieveThroughputDistribution == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/mongodbDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/collections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default/retrieveThroughputDistribution` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.RetrieveThroughputParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - collectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("collectionName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginMongoDBContainerRetrieveThroughputDistribution(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, collectionNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginMongoDBContainerRetrieveThroughputDistribution = &respr - m.beginMongoDBContainerRetrieveThroughputDistribution.add(req, beginMongoDBContainerRetrieveThroughputDistribution) - } - - resp, err := server.PollerResponderNext(beginMongoDBContainerRetrieveThroughputDistribution, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - m.beginMongoDBContainerRetrieveThroughputDistribution.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginMongoDBContainerRetrieveThroughputDistribution) { - m.beginMongoDBContainerRetrieveThroughputDistribution.remove(req) - } - - return resp, nil -} - -func (m *MongoDBResourcesServerTransport) dispatchBeginMongoDBDatabasePartitionMerge(req *http.Request) (*http.Response, error) { - if m.srv.BeginMongoDBDatabasePartitionMerge == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginMongoDBDatabasePartitionMerge not implemented")} - } - beginMongoDBDatabasePartitionMerge := m.beginMongoDBDatabasePartitionMerge.get(req) - if beginMongoDBDatabasePartitionMerge == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/mongodbDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/partitionMerge` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.MergeParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginMongoDBDatabasePartitionMerge(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginMongoDBDatabasePartitionMerge = &respr - m.beginMongoDBDatabasePartitionMerge.add(req, beginMongoDBDatabasePartitionMerge) - } - - resp, err := server.PollerResponderNext(beginMongoDBDatabasePartitionMerge, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - m.beginMongoDBDatabasePartitionMerge.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginMongoDBDatabasePartitionMerge) { - m.beginMongoDBDatabasePartitionMerge.remove(req) - } - - return resp, nil -} - -func (m *MongoDBResourcesServerTransport) dispatchBeginMongoDBDatabaseRedistributeThroughput(req *http.Request) (*http.Response, error) { - if m.srv.BeginMongoDBDatabaseRedistributeThroughput == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginMongoDBDatabaseRedistributeThroughput not implemented")} - } - beginMongoDBDatabaseRedistributeThroughput := m.beginMongoDBDatabaseRedistributeThroughput.get(req) - if beginMongoDBDatabaseRedistributeThroughput == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/mongodbDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default/redistributeThroughput` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.RedistributeThroughputParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginMongoDBDatabaseRedistributeThroughput(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginMongoDBDatabaseRedistributeThroughput = &respr - m.beginMongoDBDatabaseRedistributeThroughput.add(req, beginMongoDBDatabaseRedistributeThroughput) - } - - resp, err := server.PollerResponderNext(beginMongoDBDatabaseRedistributeThroughput, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - m.beginMongoDBDatabaseRedistributeThroughput.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginMongoDBDatabaseRedistributeThroughput) { - m.beginMongoDBDatabaseRedistributeThroughput.remove(req) - } - - return resp, nil -} - -func (m *MongoDBResourcesServerTransport) dispatchBeginMongoDBDatabaseRetrieveThroughputDistribution(req *http.Request) (*http.Response, error) { - if m.srv.BeginMongoDBDatabaseRetrieveThroughputDistribution == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginMongoDBDatabaseRetrieveThroughputDistribution not implemented")} - } - beginMongoDBDatabaseRetrieveThroughputDistribution := m.beginMongoDBDatabaseRetrieveThroughputDistribution.get(req) - if beginMongoDBDatabaseRetrieveThroughputDistribution == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/mongodbDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default/retrieveThroughputDistribution` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.RetrieveThroughputParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginMongoDBDatabaseRetrieveThroughputDistribution(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginMongoDBDatabaseRetrieveThroughputDistribution = &respr - m.beginMongoDBDatabaseRetrieveThroughputDistribution.add(req, beginMongoDBDatabaseRetrieveThroughputDistribution) - } - - resp, err := server.PollerResponderNext(beginMongoDBDatabaseRetrieveThroughputDistribution, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - m.beginMongoDBDatabaseRetrieveThroughputDistribution.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginMongoDBDatabaseRetrieveThroughputDistribution) { - m.beginMongoDBDatabaseRetrieveThroughputDistribution.remove(req) - } - - return resp, nil -} - func (m *MongoDBResourcesServerTransport) dispatchBeginRetrieveContinuousBackupInformation(req *http.Request) (*http.Response, error) { if m.srv.BeginRetrieveContinuousBackupInformation == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRetrieveContinuousBackupInformation not implemented")} diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/server_factory.go b/sdk/resourcemanager/cosmos/armcosmos/fake/server_factory.go index 81fd4d222983..b1a3bda52810 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/server_factory.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/server_factory.go @@ -26,14 +26,11 @@ type ServerFactory struct { CollectionPartitionServer CollectionPartitionServer CollectionPartitionRegionServer CollectionPartitionRegionServer CollectionRegionServer CollectionRegionServer - DataTransferJobsServer DataTransferJobsServer DatabaseAccountRegionServer DatabaseAccountRegionServer DatabaseAccountsServer DatabaseAccountsServer DatabaseServer DatabaseServer - GraphResourcesServer GraphResourcesServer GremlinResourcesServer GremlinResourcesServer LocationsServer LocationsServer - MongoClustersServer MongoClustersServer MongoDBResourcesServer MongoDBResourcesServer NotebookWorkspacesServer NotebookWorkspacesServer OperationsServer OperationsServer @@ -82,14 +79,11 @@ type ServerFactoryTransport struct { trCollectionPartitionServer *CollectionPartitionServerTransport trCollectionPartitionRegionServer *CollectionPartitionRegionServerTransport trCollectionRegionServer *CollectionRegionServerTransport - trDataTransferJobsServer *DataTransferJobsServerTransport trDatabaseAccountRegionServer *DatabaseAccountRegionServerTransport trDatabaseAccountsServer *DatabaseAccountsServerTransport trDatabaseServer *DatabaseServerTransport - trGraphResourcesServer *GraphResourcesServerTransport trGremlinResourcesServer *GremlinResourcesServerTransport trLocationsServer *LocationsServerTransport - trMongoClustersServer *MongoClustersServerTransport trMongoDBResourcesServer *MongoDBResourcesServerTransport trNotebookWorkspacesServer *NotebookWorkspacesServerTransport trOperationsServer *OperationsServerTransport @@ -163,11 +157,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewCollectionRegionServerTransport(&s.srv.CollectionRegionServer) }) resp, err = s.trCollectionRegionServer.Do(req) - case "DataTransferJobsClient": - initServer(s, &s.trDataTransferJobsServer, func() *DataTransferJobsServerTransport { - return NewDataTransferJobsServerTransport(&s.srv.DataTransferJobsServer) - }) - resp, err = s.trDataTransferJobsServer.Do(req) case "DatabaseAccountRegionClient": initServer(s, &s.trDatabaseAccountRegionServer, func() *DatabaseAccountRegionServerTransport { return NewDatabaseAccountRegionServerTransport(&s.srv.DatabaseAccountRegionServer) @@ -181,11 +170,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "DatabaseClient": initServer(s, &s.trDatabaseServer, func() *DatabaseServerTransport { return NewDatabaseServerTransport(&s.srv.DatabaseServer) }) resp, err = s.trDatabaseServer.Do(req) - case "GraphResourcesClient": - initServer(s, &s.trGraphResourcesServer, func() *GraphResourcesServerTransport { - return NewGraphResourcesServerTransport(&s.srv.GraphResourcesServer) - }) - resp, err = s.trGraphResourcesServer.Do(req) case "GremlinResourcesClient": initServer(s, &s.trGremlinResourcesServer, func() *GremlinResourcesServerTransport { return NewGremlinResourcesServerTransport(&s.srv.GremlinResourcesServer) @@ -194,11 +178,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "LocationsClient": initServer(s, &s.trLocationsServer, func() *LocationsServerTransport { return NewLocationsServerTransport(&s.srv.LocationsServer) }) resp, err = s.trLocationsServer.Do(req) - case "MongoClustersClient": - initServer(s, &s.trMongoClustersServer, func() *MongoClustersServerTransport { - return NewMongoClustersServerTransport(&s.srv.MongoClustersServer) - }) - resp, err = s.trMongoClustersServer.Do(req) case "MongoDBResourcesClient": initServer(s, &s.trMongoDBResourcesServer, func() *MongoDBResourcesServerTransport { return NewMongoDBResourcesServerTransport(&s.srv.MongoDBResourcesServer) diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/sqlresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/sqlresources_server.go index a5f9acb5b3cd..aefd6a39ef5c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/sqlresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/sqlresources_server.go @@ -127,10 +127,6 @@ type SQLResourcesServer struct { // HTTP status codes to indicate success: http.StatusOK NewListClientEncryptionKeysPager func(resourceGroupName string, accountName string, databaseName string, options *armcosmos.SQLResourcesClientListClientEncryptionKeysOptions) (resp azfake.PagerResponder[armcosmos.SQLResourcesClientListClientEncryptionKeysResponse]) - // BeginListSQLContainerPartitionMerge is the fake for method SQLResourcesClient.BeginListSQLContainerPartitionMerge - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginListSQLContainerPartitionMerge func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, mergeParameters armcosmos.MergeParameters, options *armcosmos.SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (resp azfake.PollerResponder[armcosmos.SQLResourcesClientListSQLContainerPartitionMergeResponse], errResp azfake.ErrorResponder) - // NewListSQLContainersPager is the fake for method SQLResourcesClient.NewListSQLContainersPager // HTTP status codes to indicate success: http.StatusOK NewListSQLContainersPager func(resourceGroupName string, accountName string, databaseName string, options *armcosmos.SQLResourcesClientListSQLContainersOptions) (resp azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLContainersResponse]) @@ -179,26 +175,6 @@ type SQLResourcesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginRetrieveContinuousBackupInformation func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, location armcosmos.ContinuousBackupRestoreLocation, options *armcosmos.SQLResourcesClientBeginRetrieveContinuousBackupInformationOptions) (resp azfake.PollerResponder[armcosmos.SQLResourcesClientRetrieveContinuousBackupInformationResponse], errResp azfake.ErrorResponder) - // BeginSQLContainerRedistributeThroughput is the fake for method SQLResourcesClient.BeginSQLContainerRedistributeThroughput - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginSQLContainerRedistributeThroughput func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, redistributeThroughputParameters armcosmos.RedistributeThroughputParameters, options *armcosmos.SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (resp azfake.PollerResponder[armcosmos.SQLResourcesClientSQLContainerRedistributeThroughputResponse], errResp azfake.ErrorResponder) - - // BeginSQLContainerRetrieveThroughputDistribution is the fake for method SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginSQLContainerRetrieveThroughputDistribution func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, retrieveThroughputParameters armcosmos.RetrieveThroughputParameters, options *armcosmos.SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (resp azfake.PollerResponder[armcosmos.SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse], errResp azfake.ErrorResponder) - - // BeginSQLDatabasePartitionMerge is the fake for method SQLResourcesClient.BeginSQLDatabasePartitionMerge - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginSQLDatabasePartitionMerge func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, mergeParameters armcosmos.MergeParameters, options *armcosmos.SQLResourcesClientBeginSQLDatabasePartitionMergeOptions) (resp azfake.PollerResponder[armcosmos.SQLResourcesClientSQLDatabasePartitionMergeResponse], errResp azfake.ErrorResponder) - - // BeginSQLDatabaseRedistributeThroughput is the fake for method SQLResourcesClient.BeginSQLDatabaseRedistributeThroughput - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginSQLDatabaseRedistributeThroughput func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, redistributeThroughputParameters armcosmos.RedistributeThroughputParameters, options *armcosmos.SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions) (resp azfake.PollerResponder[armcosmos.SQLResourcesClientSQLDatabaseRedistributeThroughputResponse], errResp azfake.ErrorResponder) - - // BeginSQLDatabaseRetrieveThroughputDistribution is the fake for method SQLResourcesClient.BeginSQLDatabaseRetrieveThroughputDistribution - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginSQLDatabaseRetrieveThroughputDistribution func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, retrieveThroughputParameters armcosmos.RetrieveThroughputParameters, options *armcosmos.SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions) (resp azfake.PollerResponder[armcosmos.SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse], errResp azfake.ErrorResponder) - // BeginUpdateSQLContainerThroughput is the fake for method SQLResourcesClient.BeginUpdateSQLContainerThroughput // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginUpdateSQLContainerThroughput func(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters armcosmos.ThroughputSettingsUpdateParameters, options *armcosmos.SQLResourcesClientBeginUpdateSQLContainerThroughputOptions) (resp azfake.PollerResponder[armcosmos.SQLResourcesClientUpdateSQLContainerThroughputResponse], errResp azfake.ErrorResponder) @@ -213,86 +189,74 @@ type SQLResourcesServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewSQLResourcesServerTransport(srv *SQLResourcesServer) *SQLResourcesServerTransport { return &SQLResourcesServerTransport{ - srv: srv, - beginCreateUpdateClientEncryptionKey: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateClientEncryptionKeyResponse]](), - beginCreateUpdateSQLContainer: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLContainerResponse]](), - beginCreateUpdateSQLDatabase: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLDatabaseResponse]](), - beginCreateUpdateSQLRoleAssignment: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLRoleAssignmentResponse]](), - beginCreateUpdateSQLRoleDefinition: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLRoleDefinitionResponse]](), - beginCreateUpdateSQLStoredProcedure: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLStoredProcedureResponse]](), - beginCreateUpdateSQLTrigger: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLTriggerResponse]](), - beginCreateUpdateSQLUserDefinedFunction: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLUserDefinedFunctionResponse]](), - beginDeleteSQLContainer: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLContainerResponse]](), - beginDeleteSQLDatabase: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLDatabaseResponse]](), - beginDeleteSQLRoleAssignment: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLRoleAssignmentResponse]](), - beginDeleteSQLRoleDefinition: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLRoleDefinitionResponse]](), - beginDeleteSQLStoredProcedure: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLStoredProcedureResponse]](), - beginDeleteSQLTrigger: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLTriggerResponse]](), - beginDeleteSQLUserDefinedFunction: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLUserDefinedFunctionResponse]](), - newListClientEncryptionKeysPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListClientEncryptionKeysResponse]](), - beginListSQLContainerPartitionMerge: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientListSQLContainerPartitionMergeResponse]](), - newListSQLContainersPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLContainersResponse]](), - newListSQLDatabasesPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLDatabasesResponse]](), - newListSQLRoleAssignmentsPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLRoleAssignmentsResponse]](), - newListSQLRoleDefinitionsPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLRoleDefinitionsResponse]](), - newListSQLStoredProceduresPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLStoredProceduresResponse]](), - newListSQLTriggersPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLTriggersResponse]](), - newListSQLUserDefinedFunctionsPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLUserDefinedFunctionsResponse]](), - beginMigrateSQLContainerToAutoscale: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLContainerToAutoscaleResponse]](), - beginMigrateSQLContainerToManualThroughput: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLContainerToManualThroughputResponse]](), - beginMigrateSQLDatabaseToAutoscale: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLDatabaseToAutoscaleResponse]](), - beginMigrateSQLDatabaseToManualThroughput: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLDatabaseToManualThroughputResponse]](), - beginRetrieveContinuousBackupInformation: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientRetrieveContinuousBackupInformationResponse]](), - beginSQLContainerRedistributeThroughput: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientSQLContainerRedistributeThroughputResponse]](), - beginSQLContainerRetrieveThroughputDistribution: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse]](), - beginSQLDatabasePartitionMerge: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientSQLDatabasePartitionMergeResponse]](), - beginSQLDatabaseRedistributeThroughput: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientSQLDatabaseRedistributeThroughputResponse]](), - beginSQLDatabaseRetrieveThroughputDistribution: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse]](), - beginUpdateSQLContainerThroughput: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientUpdateSQLContainerThroughputResponse]](), - beginUpdateSQLDatabaseThroughput: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientUpdateSQLDatabaseThroughputResponse]](), + srv: srv, + beginCreateUpdateClientEncryptionKey: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateClientEncryptionKeyResponse]](), + beginCreateUpdateSQLContainer: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLContainerResponse]](), + beginCreateUpdateSQLDatabase: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLDatabaseResponse]](), + beginCreateUpdateSQLRoleAssignment: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLRoleAssignmentResponse]](), + beginCreateUpdateSQLRoleDefinition: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLRoleDefinitionResponse]](), + beginCreateUpdateSQLStoredProcedure: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLStoredProcedureResponse]](), + beginCreateUpdateSQLTrigger: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLTriggerResponse]](), + beginCreateUpdateSQLUserDefinedFunction: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLUserDefinedFunctionResponse]](), + beginDeleteSQLContainer: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLContainerResponse]](), + beginDeleteSQLDatabase: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLDatabaseResponse]](), + beginDeleteSQLRoleAssignment: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLRoleAssignmentResponse]](), + beginDeleteSQLRoleDefinition: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLRoleDefinitionResponse]](), + beginDeleteSQLStoredProcedure: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLStoredProcedureResponse]](), + beginDeleteSQLTrigger: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLTriggerResponse]](), + beginDeleteSQLUserDefinedFunction: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLUserDefinedFunctionResponse]](), + newListClientEncryptionKeysPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListClientEncryptionKeysResponse]](), + newListSQLContainersPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLContainersResponse]](), + newListSQLDatabasesPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLDatabasesResponse]](), + newListSQLRoleAssignmentsPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLRoleAssignmentsResponse]](), + newListSQLRoleDefinitionsPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLRoleDefinitionsResponse]](), + newListSQLStoredProceduresPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLStoredProceduresResponse]](), + newListSQLTriggersPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLTriggersResponse]](), + newListSQLUserDefinedFunctionsPager: newTracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLUserDefinedFunctionsResponse]](), + beginMigrateSQLContainerToAutoscale: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLContainerToAutoscaleResponse]](), + beginMigrateSQLContainerToManualThroughput: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLContainerToManualThroughputResponse]](), + beginMigrateSQLDatabaseToAutoscale: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLDatabaseToAutoscaleResponse]](), + beginMigrateSQLDatabaseToManualThroughput: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLDatabaseToManualThroughputResponse]](), + beginRetrieveContinuousBackupInformation: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientRetrieveContinuousBackupInformationResponse]](), + beginUpdateSQLContainerThroughput: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientUpdateSQLContainerThroughputResponse]](), + beginUpdateSQLDatabaseThroughput: newTracker[azfake.PollerResponder[armcosmos.SQLResourcesClientUpdateSQLDatabaseThroughputResponse]](), } } // SQLResourcesServerTransport connects instances of armcosmos.SQLResourcesClient to instances of SQLResourcesServer. // Don't use this type directly, use NewSQLResourcesServerTransport instead. type SQLResourcesServerTransport struct { - srv *SQLResourcesServer - beginCreateUpdateClientEncryptionKey *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateClientEncryptionKeyResponse]] - beginCreateUpdateSQLContainer *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLContainerResponse]] - beginCreateUpdateSQLDatabase *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLDatabaseResponse]] - beginCreateUpdateSQLRoleAssignment *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLRoleAssignmentResponse]] - beginCreateUpdateSQLRoleDefinition *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLRoleDefinitionResponse]] - beginCreateUpdateSQLStoredProcedure *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLStoredProcedureResponse]] - beginCreateUpdateSQLTrigger *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLTriggerResponse]] - beginCreateUpdateSQLUserDefinedFunction *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLUserDefinedFunctionResponse]] - beginDeleteSQLContainer *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLContainerResponse]] - beginDeleteSQLDatabase *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLDatabaseResponse]] - beginDeleteSQLRoleAssignment *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLRoleAssignmentResponse]] - beginDeleteSQLRoleDefinition *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLRoleDefinitionResponse]] - beginDeleteSQLStoredProcedure *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLStoredProcedureResponse]] - beginDeleteSQLTrigger *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLTriggerResponse]] - beginDeleteSQLUserDefinedFunction *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLUserDefinedFunctionResponse]] - newListClientEncryptionKeysPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListClientEncryptionKeysResponse]] - beginListSQLContainerPartitionMerge *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientListSQLContainerPartitionMergeResponse]] - newListSQLContainersPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLContainersResponse]] - newListSQLDatabasesPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLDatabasesResponse]] - newListSQLRoleAssignmentsPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLRoleAssignmentsResponse]] - newListSQLRoleDefinitionsPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLRoleDefinitionsResponse]] - newListSQLStoredProceduresPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLStoredProceduresResponse]] - newListSQLTriggersPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLTriggersResponse]] - newListSQLUserDefinedFunctionsPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLUserDefinedFunctionsResponse]] - beginMigrateSQLContainerToAutoscale *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLContainerToAutoscaleResponse]] - beginMigrateSQLContainerToManualThroughput *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLContainerToManualThroughputResponse]] - beginMigrateSQLDatabaseToAutoscale *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLDatabaseToAutoscaleResponse]] - beginMigrateSQLDatabaseToManualThroughput *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLDatabaseToManualThroughputResponse]] - beginRetrieveContinuousBackupInformation *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientRetrieveContinuousBackupInformationResponse]] - beginSQLContainerRedistributeThroughput *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientSQLContainerRedistributeThroughputResponse]] - beginSQLContainerRetrieveThroughputDistribution *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse]] - beginSQLDatabasePartitionMerge *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientSQLDatabasePartitionMergeResponse]] - beginSQLDatabaseRedistributeThroughput *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientSQLDatabaseRedistributeThroughputResponse]] - beginSQLDatabaseRetrieveThroughputDistribution *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse]] - beginUpdateSQLContainerThroughput *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientUpdateSQLContainerThroughputResponse]] - beginUpdateSQLDatabaseThroughput *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientUpdateSQLDatabaseThroughputResponse]] + srv *SQLResourcesServer + beginCreateUpdateClientEncryptionKey *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateClientEncryptionKeyResponse]] + beginCreateUpdateSQLContainer *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLContainerResponse]] + beginCreateUpdateSQLDatabase *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLDatabaseResponse]] + beginCreateUpdateSQLRoleAssignment *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLRoleAssignmentResponse]] + beginCreateUpdateSQLRoleDefinition *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLRoleDefinitionResponse]] + beginCreateUpdateSQLStoredProcedure *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLStoredProcedureResponse]] + beginCreateUpdateSQLTrigger *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLTriggerResponse]] + beginCreateUpdateSQLUserDefinedFunction *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientCreateUpdateSQLUserDefinedFunctionResponse]] + beginDeleteSQLContainer *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLContainerResponse]] + beginDeleteSQLDatabase *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLDatabaseResponse]] + beginDeleteSQLRoleAssignment *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLRoleAssignmentResponse]] + beginDeleteSQLRoleDefinition *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLRoleDefinitionResponse]] + beginDeleteSQLStoredProcedure *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLStoredProcedureResponse]] + beginDeleteSQLTrigger *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLTriggerResponse]] + beginDeleteSQLUserDefinedFunction *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientDeleteSQLUserDefinedFunctionResponse]] + newListClientEncryptionKeysPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListClientEncryptionKeysResponse]] + newListSQLContainersPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLContainersResponse]] + newListSQLDatabasesPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLDatabasesResponse]] + newListSQLRoleAssignmentsPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLRoleAssignmentsResponse]] + newListSQLRoleDefinitionsPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLRoleDefinitionsResponse]] + newListSQLStoredProceduresPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLStoredProceduresResponse]] + newListSQLTriggersPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLTriggersResponse]] + newListSQLUserDefinedFunctionsPager *tracker[azfake.PagerResponder[armcosmos.SQLResourcesClientListSQLUserDefinedFunctionsResponse]] + beginMigrateSQLContainerToAutoscale *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLContainerToAutoscaleResponse]] + beginMigrateSQLContainerToManualThroughput *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLContainerToManualThroughputResponse]] + beginMigrateSQLDatabaseToAutoscale *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLDatabaseToAutoscaleResponse]] + beginMigrateSQLDatabaseToManualThroughput *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientMigrateSQLDatabaseToManualThroughputResponse]] + beginRetrieveContinuousBackupInformation *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientRetrieveContinuousBackupInformationResponse]] + beginUpdateSQLContainerThroughput *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientUpdateSQLContainerThroughputResponse]] + beginUpdateSQLDatabaseThroughput *tracker[azfake.PollerResponder[armcosmos.SQLResourcesClientUpdateSQLDatabaseThroughputResponse]] } // Do implements the policy.Transporter interface for SQLResourcesServerTransport. @@ -359,8 +323,6 @@ func (s *SQLResourcesServerTransport) Do(req *http.Request) (*http.Response, err resp, err = s.dispatchGetSQLUserDefinedFunction(req) case "SQLResourcesClient.NewListClientEncryptionKeysPager": resp, err = s.dispatchNewListClientEncryptionKeysPager(req) - case "SQLResourcesClient.BeginListSQLContainerPartitionMerge": - resp, err = s.dispatchBeginListSQLContainerPartitionMerge(req) case "SQLResourcesClient.NewListSQLContainersPager": resp, err = s.dispatchNewListSQLContainersPager(req) case "SQLResourcesClient.NewListSQLDatabasesPager": @@ -385,16 +347,6 @@ func (s *SQLResourcesServerTransport) Do(req *http.Request) (*http.Response, err resp, err = s.dispatchBeginMigrateSQLDatabaseToManualThroughput(req) case "SQLResourcesClient.BeginRetrieveContinuousBackupInformation": resp, err = s.dispatchBeginRetrieveContinuousBackupInformation(req) - case "SQLResourcesClient.BeginSQLContainerRedistributeThroughput": - resp, err = s.dispatchBeginSQLContainerRedistributeThroughput(req) - case "SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution": - resp, err = s.dispatchBeginSQLContainerRetrieveThroughputDistribution(req) - case "SQLResourcesClient.BeginSQLDatabasePartitionMerge": - resp, err = s.dispatchBeginSQLDatabasePartitionMerge(req) - case "SQLResourcesClient.BeginSQLDatabaseRedistributeThroughput": - resp, err = s.dispatchBeginSQLDatabaseRedistributeThroughput(req) - case "SQLResourcesClient.BeginSQLDatabaseRetrieveThroughputDistribution": - resp, err = s.dispatchBeginSQLDatabaseRetrieveThroughputDistribution(req) case "SQLResourcesClient.BeginUpdateSQLContainerThroughput": resp, err = s.dispatchBeginUpdateSQLContainerThroughput(req) case "SQLResourcesClient.BeginUpdateSQLDatabaseThroughput": @@ -1670,62 +1622,6 @@ func (s *SQLResourcesServerTransport) dispatchNewListClientEncryptionKeysPager(r return resp, nil } -func (s *SQLResourcesServerTransport) dispatchBeginListSQLContainerPartitionMerge(req *http.Request) (*http.Response, error) { - if s.srv.BeginListSQLContainerPartitionMerge == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginListSQLContainerPartitionMerge not implemented")} - } - beginListSQLContainerPartitionMerge := s.beginListSQLContainerPartitionMerge.get(req) - if beginListSQLContainerPartitionMerge == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sqlDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/containers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/partitionMerge` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.MergeParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - containerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginListSQLContainerPartitionMerge(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, containerNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginListSQLContainerPartitionMerge = &respr - s.beginListSQLContainerPartitionMerge.add(req, beginListSQLContainerPartitionMerge) - } - - resp, err := server.PollerResponderNext(beginListSQLContainerPartitionMerge, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - s.beginListSQLContainerPartitionMerge.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginListSQLContainerPartitionMerge) { - s.beginListSQLContainerPartitionMerge.remove(req) - } - - return resp, nil -} - func (s *SQLResourcesServerTransport) dispatchNewListSQLContainersPager(req *http.Request) (*http.Response, error) { if s.srv.NewListSQLContainersPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListSQLContainersPager not implemented")} @@ -2276,274 +2172,6 @@ func (s *SQLResourcesServerTransport) dispatchBeginRetrieveContinuousBackupInfor return resp, nil } -func (s *SQLResourcesServerTransport) dispatchBeginSQLContainerRedistributeThroughput(req *http.Request) (*http.Response, error) { - if s.srv.BeginSQLContainerRedistributeThroughput == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginSQLContainerRedistributeThroughput not implemented")} - } - beginSQLContainerRedistributeThroughput := s.beginSQLContainerRedistributeThroughput.get(req) - if beginSQLContainerRedistributeThroughput == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sqlDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/containers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default/redistributeThroughput` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.RedistributeThroughputParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - containerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginSQLContainerRedistributeThroughput(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, containerNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginSQLContainerRedistributeThroughput = &respr - s.beginSQLContainerRedistributeThroughput.add(req, beginSQLContainerRedistributeThroughput) - } - - resp, err := server.PollerResponderNext(beginSQLContainerRedistributeThroughput, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - s.beginSQLContainerRedistributeThroughput.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginSQLContainerRedistributeThroughput) { - s.beginSQLContainerRedistributeThroughput.remove(req) - } - - return resp, nil -} - -func (s *SQLResourcesServerTransport) dispatchBeginSQLContainerRetrieveThroughputDistribution(req *http.Request) (*http.Response, error) { - if s.srv.BeginSQLContainerRetrieveThroughputDistribution == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginSQLContainerRetrieveThroughputDistribution not implemented")} - } - beginSQLContainerRetrieveThroughputDistribution := s.beginSQLContainerRetrieveThroughputDistribution.get(req) - if beginSQLContainerRetrieveThroughputDistribution == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sqlDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/containers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default/retrieveThroughputDistribution` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.RetrieveThroughputParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - containerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginSQLContainerRetrieveThroughputDistribution(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, containerNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginSQLContainerRetrieveThroughputDistribution = &respr - s.beginSQLContainerRetrieveThroughputDistribution.add(req, beginSQLContainerRetrieveThroughputDistribution) - } - - resp, err := server.PollerResponderNext(beginSQLContainerRetrieveThroughputDistribution, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - s.beginSQLContainerRetrieveThroughputDistribution.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginSQLContainerRetrieveThroughputDistribution) { - s.beginSQLContainerRetrieveThroughputDistribution.remove(req) - } - - return resp, nil -} - -func (s *SQLResourcesServerTransport) dispatchBeginSQLDatabasePartitionMerge(req *http.Request) (*http.Response, error) { - if s.srv.BeginSQLDatabasePartitionMerge == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginSQLDatabasePartitionMerge not implemented")} - } - beginSQLDatabasePartitionMerge := s.beginSQLDatabasePartitionMerge.get(req) - if beginSQLDatabasePartitionMerge == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sqlDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/partitionMerge` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.MergeParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginSQLDatabasePartitionMerge(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginSQLDatabasePartitionMerge = &respr - s.beginSQLDatabasePartitionMerge.add(req, beginSQLDatabasePartitionMerge) - } - - resp, err := server.PollerResponderNext(beginSQLDatabasePartitionMerge, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - s.beginSQLDatabasePartitionMerge.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginSQLDatabasePartitionMerge) { - s.beginSQLDatabasePartitionMerge.remove(req) - } - - return resp, nil -} - -func (s *SQLResourcesServerTransport) dispatchBeginSQLDatabaseRedistributeThroughput(req *http.Request) (*http.Response, error) { - if s.srv.BeginSQLDatabaseRedistributeThroughput == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginSQLDatabaseRedistributeThroughput not implemented")} - } - beginSQLDatabaseRedistributeThroughput := s.beginSQLDatabaseRedistributeThroughput.get(req) - if beginSQLDatabaseRedistributeThroughput == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sqlDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default/redistributeThroughput` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.RedistributeThroughputParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginSQLDatabaseRedistributeThroughput(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginSQLDatabaseRedistributeThroughput = &respr - s.beginSQLDatabaseRedistributeThroughput.add(req, beginSQLDatabaseRedistributeThroughput) - } - - resp, err := server.PollerResponderNext(beginSQLDatabaseRedistributeThroughput, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - s.beginSQLDatabaseRedistributeThroughput.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginSQLDatabaseRedistributeThroughput) { - s.beginSQLDatabaseRedistributeThroughput.remove(req) - } - - return resp, nil -} - -func (s *SQLResourcesServerTransport) dispatchBeginSQLDatabaseRetrieveThroughputDistribution(req *http.Request) (*http.Response, error) { - if s.srv.BeginSQLDatabaseRetrieveThroughputDistribution == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginSQLDatabaseRetrieveThroughputDistribution not implemented")} - } - beginSQLDatabaseRetrieveThroughputDistribution := s.beginSQLDatabaseRetrieveThroughputDistribution.get(req) - if beginSQLDatabaseRetrieveThroughputDistribution == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DocumentDB/databaseAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sqlDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/throughputSettings/default/retrieveThroughputDistribution` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcosmos.RetrieveThroughputParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginSQLDatabaseRetrieveThroughputDistribution(req.Context(), resourceGroupNameParam, accountNameParam, databaseNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginSQLDatabaseRetrieveThroughputDistribution = &respr - s.beginSQLDatabaseRetrieveThroughputDistribution.add(req, beginSQLDatabaseRetrieveThroughputDistribution) - } - - resp, err := server.PollerResponderNext(beginSQLDatabaseRetrieveThroughputDistribution, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - s.beginSQLDatabaseRetrieveThroughputDistribution.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginSQLDatabaseRetrieveThroughputDistribution) { - s.beginSQLDatabaseRetrieveThroughputDistribution.remove(req) - } - - return resp, nil -} - func (s *SQLResourcesServerTransport) dispatchBeginUpdateSQLContainerThroughput(req *http.Request) (*http.Response, error) { if s.srv.BeginUpdateSQLContainerThroughput == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdateSQLContainerThroughput not implemented")} diff --git a/sdk/resourcemanager/cosmos/armcosmos/go.mod b/sdk/resourcemanager/cosmos/armcosmos/go.mod index c11bc3792e0a..2c90d4f29bf4 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/go.mod +++ b/sdk/resourcemanager/cosmos/armcosmos/go.mod @@ -1,4 +1,4 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2 go 1.18 @@ -6,6 +6,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3 v3.0.0-beta.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 github.com/stretchr/testify v1.8.4 diff --git a/sdk/resourcemanager/cosmos/armcosmos/go.sum b/sdk/resourcemanager/cosmos/armcosmos/go.sum index 88bb72abf2ba..d817759222f4 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/go.sum +++ b/sdk/resourcemanager/cosmos/armcosmos/go.sum @@ -4,6 +4,8 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZM github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 h1:d81/ng9rET2YqdVkVwkb6EXeRrLJIwyGnJcAlAWKwhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3 v3.0.0-beta.2 h1:ANwoUvNPWo/MWJcG95cOCQPEbKrdkDNxzUHe45PuNvo= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3 v3.0.0-beta.2/go.mod h1:xwERKmt+vSVHIhVI1RzLI6QAQwdFEEJfu89ZUHXWcKA= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= diff --git a/sdk/resourcemanager/cosmos/armcosmos/graphresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/graphresources_client.go deleted file mode 100644 index b74afdd7c213..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/graphresources_client.go +++ /dev/null @@ -1,344 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "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 { - internal *arm.Client - subscriptionID string -} - -// 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) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GraphResourcesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - 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 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GraphResourcesClientCreateUpdateGraphResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GraphResourcesClientCreateUpdateGraphResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateUpdateGraph - Create or update an Azure Cosmos DB Graph. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *GraphResourcesClient) createUpdateGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters GraphResourceCreateUpdateParameters, options *GraphResourcesClientBeginCreateUpdateGraphOptions) (*http.Response, error) { - var err error - const operationName = "GraphResourcesClient.BeginCreateUpdateGraph" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createUpdateGraphCreateRequest(ctx, resourceGroupName, accountName, graphName, createUpdateGraphParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, createUpdateGraphParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDeleteGraphResource - Deletes an existing Azure Cosmos DB Graph Resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GraphResourcesClientDeleteGraphResourceResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GraphResourcesClientDeleteGraphResourceResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// DeleteGraphResource - Deletes an existing Azure Cosmos DB Graph Resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *GraphResourcesClient) deleteGraphResource(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientBeginDeleteGraphResourceOptions) (*http.Response, error) { - var err error - const operationName = "GraphResourcesClient.BeginDeleteGraphResource" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteGraphResourceCreateRequest(ctx, resourceGroupName, accountName, graphName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 2023-03-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) { - var err error - const operationName = "GraphResourcesClient.GetGraph" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getGraphCreateRequest(ctx, resourceGroupName, accountName, graphName, options) - if err != nil { - return GraphResourcesClientGetGraphResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GraphResourcesClientGetGraphResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GraphResourcesClientGetGraphResponse{}, err - } - resp, err := client.getGraphHandleResponse(httpResp) - return resp, err -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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. -// -// Generated from API version 2023-03-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.NewListGraphsPager -// 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) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GraphResourcesClient.NewListGraphsPager") - req, err := client.listGraphsCreateRequest(ctx, resourceGroupName, accountName, options) - if err != nil { - return GraphResourcesClientListGraphsResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GraphResourcesClientListGraphsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GraphResourcesClientListGraphsResponse{}, runtime.NewResponseError(resp) - } - return client.listGraphsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 33749ce58720..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/graphresources_client_example_test.go +++ /dev/null @@ -1,160 +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_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/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGraphResourcesClient().NewListGraphsPager("rgName", "ddb1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GraphResourcesListResult = armcosmos.GraphResourcesListResult{ - // Value: []*armcosmos.GraphResourceGetResults{ - // { - // Name: to.Ptr("graphName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/graphs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/graphs/graphName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.GraphResourceGetProperties{ - // Resource: &armcosmos.GraphResourceGetPropertiesResource{ - // ID: to.Ptr("graphName"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGraphResourcesClient().GetGraph(ctx, "rg1", "ddb1", "graphName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GraphResourceGetResults = armcosmos.GraphResourceGetResults{ - // Name: to.Ptr("graphName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/graphs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/graphs/graphName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.GraphResourceGetProperties{ - // Resource: &armcosmos.GraphResourceGetPropertiesResource{ - // ID: to.Ptr("graphName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGraphResourcesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GraphResourceGetResults = armcosmos.GraphResourceGetResults{ - // Name: to.Ptr("graphName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/graphs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/graphs/graphName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.GraphResourceGetProperties{ - // Resource: &armcosmos.GraphResourceGetPropertiesResource{ - // ID: to.Ptr("graphName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGraphResourcesClient().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 b17a56553ee4..188a74b9d439 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client.go @@ -46,7 +46,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -73,7 +73,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *GremlinResourcesClient) createUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters, options *GremlinResourcesClientBeginCreateUpdateGremlinDatabaseOptions) (*http.Response, error) { var err error const operationName = "GremlinResourcesClient.BeginCreateUpdateGremlinDatabase" @@ -119,7 +119,7 @@ func (client *GremlinResourcesClient) createUpdateGremlinDatabaseCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateGremlinDatabaseParameters); err != nil { @@ -131,7 +131,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -159,7 +159,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *GremlinResourcesClient) createUpdateGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters, options *GremlinResourcesClientBeginCreateUpdateGremlinGraphOptions) (*http.Response, error) { var err error const operationName = "GremlinResourcesClient.BeginCreateUpdateGremlinGraph" @@ -209,7 +209,7 @@ func (client *GremlinResourcesClient) createUpdateGremlinGraphCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateGremlinGraphParameters); err != nil { @@ -221,7 +221,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -247,7 +247,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *GremlinResourcesClient) deleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientBeginDeleteGremlinDatabaseOptions) (*http.Response, error) { var err error const operationName = "GremlinResourcesClient.BeginDeleteGremlinDatabase" @@ -293,7 +293,7 @@ func (client *GremlinResourcesClient) deleteGremlinDatabaseCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -301,7 +301,7 @@ func (client *GremlinResourcesClient) deleteGremlinDatabaseCreateRequest(ctx con // BeginDeleteGremlinGraph - Deletes an existing Azure Cosmos DB Gremlin graph. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -328,7 +328,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *GremlinResourcesClient) deleteGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginDeleteGremlinGraphOptions) (*http.Response, error) { var err error const operationName = "GremlinResourcesClient.BeginDeleteGremlinGraph" @@ -378,7 +378,7 @@ func (client *GremlinResourcesClient) deleteGremlinGraphCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -386,7 +386,7 @@ func (client *GremlinResourcesClient) deleteGremlinGraphCreateRequest(ctx contex // 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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -438,7 +438,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -457,7 +457,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseHandleResponse(resp *htt // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -509,7 +509,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -527,7 +527,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -584,7 +584,7 @@ func (client *GremlinResourcesClient) getGremlinGraphCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -603,7 +603,7 @@ func (client *GremlinResourcesClient) getGremlinGraphHandleResponse(resp *http.R // provided name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -660,7 +660,7 @@ func (client *GremlinResourcesClient) getGremlinGraphThroughputCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -677,7 +677,7 @@ func (client *GremlinResourcesClient) getGremlinGraphThroughputHandleResponse(re // NewListGremlinDatabasesPager - Lists the Gremlin databases under an existing Azure Cosmos DB database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListGremlinDatabasesPager @@ -726,7 +726,7 @@ func (client *GremlinResourcesClient) listGremlinDatabasesCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -743,7 +743,7 @@ func (client *GremlinResourcesClient) listGremlinDatabasesHandleResponse(resp *h // NewListGremlinGraphsPager - Lists the Gremlin graph under an existing Azure Cosmos DB database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -797,7 +797,7 @@ func (client *GremlinResourcesClient) listGremlinGraphsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -815,7 +815,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -841,7 +841,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *GremlinResourcesClient) migrateGremlinDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientBeginMigrateGremlinDatabaseToAutoscaleOptions) (*http.Response, error) { var err error const operationName = "GremlinResourcesClient.BeginMigrateGremlinDatabaseToAutoscale" @@ -887,7 +887,7 @@ func (client *GremlinResourcesClient) migrateGremlinDatabaseToAutoscaleCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -896,7 +896,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -922,7 +922,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *GremlinResourcesClient) migrateGremlinDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientBeginMigrateGremlinDatabaseToManualThroughputOptions) (*http.Response, error) { var err error const operationName = "GremlinResourcesClient.BeginMigrateGremlinDatabaseToManualThroughput" @@ -968,7 +968,7 @@ func (client *GremlinResourcesClient) migrateGremlinDatabaseToManualThroughputCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -977,7 +977,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1004,7 +1004,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *GremlinResourcesClient) migrateGremlinGraphToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginMigrateGremlinGraphToAutoscaleOptions) (*http.Response, error) { var err error const operationName = "GremlinResourcesClient.BeginMigrateGremlinGraphToAutoscale" @@ -1054,7 +1054,7 @@ func (client *GremlinResourcesClient) migrateGremlinGraphToAutoscaleCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1063,7 +1063,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1090,7 +1090,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *GremlinResourcesClient) migrateGremlinGraphToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginMigrateGremlinGraphToManualThroughputOptions) (*http.Response, error) { var err error const operationName = "GremlinResourcesClient.BeginMigrateGremlinGraphToManualThroughput" @@ -1140,7 +1140,7 @@ func (client *GremlinResourcesClient) migrateGremlinGraphToManualThroughputCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1149,7 +1149,7 @@ func (client *GremlinResourcesClient) migrateGremlinGraphToManualThroughputCreat // BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a gremlin graph. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1178,7 +1178,7 @@ func (client *GremlinResourcesClient) BeginRetrieveContinuousBackupInformation(c // RetrieveContinuousBackupInformation - Retrieves continuous backup information for a gremlin graph. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *GremlinResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, location ContinuousBackupRestoreLocation, options *GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { var err error const operationName = "GremlinResourcesClient.BeginRetrieveContinuousBackupInformation" @@ -1228,7 +1228,7 @@ func (client *GremlinResourcesClient) retrieveContinuousBackupInformationCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, location); err != nil { @@ -1240,7 +1240,7 @@ func (client *GremlinResourcesClient) retrieveContinuousBackupInformationCreateR // 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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1267,7 +1267,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *GremlinResourcesClient) updateGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions) (*http.Response, error) { var err error const operationName = "GremlinResourcesClient.BeginUpdateGremlinDatabaseThroughput" @@ -1313,7 +1313,7 @@ func (client *GremlinResourcesClient) updateGremlinDatabaseThroughputCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { @@ -1325,7 +1325,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1353,7 +1353,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *GremlinResourcesClient) updateGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *GremlinResourcesClientBeginUpdateGremlinGraphThroughputOptions) (*http.Response, error) { var err error const operationName = "GremlinResourcesClient.BeginUpdateGremlinGraphThroughput" @@ -1403,7 +1403,7 @@ func (client *GremlinResourcesClient) updateGremlinGraphThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client_example_test.go index f17f4a23cb50..9a004c56ab6d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinDatabaseList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinDatabaseList.json func ExampleGremlinResourcesClient_NewListGremlinDatabasesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,7 +62,7 @@ func ExampleGremlinResourcesClient_NewListGremlinDatabasesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinDatabaseGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinDatabaseGet.json func ExampleGremlinResourcesClient_GetGremlinDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExampleGremlinResourcesClient_GetGremlinDatabase() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -147,7 +147,7 @@ func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinDatabase() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinDatabaseDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinDatabaseDelete.json func ExampleGremlinResourcesClient_BeginDeleteGremlinDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -168,7 +168,7 @@ func ExampleGremlinResourcesClient_BeginDeleteGremlinDatabase() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinDatabaseThroughputGet.json func ExampleGremlinResourcesClient_GetGremlinDatabaseThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -198,15 +198,17 @@ func ExampleGremlinResourcesClient_GetGremlinDatabaseThroughput() { // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), // Rid: to.Ptr("PD5DALigDgw="), // Ts: to.Ptr[float32](1459200611), + // InstantMaximumThroughput: to.Ptr("10000"), // MinimumThroughput: to.Ptr("400"), // OfferReplacePending: to.Ptr("true"), + // SoftAllowedMaximumThroughput: to.Ptr("1000000"), // Throughput: to.Ptr[int32](400), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json func ExampleGremlinResourcesClient_BeginUpdateGremlinDatabaseThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -256,7 +258,7 @@ func ExampleGremlinResourcesClient_BeginUpdateGremlinDatabaseThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -295,7 +297,7 @@ func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToAutoscale() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -331,7 +333,7 @@ func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToManualThroughput // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinGraphList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinGraphList.json func ExampleGremlinResourcesClient_NewListGremlinGraphsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -410,7 +412,7 @@ func ExampleGremlinResourcesClient_NewListGremlinGraphsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinGraphGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinGraphGet.json func ExampleGremlinResourcesClient_GetGremlinGraph() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -481,7 +483,7 @@ func ExampleGremlinResourcesClient_GetGremlinGraph() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinGraphCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinGraphCreateUpdate.json func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinGraph() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -605,7 +607,7 @@ func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinGraph() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinGraphDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinGraphDelete.json func ExampleGremlinResourcesClient_BeginDeleteGremlinGraph() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -626,7 +628,7 @@ func ExampleGremlinResourcesClient_BeginDeleteGremlinGraph() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinGraphThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinGraphThroughputGet.json func ExampleGremlinResourcesClient_GetGremlinGraphThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -656,15 +658,17 @@ func ExampleGremlinResourcesClient_GetGremlinGraphThroughput() { // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), // Rid: to.Ptr("PD5DALigDgw="), // Ts: to.Ptr[float32](1459200611), + // InstantMaximumThroughput: to.Ptr("10000"), // MinimumThroughput: to.Ptr("400"), // OfferReplacePending: to.Ptr("true"), + // SoftAllowedMaximumThroughput: to.Ptr("1000000"), // Throughput: to.Ptr[int32](400), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinGraphThroughputUpdate.json func ExampleGremlinResourcesClient_BeginUpdateGremlinGraphThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -714,7 +718,7 @@ func ExampleGremlinResourcesClient_BeginUpdateGremlinGraphThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -753,7 +757,7 @@ func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToAutoscale() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -789,7 +793,7 @@ func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToManualThroughput() // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGremlinGraphBackupInformation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGremlinGraphBackupInformation.json func ExampleGremlinResourcesClient_BeginRetrieveContinuousBackupInformation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/interfaces.go b/sdk/resourcemanager/cosmos/armcosmos/interfaces.go index 2754b4b31d22..4656e9a020b6 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/interfaces.go +++ b/sdk/resourcemanager/cosmos/armcosmos/interfaces.go @@ -17,16 +17,6 @@ type BackupPolicyClassification interface { GetBackupPolicy() *BackupPolicy } -// 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, *MongoDataTransferDataSourceSink, -// - *SQLDataTransferDataSourceSink -type DataTransferDataSourceSinkClassification interface { - // GetDataTransferDataSourceSink returns the DataTransferDataSourceSink content of the underlying type. - GetDataTransferDataSourceSink() *DataTransferDataSourceSink -} - // ServiceResourcePropertiesClassification provides polymorphic access to related types. // Call the interface's GetServiceResourceProperties() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: diff --git a/sdk/resourcemanager/cosmos/armcosmos/locations_client.go b/sdk/resourcemanager/cosmos/armcosmos/locations_client.go index 73e622b51c99..48597cd95a93 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/locations_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/locations_client.go @@ -46,7 +46,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 2023-03-15-preview +// Generated from API version 2023-11-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) { @@ -87,7 +87,7 @@ func (client *LocationsClient) getCreateRequest(ctx context.Context, location st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -104,7 +104,7 @@ func (client *LocationsClient) getHandleResponse(resp *http.Response) (Locations // NewListPager - List Cosmos DB locations and their properties // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - options - LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method. func (client *LocationsClient) NewListPager(options *LocationsClientListOptions) *runtime.Pager[LocationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[LocationsClientListResponse]{ @@ -142,7 +142,7 @@ func (client *LocationsClient) listCreateRequest(ctx context.Context, options *L return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 06ae1560d9f5..47525ae93b38 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/locations_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/locations_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBLocationList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBLocationList.json func ExampleLocationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -75,7 +75,7 @@ func ExampleLocationsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBLocationGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBLocationGet.json func ExampleLocationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/models.go b/sdk/resourcemanager/cosmos/armcosmos/models.go index 5e8d19054697..53dffaff89ad 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/models.go +++ b/sdk/resourcemanager/cosmos/armcosmos/models.go @@ -30,9 +30,6 @@ type ARMProxyResource struct { // ARMResourceProperties - The core properties of ARM resources. type ARMResourceProperties struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -114,23 +111,6 @@ type AutoscaleSettingsResource struct { TargetMaxThroughput *int32 } -// AzureBlobDataTransferDataSourceSink - An Azure Blob Storage data source/sink -type AzureBlobDataTransferDataSourceSink struct { - // REQUIRED - Component *DataTransferComponent - - // REQUIRED - ContainerName *string - EndpointURL *string -} - -// 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. @@ -161,25 +141,6 @@ type BackupPolicyMigrationState struct { TargetType *BackupPolicyType } -// BackupResource - A restorable backup of a Cassandra cluster. -type BackupResource struct { - Properties *BackupResourceProperties - - // READ-ONLY; The unique resource identifier of the database account. - ID *string - - // READ-ONLY; The name of the database account. - Name *string - - // READ-ONLY; The type of Azure resource. - Type *string -} - -type BackupResourceProperties struct { - // The time this backup was taken, formatted like 2021-01-21T17:35:21 - Timestamp *time.Time -} - // Capability - Cosmos DB capability object type Capability struct { // Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and @@ -218,25 +179,6 @@ type CassandraClusterPublicStatusDataCentersItem struct { SeedNodes []*string } -// CassandraDataTransferDataSourceSink - A CosmosDB Cassandra API data source/sink -type CassandraDataTransferDataSourceSink struct { - // REQUIRED - Component *DataTransferComponent - - // REQUIRED - KeyspaceName *string - - // REQUIRED - TableName *string -} - -// GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type CassandraDataTransferDataSourceSink. -func (c *CassandraDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink { - return &DataTransferDataSourceSink{ - Component: c.Component, - } -} - type CassandraError struct { // Additional information about the error. AdditionalErrorInfo *string @@ -256,9 +198,6 @@ type CassandraKeyspaceCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Cassandra keyspace. Properties *CassandraKeyspaceCreateUpdateProperties - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -319,9 +258,6 @@ type CassandraKeyspaceGetPropertiesResource struct { // CassandraKeyspaceGetResults - An Azure Cosmos DB Cassandra keyspace. type CassandraKeyspaceGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -380,9 +316,6 @@ type CassandraTableCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Cassandra table. Properties *CassandraTableCreateUpdateProperties - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -452,9 +385,6 @@ type CassandraTableGetPropertiesResource struct { // CassandraTableGetResults - An Azure Cosmos DB Cassandra table. type CassandraTableGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -499,144 +429,11 @@ type CassandraTableResource struct { Schema *CassandraSchema } -// 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 - - // Identity for the resource. - Identity *ManagedServiceIdentity - - // The location of the resource group to which the resource belongs. - Location *string - - // 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 - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string - - // READ-ONLY; The name of the ARM resource. - Name *string - - // READ-ONLY; The type of Azure resource. - Type *string -} - -// 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 - - // A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - Options *CreateUpdateOptions -} - -// CassandraViewGetProperties - The properties of an Azure Cosmos DB Cassandra view -type CassandraViewGetProperties struct { - Options *CassandraViewGetPropertiesOptions - Resource *CassandraViewGetPropertiesResource -} - -type CassandraViewGetPropertiesOptions struct { - // Specifies the Autoscale settings. - AutoscaleSettings *AutoscaleSettings - - // Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer - // details. - Throughput *int32 -} - -type CassandraViewGetPropertiesResource struct { - // REQUIRED; Name of the Cosmos DB Cassandra view - ID *string - - // REQUIRED; View Definition of the Cosmos DB Cassandra view - ViewDefinition *string - - // READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. - Etag *string - - // READ-ONLY; A system generated property. A unique identifier. - Rid *string - - // READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. - Ts *float32 -} - -// CassandraViewGetResults - An Azure Cosmos DB Cassandra view. -type CassandraViewGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - - // The location of the resource group to which the resource belongs. - Location *string - - // The properties of an Azure Cosmos DB Cassandra view - Properties *CassandraViewGetProperties - - // 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 - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string - - // READ-ONLY; The name of the ARM resource. - Name *string - - // READ-ONLY; The type of Azure resource. - Type *string -} - -// 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 -} - -// CassandraViewResource - Cosmos DB Cassandra view resource object -type CassandraViewResource struct { - // REQUIRED; Name of the Cosmos DB Cassandra view - ID *string - - // REQUIRED; View Definition of the Cosmos DB Cassandra view - ViewDefinition *string -} - type Certificate struct { // PEM formatted public key. Pem *string } -// CheckNameAvailabilityRequest - The check availability request body. -type CheckNameAvailabilityRequest struct { - // The name of the resource for which availability needs to be checked. - Name *string - - // The resource type. - Type *string -} - -// CheckNameAvailabilityResponse - The check availability result. -type CheckNameAvailabilityResponse struct { - // Detailed reason why the given name is available. - Message *string - - // Indicates if the resource name is available. - NameAvailable *bool - - // The reason why the given name is not available. - Reason *CheckNameAvailabilityReason -} - // ClientEncryptionIncludedPath - . type ClientEncryptionIncludedPath struct { // REQUIRED; The identifier of the Client Encryption Key to be used to encrypt the path. @@ -952,6 +749,15 @@ type CompositePath struct { Path *string } +// ComputedProperty - The definition of a computed property +type ComputedProperty struct { + // The name of a computed property, for example - "cp_lowerName" + Name *string + + // The query that evaluates the value for computed property, for example - "SELECT VALUE LOWER(c.name) FROM c" + Query *string +} + // ConflictResolutionPolicy - The conflict resolution policy for the container. type ConflictResolutionPolicy struct { // The conflict resolution path in the case of LastWriterWins mode. @@ -981,15 +787,6 @@ type ConnectionError struct { Port *int32 } -// ConnectionString - Connection string for the mongo cluster -type ConnectionString struct { - // READ-ONLY; Value of the connection string - ConnectionString *string - - // READ-ONLY; Description of the connection string - Description *string -} - // ConsistencyPolicy - The consistency policy for the Cosmos DB database account. type ConsistencyPolicy struct { // REQUIRED; The default consistency level and configuration settings of the Cosmos DB account. @@ -1056,7 +853,7 @@ func (c *ContinuousModeBackupPolicy) GetBackupPolicy() *BackupPolicy { // ContinuousModeProperties - Configuration values for periodic mode backup type ContinuousModeProperties struct { - // Enum to indicate type of Continuos backup mode + // Enum to indicate type of Continuous backup mode Tier *ContinuousTier } @@ -1078,25 +875,10 @@ type CorsPolicy struct { MaxAgeInSeconds *int64 } -// CreateJobRequest - Parameters to create Data Transfer Job -type CreateJobRequest struct { - // REQUIRED; Data Transfer Create Job Properties - Properties *DataTransferJobProperties - - // READ-ONLY; The unique resource identifier of the database account. - ID *string - - // READ-ONLY; The name of the database account. - Name *string - - // READ-ONLY; The type of Azure resource. - Type *string -} - // 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 { - // Specifies the Autoscale settings. + // Specifies the Autoscale settings. Note: Either throughput or autoscaleSettings is required, but not both. AutoscaleSettings *AutoscaleSettings // Request Units per second. For example, "throughput": 10000. @@ -1177,71 +959,6 @@ type DataCenterResourceProperties struct { SeedNodes []*SeedNode } -// DataTransferDataSourceSink - Base class for all DataTransfer source/sink -type DataTransferDataSourceSink struct { - // REQUIRED - Component *DataTransferComponent -} - -// 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 - - // READ-ONLY; List of Data Transfer jobs and their properties. - Value []*DataTransferJobGetResults -} - -// DataTransferJobGetResults - A Cosmos DB Data Transfer Job -type DataTransferJobGetResults struct { - // The properties of a DataTransfer Job - Properties *DataTransferJobProperties - - // READ-ONLY; The unique resource identifier of the database account. - ID *string - - // READ-ONLY; The name of the database account. - Name *string - - // READ-ONLY; The type of Azure resource. - Type *string -} - -// DataTransferJobProperties - The properties of a DataTransfer Job -type DataTransferJobProperties struct { - // REQUIRED; Destination DataStore details - Destination DataTransferDataSourceSinkClassification - - // REQUIRED; Source DataStore details - Source DataTransferDataSourceSinkClassification - - // Worker count - WorkerCount *int32 - - // READ-ONLY; Error response for Faulted job - Error *ErrorResponse - - // READ-ONLY; Job Name - JobName *string - - // READ-ONLY; Last Updated Time (ISO-8601 format). - LastUpdatedUTCTime *time.Time - - // READ-ONLY; Processed Count. - ProcessedCount *int64 - - // READ-ONLY; Job Status - Status *string - - // READ-ONLY; Total Count. - TotalCount *int64 -} - // DataTransferRegionalServiceResource - Resource for a regional service location. type DataTransferRegionalServiceResource struct { // READ-ONLY; The location name. @@ -1378,14 +1095,15 @@ type DatabaseAccountCreateUpdateProperties struct { // Enum to indicate the mode of account creation. CreateMode *CreateMode + // Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides + // troubleshooting guidance. + CustomerManagedKeyStatus *string + // The default identity for accessing key vault used in features like customer managed keys. The default identity needs to // be explicitly set by the users. It can be "FirstPartyIdentity", // "SystemAssignedIdentity" and more. DefaultIdentity *string - // The Object representing the different Diagnostic log settings for the Cosmos DB Account. - DiagnosticLogSettings *DiagnosticLogSettings - // Disable write operations on metadata resources (databases, containers, throughput) via account keys DisableKeyBasedMetadataWriteAccess *bool @@ -1409,9 +1127,6 @@ type DatabaseAccountCreateUpdateProperties struct { // Flag to indicate whether Free Tier is enabled. EnableFreeTier *bool - // Flag to indicate whether to enable MaterializedViews on the Cosmos DB account - EnableMaterializedViews *bool - // Enables the account to write in multiple locations EnableMultipleWriteLocations *bool @@ -1427,8 +1142,7 @@ type DatabaseAccountCreateUpdateProperties struct { // The URI of the key vault KeyVaultKeyURI *string - // Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work - // with Tls 1.2. + // Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. MinimalTLSVersion *MinimalTLSVersion // Indicates what services are allowed to bypass firewall checks. @@ -1480,14 +1194,15 @@ type DatabaseAccountGetProperties struct { // Enum to indicate the mode of account creation. CreateMode *CreateMode + // Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides + // troubleshooting guidance. + CustomerManagedKeyStatus *string + // The default identity for accessing key vault used in features like customer managed keys. The default identity needs to // be explicitly set by the users. It can be "FirstPartyIdentity", // "SystemAssignedIdentity" and more. DefaultIdentity *string - // The Object representing the different Diagnostic log settings for the Cosmos DB Account. - DiagnosticLogSettings *DiagnosticLogSettings - // Disable write operations on metadata resources (databases, containers, throughput) via account keys DisableKeyBasedMetadataWriteAccess *bool @@ -1511,9 +1226,6 @@ type DatabaseAccountGetProperties struct { // Flag to indicate whether Free Tier is enabled. EnableFreeTier *bool - // Flag to indicate whether to enable MaterializedViews on the Cosmos DB account - EnableMaterializedViews *bool - // Enables the account to write in multiple locations EnableMultipleWriteLocations *bool @@ -1529,8 +1241,7 @@ type DatabaseAccountGetProperties struct { // The URI of the key vault KeyVaultKeyURI *string - // Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work - // with Tls 1.2. + // Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. MinimalTLSVersion *MinimalTLSVersion // Indicates what services are allowed to bypass firewall checks. @@ -1714,14 +1425,15 @@ type DatabaseAccountUpdateProperties struct { // The CORS policy for the Cosmos DB database account. Cors []*CorsPolicy + // Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides + // troubleshooting guidance. + CustomerManagedKeyStatus *string + // The default identity for accessing key vault used in features like customer managed keys. The default identity needs to // be explicitly set by the users. It can be "FirstPartyIdentity", // "SystemAssignedIdentity" and more. DefaultIdentity *string - // The Object representing the different Diagnostic log settings for the Cosmos DB Account. - DiagnosticLogSettings *DiagnosticLogSettings - // Disable write operations on metadata resources (databases, containers, throughput) via account keys DisableKeyBasedMetadataWriteAccess *bool @@ -1745,9 +1457,6 @@ type DatabaseAccountUpdateProperties struct { // Flag to indicate whether Free Tier is enabled. EnableFreeTier *bool - // Flag to indicate whether to enable MaterializedViews on the Cosmos DB account - EnableMaterializedViews *bool - // Enables the account to write in multiple locations EnableMultipleWriteLocations *bool @@ -1766,8 +1475,7 @@ type DatabaseAccountUpdateProperties struct { // An array that contains the georeplication locations enabled for the Cosmos DB account. Locations []*Location - // Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work - // with Tls 1.2. + // Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. MinimalTLSVersion *MinimalTLSVersion // Indicates what services are allowed to bypass firewall checks. @@ -1802,39 +1510,6 @@ type DatabaseRestoreResource struct { DatabaseName *string } -// 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 -} - -// ErrorAdditionalInfo - The resource management error additional info. -type ErrorAdditionalInfo struct { - // READ-ONLY; The additional info. - Info any - - // READ-ONLY; The additional info type. - Type *string -} - -// ErrorDetail - The error detail. -type ErrorDetail struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo - - // READ-ONLY; The error code. - Code *string - - // READ-ONLY; The error details. - Details []*ErrorDetail - - // READ-ONLY; The error message. - Message *string - - // READ-ONLY; The error target. - Target *string -} - // ErrorResponse - Error Response. type ErrorResponse struct { // Error code. @@ -1844,13 +1519,6 @@ type ErrorResponse struct { Message *string } -// ErrorResponseAutoGenerated - Common error response for all Azure Resource Manager APIs to return error details for failed -// operations. (This also follows the OData error response format.). -type ErrorResponseAutoGenerated struct { - // The error object. - Error *ErrorDetail -} - type ExcludedPath struct { // The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) Path *string @@ -1889,45 +1557,6 @@ type FailoverPolicy struct { ID *string } -// FirewallRule - Represents a mongo cluster firewall rule. -type FirewallRule struct { - // REQUIRED; The properties of a firewall rule. - Properties *FirewallRuleProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// FirewallRuleListResult - A list of firewall rules. -type FirewallRuleListResult struct { - // The list of firewall rules in a mongo cluster. - Value []*FirewallRule - - // READ-ONLY; The link used to get the next page of results. - NextLink *string -} - -// FirewallRuleProperties - The properties of a mongo cluster firewall rule. -type FirewallRuleProperties struct { - // REQUIRED; The end IP address of the mongo cluster firewall rule. Must be IPv4 format. - EndIPAddress *string - - // REQUIRED; The start IP address of the mongo cluster firewall rule. Must be IPv4 format. - StartIPAddress *string - - // READ-ONLY; The provisioning state of the firewall rule. - ProvisioningState *ProvisioningState -} - // GraphAPIComputeRegionalServiceResource - Resource for a regional service location. type GraphAPIComputeRegionalServiceResource struct { // READ-ONLY; The regional endpoint for GraphAPICompute. @@ -1988,111 +1617,11 @@ func (g *GraphAPIComputeServiceResourceProperties) GetServiceResourceProperties( } } -// GraphResource - Cosmos DB Graph resource object -type GraphResource struct { - // REQUIRED; Name of the Cosmos DB Graph - ID *string -} - -// 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 - - // Identity for the resource. - Identity *ManagedServiceIdentity - - // The location of the resource group to which the resource belongs. - Location *string - - // 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 - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string - - // READ-ONLY; The name of the ARM resource. - Name *string - - // READ-ONLY; The type of Azure resource. - Type *string -} - -// 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 - - // A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - Options *CreateUpdateOptions -} - -// GraphResourceGetProperties - The properties of an Azure Cosmos DB SQL database -type GraphResourceGetProperties struct { - Options *GraphResourceGetPropertiesOptions - Resource *GraphResourceGetPropertiesResource -} - -type GraphResourceGetPropertiesOptions struct { - // Specifies the Autoscale settings. - AutoscaleSettings *AutoscaleSettings - - // Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer - // details. - Throughput *int32 -} - -type GraphResourceGetPropertiesResource struct { - // REQUIRED; Name of the Cosmos DB Graph - ID *string -} - -// GraphResourceGetResults - An Azure Cosmos DB Graph resource. -type GraphResourceGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - - // The location of the resource group to which the resource belongs. - Location *string - - // The properties of an Azure Cosmos DB Graph resource. - Properties *GraphResourceGetProperties - - // 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 - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string - - // READ-ONLY; The name of the ARM resource. - Name *string - - // READ-ONLY; The type of Azure resource. - Type *string -} - -// 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 -} - // 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 - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -2159,9 +1688,6 @@ type GremlinDatabaseGetPropertiesResource struct { // GremlinDatabaseGetResults - An Azure Cosmos DB Gremlin database. type GremlinDatabaseGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -2217,9 +1743,6 @@ type GremlinGraphCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Gremlin graph. Properties *GremlinGraphCreateUpdateProperties - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -2305,9 +1828,6 @@ type GremlinGraphGetPropertiesResource struct { // GremlinGraphGetResults - An Azure Cosmos DB Gremlin graph. type GremlinGraphGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -2435,24 +1955,12 @@ type KeyWrapMetadata struct { Value *string } -// ListBackups - List of restorable backups for a Cassandra cluster. -type ListBackups struct { - // READ-ONLY; Container for array of backups. - Value []*BackupResource -} - // ListClusters - List of managed Cassandra clusters. type ListClusters struct { // Container for the array of clusters. Value []*ClusterResource } -// ListConnectionStringsResult - The connection strings for the given mongo cluster. -type ListConnectionStringsResult struct { - // READ-ONLY; An array that contains the connection strings for a mongo cluster. - ConnectionStrings []*ConnectionString -} - // ListDataCenters - List of managed Cassandra data centers and their properties. type ListDataCenters struct { // READ-ONLY; Container for array of data centers. @@ -2596,19 +2104,6 @@ type ManagedServiceIdentity struct { TenantID *string } -// MaterializedViewDefinition - Materialized View definition for the container. -type MaterializedViewDefinition struct { - // REQUIRED; The definition should be an SQL query which would be used to fetch data from the source container to populate - // into the Materialized View container. - Definition *string - - // REQUIRED; The name of the source container on which the Materialized View will be created. - SourceCollectionID *string - - // READ-ONLY; An unique identifier for the source collection. This is a system generated property. - SourceCollectionRid *string -} - // MaterializedViewsBuilderRegionalServiceResource - Resource for a regional service location. type MaterializedViewsBuilderRegionalServiceResource struct { // READ-ONLY; The location name. @@ -2663,12 +2158,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 -} - // Metric data type Metric struct { // READ-ONLY; The end time for the metric (ISO-8601 format). @@ -2749,98 +2238,14 @@ type MetricValue struct { // READ-ONLY; The max value of the metric. Maximum *float64 - // READ-ONLY; The min value of the metric. - Minimum *float64 - - // READ-ONLY; The metric timestamp (ISO-8601 format). - Timestamp *time.Time - - // READ-ONLY; The total value of the metric. - Total *float64 -} - -// MongoCluster - Represents a mongo cluster resource. -type MongoCluster struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Properties of the mongo cluster. - Properties *MongoClusterProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// MongoClusterListResult - A list of mongo clusters. -type MongoClusterListResult struct { - // The list of mongo clusters - Value []*MongoCluster - - // READ-ONLY; The link used to get the next page of results. - NextLink *string -} - -// MongoClusterProperties - The properties of a mongo cluster. -type MongoClusterProperties struct { - // The administrator's login for the mongo cluster. - AdministratorLogin *string - - // The password of the administrator login. - AdministratorLoginPassword *string - - // The mode to create a mongo cluster. - CreateMode *CreateMode - - // The list of node group specs in the cluster. - NodeGroupSpecs []*NodeGroupSpec - - // Parameters used for restore operations - RestoreParameters *MongoClusterRestoreParameters - - // The Mongo DB server version. Defaults to the latest available version if not specified. - ServerVersion *string - - // READ-ONLY; A status of the mongo cluster. - ClusterStatus *MongoClusterStatus - - // READ-ONLY; The default mongo connection string for the cluster. - ConnectionString *string - - // READ-ONLY; Earliest restore timestamp in UTC ISO8601 format. - EarliestRestoreTime *string - - // READ-ONLY; A provisioning state of the mongo cluster. - ProvisioningState *ProvisioningState -} - -// MongoClusterRestoreParameters - Parameters used for restore operations -type MongoClusterRestoreParameters struct { - // UTC point in time to restore a mongo cluster - PointInTimeUTC *time.Time - - // Resource ID to locate the source cluster to restore - SourceResourceID *string -} + // READ-ONLY; The min value of the metric. + Minimum *float64 -// MongoClusterUpdate - Represents a mongo cluster resource for updates. -type MongoClusterUpdate struct { - // Properties of the mongo cluster. - Properties *MongoClusterProperties + // READ-ONLY; The metric timestamp (ISO-8601 format). + Timestamp *time.Time - // Application-specific metadata in the form of key-value pairs. - Tags map[string]*string + // READ-ONLY; The total value of the metric. + Total *float64 } // MongoDBCollectionCreateUpdateParameters - Parameters to create and update Cosmos DB MongoDB collection. @@ -2848,9 +2253,6 @@ type MongoDBCollectionCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB MongoDB collection. Properties *MongoDBCollectionCreateUpdateProperties - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -2926,9 +2328,6 @@ type MongoDBCollectionGetPropertiesResource struct { // MongoDBCollectionGetResults - An Azure Cosmos DB MongoDB collection. type MongoDBCollectionGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -2984,9 +2383,6 @@ type MongoDBDatabaseCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB MongoDB database. Properties *MongoDBDatabaseCreateUpdateProperties - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -3053,9 +2449,6 @@ type MongoDBDatabaseGetPropertiesResource struct { // MongoDBDatabaseGetResults - An Azure Cosmos DB MongoDB database. type MongoDBDatabaseGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -3097,25 +2490,6 @@ type MongoDBDatabaseResource struct { RestoreParameters *ResourceRestoreParameters } -// MongoDataTransferDataSourceSink - A CosmosDB Cassandra API data source/sink -type MongoDataTransferDataSourceSink struct { - // REQUIRED - CollectionName *string - - // REQUIRED - Component *DataTransferComponent - - // REQUIRED - DatabaseName *string -} - -// GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type MongoDataTransferDataSourceSink. -func (m *MongoDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink { - return &DataTransferDataSourceSink{ - Component: m.Component, - } -} - // MongoIndex - Cosmos DB MongoDB collection index key type MongoIndex struct { // Cosmos DB MongoDB collection index keys @@ -3235,38 +2609,6 @@ type MongoUserDefinitionResource struct { UserName *string } -// NodeGroupProperties - The properties of the node group on a cluster. -type NodeGroupProperties struct { - // The disk storage size for the node group in GB. Example values: 128, 256, 512, 1024. - DiskSizeGB *int64 - - // Whether high availability is enabled on the node group. - EnableHa *bool - - // The resource sku for the node group. This defines the size of CPU and memory that is provisioned for each node. Example - // values: 'M30', 'M40'. - SKU *string -} - -// NodeGroupSpec - Specification for a node group. -type NodeGroupSpec struct { - // The disk storage size for the node group in GB. Example values: 128, 256, 512, 1024. - DiskSizeGB *int64 - - // Whether high availability is enabled on the node group. - EnableHa *bool - - // The node type deployed in the node group. - Kind *NodeKind - - // The number of nodes in the node group. - NodeCount *int32 - - // The resource sku for the node group. This defines the size of CPU and memory that is provisioned for each node. Example - // values: 'M30', 'M40'. - SKU *string -} - // NotebookWorkspace - A notebook workspace resource type NotebookWorkspace struct { // Resource properties. @@ -3535,84 +2877,6 @@ type Permission struct { NotDataActions []*string } -// PhysicalPartitionID - PhysicalPartitionId object -type PhysicalPartitionID struct { - // REQUIRED; Id of a physical partition - ID *string -} - -// PhysicalPartitionStorageInfo - The storage of a physical partition -type PhysicalPartitionStorageInfo struct { - // READ-ONLY; The unique identifier of the partition. - ID *string - - // READ-ONLY; The storage in KB for the physical partition. - StorageInKB *float64 -} - -// 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 -} - -// PhysicalPartitionThroughputInfoProperties - The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties -// object -type PhysicalPartitionThroughputInfoProperties struct { - // Array of physical partition throughput info objects - PhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource -} - -// PhysicalPartitionThroughputInfoResource - PhysicalPartitionThroughputInfo object -type PhysicalPartitionThroughputInfoResource struct { - // REQUIRED; Id of a physical partition - ID *string - - // Throughput of a physical partition - Throughput *float64 -} - -// PhysicalPartitionThroughputInfoResult - An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. -type PhysicalPartitionThroughputInfoResult struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - - // The location of the resource group to which the resource belongs. - Location *string - - // The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object - Properties *PhysicalPartitionThroughputInfoResultProperties - - // 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 - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string - - // READ-ONLY; The name of the ARM resource. - Name *string - - // READ-ONLY; The type of Azure resource. - Type *string -} - -// PhysicalPartitionThroughputInfoResultProperties - The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult -// object -type PhysicalPartitionThroughputInfoResultProperties struct { - // properties of physical partition throughput info - Resource *PhysicalPartitionThroughputInfoResultPropertiesResource -} - -// PhysicalPartitionThroughputInfoResultPropertiesResource - properties of physical partition throughput info -type PhysicalPartitionThroughputInfoResultPropertiesResource struct { - // Array of physical partition throughput info objects - PhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource -} - // PrivateEndpointConnection - A private endpoint connection type PrivateEndpointConnection struct { // Resource properties. @@ -3731,68 +2995,6 @@ type ProxyResource struct { Type *string } -// ProxyResourceAutoGenerated - The resource model definition for a Azure Resource Manager proxy resource. It will not have -// tags and a location -type ProxyResourceAutoGenerated struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// RedistributeThroughputParameters - Cosmos DB redistribute throughput parameters object -type RedistributeThroughputParameters struct { - // REQUIRED; Properties to redistribute throughput parameters object - Properties *RedistributeThroughputProperties - - // Identity for the resource. - Identity *ManagedServiceIdentity - - // The location of the resource group to which the resource belongs. - Location *string - - // 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 - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string - - // READ-ONLY; The name of the ARM resource. - Name *string - - // READ-ONLY; The type of Azure resource. - Type *string -} - -// RedistributeThroughputProperties - Properties to redistribute throughput for Azure Cosmos DB resource. -type RedistributeThroughputProperties struct { - // REQUIRED; The standard JSON format of a resource throughput - Resource *RedistributeThroughputPropertiesResource -} - -// RedistributeThroughputPropertiesResource - Resource to redistribute throughput for Azure Cosmos DB resource -type RedistributeThroughputPropertiesResource struct { - // REQUIRED; Array of PhysicalPartitionThroughputInfoResource objects. - SourcePhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource - - // REQUIRED; Array of PhysicalPartitionThroughputInfoResource objects. - TargetPhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource - - // REQUIRED; ThroughputPolicy to apply for throughput redistribution - ThroughputPolicy *ThroughputPolicyType -} - // RegionForOnlineOffline - Cosmos DB region to online or offline. type RegionForOnlineOffline struct { // REQUIRED; Cosmos DB region, with spaces between words and each word capitalized. @@ -3823,21 +3025,6 @@ type Resource struct { Type *string } -// ResourceAutoGenerated - Common fields that are returned in the response for all Azure Resource Manager resources -type ResourceAutoGenerated struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - // ResourceRestoreParameters - Parameters to indicate the information about the restore. type ResourceRestoreParameters struct { // The id of the restorable database account from which the restore has to be initiated. For example: @@ -3917,6 +3104,12 @@ type RestorableGremlinDatabaseProperties struct { // RestorableGremlinDatabasePropertiesResource - The resource of an Azure Cosmos DB Gremlin database event type RestorableGremlinDatabasePropertiesResource struct { + // READ-ONLY; A state of this database to identify if this database is restorable in same account. + CanUndelete *string + + // READ-ONLY; The reason why this database can not be restored in same account. + CanUndeleteReason *string + // READ-ONLY; The time when this database event happened. EventTimestamp *string @@ -3963,6 +3156,12 @@ type RestorableGremlinGraphProperties struct { // RestorableGremlinGraphPropertiesResource - The resource of an Azure Cosmos DB Gremlin graph event type RestorableGremlinGraphPropertiesResource struct { + // READ-ONLY; A state of this graph to identify if this graph is restorable in same account. + CanUndelete *string + + // READ-ONLY; The reason why this graph can not be restored in same account. + CanUndeleteReason *string + // READ-ONLY; The time when this graph event happened. EventTimestamp *string @@ -4047,6 +3246,12 @@ type RestorableMongodbCollectionProperties struct { // RestorableMongodbCollectionPropertiesResource - The resource of an Azure Cosmos DB MongoDB collection event type RestorableMongodbCollectionPropertiesResource struct { + // READ-ONLY; A state of this collection to identify if this container is restorable in same account. + CanUndelete *string + + // READ-ONLY; The reason why this collection can not be restored in same account. + CanUndeleteReason *string + // READ-ONLY; The time when this collection event happened. EventTimestamp *string @@ -4093,6 +3298,12 @@ type RestorableMongodbDatabaseProperties struct { // RestorableMongodbDatabasePropertiesResource - The resource of an Azure Cosmos DB MongoDB database event type RestorableMongodbDatabasePropertiesResource struct { + // READ-ONLY; A state of this database to identify if this database is restorable in same account. + CanUndelete *string + + // READ-ONLY; The reason why this database can not be restored in same account. + CanUndeleteReason *string + // READ-ONLY; The time when this database event happened. EventTimestamp *string @@ -4166,6 +3377,12 @@ type RestorableSQLContainerPropertiesResource struct { // Cosmos DB SQL container resource object Container *RestorableSQLContainerPropertiesResourceContainer + // READ-ONLY; A state of this container to identify if this container is restorable in same account. + CanUndelete *string + + // READ-ONLY; The reason why this container can not be restored in same account. + CanUndeleteReason *string + // READ-ONLY; The when this container event happened. EventTimestamp *string @@ -4193,6 +3410,9 @@ type RestorableSQLContainerPropertiesResourceContainer struct { // The client encryption policy for the container. ClientEncryptionPolicy *ClientEncryptionPolicy + // List of computed properties + ComputedProperties []*ComputedProperty + // The conflict resolution policy for the container. ConflictResolutionPolicy *ConflictResolutionPolicy @@ -4205,9 +3425,6 @@ type RestorableSQLContainerPropertiesResourceContainer struct { // The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container IndexingPolicy *IndexingPolicy - // The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. - MaterializedViewDefinition *MaterializedViewDefinition - // The configuration of the partition key to be used for partitioning data into multiple partitions PartitionKey *ContainerPartitionKey @@ -4263,6 +3480,12 @@ type RestorableSQLDatabasePropertiesResource struct { // Cosmos DB SQL database resource object Database *RestorableSQLDatabasePropertiesResourceDatabase + // READ-ONLY; A state of this database to identify if this database is restorable in same account. + CanUndelete *string + + // READ-ONLY; The reason why this database can not be restored in same account. + CanUndeleteReason *string + // READ-ONLY; The time when this database event happened. EventTimestamp *string @@ -4362,6 +3585,12 @@ type RestorableTableProperties struct { // RestorableTablePropertiesResource - The resource of an Azure Cosmos DB Table event type RestorableTablePropertiesResource struct { + // READ-ONLY; A state of this table to identify if this table is restorable in same account. + CanUndelete *string + + // READ-ONLY; The reason why this table can not be restored in same account. + CanUndeleteReason *string + // READ-ONLY; The time when this table event happened. EventTimestamp *string @@ -4420,9 +3649,6 @@ type RestoreParameters struct { // Time to which the account has to be restored (ISO-8601 format). RestoreTimestampInUTC *time.Time - // The source backup location for restore. - SourceBackupLocation *string - // List of specific tables available for restore. TablesToRestore []*string } @@ -4437,46 +3663,6 @@ type RestoreParametersBase struct { RestoreTimestampInUTC *time.Time } -// RetrieveThroughputParameters - Cosmos DB retrieve throughput parameters object -type RetrieveThroughputParameters struct { - // REQUIRED; Properties to retrieve throughput parameters object - Properties *RetrieveThroughputProperties - - // Identity for the resource. - Identity *ManagedServiceIdentity - - // The location of the resource group to which the resource belongs. - Location *string - - // 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 - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string - - // READ-ONLY; The name of the ARM resource. - Name *string - - // READ-ONLY; The type of Azure resource. - Type *string -} - -// RetrieveThroughputProperties - Properties to retrieve throughput for Azure Cosmos DB resource. -type RetrieveThroughputProperties struct { - // REQUIRED; The standard JSON format of a resource throughput - Resource *RetrieveThroughputPropertiesResource -} - -// RetrieveThroughputPropertiesResource - Resource to retrieve throughput information for Cosmos DB resource -type RetrieveThroughputPropertiesResource struct { - // REQUIRED; Array of PhysicalPartitionId objects. - PhysicalPartitionIDs []*PhysicalPartitionID -} - // Role - The set of roles permitted through this Role Definition. type Role struct { // The database name the role is applied. @@ -4491,9 +3677,6 @@ type SQLContainerCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB container. Properties *SQLContainerCreateUpdateProperties - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -4548,6 +3731,9 @@ type SQLContainerGetPropertiesResource struct { // The client encryption policy for the container. ClientEncryptionPolicy *ClientEncryptionPolicy + // List of computed properties + ComputedProperties []*ComputedProperty + // The conflict resolution policy for the container. ConflictResolutionPolicy *ConflictResolutionPolicy @@ -4560,9 +3746,6 @@ type SQLContainerGetPropertiesResource struct { // The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container IndexingPolicy *IndexingPolicy - // The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. - MaterializedViewDefinition *MaterializedViewDefinition - // The configuration of the partition key to be used for partitioning data into multiple partitions PartitionKey *ContainerPartitionKey @@ -4585,9 +3768,6 @@ type SQLContainerGetPropertiesResource struct { // SQLContainerGetResults - An Azure Cosmos DB container. type SQLContainerGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -4628,6 +3808,9 @@ type SQLContainerResource struct { // The client encryption policy for the container. ClientEncryptionPolicy *ClientEncryptionPolicy + // List of computed properties + ComputedProperties []*ComputedProperty + // The conflict resolution policy for the container. ConflictResolutionPolicy *ConflictResolutionPolicy @@ -4640,9 +3823,6 @@ type SQLContainerResource struct { // The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container IndexingPolicy *IndexingPolicy - // The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. - MaterializedViewDefinition *MaterializedViewDefinition - // The configuration of the partition key to be used for partitioning data into multiple partitions PartitionKey *ContainerPartitionKey @@ -4654,33 +3834,11 @@ type SQLContainerResource struct { UniqueKeyPolicy *UniqueKeyPolicy } -// SQLDataTransferDataSourceSink - A CosmosDB Cassandra API data source/sink -type SQLDataTransferDataSourceSink struct { - // REQUIRED - Component *DataTransferComponent - - // REQUIRED - ContainerName *string - - // REQUIRED - DatabaseName *string -} - -// 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 - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -4753,9 +3911,6 @@ type SQLDatabaseGetPropertiesResource struct { // SQLDatabaseGetResults - An Azure Cosmos DB SQL database. type SQLDatabaseGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -4949,9 +4104,6 @@ type SQLStoredProcedureCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB storedProcedure. Properties *SQLStoredProcedureCreateUpdateProperties - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -5005,9 +4157,6 @@ type SQLStoredProcedureGetPropertiesResource struct { // SQLStoredProcedureGetResults - An Azure Cosmos DB storedProcedure. type SQLStoredProcedureGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -5051,9 +4200,6 @@ type SQLTriggerCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB trigger. Properties *SQLTriggerCreateUpdateProperties - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -5113,9 +4259,6 @@ type SQLTriggerGetPropertiesResource struct { // SQLTriggerGetResults - An Azure Cosmos DB trigger. type SQLTriggerGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -5165,9 +4308,6 @@ type SQLUserDefinedFunctionCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB userDefinedFunction. Properties *SQLUserDefinedFunctionCreateUpdateProperties - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -5221,9 +4361,6 @@ type SQLUserDefinedFunctionGetPropertiesResource struct { // SQLUserDefinedFunctionGetResults - An Azure Cosmos DB userDefinedFunction. type SQLUserDefinedFunctionGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -5366,9 +4503,6 @@ type TableCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Table. Properties *TableCreateUpdateProperties - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -5435,9 +4569,6 @@ type TableGetPropertiesResource struct { // TableGetResults - An Azure Cosmos DB Table. type TableGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -5503,6 +4634,9 @@ type ThroughputSettingsGetPropertiesResource struct { // READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. Etag *string + // READ-ONLY; The offer throughput value to instantly scale up without triggering splits + InstantMaximumThroughput *string + // READ-ONLY; The minimum throughput of the resource MinimumThroughput *string @@ -5512,15 +4646,15 @@ type ThroughputSettingsGetPropertiesResource struct { // READ-ONLY; A system generated property. A unique identifier. Rid *string + // READ-ONLY; The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified + SoftAllowedMaximumThroughput *string + // READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. Ts *float32 } // ThroughputSettingsGetResults - An Azure Cosmos DB resource throughput. type ThroughputSettingsGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -5553,11 +4687,17 @@ type ThroughputSettingsResource struct { // Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. Throughput *int32 + // READ-ONLY; The offer throughput value to instantly scale up without triggering splits + InstantMaximumThroughput *string + // READ-ONLY; The minimum throughput of the resource MinimumThroughput *string // READ-ONLY; The throughput replace is pending OfferReplacePending *string + + // READ-ONLY; The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified + SoftAllowedMaximumThroughput *string } // ThroughputSettingsUpdateParameters - Parameters to update Cosmos DB resource throughput. @@ -5565,9 +4705,6 @@ type ThroughputSettingsUpdateParameters struct { // REQUIRED; Properties to update Azure Cosmos DB resource throughput. Properties *ThroughputSettingsUpdateProperties - // Identity for the resource. - Identity *ManagedServiceIdentity - // The location of the resource group to which the resource belongs. Location *string @@ -5594,28 +4731,6 @@ type ThroughputSettingsUpdateProperties struct { Resource *ThroughputSettingsResource } -// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' -// and a 'location' -type TrackedResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - // UniqueKey - The unique key on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB // service. type UniqueKey struct { diff --git a/sdk/resourcemanager/cosmos/armcosmos/models_serde.go b/sdk/resourcemanager/cosmos/armcosmos/models_serde.go index 6e96598114d6..182a5b414c30 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/models_serde.go +++ b/sdk/resourcemanager/cosmos/armcosmos/models_serde.go @@ -82,7 +82,6 @@ func (a *ARMProxyResource) UnmarshalJSON(data []byte) error { func (a ARMResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -102,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) @@ -323,41 +319,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]any) - 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]any) @@ -451,72 +412,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]any) - 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]any) - populateDateTimeRFC3339(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 = unpopulateDateTimeRFC3339(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]any) @@ -649,41 +544,6 @@ 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]any) - 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 CassandraError. func (c CassandraError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -727,7 +587,6 @@ func (c *CassandraError) UnmarshalJSON(data []byte) error { func (c CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -748,9 +607,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) @@ -910,7 +766,6 @@ func (c *CassandraKeyspaceGetPropertiesResource) UnmarshalJSON(data []byte) erro func (c CassandraKeyspaceGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -931,9 +786,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) @@ -1077,7 +929,6 @@ func (c *CassandraSchema) UnmarshalJSON(data []byte) error { func (c CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -1098,9 +949,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) @@ -1272,7 +1120,6 @@ func (c *CassandraTableGetPropertiesResource) UnmarshalJSON(data []byte) error { func (c CassandraTableGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -1293,9 +1140,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) @@ -1385,21 +1229,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]any) - 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) @@ -1407,26 +1245,47 @@ 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) + case "pem": + err = unpopulate(val, "Pem", &c.Pem) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionIncludedPath. +func (c ClientEncryptionIncludedPath) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientEncryptionKeyId", c.ClientEncryptionKeyID) + populate(objectMap, "encryptionAlgorithm", c.EncryptionAlgorithm) + populate(objectMap, "encryptionType", c.EncryptionType) + populate(objectMap, "path", c.Path) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionIncludedPath. +func (c *ClientEncryptionIncludedPath) 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 "clientEncryptionKeyId": + err = unpopulate(val, "ClientEncryptionKeyID", &c.ClientEncryptionKeyID) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "encryptionAlgorithm": + err = unpopulate(val, "EncryptionAlgorithm", &c.EncryptionAlgorithm) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "encryptionType": + err = unpopulate(val, "EncryptionType", &c.EncryptionType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "path": + err = unpopulate(val, "Path", &c.Path) delete(rawMsg, key) } if err != nil { @@ -1436,16 +1295,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 ClientEncryptionKeyCreateUpdateParameters. +func (c ClientEncryptionKeyCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "options", c.Options) - populate(objectMap, "resource", c.Resource) + populate(objectMap, "properties", c.Properties) 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 ClientEncryptionKeyCreateUpdateParameters. +func (c *ClientEncryptionKeyCreateUpdateParameters) 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) @@ -1453,11 +1311,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 "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) } if err != nil { @@ -1467,16 +1322,15 @@ 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 ClientEncryptionKeyCreateUpdateProperties. +func (c ClientEncryptionKeyCreateUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "options", c.Options) populate(objectMap, "resource", c.Resource) 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 ClientEncryptionKeyCreateUpdateProperties. +func (c *ClientEncryptionKeyCreateUpdateProperties) 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) @@ -1484,9 +1338,6 @@ 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) - delete(rawMsg, key) case "resource": err = unpopulate(val, "Resource", &c.Resource) delete(rawMsg, key) @@ -1498,16 +1349,15 @@ 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 ClientEncryptionKeyGetProperties. +func (c ClientEncryptionKeyGetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoscaleSettings", c.AutoscaleSettings) - populate(objectMap, "throughput", c.Throughput) + populate(objectMap, "resource", c.Resource) 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 ClientEncryptionKeyGetProperties. +func (c *ClientEncryptionKeyGetProperties) 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) @@ -1515,11 +1365,8 @@ 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) - delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &c.Throughput) + case "resource": + err = unpopulate(val, "Resource", &c.Resource) delete(rawMsg, key) } if err != nil { @@ -1529,19 +1376,21 @@ 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 ClientEncryptionKeyGetPropertiesResource. +func (c ClientEncryptionKeyGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + 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) - populate(objectMap, "viewDefinition", c.ViewDefinition) + populateByteArray(objectMap, "wrappedDataEncryptionKey", c.WrappedDataEncryptionKey, runtime.Base64StdFormat) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewGetPropertiesResource. -func (c *CassandraViewGetPropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyGetPropertiesResource. +func (c *ClientEncryptionKeyGetPropertiesResource) 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) @@ -1549,20 +1398,26 @@ func (c *CassandraViewGetPropertiesResource) 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 "_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) delete(rawMsg, key) case "_ts": err = unpopulate(val, "Ts", &c.Ts) delete(rawMsg, key) - case "viewDefinition": - err = unpopulate(val, "ViewDefinition", &c.ViewDefinition) + case "wrappedDataEncryptionKey": + err = runtime.DecodeByteArray(string(val), &c.WrappedDataEncryptionKey, runtime.Base64StdFormat) delete(rawMsg, key) } if err != nil { @@ -1572,21 +1427,18 @@ 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 ClientEncryptionKeyGetResults. +func (c ClientEncryptionKeyGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 ClientEncryptionKeyGetResults. +func (c *ClientEncryptionKeyGetResults) 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) @@ -1597,21 +1449,12 @@ func (c *CassandraViewGetResults) 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) 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) @@ -1623,15 +1466,18 @@ 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 ClientEncryptionKeyResource. +func (c ClientEncryptionKeyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", c.Value) + populate(objectMap, "encryptionAlgorithm", c.EncryptionAlgorithm) + populate(objectMap, "id", c.ID) + populate(objectMap, "keyWrapMetadata", c.KeyWrapMetadata) + populateByteArray(objectMap, "wrappedDataEncryptionKey", c.WrappedDataEncryptionKey, runtime.Base64StdFormat) 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 ClientEncryptionKeyResource. +func (c *ClientEncryptionKeyResource) 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) @@ -1639,8 +1485,17 @@ 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 "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) delete(rawMsg, key) } if err != nil { @@ -1650,16 +1505,15 @@ 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 ClientEncryptionKeysListResult. +func (c ClientEncryptionKeysListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "viewDefinition", c.ViewDefinition) + populate(objectMap, "value", c.Value) 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 ClientEncryptionKeysListResult. +func (c *ClientEncryptionKeysListResult) 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) @@ -1667,11 +1521,8 @@ 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) - delete(rawMsg, key) - case "viewDefinition": - err = unpopulate(val, "ViewDefinition", &c.ViewDefinition) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -1681,15 +1532,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 ClientEncryptionPolicy. +func (c ClientEncryptionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "pem", c.Pem) + populate(objectMap, "includedPaths", c.IncludedPaths) + populate(objectMap, "policyFormatVersion", c.PolicyFormatVersion) 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 ClientEncryptionPolicy. +func (c *ClientEncryptionPolicy) 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) @@ -1697,8 +1549,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 "includedPaths": + err = unpopulate(val, "IncludedPaths", &c.IncludedPaths) + delete(rawMsg, key) + case "policyFormatVersion": + err = unpopulate(val, "PolicyFormatVersion", &c.PolicyFormatVersion) delete(rawMsg, key) } if err != nil { @@ -1708,16 +1563,16 @@ func (c *Certificate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. -func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterKey. +func (c ClusterKey) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", c.Name) - populate(objectMap, "type", c.Type) + populate(objectMap, "orderBy", c.OrderBy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest. -func (c *CheckNameAvailabilityRequest) 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) @@ -1728,8 +1583,8 @@ func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "orderBy": + err = unpopulate(val, "OrderBy", &c.OrderBy) delete(rawMsg, key) } if err != nil { @@ -1739,17 +1594,21 @@ func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse. -func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterResource. +func (c ClusterResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "message", c.Message) - populate(objectMap, "nameAvailable", c.NameAvailable) - populate(objectMap, "reason", c.Reason) + 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 CheckNameAvailabilityResponse. -func (c *CheckNameAvailabilityResponse) 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) @@ -1757,14 +1616,26 @@ func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "message": - err = unpopulate(val, "Message", &c.Message) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "nameAvailable": - err = unpopulate(val, "NameAvailable", &c.NameAvailable) + 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 "reason": - err = unpopulate(val, "Reason", &c.Reason) + 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 { @@ -1774,18 +1645,32 @@ func (c *CheckNameAvailabilityResponse) 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 ClusterResourceProperties. +func (c ClusterResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientEncryptionKeyId", c.ClientEncryptionKeyID) - populate(objectMap, "encryptionAlgorithm", c.EncryptionAlgorithm) - populate(objectMap, "encryptionType", c.EncryptionType) - populate(objectMap, "path", c.Path) + 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, "provisionError", c.ProvisionError) + 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 ClientEncryptionIncludedPath. -func (c *ClientEncryptionIncludedPath) UnmarshalJSON(data []byte) error { +// 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) @@ -1793,17 +1678,59 @@ 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 "authenticationMethod": + err = unpopulate(val, "AuthenticationMethod", &c.AuthenticationMethod) delete(rawMsg, key) - case "encryptionAlgorithm": - err = unpopulate(val, "EncryptionAlgorithm", &c.EncryptionAlgorithm) + case "cassandraAuditLoggingEnabled": + err = unpopulate(val, "CassandraAuditLoggingEnabled", &c.CassandraAuditLoggingEnabled) delete(rawMsg, key) - case "encryptionType": - err = unpopulate(val, "EncryptionType", &c.EncryptionType) + case "cassandraVersion": + err = unpopulate(val, "CassandraVersion", &c.CassandraVersion) delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &c.Path) + 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 "provisionError": + err = unpopulate(val, "ProvisionError", &c.ProvisionError) + 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 "seedNodes": + err = unpopulate(val, "SeedNodes", &c.SeedNodes) delete(rawMsg, key) } if err != nil { @@ -1813,15 +1740,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 Column. +func (c Column) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) 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 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) @@ -1829,8 +1757,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 "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -1840,15 +1771,15 @@ 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 CommandOutput. +func (c CommandOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "resource", c.Resource) + populate(objectMap, "commandOutput", c.CommandOutput) 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 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) @@ -1856,8 +1787,8 @@ 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 "commandOutput": + err = unpopulate(val, "CommandOutput", &c.CommandOutput) delete(rawMsg, key) } if err != nil { @@ -1867,15 +1798,19 @@ func (c *ClientEncryptionKeyCreateUpdateProperties) UnmarshalJSON(data []byte) e 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 CommandPostBody. +func (c CommandPostBody) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "resource", c.Resource) + 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 ClientEncryptionKeyGetProperties. -func (c *ClientEncryptionKeyGetProperties) 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) @@ -1883,8 +1818,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 "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 "host": + err = unpopulate(val, "Host", &c.Host) + delete(rawMsg, key) + case "readwrite": + err = unpopulate(val, "Readwrite", &c.Readwrite) delete(rawMsg, key) } if err != nil { @@ -1894,21 +1841,16 @@ 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 Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. +func (c Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "clientId", c.ClientID) + populate(objectMap, "principalId", c.PrincipalID) 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 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) @@ -1916,26 +1858,11 @@ 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) + case "clientId": + err = unpopulate(val, "ClientID", &c.ClientID) 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) - delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &c.Ts) - delete(rawMsg, key) - case "wrappedDataEncryptionKey": - err = runtime.DecodeByteArray(string(val), &c.WrappedDataEncryptionKey, runtime.Base64StdFormat) + case "principalId": + err = unpopulate(val, "PrincipalID", &c.PrincipalID) delete(rawMsg, key) } if err != nil { @@ -1945,18 +1872,31 @@ 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 ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems. +func (c ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) + populate(objectMap, "address", c.Address) + populate(objectMap, "cpuUsage", c.CPUUsage) + populate(objectMap, "cassandraProcessStatus", c.CassandraProcessStatus) + 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 ClientEncryptionKeyGetResults. -func (c *ClientEncryptionKeyGetResults) 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) @@ -1964,17 +1904,56 @@ 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 "address": + err = unpopulate(val, "Address", &c.Address) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "cpuUsage": + err = unpopulate(val, "CPUUsage", &c.CPUUsage) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "cassandraProcessStatus": + err = unpopulate(val, "CassandraProcessStatus", &c.CassandraProcessStatus) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "diskFreeKB": + err = unpopulate(val, "DiskFreeKB", &c.DiskFreeKB) + delete(rawMsg, key) + case "diskUsedKB": + err = unpopulate(val, "DiskUsedKB", &c.DiskUsedKB) + delete(rawMsg, key) + 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 { @@ -1984,18 +1963,16 @@ 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 CompositePath. +func (c CompositePath) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "encryptionAlgorithm", c.EncryptionAlgorithm) - populate(objectMap, "id", c.ID) - populate(objectMap, "keyWrapMetadata", c.KeyWrapMetadata) - populateByteArray(objectMap, "wrappedDataEncryptionKey", c.WrappedDataEncryptionKey, runtime.Base64StdFormat) + populate(objectMap, "order", c.Order) + populate(objectMap, "path", c.Path) 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 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) @@ -2003,17 +1980,11 @@ 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) + case "order": + err = unpopulate(val, "Order", &c.Order) delete(rawMsg, key) - case "wrappedDataEncryptionKey": - err = runtime.DecodeByteArray(string(val), &c.WrappedDataEncryptionKey, runtime.Base64StdFormat) + case "path": + err = unpopulate(val, "Path", &c.Path) delete(rawMsg, key) } if err != nil { @@ -2023,15 +1994,16 @@ 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 ComputedProperty. +func (c ComputedProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", c.Value) + populate(objectMap, "name", c.Name) + populate(objectMap, "query", c.Query) 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 ComputedProperty. +func (c *ComputedProperty) 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) @@ -2039,8 +2011,11 @@ 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 "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &c.Query) delete(rawMsg, key) } if err != nil { @@ -2050,16 +2025,17 @@ 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 ConflictResolutionPolicy. +func (c ConflictResolutionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "includedPaths", c.IncludedPaths) - populate(objectMap, "policyFormatVersion", c.PolicyFormatVersion) + 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 ClientEncryptionPolicy. -func (c *ClientEncryptionPolicy) 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) @@ -2067,11 +2043,14 @@ 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 "conflictResolutionPath": + err = unpopulate(val, "ConflictResolutionPath", &c.ConflictResolutionPath) delete(rawMsg, key) - case "policyFormatVersion": - err = unpopulate(val, "PolicyFormatVersion", &c.PolicyFormatVersion) + 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 { @@ -2081,16 +2060,19 @@ func (c *ClientEncryptionPolicy) 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 ConnectionError. +func (c ConnectionError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "orderBy", c.OrderBy) + 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 ClusterKey. -func (c *ClusterKey) 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) @@ -2098,11 +2080,20 @@ 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 "connectionState": + err = unpopulate(val, "ConnectionState", &c.ConnectionState) delete(rawMsg, key) - case "orderBy": - err = unpopulate(val, "OrderBy", &c.OrderBy) + 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 { @@ -2112,21 +2103,17 @@ 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 ConsistencyPolicy. +func (c ConsistencyPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "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 ClusterResource. -func (c *ClusterResource) 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) @@ -2134,26 +2121,14 @@ func (c *ClusterResource) 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) + case "defaultConsistencyLevel": + err = unpopulate(val, "DefaultConsistencyLevel", &c.DefaultConsistencyLevel) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "maxIntervalInSeconds": + err = unpopulate(val, "MaxIntervalInSeconds", &c.MaxIntervalInSeconds) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "maxStalenessPrefix": + err = unpopulate(val, "MaxStalenessPrefix", &c.MaxStalenessPrefix) delete(rawMsg, key) } if err != nil { @@ -2163,32 +2138,18 @@ func (c *ClusterResource) UnmarshalJSON(data []byte) error { 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 ContainerPartitionKey. +func (c ContainerPartitionKey) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "provisionError", c.ProvisionError) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "repairEnabled", c.RepairEnabled) - populate(objectMap, "restoreFromBackupId", c.RestoreFromBackupID) - populate(objectMap, "seedNodes", c.SeedNodes) + 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 ClusterResourceProperties. -func (c *ClusterResourceProperties) 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) @@ -2196,59 +2157,17 @@ func (c *ClusterResourceProperties) UnmarshalJSON(data []byte) error { 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) - 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 "provisionError": - err = unpopulate(val, "ProvisionError", &c.ProvisionError) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) delete(rawMsg, key) - case "repairEnabled": - err = unpopulate(val, "RepairEnabled", &c.RepairEnabled) + case "paths": + err = unpopulate(val, "Paths", &c.Paths) delete(rawMsg, key) - case "restoreFromBackupId": - err = unpopulate(val, "RestoreFromBackupID", &c.RestoreFromBackupID) + case "systemKey": + err = unpopulate(val, "SystemKey", &c.SystemKey) delete(rawMsg, key) - case "seedNodes": - err = unpopulate(val, "SeedNodes", &c.SeedNodes) + case "version": + err = unpopulate(val, "Version", &c.Version) delete(rawMsg, key) } if err != nil { @@ -2258,16 +2177,15 @@ func (c *ClusterResourceProperties) UnmarshalJSON(data []byte) error { 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 ContinuousBackupInformation. +func (c ContinuousBackupInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "type", c.Type) + populate(objectMap, "latestRestorableTimestamp", c.LatestRestorableTimestamp) 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 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) @@ -2275,11 +2193,8 @@ func (c *Column) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "latestRestorableTimestamp": + err = unpopulate(val, "LatestRestorableTimestamp", &c.LatestRestorableTimestamp) delete(rawMsg, key) } if err != nil { @@ -2289,15 +2204,15 @@ func (c *Column) UnmarshalJSON(data []byte) error { 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 ContinuousBackupRestoreLocation. +func (c ContinuousBackupRestoreLocation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "commandOutput", c.CommandOutput) + populate(objectMap, "location", c.Location) 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 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) @@ -2305,8 +2220,8 @@ func (c *CommandOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "commandOutput": - err = unpopulate(val, "CommandOutput", &c.CommandOutput) + case "location": + err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) } if err != nil { @@ -2316,19 +2231,17 @@ func (c *CommandOutput) UnmarshalJSON(data []byte) error { 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 ContinuousModeBackupPolicy. +func (c ContinuousModeBackupPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 CommandPostBody. -func (c *CommandPostBody) 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) @@ -2336,20 +2249,14 @@ func (c *CommandPostBody) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - 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) + case "continuousModeProperties": + err = unpopulate(val, "ContinuousModeProperties", &c.ContinuousModeProperties) delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &c.Host) + case "migrationState": + err = unpopulate(val, "MigrationState", &c.MigrationState) delete(rawMsg, key) - case "readwrite": - err = unpopulate(val, "Readwrite", &c.Readwrite) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -2359,16 +2266,15 @@ func (c *CommandPostBody) UnmarshalJSON(data []byte) error { 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 ContinuousModeProperties. +func (c ContinuousModeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientId", c.ClientID) - populate(objectMap, "principalId", c.PrincipalID) + populate(objectMap, "tier", c.Tier) 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 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) @@ -2376,11 +2282,8 @@ func (c *Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedide for key, val := range rawMsg { var err error switch key { - case "clientId": - err = unpopulate(val, "ClientID", &c.ClientID) - delete(rawMsg, key) - case "principalId": - err = unpopulate(val, "PrincipalID", &c.PrincipalID) + case "tier": + err = unpopulate(val, "Tier", &c.Tier) delete(rawMsg, key) } if err != nil { @@ -2390,31 +2293,19 @@ func (c *Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedide 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 CorsPolicy. +func (c CorsPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "address", c.Address) - populate(objectMap, "cpuUsage", c.CPUUsage) - populate(objectMap, "cassandraProcessStatus", c.CassandraProcessStatus) - 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, "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 ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems. -func (c *ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems) 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) @@ -2422,56 +2313,20 @@ func (c *ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacenter for key, val := range rawMsg { var err error switch key { - case "address": - err = unpopulate(val, "Address", &c.Address) - delete(rawMsg, key) - case "cpuUsage": - err = unpopulate(val, "CPUUsage", &c.CPUUsage) - delete(rawMsg, key) - case "cassandraProcessStatus": - err = unpopulate(val, "CassandraProcessStatus", &c.CassandraProcessStatus) - delete(rawMsg, key) - case "diskFreeKB": - err = unpopulate(val, "DiskFreeKB", &c.DiskFreeKB) - delete(rawMsg, key) - case "diskUsedKB": - err = unpopulate(val, "DiskUsedKB", &c.DiskUsedKB) - delete(rawMsg, key) - 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) + case "allowedHeaders": + err = unpopulate(val, "AllowedHeaders", &c.AllowedHeaders) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) + case "allowedMethods": + err = unpopulate(val, "AllowedMethods", &c.AllowedMethods) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) + case "allowedOrigins": + err = unpopulate(val, "AllowedOrigins", &c.AllowedOrigins) delete(rawMsg, key) - case "timestamp": - err = unpopulate(val, "Timestamp", &c.Timestamp) + case "exposedHeaders": + err = unpopulate(val, "ExposedHeaders", &c.ExposedHeaders) delete(rawMsg, key) - case "tokens": - err = unpopulate(val, "Tokens", &c.Tokens) + case "maxAgeInSeconds": + err = unpopulate(val, "MaxAgeInSeconds", &c.MaxAgeInSeconds) delete(rawMsg, key) } if err != nil { @@ -2481,16 +2336,16 @@ func (c *ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacenter 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 CreateUpdateOptions. +func (c CreateUpdateOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "order", c.Order) - populate(objectMap, "path", c.Path) + populate(objectMap, "autoscaleSettings", c.AutoscaleSettings) + populate(objectMap, "throughput", c.Throughput) 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 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) @@ -2498,11 +2353,11 @@ func (c *CompositePath) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "order": - err = unpopulate(val, "Order", &c.Order) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &c.Path) + 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 { @@ -2512,4398 +2367,2499 @@ func (c *CompositePath) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConflictResolutionPolicy. -func (c ConflictResolutionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataCenterResource. +func (d DataCenterResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "conflictResolutionPath", c.ConflictResolutionPath) - populate(objectMap, "conflictResolutionProcedure", c.ConflictResolutionProcedure) - populate(objectMap, "mode", c.Mode) + 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 ConflictResolutionPolicy. -func (c *ConflictResolutionPolicy) 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 "conflictResolutionPath": - err = unpopulate(val, "ConflictResolutionPath", &c.ConflictResolutionPath) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "conflictResolutionProcedure": - err = unpopulate(val, "ConflictResolutionProcedure", &c.ConflictResolutionProcedure) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &c.Mode) + 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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectionError. -func (c ConnectionError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataCenterResourceProperties. +func (d DataCenterResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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, "deallocated", d.Deallocated) + 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, "provisionError", d.ProvisionError) + 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 ConnectionError. -func (c *ConnectionError) 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 "connectionState": - err = unpopulate(val, "ConnectionState", &c.ConnectionState) + case "authenticationMethodLdapProperties": + err = unpopulate(val, "AuthenticationMethodLdapProperties", &d.AuthenticationMethodLdapProperties) delete(rawMsg, key) - case "exception": - err = unpopulate(val, "Exception", &c.Exception) + case "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &d.AvailabilityZone) delete(rawMsg, key) - case "iPFrom": - err = unpopulate(val, "IPFrom", &c.IPFrom) + case "backupStorageCustomerKeyUri": + err = unpopulate(val, "BackupStorageCustomerKeyURI", &d.BackupStorageCustomerKeyURI) delete(rawMsg, key) - case "iPTo": - err = unpopulate(val, "IPTo", &c.IPTo) + case "base64EncodedCassandraYamlFragment": + err = unpopulate(val, "Base64EncodedCassandraYamlFragment", &d.Base64EncodedCassandraYamlFragment) delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &c.Port) + case "dataCenterLocation": + err = unpopulate(val, "DataCenterLocation", &d.DataCenterLocation) + delete(rawMsg, key) + case "deallocated": + err = unpopulate(val, "Deallocated", &d.Deallocated) + 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 "provisionError": + err = unpopulate(val, "ProvisionError", &d.ProvisionError) + 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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectionString. -func (c ConnectionString) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataTransferRegionalServiceResource. +func (d DataTransferRegionalServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectionString", c.ConnectionString) - populate(objectMap, "description", c.Description) + 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 ConnectionString. -func (c *ConnectionString) 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 "connectionString": - err = unpopulate(val, "ConnectionString", &c.ConnectionString) + case "location": + err = unpopulate(val, "Location", &d.Location) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) + 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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConsistencyPolicy. -func (c ConsistencyPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataTransferServiceResource. +func (d DataTransferServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "defaultConsistencyLevel", c.DefaultConsistencyLevel) - populate(objectMap, "maxIntervalInSeconds", c.MaxIntervalInSeconds) - populate(objectMap, "maxStalenessPrefix", c.MaxStalenessPrefix) + populate(objectMap, "properties", d.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConsistencyPolicy. -func (c *ConsistencyPolicy) 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 "defaultConsistencyLevel": - err = unpopulate(val, "DefaultConsistencyLevel", &c.DefaultConsistencyLevel) - delete(rawMsg, key) - case "maxIntervalInSeconds": - err = unpopulate(val, "MaxIntervalInSeconds", &c.MaxIntervalInSeconds) - delete(rawMsg, key) - case "maxStalenessPrefix": - err = unpopulate(val, "MaxStalenessPrefix", &c.MaxStalenessPrefix) + 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 ContainerPartitionKey. -func (c ContainerPartitionKey) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataTransferServiceResourceProperties. +func (d DataTransferServiceResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "kind", c.Kind) - populate(objectMap, "paths", c.Paths) - populate(objectMap, "systemKey", c.SystemKey) - populate(objectMap, "version", c.Version) + populateDateTimeRFC3339(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 ContainerPartitionKey. -func (c *ContainerPartitionKey) 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 "kind": - err = unpopulate(val, "Kind", &c.Kind) + case "creationTime": + err = unpopulateDateTimeRFC3339(val, "CreationTime", &d.CreationTime) delete(rawMsg, key) - case "paths": - err = unpopulate(val, "Paths", &c.Paths) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &d.InstanceCount) delete(rawMsg, key) - case "systemKey": - err = unpopulate(val, "SystemKey", &c.SystemKey) + case "instanceSize": + err = unpopulate(val, "InstanceSize", &d.InstanceSize) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &c.Version) + 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]any{} + } + if val != nil { + var aux any + 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 ContinuousBackupInformation. -func (c ContinuousBackupInformation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountConnectionString. +func (d DatabaseAccountConnectionString) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "latestRestorableTimestamp", c.LatestRestorableTimestamp) + populate(objectMap, "connectionString", d.ConnectionString) + populate(objectMap, "description", d.Description) + populate(objectMap, "keyKind", d.KeyKind) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousBackupInformation. -func (c *ContinuousBackupInformation) 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 "latestRestorableTimestamp": - err = unpopulate(val, "LatestRestorableTimestamp", &c.LatestRestorableTimestamp) + case "connectionString": + err = unpopulate(val, "ConnectionString", &d.ConnectionString) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "keyKind": + err = unpopulate(val, "KeyKind", &d.KeyKind) + delete(rawMsg, key) + 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 ContinuousBackupRestoreLocation. -func (c ContinuousBackupRestoreLocation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountCreateUpdateParameters. +func (d DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "location", c.Location) + 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 ContinuousBackupRestoreLocation. -func (c *ContinuousBackupRestoreLocation) 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 "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", &c.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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContinuousModeBackupPolicy. -func (c ContinuousModeBackupPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountCreateUpdateProperties. +func (d DatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "continuousModeProperties", c.ContinuousModeProperties) - populate(objectMap, "migrationState", c.MigrationState) - objectMap["type"] = BackupPolicyTypeContinuous + 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) + populate(objectMap, "customerManagedKeyStatus", d.CustomerManagedKeyStatus) + 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, "enableBurstCapacity", d.EnableBurstCapacity) + 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, "minimalTlsVersion", d.MinimalTLSVersion) + 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 ContinuousModeBackupPolicy. -func (c *ContinuousModeBackupPolicy) 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 "continuousModeProperties": - err = unpopulate(val, "ContinuousModeProperties", &c.ContinuousModeProperties) + case "apiProperties": + err = unpopulate(val, "APIProperties", &d.APIProperties) delete(rawMsg, key) - case "migrationState": - err = unpopulate(val, "MigrationState", &c.MigrationState) + case "analyticalStorageConfiguration": + err = unpopulate(val, "AnalyticalStorageConfiguration", &d.AnalyticalStorageConfiguration) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + 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 "customerManagedKeyStatus": + err = unpopulate(val, "CustomerManagedKeyStatus", &d.CustomerManagedKeyStatus) + 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 "enableAnalyticalStorage": + err = unpopulate(val, "EnableAnalyticalStorage", &d.EnableAnalyticalStorage) + delete(rawMsg, key) + case "enableAutomaticFailover": + err = unpopulate(val, "EnableAutomaticFailover", &d.EnableAutomaticFailover) + delete(rawMsg, key) + case "enableBurstCapacity": + err = unpopulate(val, "EnableBurstCapacity", &d.EnableBurstCapacity) + 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 "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 "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &d.MinimalTLSVersion) + 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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContinuousModeProperties. -func (c ContinuousModeProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountGetProperties. +func (d DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "tier", c.Tier) + 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) + populate(objectMap, "customerManagedKeyStatus", d.CustomerManagedKeyStatus) + 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, "enableBurstCapacity", d.EnableBurstCapacity) + 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, "minimalTlsVersion", d.MinimalTLSVersion) + 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 ContinuousModeProperties. -func (c *ContinuousModeProperties) 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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "tier": - err = unpopulate(val, "Tier", &c.Tier) + case "apiProperties": + err = unpopulate(val, "APIProperties", &d.APIProperties) 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]any) - 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) + case "analyticalStorageConfiguration": + err = unpopulate(val, "AnalyticalStorageConfiguration", &d.AnalyticalStorageConfiguration) delete(rawMsg, key) - case "allowedMethods": - err = unpopulate(val, "AllowedMethods", &c.AllowedMethods) + case "backupPolicy": + d.BackupPolicy, err = unmarshalBackupPolicyClassification(val) delete(rawMsg, key) - case "allowedOrigins": - err = unpopulate(val, "AllowedOrigins", &c.AllowedOrigins) + case "capabilities": + err = unpopulate(val, "Capabilities", &d.Capabilities) delete(rawMsg, key) - case "exposedHeaders": - err = unpopulate(val, "ExposedHeaders", &c.ExposedHeaders) + case "capacity": + err = unpopulate(val, "Capacity", &d.Capacity) delete(rawMsg, key) - case "maxAgeInSeconds": - err = unpopulate(val, "MaxAgeInSeconds", &c.MaxAgeInSeconds) + case "connectorOffer": + err = unpopulate(val, "ConnectorOffer", &d.ConnectorOffer) 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]any) - 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) + case "consistencyPolicy": + err = unpopulate(val, "ConsistencyPolicy", &d.ConsistencyPolicy) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "cors": + err = unpopulate(val, "Cors", &d.Cors) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "createMode": + err = unpopulate(val, "CreateMode", &d.CreateMode) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "customerManagedKeyStatus": + err = unpopulate(val, "CustomerManagedKeyStatus", &d.CustomerManagedKeyStatus) 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]any) - 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) + case "databaseAccountOfferType": + err = unpopulate(val, "DatabaseAccountOfferType", &d.DatabaseAccountOfferType) delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &c.Throughput) + case "defaultIdentity": + err = unpopulate(val, "DefaultIdentity", &d.DefaultIdentity) 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]any) - 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) + case "disableKeyBasedMetadataWriteAccess": + err = unpopulate(val, "DisableKeyBasedMetadataWriteAccess", &d.DisableKeyBasedMetadataWriteAccess) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "documentEndpoint": + err = unpopulate(val, "DocumentEndpoint", &d.DocumentEndpoint) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "enableAnalyticalStorage": + err = unpopulate(val, "EnableAnalyticalStorage", &d.EnableAnalyticalStorage) 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]any) - 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, "deallocated", d.Deallocated) - 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, "provisionError", d.ProvisionError) - 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) + case "enableAutomaticFailover": + err = unpopulate(val, "EnableAutomaticFailover", &d.EnableAutomaticFailover) delete(rawMsg, key) - case "availabilityZone": - err = unpopulate(val, "AvailabilityZone", &d.AvailabilityZone) + case "enableBurstCapacity": + err = unpopulate(val, "EnableBurstCapacity", &d.EnableBurstCapacity) delete(rawMsg, key) - case "backupStorageCustomerKeyUri": - err = unpopulate(val, "BackupStorageCustomerKeyURI", &d.BackupStorageCustomerKeyURI) + case "enableCassandraConnector": + err = unpopulate(val, "EnableCassandraConnector", &d.EnableCassandraConnector) delete(rawMsg, key) - case "base64EncodedCassandraYamlFragment": - err = unpopulate(val, "Base64EncodedCassandraYamlFragment", &d.Base64EncodedCassandraYamlFragment) + case "enableFreeTier": + err = unpopulate(val, "EnableFreeTier", &d.EnableFreeTier) delete(rawMsg, key) - case "dataCenterLocation": - err = unpopulate(val, "DataCenterLocation", &d.DataCenterLocation) + case "enableMultipleWriteLocations": + err = unpopulate(val, "EnableMultipleWriteLocations", &d.EnableMultipleWriteLocations) delete(rawMsg, key) - case "deallocated": - err = unpopulate(val, "Deallocated", &d.Deallocated) + case "enablePartitionMerge": + err = unpopulate(val, "EnablePartitionMerge", &d.EnablePartitionMerge) delete(rawMsg, key) - case "delegatedSubnetId": - err = unpopulate(val, "DelegatedSubnetID", &d.DelegatedSubnetID) + case "failoverPolicies": + err = unpopulate(val, "FailoverPolicies", &d.FailoverPolicies) delete(rawMsg, key) - case "diskCapacity": - err = unpopulate(val, "DiskCapacity", &d.DiskCapacity) + case "ipRules": + err = unpopulate(val, "IPRules", &d.IPRules) delete(rawMsg, key) - case "diskSku": - err = unpopulate(val, "DiskSKU", &d.DiskSKU) + case "instanceId": + err = unpopulate(val, "InstanceID", &d.InstanceID) delete(rawMsg, key) - case "managedDiskCustomerKeyUri": - err = unpopulate(val, "ManagedDiskCustomerKeyURI", &d.ManagedDiskCustomerKeyURI) + case "isVirtualNetworkFilterEnabled": + err = unpopulate(val, "IsVirtualNetworkFilterEnabled", &d.IsVirtualNetworkFilterEnabled) delete(rawMsg, key) - case "nodeCount": - err = unpopulate(val, "NodeCount", &d.NodeCount) + case "keyVaultKeyUri": + err = unpopulate(val, "KeyVaultKeyURI", &d.KeyVaultKeyURI) delete(rawMsg, key) - case "provisionError": - err = unpopulate(val, "ProvisionError", &d.ProvisionError) + case "keysMetadata": + err = unpopulate(val, "KeysMetadata", &d.KeysMetadata) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &d.Locations) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &d.MinimalTLSVersion) + 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 "sku": - err = unpopulate(val, "SKU", &d.SKU) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) delete(rawMsg, key) - case "seedNodes": - err = unpopulate(val, "SeedNodes", &d.SeedNodes) + case "readLocations": + err = unpopulate(val, "ReadLocations", &d.ReadLocations) 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]any) - 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]any) - 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]any) - 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]any) - populate(objectMap, "destination", d.Destination) - populate(objectMap, "error", d.Error) - populate(objectMap, "jobName", d.JobName) - populateDateTimeRFC3339(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 = unpopulateDateTimeRFC3339(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]any) - 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]any) - 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]any) - populateDateTimeRFC3339(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 = unpopulateDateTimeRFC3339(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]any{} - } - if val != nil { - var aux any - 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]any) - populate(objectMap, "connectionString", d.ConnectionString) - populate(objectMap, "description", d.Description) - populate(objectMap, "keyKind", d.KeyKind) - populate(objectMap, "type", d.Type) - 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) - case "keyKind": - err = unpopulate(val, "KeyKind", &d.KeyKind) - 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 DatabaseAccountCreateUpdateParameters. -func (d DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) - 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, "enableBurstCapacity", d.EnableBurstCapacity) - populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) - populate(objectMap, "enableFreeTier", d.EnableFreeTier) - populate(objectMap, "enableMaterializedViews", d.EnableMaterializedViews) - 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, "minimalTlsVersion", d.MinimalTLSVersion) - 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 "enableBurstCapacity": - err = unpopulate(val, "EnableBurstCapacity", &d.EnableBurstCapacity) - 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 "enablePartitionMerge": - err = unpopulate(val, "EnablePartitionMerge", &d.EnablePartitionMerge) - 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 "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &d.MinimalTLSVersion) - 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]any) - 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, "enableBurstCapacity", d.EnableBurstCapacity) - populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) - populate(objectMap, "enableFreeTier", d.EnableFreeTier) - populate(objectMap, "enableMaterializedViews", d.EnableMaterializedViews) - 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, "minimalTlsVersion", d.MinimalTLSVersion) - 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 "enableBurstCapacity": - err = unpopulate(val, "EnableBurstCapacity", &d.EnableBurstCapacity) - 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 "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 "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &d.MinimalTLSVersion) - 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]any) - 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]any) - 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]any) - 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]any) - 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]any) - 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]any) - 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]any) - 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]any) - 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, "enableBurstCapacity", d.EnableBurstCapacity) - populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) - populate(objectMap, "enableFreeTier", d.EnableFreeTier) - populate(objectMap, "enableMaterializedViews", d.EnableMaterializedViews) - 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, "minimalTlsVersion", d.MinimalTLSVersion) - 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 "enableBurstCapacity": - err = unpopulate(val, "EnableBurstCapacity", &d.EnableBurstCapacity) - 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 "enablePartitionMerge": - err = unpopulate(val, "EnablePartitionMerge", &d.EnablePartitionMerge) - 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 "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &d.MinimalTLSVersion) - 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]any) - 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]any) - 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]any) - 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 ErrorAdditionalInfo. -func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateAny(objectMap, "info", e.Info) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. -func (e *ErrorAdditionalInfo) 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 "info": - err = unpopulate(val, "Info", &e.Info) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - 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 ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. -func (e *ErrorDetail) 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 "additionalInfo": - err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) - 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 ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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 ErrorResponseAutoGenerated. -func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated. -func (e *ErrorResponseAutoGenerated) 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 "error": - err = unpopulate(val, "Error", &e.Error) - 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]any) - 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]any) - 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]any) - 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]any) - 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 FirewallRule. -func (f FirewallRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", f.ID) - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "systemData", f.SystemData) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRule. -func (f *FirewallRule) 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 "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &f.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) - 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 FirewallRuleListResult. -func (f FirewallRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", f.NextLink) - populate(objectMap, "value", f.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleListResult. -func (f *FirewallRuleListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &f.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &f.Value) - 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 FirewallRuleProperties. -func (f FirewallRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "endIpAddress", f.EndIPAddress) - populate(objectMap, "provisioningState", f.ProvisioningState) - populate(objectMap, "startIpAddress", f.StartIPAddress) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleProperties. -func (f *FirewallRuleProperties) 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 "endIpAddress": - err = unpopulate(val, "EndIPAddress", &f.EndIPAddress) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) - delete(rawMsg, key) - case "startIpAddress": - err = unpopulate(val, "StartIPAddress", &f.StartIPAddress) - 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]any) - 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]any) - 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]any) - populateDateTimeRFC3339(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 = unpopulateDateTimeRFC3339(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]any{} - } - if val != nil { - var aux any - 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]any) - 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]any) - 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]any) - 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]any) - 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]any) - 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]any) - 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]any) - 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]any) - 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]any) - 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]any) - 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) + case "restoreParameters": + err = unpopulate(val, "RestoreParameters", &d.RestoreParameters) 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]any) - 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) + case "virtualNetworkRules": + err = unpopulate(val, "VirtualNetworkRules", &d.VirtualNetworkRules) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &g.Resource) + 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 GremlinDatabaseGetPropertiesOptions. -func (g GremlinDatabaseGetPropertiesOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountGetResults. +func (d DatabaseAccountGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoscaleSettings", g.AutoscaleSettings) - populate(objectMap, "throughput", g.Throughput) + 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 GremlinDatabaseGetPropertiesOptions. -func (g *GremlinDatabaseGetPropertiesOptions) 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 "autoscaleSettings": - err = unpopulate(val, "AutoscaleSettings", &g.AutoscaleSettings) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &g.Throughput) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) 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]any) - populate(objectMap, "createMode", g.CreateMode) - populate(objectMap, "_etag", g.Etag) - populate(objectMap, "id", g.ID) - populate(objectMap, "restoreParameters", g.RestoreParameters) - 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 "createMode": - err = unpopulate(val, "CreateMode", &g.CreateMode) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) delete(rawMsg, key) - case "_etag": - err = unpopulate(val, "Etag", &g.Etag) + case "location": + err = unpopulate(val, "Location", &d.Location) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &g.ID) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "restoreParameters": - err = unpopulate(val, "RestoreParameters", &g.RestoreParameters) + 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 "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 GremlinDatabaseGetResults. -func (g GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountKeysMetadata. +func (d DatabaseAccountKeysMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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 GremlinDatabaseGetResults. -func (g *GremlinDatabaseGetResults) 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 GremlinDatabaseListResult. -func (g GremlinDatabaseListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListConnectionStringsResult. +func (d DatabaseAccountListConnectionStringsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", g.Value) + populate(objectMap, "connectionStrings", d.ConnectionStrings) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseListResult. -func (g *GremlinDatabaseListResult) 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 GremlinDatabaseResource. -func (g GremlinDatabaseResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListKeysResult. +func (d DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "createMode", g.CreateMode) - populate(objectMap, "id", g.ID) - populate(objectMap, "restoreParameters", g.RestoreParameters) + 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 GremlinDatabaseResource. -func (g *GremlinDatabaseResource) 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 "createMode": - err = unpopulate(val, "CreateMode", &g.CreateMode) + case "primaryMasterKey": + err = unpopulate(val, "PrimaryMasterKey", &d.PrimaryMasterKey) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &g.ID) + case "primaryReadonlyMasterKey": + err = unpopulate(val, "PrimaryReadonlyMasterKey", &d.PrimaryReadonlyMasterKey) delete(rawMsg, key) - case "restoreParameters": - err = unpopulate(val, "RestoreParameters", &g.RestoreParameters) + 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseRestoreResource. -func (g GremlinDatabaseRestoreResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListReadOnlyKeysResult. +func (d DatabaseAccountListReadOnlyKeysResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseName", g.DatabaseName) - populate(objectMap, "graphNames", g.GraphNames) + populate(objectMap, "primaryReadonlyMasterKey", d.PrimaryReadonlyMasterKey) + populate(objectMap, "secondaryReadonlyMasterKey", d.SecondaryReadonlyMasterKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseRestoreResource. -func (g *GremlinDatabaseRestoreResource) 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &g.DatabaseName) + case "primaryReadonlyMasterKey": + err = unpopulate(val, "PrimaryReadonlyMasterKey", &d.PrimaryReadonlyMasterKey) delete(rawMsg, key) - case "graphNames": - err = unpopulate(val, "GraphNames", &g.GraphNames) + 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 GremlinGraphCreateUpdateParameters. -func (g GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountRegenerateKeyParameters. +func (d DatabaseAccountRegenerateKeyParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "keyKind", d.KeyKind) 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) - 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) +// 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GremlinGraphCreateUpdateProperties. -func (g GremlinGraphCreateUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountUpdateParameters. +func (d DatabaseAccountUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "options", g.Options) - populate(objectMap, "resource", g.Resource) + 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 GremlinGraphCreateUpdateProperties. -func (g *GremlinGraphCreateUpdateProperties) 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "options": - err = unpopulate(val, "Options", &g.Options) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &g.Resource) + 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetProperties. -func (g GremlinGraphGetProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountUpdateProperties. +func (d DatabaseAccountUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "options", g.Options) - populate(objectMap, "resource", g.Resource) + 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, "customerManagedKeyStatus", d.CustomerManagedKeyStatus) + 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, "enableBurstCapacity", d.EnableBurstCapacity) + 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, "minimalTlsVersion", d.MinimalTLSVersion) + 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 GremlinGraphGetProperties. -func (g *GremlinGraphGetProperties) 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "options": - err = unpopulate(val, "Options", &g.Options) + case "apiProperties": + err = unpopulate(val, "APIProperties", &d.APIProperties) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &g.Resource) + 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 "customerManagedKeyStatus": + err = unpopulate(val, "CustomerManagedKeyStatus", &d.CustomerManagedKeyStatus) + 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 "enableBurstCapacity": + err = unpopulate(val, "EnableBurstCapacity", &d.EnableBurstCapacity) + 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 "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 "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &d.MinimalTLSVersion) + 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", 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 DatabaseAccountsListResult. +func (d DatabaseAccountsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoscaleSettings", g.AutoscaleSettings) - populate(objectMap, "throughput", g.Throughput) + populate(objectMap, "value", d.Value) 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 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", 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) - delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &g.Throughput) + case "value": + err = unpopulate(val, "Value", &d.Value) 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 DatabaseRestoreResource. +func (d DatabaseRestoreResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "analyticalStorageTtl", g.AnalyticalStorageTTL) - populate(objectMap, "conflictResolutionPolicy", g.ConflictResolutionPolicy) - populate(objectMap, "createMode", g.CreateMode) - 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, "restoreParameters", g.RestoreParameters) - populate(objectMap, "_rid", g.Rid) - populate(objectMap, "_ts", g.Ts) - populate(objectMap, "uniqueKeyPolicy", g.UniqueKeyPolicy) + populate(objectMap, "collectionNames", d.CollectionNames) + populate(objectMap, "databaseName", d.DatabaseName) 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 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", 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 "createMode": - err = unpopulate(val, "CreateMode", &g.CreateMode) - delete(rawMsg, key) - case "defaultTtl": - err = unpopulate(val, "DefaultTTL", &g.DefaultTTL) - delete(rawMsg, key) - case "_etag": - err = unpopulate(val, "Etag", &g.Etag) - 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 "restoreParameters": - err = unpopulate(val, "RestoreParameters", &g.RestoreParameters) - delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &g.Rid) - delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &g.Ts) + case "collectionNames": + err = unpopulate(val, "CollectionNames", &d.CollectionNames) delete(rawMsg, key) - case "uniqueKeyPolicy": - err = unpopulate(val, "UniqueKeyPolicy", &g.UniqueKeyPolicy) + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) 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 ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "code", e.Code) + populate(objectMap, "message", e.Message) 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 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", g, 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", &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) + case "code": + err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) + case "message": + err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, 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 ExcludedPath. +func (e ExcludedPath) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", g.Value) + populate(objectMap, "path", e.Path) 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 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", g, 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", &g.Value) + case "path": + err = unpopulate(val, "Path", &e.Path) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, 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 ExtendedResourceProperties. +func (e ExtendedResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "analyticalStorageTtl", g.AnalyticalStorageTTL) - populate(objectMap, "conflictResolutionPolicy", g.ConflictResolutionPolicy) - populate(objectMap, "createMode", g.CreateMode) - populate(objectMap, "defaultTtl", g.DefaultTTL) - populate(objectMap, "id", g.ID) - populate(objectMap, "indexingPolicy", g.IndexingPolicy) - populate(objectMap, "partitionKey", g.PartitionKey) - populate(objectMap, "restoreParameters", g.RestoreParameters) - populate(objectMap, "uniqueKeyPolicy", g.UniqueKeyPolicy) + 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 GremlinGraphResource. -func (g *GremlinGraphResource) 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, 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 "createMode": - err = unpopulate(val, "CreateMode", &g.CreateMode) - 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) + case "_etag": + err = unpopulate(val, "Etag", &e.Etag) delete(rawMsg, key) - case "restoreParameters": - err = unpopulate(val, "RestoreParameters", &g.RestoreParameters) + case "_rid": + err = unpopulate(val, "Rid", &e.Rid) delete(rawMsg, key) - case "uniqueKeyPolicy": - err = unpopulate(val, "UniqueKeyPolicy", &g.UniqueKeyPolicy) + case "_ts": + err = unpopulate(val, "Ts", &e.Ts) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, 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 FailoverPolicies. +func (f FailoverPolicies) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "ipAddressOrRange", i.IPAddressOrRange) + populate(objectMap, "failoverPolicies", f.FailoverPolicies) 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "ipAddressOrRange": - err = unpopulate(val, "IPAddressOrRange", &i.IPAddressOrRange) + case "failoverPolicies": + err = unpopulate(val, "FailoverPolicies", &f.FailoverPolicies) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FailoverPolicy. +func (f FailoverPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "indexes", i.Indexes) - populate(objectMap, "path", i.Path) + 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 IncludedPath. -func (i *IncludedPath) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "indexes": - err = unpopulate(val, "Indexes", &i.Indexes) + case "failoverPriority": + err = unpopulate(val, "FailoverPriority", &f.FailoverPriority) delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &i.Path) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 GraphAPIComputeRegionalServiceResource. +func (g GraphAPIComputeRegionalServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataType", i.DataType) - populate(objectMap, "kind", i.Kind) - populate(objectMap, "precision", i.Precision) + 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 Indexes. -func (i *Indexes) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "dataType": - err = unpopulate(val, "DataType", &i.DataType) + case "graphApiComputeEndpoint": + err = unpopulate(val, "GraphAPIComputeEndpoint", &g.GraphAPIComputeEndpoint) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &i.Kind) + case "location": + err = unpopulate(val, "Location", &g.Location) delete(rawMsg, key) - case "precision": - err = unpopulate(val, "Precision", &i.Precision) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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 GraphAPIComputeServiceResource. +func (g GraphAPIComputeServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "properties", g.Properties) 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "automatic": - err = unpopulate(val, "Automatic", &i.Automatic) + 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]any) + populateDateTimeRFC3339(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 = unpopulateDateTimeRFC3339(val, "CreationTime", &g.CreationTime) delete(rawMsg, key) - case "compositeIndexes": - err = unpopulate(val, "CompositeIndexes", &i.CompositeIndexes) + case "graphApiComputeEndpoint": + err = unpopulate(val, "GraphAPIComputeEndpoint", &g.GraphAPIComputeEndpoint) delete(rawMsg, key) - case "excludedPaths": - err = unpopulate(val, "ExcludedPaths", &i.ExcludedPaths) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &g.InstanceCount) delete(rawMsg, key) - case "includedPaths": - err = unpopulate(val, "IncludedPaths", &i.IncludedPaths) + case "instanceSize": + err = unpopulate(val, "InstanceSize", &g.InstanceSize) delete(rawMsg, key) - case "indexingMode": - err = unpopulate(val, "IndexingMode", &i.IndexingMode) + case "locations": + err = unpopulate(val, "Locations", &g.Locations) delete(rawMsg, key) - case "spatialIndexes": - err = unpopulate(val, "SpatialIndexes", &i.SpatialIndexes) + 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]any{} + } + if val != nil { + var aux any + err = json.Unmarshal(val, &aux) + g.AdditionalProperties[key] = aux + } delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type KeyWrapMetadata. -func (k KeyWrapMetadata) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseCreateUpdateParameters. +func (g GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "algorithm", k.Algorithm) - populate(objectMap, "name", k.Name) - populate(objectMap, "type", k.Type) - populate(objectMap, "value", k.Value) + 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 KeyWrapMetadata. -func (k *KeyWrapMetadata) 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", k, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "algorithm": - err = unpopulate(val, "Algorithm", &k.Algorithm) + 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", &k.Name) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &k.Type) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &k.Value) + 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", k, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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 GremlinDatabaseCreateUpdateProperties. +func (g GremlinDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", l.Value) + populate(objectMap, "options", g.Options) + populate(objectMap, "resource", g.Resource) 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 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", l, 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", &l.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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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 GremlinDatabaseGetProperties. +func (g GremlinDatabaseGetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", l.Value) + populate(objectMap, "options", g.Options) + populate(objectMap, "resource", g.Resource) 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 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", l, 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", &l.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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ListConnectionStringsResult. -func (l ListConnectionStringsResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetPropertiesOptions. +func (g GremlinDatabaseGetPropertiesOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectionStrings", l.ConnectionStrings) + populate(objectMap, "autoscaleSettings", g.AutoscaleSettings) + populate(objectMap, "throughput", g.Throughput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ListConnectionStringsResult. -func (l *ListConnectionStringsResult) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "connectionStrings": - err = unpopulate(val, "ConnectionStrings", &l.ConnectionStrings) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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 GremlinDatabaseGetPropertiesResource. +func (g GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", l.Value) + populate(objectMap, "createMode", g.CreateMode) + populate(objectMap, "_etag", g.Etag) + populate(objectMap, "id", g.ID) + populate(objectMap, "restoreParameters", g.RestoreParameters) + populate(objectMap, "_rid", g.Rid) + populate(objectMap, "_ts", g.Ts) 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 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", l, 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", &l.Value) + case "createMode": + err = unpopulate(val, "CreateMode", &g.CreateMode) + delete(rawMsg, key) + case "_etag": + err = unpopulate(val, "Etag", &g.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "restoreParameters": + err = unpopulate(val, "RestoreParameters", &g.RestoreParameters) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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 GremlinDatabaseGetResults. +func (g GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "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 Location. -func (l *Location) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "documentEndpoint": - err = unpopulate(val, "DocumentEndpoint", &l.DocumentEndpoint) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "failoverPriority": - err = unpopulate(val, "FailoverPriority", &l.FailoverPriority) + case "location": + err = unpopulate(val, "Location", &g.Location) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &l.ID) + case "name": + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "isZoneRedundant": - err = unpopulate(val, "IsZoneRedundant", &l.IsZoneRedundant) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) - case "locationName": - err = unpopulate(val, "LocationName", &l.LocationName) + case "tags": + err = unpopulate(val, "Tags", &g.Tags) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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 GremlinDatabaseListResult. +func (g GremlinDatabaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "type", l.Type) + populate(objectMap, "value", g.Value) 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 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", l, 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", &l.ID) - delete(rawMsg, key) - 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) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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 GremlinDatabaseResource. +func (g GremlinDatabaseResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", l.Value) + populate(objectMap, "createMode", g.CreateMode) + populate(objectMap, "id", g.ID) + populate(objectMap, "restoreParameters", g.RestoreParameters) 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 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", l, 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", &l.Value) + case "createMode": + err = unpopulate(val, "CreateMode", &g.CreateMode) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "restoreParameters": + err = unpopulate(val, "RestoreParameters", &g.RestoreParameters) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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 GremlinDatabaseRestoreResource. +func (g GremlinDatabaseRestoreResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupStorageRedundancies", l.BackupStorageRedundancies) - populate(objectMap, "isResidencyRestricted", l.IsResidencyRestricted) - populate(objectMap, "isSubscriptionRegionAccessAllowedForAz", l.IsSubscriptionRegionAccessAllowedForAz) - populate(objectMap, "isSubscriptionRegionAccessAllowedForRegular", l.IsSubscriptionRegionAccessAllowedForRegular) - populate(objectMap, "status", l.Status) - populate(objectMap, "supportsAvailabilityZone", l.SupportsAvailabilityZone) + populate(objectMap, "databaseName", g.DatabaseName) + populate(objectMap, "graphNames", g.GraphNames) 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 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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) - delete(rawMsg, key) - case "isSubscriptionRegionAccessAllowedForAz": - err = unpopulate(val, "IsSubscriptionRegionAccessAllowedForAz", &l.IsSubscriptionRegionAccessAllowedForAz) - delete(rawMsg, key) - case "isSubscriptionRegionAccessAllowedForRegular": - err = unpopulate(val, "IsSubscriptionRegionAccessAllowedForRegular", &l.IsSubscriptionRegionAccessAllowedForRegular) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &l.Status) + case "databaseName": + err = unpopulate(val, "DatabaseName", &g.DatabaseName) delete(rawMsg, key) - case "supportsAvailabilityZone": - err = unpopulate(val, "SupportsAvailabilityZone", &l.SupportsAvailabilityZone) + case "graphNames": + err = unpopulate(val, "GraphNames", &g.GraphNames) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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 GremlinGraphCreateUpdateParameters. +func (g GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "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 ManagedCassandraARMResourceProperties. -func (m *ManagedCassandraARMResourceProperties) 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 "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", &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 ManagedCassandraManagedServiceIdentity. -func (m ManagedCassandraManagedServiceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphCreateUpdateProperties. +func (g GremlinGraphCreateUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) + populate(objectMap, "options", g.Options) + populate(objectMap, "resource", g.Resource) 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 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 "principalId": - err = unpopulate(val, "PrincipalID", &m.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &m.TenantID) + case "options": + err = unpopulate(val, "Options", &g.Options) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + 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 ManagedCassandraReaperStatus. -func (m ManagedCassandraReaperStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetProperties. +func (g GremlinGraphGetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "healthy", m.Healthy) - populate(objectMap, "repairRunIds", m.RepairRunIDs) - populate(objectMap, "repairSchedules", m.RepairSchedules) + populate(objectMap, "options", g.Options) + populate(objectMap, "resource", g.Resource) 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 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 "healthy": - err = unpopulate(val, "Healthy", &m.Healthy) - delete(rawMsg, key) - case "repairRunIds": - err = unpopulate(val, "RepairRunIDs", &m.RepairRunIDs) + case "options": + err = unpopulate(val, "Options", &g.Options) delete(rawMsg, key) - case "repairSchedules": - err = unpopulate(val, "RepairSchedules", &m.RepairSchedules) + 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 ManagedServiceIdentity. -func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetPropertiesOptions. +func (g GremlinGraphGetPropertiesOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) - populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + populate(objectMap, "autoscaleSettings", g.AutoscaleSettings) + populate(objectMap, "throughput", g.Throughput) 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 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 "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 "autoscaleSettings": + err = unpopulate(val, "AutoscaleSettings", &g.AutoscaleSettings) delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + 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 MaterializedViewDefinition. -func (m MaterializedViewDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetPropertiesResource. +func (g GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "definition", m.Definition) - populate(objectMap, "sourceCollectionId", m.SourceCollectionID) - populate(objectMap, "sourceCollectionRid", m.SourceCollectionRid) + populate(objectMap, "analyticalStorageTtl", g.AnalyticalStorageTTL) + populate(objectMap, "conflictResolutionPolicy", g.ConflictResolutionPolicy) + populate(objectMap, "createMode", g.CreateMode) + 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, "restoreParameters", g.RestoreParameters) + 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 MaterializedViewDefinition. -func (m *MaterializedViewDefinition) 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 "definition": - err = unpopulate(val, "Definition", &m.Definition) + case "analyticalStorageTtl": + err = unpopulate(val, "AnalyticalStorageTTL", &g.AnalyticalStorageTTL) + delete(rawMsg, key) + case "conflictResolutionPolicy": + err = unpopulate(val, "ConflictResolutionPolicy", &g.ConflictResolutionPolicy) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &g.CreateMode) + delete(rawMsg, key) + case "defaultTtl": + err = unpopulate(val, "DefaultTTL", &g.DefaultTTL) + delete(rawMsg, key) + case "_etag": + err = unpopulate(val, "Etag", &g.Etag) + 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 "restoreParameters": + err = unpopulate(val, "RestoreParameters", &g.RestoreParameters) + delete(rawMsg, key) + case "_rid": + err = unpopulate(val, "Rid", &g.Rid) delete(rawMsg, key) - case "sourceCollectionId": - err = unpopulate(val, "SourceCollectionID", &m.SourceCollectionID) + case "_ts": + err = unpopulate(val, "Ts", &g.Ts) delete(rawMsg, key) - case "sourceCollectionRid": - err = unpopulate(val, "SourceCollectionRid", &m.SourceCollectionRid) + 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 MaterializedViewsBuilderRegionalServiceResource. -func (m MaterializedViewsBuilderRegionalServiceResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetResults. +func (g GremlinGraphGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "status", m.Status) + 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 MaterializedViewsBuilderRegionalServiceResource. -func (m *MaterializedViewsBuilderRegionalServiceResource) 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", &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 "status": - err = unpopulate(val, "Status", &m.Status) + 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 MaterializedViewsBuilderServiceResource. -func (m MaterializedViewsBuilderServiceResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphListResult. +func (g GremlinGraphListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", m.Properties) + populate(objectMap, "value", g.Value) 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 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 "properties": - err = unpopulate(val, "Properties", &m.Properties) + 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 MaterializedViewsBuilderServiceResourceProperties. -func (m MaterializedViewsBuilderServiceResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphResource. +func (g GremlinGraphResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(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, "analyticalStorageTtl", g.AnalyticalStorageTTL) + populate(objectMap, "conflictResolutionPolicy", g.ConflictResolutionPolicy) + populate(objectMap, "createMode", g.CreateMode) + populate(objectMap, "defaultTtl", g.DefaultTTL) + populate(objectMap, "id", g.ID) + populate(objectMap, "indexingPolicy", g.IndexingPolicy) + populate(objectMap, "partitionKey", g.PartitionKey) + populate(objectMap, "restoreParameters", g.RestoreParameters) + populate(objectMap, "uniqueKeyPolicy", g.UniqueKeyPolicy) 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 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 "creationTime": - err = unpopulateDateTimeRFC3339(val, "CreationTime", &m.CreationTime) + case "analyticalStorageTtl": + err = unpopulate(val, "AnalyticalStorageTTL", &g.AnalyticalStorageTTL) delete(rawMsg, key) - case "instanceCount": - err = unpopulate(val, "InstanceCount", &m.InstanceCount) + case "conflictResolutionPolicy": + err = unpopulate(val, "ConflictResolutionPolicy", &g.ConflictResolutionPolicy) delete(rawMsg, key) - case "instanceSize": - err = unpopulate(val, "InstanceSize", &m.InstanceSize) + case "createMode": + err = unpopulate(val, "CreateMode", &g.CreateMode) delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &m.Locations) + case "defaultTtl": + err = unpopulate(val, "DefaultTTL", &g.DefaultTTL) delete(rawMsg, key) - case "serviceType": - err = unpopulate(val, "ServiceType", &m.ServiceType) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "indexingPolicy": + err = unpopulate(val, "IndexingPolicy", &g.IndexingPolicy) delete(rawMsg, key) - default: - if m.AdditionalProperties == nil { - m.AdditionalProperties = map[string]any{} - } - if val != nil { - var aux any - err = json.Unmarshal(val, &aux) - m.AdditionalProperties[key] = aux - } + case "partitionKey": + err = unpopulate(val, "PartitionKey", &g.PartitionKey) + delete(rawMsg, key) + case "restoreParameters": + err = unpopulate(val, "RestoreParameters", &g.RestoreParameters) + 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 MergeParameters. -func (m MergeParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IPAddressOrRange. +func (i IPAddressOrRange) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isDryRun", m.IsDryRun) + populate(objectMap, "ipAddressOrRange", i.IPAddressOrRange) 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 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 "isDryRun": - err = unpopulate(val, "IsDryRun", &m.IsDryRun) + 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 Metric. -func (m Metric) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IncludedPath. +func (i IncludedPath) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endTime", m.EndTime) - populate(objectMap, "metricValues", m.MetricValues) - populate(objectMap, "name", m.Name) - populateDateTimeRFC3339(objectMap, "startTime", m.StartTime) - populate(objectMap, "timeGrain", m.TimeGrain) - populate(objectMap, "unit", m.Unit) + populate(objectMap, "indexes", i.Indexes) + populate(objectMap, "path", i.Path) 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 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 "endTime": - err = unpopulateDateTimeRFC3339(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 "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &m.StartTime) - delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &m.TimeGrain) + case "indexes": + err = unpopulate(val, "Indexes", &i.Indexes) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) + 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 MetricAvailability. -func (m MetricAvailability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Indexes. +func (i Indexes) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "retention", m.Retention) - populate(objectMap, "timeGrain", m.TimeGrain) + 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 MetricAvailability. -func (m *MetricAvailability) 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 "retention": - err = unpopulate(val, "Retention", &m.Retention) + case "dataType": + err = unpopulate(val, "DataType", &i.DataType) delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &m.TimeGrain) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + 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 MetricDefinition. -func (m MetricDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IndexingPolicy. +func (i IndexingPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "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 MetricDefinition. -func (m *MetricDefinition) 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 "metricAvailabilities": - err = unpopulate(val, "MetricAvailabilities", &m.MetricAvailabilities) + case "automatic": + err = unpopulate(val, "Automatic", &i.Automatic) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "compositeIndexes": + err = unpopulate(val, "CompositeIndexes", &i.CompositeIndexes) delete(rawMsg, key) - case "primaryAggregationType": - err = unpopulate(val, "PrimaryAggregationType", &m.PrimaryAggregationType) + case "excludedPaths": + err = unpopulate(val, "ExcludedPaths", &i.ExcludedPaths) delete(rawMsg, key) - case "resourceUri": - err = unpopulate(val, "ResourceURI", &m.ResourceURI) + case "includedPaths": + err = unpopulate(val, "IncludedPaths", &i.IncludedPaths) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) + 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 MetricDefinitionsListResult. -func (m MetricDefinitionsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KeyWrapMetadata. +func (k KeyWrapMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", m.Value) + 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 MetricDefinitionsListResult. -func (m *MetricDefinitionsListResult) UnmarshalJSON(data []byte) error { +// 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", m, err) + 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) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &k.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &k.Type) + delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &m.Value) + err = unpopulate(val, "Value", &k.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", k, 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 ListClusters. +func (l ListClusters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", m.Value) + populate(objectMap, "value", l.Value) 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 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 "value": - err = unpopulate(val, "Value", &m.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 MetricName. -func (m MetricName) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ListDataCenters. +func (l ListDataCenters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "localizedValue", m.LocalizedValue) - populate(objectMap, "value", m.Value) + populate(objectMap, "value", l.Value) 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 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 "localizedValue": - err = unpopulate(val, "LocalizedValue", &m.LocalizedValue) - delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &m.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 MetricValue. -func (m MetricValue) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Location. +func (l Location) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "average", m.Average) - populate(objectMap, "_count", m.Count) - populate(objectMap, "maximum", m.Maximum) - populate(objectMap, "minimum", m.Minimum) - populateDateTimeRFC3339(objectMap, "timestamp", m.Timestamp) - populate(objectMap, "total", m.Total) + 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 MetricValue. -func (m *MetricValue) 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 "average": - err = unpopulate(val, "Average", &m.Average) + case "documentEndpoint": + err = unpopulate(val, "DocumentEndpoint", &l.DocumentEndpoint) delete(rawMsg, key) - case "_count": - err = unpopulate(val, "Count", &m.Count) + case "failoverPriority": + err = unpopulate(val, "FailoverPriority", &l.FailoverPriority) delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &m.Maximum) + case "id": + err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &m.Minimum) + case "isZoneRedundant": + err = unpopulate(val, "IsZoneRedundant", &l.IsZoneRedundant) delete(rawMsg, key) - case "timestamp": - err = unpopulateDateTimeRFC3339(val, "Timestamp", &m.Timestamp) + case "locationName": + err = unpopulate(val, "LocationName", &l.LocationName) delete(rawMsg, key) - case "total": - err = unpopulate(val, "Total", &m.Total) + 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 MongoCluster. -func (m MongoCluster) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocationGetResult. +func (l LocationGetResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) + 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 MongoCluster. -func (m *MongoCluster) 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 "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) + err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &m.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 MongoClusterListResult. -func (m MongoClusterListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocationListResult. +func (l LocationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoClusterListResult. -func (m *MongoClusterListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) - delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &m.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 MongoClusterProperties. -func (m MongoClusterProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocationProperties. +func (l LocationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administratorLogin", m.AdministratorLogin) - populate(objectMap, "administratorLoginPassword", m.AdministratorLoginPassword) - populate(objectMap, "clusterStatus", m.ClusterStatus) - populate(objectMap, "connectionString", m.ConnectionString) - populate(objectMap, "createMode", m.CreateMode) - populate(objectMap, "earliestRestoreTime", m.EarliestRestoreTime) - populate(objectMap, "nodeGroupSpecs", m.NodeGroupSpecs) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "restoreParameters", m.RestoreParameters) - populate(objectMap, "serverVersion", m.ServerVersion) + populate(objectMap, "backupStorageRedundancies", l.BackupStorageRedundancies) + populate(objectMap, "isResidencyRestricted", l.IsResidencyRestricted) + populate(objectMap, "isSubscriptionRegionAccessAllowedForAz", l.IsSubscriptionRegionAccessAllowedForAz) + populate(objectMap, "isSubscriptionRegionAccessAllowedForRegular", l.IsSubscriptionRegionAccessAllowedForRegular) + populate(objectMap, "status", l.Status) + populate(objectMap, "supportsAvailabilityZone", l.SupportsAvailabilityZone) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoClusterProperties. -func (m *MongoClusterProperties) 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 "administratorLogin": - err = unpopulate(val, "AdministratorLogin", &m.AdministratorLogin) - delete(rawMsg, key) - case "administratorLoginPassword": - err = unpopulate(val, "AdministratorLoginPassword", &m.AdministratorLoginPassword) - delete(rawMsg, key) - case "clusterStatus": - err = unpopulate(val, "ClusterStatus", &m.ClusterStatus) - delete(rawMsg, key) - case "connectionString": - err = unpopulate(val, "ConnectionString", &m.ConnectionString) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &m.CreateMode) + case "backupStorageRedundancies": + err = unpopulate(val, "BackupStorageRedundancies", &l.BackupStorageRedundancies) delete(rawMsg, key) - case "earliestRestoreTime": - err = unpopulate(val, "EarliestRestoreTime", &m.EarliestRestoreTime) + case "isResidencyRestricted": + err = unpopulate(val, "IsResidencyRestricted", &l.IsResidencyRestricted) delete(rawMsg, key) - case "nodeGroupSpecs": - err = unpopulate(val, "NodeGroupSpecs", &m.NodeGroupSpecs) + case "isSubscriptionRegionAccessAllowedForAz": + err = unpopulate(val, "IsSubscriptionRegionAccessAllowedForAz", &l.IsSubscriptionRegionAccessAllowedForAz) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + case "isSubscriptionRegionAccessAllowedForRegular": + err = unpopulate(val, "IsSubscriptionRegionAccessAllowedForRegular", &l.IsSubscriptionRegionAccessAllowedForRegular) delete(rawMsg, key) - case "restoreParameters": - err = unpopulate(val, "RestoreParameters", &m.RestoreParameters) + case "status": + err = unpopulate(val, "Status", &l.Status) delete(rawMsg, key) - case "serverVersion": - err = unpopulate(val, "ServerVersion", &m.ServerVersion) + 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 MongoClusterRestoreParameters. -func (m MongoClusterRestoreParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedCassandraARMResourceProperties. +func (m ManagedCassandraARMResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "pointInTimeUTC", m.PointInTimeUTC) - populate(objectMap, "sourceResourceId", m.SourceResourceID) + 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) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoClusterRestoreParameters. -func (m *MongoClusterRestoreParameters) 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) @@ -6911,43 +4867,24 @@ func (m *MongoClusterRestoreParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "pointInTimeUTC": - err = unpopulateDateTimeRFC3339(val, "PointInTimeUTC", &m.PointInTimeUTC) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &m.SourceResourceID) + case "identity": + err = unpopulate(val, "Identity", &m.Identity) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MongoClusterUpdate. -func (m MongoClusterUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoClusterUpdate. -func (m *MongoClusterUpdate) 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) 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", m, err) @@ -6956,21 +4893,17 @@ func (m *MongoClusterUpdate) UnmarshalJSON(data []byte) error { 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 ManagedCassandraManagedServiceIdentity. +func (m ManagedCassandraManagedServiceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "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 MongoDBCollectionCreateUpdateParameters. -func (m *MongoDBCollectionCreateUpdateParameters) 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) @@ -6978,23 +4911,11 @@ func (m *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(data []byte) 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 "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &m.Type) @@ -7007,16 +4928,17 @@ func (m *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(data []byte) 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 ManagedCassandraReaperStatus. +func (m ManagedCassandraReaperStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "options", m.Options) - populate(objectMap, "resource", m.Resource) + 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 MongoDBCollectionCreateUpdateProperties. -func (m *MongoDBCollectionCreateUpdateProperties) 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) @@ -7024,11 +4946,14 @@ func (m *MongoDBCollectionCreateUpdateProperties) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { - case "options": - err = unpopulate(val, "Options", &m.Options) + case "healthy": + err = unpopulate(val, "Healthy", &m.Healthy) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &m.Resource) + 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 { @@ -7038,16 +4963,18 @@ func (m *MongoDBCollectionCreateUpdateProperties) UnmarshalJSON(data []byte) 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 ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "options", m.Options) - populate(objectMap, "resource", m.Resource) + 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 MongoDBCollectionGetProperties. -func (m *MongoDBCollectionGetProperties) 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) @@ -7055,11 +4982,17 @@ func (m *MongoDBCollectionGetProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "options": - err = unpopulate(val, "Options", &m.Options) + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &m.Resource) + 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 { @@ -7069,16 +5002,17 @@ func (m *MongoDBCollectionGetProperties) UnmarshalJSON(data []byte) error { 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 MaterializedViewsBuilderRegionalServiceResource. +func (m MaterializedViewsBuilderRegionalServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoscaleSettings", m.AutoscaleSettings) - populate(objectMap, "throughput", m.Throughput) + 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 MongoDBCollectionGetPropertiesOptions. -func (m *MongoDBCollectionGetPropertiesOptions) 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) @@ -7086,11 +5020,14 @@ func (m *MongoDBCollectionGetPropertiesOptions) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "autoscaleSettings": - err = unpopulate(val, "AutoscaleSettings", &m.AutoscaleSettings) + case "location": + err = unpopulate(val, "Location", &m.Location) delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &m.Throughput) + 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 { @@ -7100,23 +5037,15 @@ func (m *MongoDBCollectionGetPropertiesOptions) UnmarshalJSON(data []byte) error 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 MaterializedViewsBuilderServiceResource. +func (m MaterializedViewsBuilderServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "analyticalStorageTtl", m.AnalyticalStorageTTL) - populate(objectMap, "createMode", m.CreateMode) - populate(objectMap, "_etag", m.Etag) - populate(objectMap, "id", m.ID) - populate(objectMap, "indexes", m.Indexes) - populate(objectMap, "restoreParameters", m.RestoreParameters) - populate(objectMap, "_rid", m.Rid) - populate(objectMap, "shardKey", m.ShardKey) - populate(objectMap, "_ts", m.Ts) + populate(objectMap, "properties", m.Properties) 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 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) @@ -7124,32 +5053,8 @@ func (m *MongoDBCollectionGetPropertiesResource) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "analyticalStorageTtl": - err = unpopulate(val, "AnalyticalStorageTTL", &m.AnalyticalStorageTTL) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &m.CreateMode) - 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 "restoreParameters": - err = unpopulate(val, "RestoreParameters", &m.RestoreParameters) - 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) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) } if err != nil { @@ -7159,21 +5064,25 @@ func (m *MongoDBCollectionGetPropertiesResource) UnmarshalJSON(data []byte) erro 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 MaterializedViewsBuilderServiceResourceProperties. +func (m MaterializedViewsBuilderServiceResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populateDateTimeRFC3339(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 MongoDBCollectionGetResults. -func (m *MongoDBCollectionGetResults) 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) @@ -7181,26 +5090,33 @@ func (m *MongoDBCollectionGetResults) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) + case "creationTime": + err = unpopulateDateTimeRFC3339(val, "CreationTime", &m.CreationTime) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &m.Identity) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &m.InstanceCount) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) + case "instanceSize": + err = unpopulate(val, "InstanceSize", &m.InstanceSize) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "locations": + err = unpopulate(val, "Locations", &m.Locations) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "serviceType": + err = unpopulate(val, "ServiceType", &m.ServiceType) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + case "status": + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + default: + if m.AdditionalProperties == nil { + m.AdditionalProperties = map[string]any{} + } + if val != nil { + var aux any + err = json.Unmarshal(val, &aux) + m.AdditionalProperties[key] = aux + } delete(rawMsg, key) } if err != nil { @@ -7210,15 +5126,20 @@ func (m *MongoDBCollectionGetResults) UnmarshalJSON(data []byte) error { 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 Metric. +func (m Metric) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", m.Value) + populateDateTimeRFC3339(objectMap, "endTime", m.EndTime) + populate(objectMap, "metricValues", m.MetricValues) + populate(objectMap, "name", m.Name) + populateDateTimeRFC3339(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 MongoDBCollectionListResult. -func (m *MongoDBCollectionListResult) 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) @@ -7226,8 +5147,23 @@ func (m *MongoDBCollectionListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + case "endTime": + err = unpopulateDateTimeRFC3339(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 "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &m.StartTime) + delete(rawMsg, key) + 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 { @@ -7237,44 +5173,28 @@ func (m *MongoDBCollectionListResult) UnmarshalJSON(data []byte) error { 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 MetricAvailability. +func (m MetricAvailability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "analyticalStorageTtl", m.AnalyticalStorageTTL) - populate(objectMap, "createMode", m.CreateMode) - populate(objectMap, "id", m.ID) - populate(objectMap, "indexes", m.Indexes) - populate(objectMap, "restoreParameters", m.RestoreParameters) - populate(objectMap, "shardKey", m.ShardKey) + populate(objectMap, "retention", m.Retention) + populate(objectMap, "timeGrain", m.TimeGrain) 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 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) } - for key, val := range rawMsg { - var err error - switch key { - case "analyticalStorageTtl": - err = unpopulate(val, "AnalyticalStorageTTL", &m.AnalyticalStorageTTL) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &m.CreateMode) - 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 "restoreParameters": - err = unpopulate(val, "RestoreParameters", &m.RestoreParameters) + for key, val := range rawMsg { + var err error + switch key { + case "retention": + err = unpopulate(val, "Retention", &m.Retention) delete(rawMsg, key) - case "shardKey": - err = unpopulate(val, "ShardKey", &m.ShardKey) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &m.TimeGrain) delete(rawMsg, key) } if err != nil { @@ -7284,21 +5204,19 @@ func (m *MongoDBCollectionResource) UnmarshalJSON(data []byte) error { 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 MetricDefinition. +func (m MetricDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "location", m.Location) + populate(objectMap, "metricAvailabilities", m.MetricAvailabilities) populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) + 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 MongoDBDatabaseCreateUpdateParameters. -func (m *MongoDBDatabaseCreateUpdateParameters) 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) @@ -7306,26 +5224,20 @@ func (m *MongoDBDatabaseCreateUpdateParameters) 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 "identity": - err = unpopulate(val, "Identity", &m.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) + case "metricAvailabilities": + err = unpopulate(val, "MetricAvailabilities", &m.MetricAvailabilities) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "primaryAggregationType": + err = unpopulate(val, "PrimaryAggregationType", &m.PrimaryAggregationType) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + 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 { @@ -7335,16 +5247,15 @@ func (m *MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON(data []byte) error 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 MetricDefinitionsListResult. +func (m MetricDefinitionsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "options", m.Options) - populate(objectMap, "resource", m.Resource) + populate(objectMap, "value", m.Value) 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 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) @@ -7352,11 +5263,8 @@ func (m *MongoDBDatabaseCreateUpdateProperties) UnmarshalJSON(data []byte) error 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", &m.Value) delete(rawMsg, key) } if err != nil { @@ -7366,16 +5274,15 @@ func (m *MongoDBDatabaseCreateUpdateProperties) UnmarshalJSON(data []byte) error 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 MetricListResult. +func (m MetricListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "options", m.Options) - populate(objectMap, "resource", m.Resource) + populate(objectMap, "value", m.Value) 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 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) @@ -7383,11 +5290,8 @@ func (m *MongoDBDatabaseGetProperties) UnmarshalJSON(data []byte) error { 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", &m.Value) delete(rawMsg, key) } if err != nil { @@ -7397,16 +5301,16 @@ func (m *MongoDBDatabaseGetProperties) UnmarshalJSON(data []byte) error { 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 MetricName. +func (m MetricName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoscaleSettings", m.AutoscaleSettings) - populate(objectMap, "throughput", m.Throughput) + populate(objectMap, "localizedValue", m.LocalizedValue) + populate(objectMap, "value", m.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 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) @@ -7414,11 +5318,11 @@ func (m *MongoDBDatabaseGetPropertiesOptions) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "autoscaleSettings": - err = unpopulate(val, "AutoscaleSettings", &m.AutoscaleSettings) + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &m.LocalizedValue) delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &m.Throughput) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -7428,20 +5332,20 @@ func (m *MongoDBDatabaseGetPropertiesOptions) UnmarshalJSON(data []byte) error { 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 MetricValue. +func (m MetricValue) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "createMode", m.CreateMode) - populate(objectMap, "_etag", m.Etag) - populate(objectMap, "id", m.ID) - populate(objectMap, "restoreParameters", m.RestoreParameters) - populate(objectMap, "_rid", m.Rid) - populate(objectMap, "_ts", m.Ts) + populate(objectMap, "average", m.Average) + populate(objectMap, "_count", m.Count) + populate(objectMap, "maximum", m.Maximum) + populate(objectMap, "minimum", m.Minimum) + populateDateTimeRFC3339(objectMap, "timestamp", m.Timestamp) + populate(objectMap, "total", m.Total) 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 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) @@ -7449,23 +5353,23 @@ func (m *MongoDBDatabaseGetPropertiesResource) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "createMode": - err = unpopulate(val, "CreateMode", &m.CreateMode) + case "average": + err = unpopulate(val, "Average", &m.Average) delete(rawMsg, key) - case "_etag": - err = unpopulate(val, "Etag", &m.Etag) + case "_count": + err = unpopulate(val, "Count", &m.Count) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "maximum": + err = unpopulate(val, "Maximum", &m.Maximum) delete(rawMsg, key) - case "restoreParameters": - err = unpopulate(val, "RestoreParameters", &m.RestoreParameters) + case "minimum": + err = unpopulate(val, "Minimum", &m.Minimum) delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &m.Rid) + case "timestamp": + err = unpopulateDateTimeRFC3339(val, "Timestamp", &m.Timestamp) delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &m.Ts) + case "total": + err = unpopulate(val, "Total", &m.Total) delete(rawMsg, key) } if err != nil { @@ -7475,11 +5379,10 @@ func (m *MongoDBDatabaseGetPropertiesResource) UnmarshalJSON(data []byte) error 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 MongoDBCollectionCreateUpdateParameters. +func (m MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -7488,8 +5391,8 @@ func (m MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) { 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 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", m, err) @@ -7500,9 +5403,6 @@ func (m *MongoDBDatabaseGetResults) UnmarshalJSON(data []byte) error { 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) @@ -7526,15 +5426,16 @@ 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 MongoDBCollectionCreateUpdateProperties. +func (m MongoDBCollectionCreateUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", m.Value) + populate(objectMap, "options", m.Options) + populate(objectMap, "resource", m.Resource) 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 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", m, err) @@ -7542,8 +5443,11 @@ 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 "options": + err = unpopulate(val, "Options", &m.Options) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &m.Resource) delete(rawMsg, key) } if err != nil { @@ -7553,17 +5457,16 @@ 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 MongoDBCollectionGetProperties. +func (m MongoDBCollectionGetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "createMode", m.CreateMode) - populate(objectMap, "id", m.ID) - populate(objectMap, "restoreParameters", m.RestoreParameters) + populate(objectMap, "options", m.Options) + populate(objectMap, "resource", m.Resource) 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 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", m, err) @@ -7571,14 +5474,11 @@ func (m *MongoDBDatabaseResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "createMode": - err = unpopulate(val, "CreateMode", &m.CreateMode) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "options": + err = unpopulate(val, "Options", &m.Options) delete(rawMsg, key) - case "restoreParameters": - err = unpopulate(val, "RestoreParameters", &m.RestoreParameters) + case "resource": + err = unpopulate(val, "Resource", &m.Resource) delete(rawMsg, key) } if err != nil { @@ -7588,17 +5488,16 @@ func (m *MongoDBDatabaseResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDataTransferDataSourceSink. -func (m MongoDataTransferDataSourceSink) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetPropertiesOptions. +func (m MongoDBCollectionGetPropertiesOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "collectionName", m.CollectionName) - objectMap["component"] = DataTransferComponentCosmosDBMongo - populate(objectMap, "databaseName", m.DatabaseName) + populate(objectMap, "autoscaleSettings", m.AutoscaleSettings) + populate(objectMap, "throughput", m.Throughput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDataTransferDataSourceSink. -func (m *MongoDataTransferDataSourceSink) 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", m, err) @@ -7606,14 +5505,11 @@ func (m *MongoDataTransferDataSourceSink) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "collectionName": - err = unpopulate(val, "CollectionName", &m.CollectionName) - delete(rawMsg, key) - case "component": - err = unpopulate(val, "Component", &m.Component) + case "autoscaleSettings": + err = unpopulate(val, "AutoscaleSettings", &m.AutoscaleSettings) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) + case "throughput": + err = unpopulate(val, "Throughput", &m.Throughput) delete(rawMsg, key) } if err != nil { @@ -7623,16 +5519,23 @@ func (m *MongoDataTransferDataSourceSink) 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 MongoDBCollectionGetPropertiesResource. +func (m MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", m.Key) - populate(objectMap, "options", m.Options) + populate(objectMap, "analyticalStorageTtl", m.AnalyticalStorageTTL) + populate(objectMap, "createMode", m.CreateMode) + populate(objectMap, "_etag", m.Etag) + populate(objectMap, "id", m.ID) + populate(objectMap, "indexes", m.Indexes) + populate(objectMap, "restoreParameters", m.RestoreParameters) + 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 MongoIndex. -func (m *MongoIndex) 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", m, err) @@ -7640,11 +5543,32 @@ 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 "analyticalStorageTtl": + err = unpopulate(val, "AnalyticalStorageTTL", &m.AnalyticalStorageTTL) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &m.CreateMode) + 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 "restoreParameters": + err = unpopulate(val, "RestoreParameters", &m.RestoreParameters) + delete(rawMsg, key) + case "_rid": + err = unpopulate(val, "Rid", &m.Rid) delete(rawMsg, key) - case "options": - err = unpopulate(val, "Options", &m.Options) + 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 { @@ -7654,15 +5578,20 @@ 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 MongoDBCollectionGetResults. +func (m MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "keys", m.Keys) + 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 MongoIndexKeys. -func (m *MongoIndexKeys) 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", m, err) @@ -7670,8 +5599,23 @@ 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 "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", &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 { @@ -7681,16 +5625,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 MongoDBCollectionListResult. +func (m MongoDBCollectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "expireAfterSeconds", m.ExpireAfterSeconds) - populate(objectMap, "unique", m.Unique) + populate(objectMap, "value", m.Value) 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 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", m, err) @@ -7698,11 +5641,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 "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -7712,15 +5652,20 @@ 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 MongoDBCollectionResource. +func (m MongoDBCollectionResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", m.Properties) + populate(objectMap, "analyticalStorageTtl", m.AnalyticalStorageTTL) + populate(objectMap, "createMode", m.CreateMode) + populate(objectMap, "id", m.ID) + populate(objectMap, "indexes", m.Indexes) + populate(objectMap, "restoreParameters", m.RestoreParameters) + populate(objectMap, "shardKey", m.ShardKey) 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 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", m, err) @@ -7728,8 +5673,23 @@ 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 "analyticalStorageTtl": + err = unpopulate(val, "AnalyticalStorageTTL", &m.AnalyticalStorageTTL) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &m.CreateMode) + 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 "restoreParameters": + err = unpopulate(val, "RestoreParameters", &m.RestoreParameters) + delete(rawMsg, key) + case "shardKey": + err = unpopulate(val, "ShardKey", &m.ShardKey) delete(rawMsg, key) } if err != nil { @@ -7739,18 +5699,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 MongoDBDatabaseCreateUpdateParameters. +func (m MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 MongoRoleDefinitionGetResults. -func (m *MongoRoleDefinitionGetResults) 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", m, err) @@ -7761,12 +5723,18 @@ func (m *MongoRoleDefinitionGetResults) UnmarshalJSON(data []byte) error { 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", &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) @@ -7778,15 +5746,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 MongoDBDatabaseCreateUpdateProperties. +func (m MongoDBDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", m.Value) + populate(objectMap, "options", m.Options) + populate(objectMap, "resource", m.Resource) 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 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", m, err) @@ -7794,8 +5763,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 "options": + err = unpopulate(val, "Options", &m.Options) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &m.Resource) delete(rawMsg, key) } if err != nil { @@ -7805,19 +5777,16 @@ 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 MongoDBDatabaseGetProperties. +func (m MongoDBDatabaseGetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "options", m.Options) + populate(objectMap, "resource", m.Resource) 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 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", m, err) @@ -7825,20 +5794,42 @@ 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) - delete(rawMsg, key) - case "privileges": - err = unpopulate(val, "Privileges", &m.Privileges) + case "options": + err = unpopulate(val, "Options", &m.Options) delete(rawMsg, key) - case "roleName": - err = unpopulate(val, "RoleName", &m.RoleName) + case "resource": + err = unpopulate(val, "Resource", &m.Resource) delete(rawMsg, key) - case "roles": - err = unpopulate(val, "Roles", &m.Roles) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetPropertiesOptions. +func (m MongoDBDatabaseGetPropertiesOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoscaleSettings", m.AutoscaleSettings) + populate(objectMap, "throughput", m.Throughput) + return json.Marshal(objectMap) +} + +// 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoscaleSettings": + err = unpopulate(val, "AutoscaleSettings", &m.AutoscaleSettings) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "throughput": + err = unpopulate(val, "Throughput", &m.Throughput) delete(rawMsg, key) } if err != nil { @@ -7848,15 +5839,20 @@ 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 MongoDBDatabaseGetPropertiesResource. +func (m MongoDBDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", m.Properties) + populate(objectMap, "createMode", m.CreateMode) + populate(objectMap, "_etag", m.Etag) + populate(objectMap, "id", m.ID) + populate(objectMap, "restoreParameters", m.RestoreParameters) + populate(objectMap, "_rid", m.Rid) + populate(objectMap, "_ts", m.Ts) 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 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", m, err) @@ -7864,8 +5860,23 @@ 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 "createMode": + err = unpopulate(val, "CreateMode", &m.CreateMode) + 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 "restoreParameters": + err = unpopulate(val, "RestoreParameters", &m.RestoreParameters) + 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 { @@ -7875,18 +5886,20 @@ 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 MongoDBDatabaseGetResults. +func (m MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 MongoUserDefinitionGetResults. -func (m *MongoUserDefinitionGetResults) 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", m, err) @@ -7897,12 +5910,18 @@ func (m *MongoUserDefinitionGetResults) UnmarshalJSON(data []byte) error { 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", &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) @@ -7914,15 +5933,15 @@ 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 MongoDBDatabaseListResult. +func (m MongoDBDatabaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 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", m, err) @@ -7941,20 +5960,17 @@ 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 MongoDBDatabaseResource. +func (m MongoDBDatabaseResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "createMode", m.CreateMode) + populate(objectMap, "id", m.ID) + populate(objectMap, "restoreParameters", m.RestoreParameters) 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 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", m, err) @@ -7962,23 +5978,14 @@ 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) - 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) + case "createMode": + err = unpopulate(val, "CreateMode", &m.CreateMode) delete(rawMsg, key) - case "roles": - err = unpopulate(val, "Roles", &m.Roles) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &m.UserName) + case "restoreParameters": + err = unpopulate(val, "RestoreParameters", &m.RestoreParameters) delete(rawMsg, key) } if err != nil { @@ -7988,734 +5995,682 @@ func (m *MongoUserDefinitionResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NodeGroupProperties. -func (n NodeGroupProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoIndex. +func (m MongoIndex) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "diskSizeGB", n.DiskSizeGB) - populate(objectMap, "enableHa", n.EnableHa) - populate(objectMap, "sku", n.SKU) + populate(objectMap, "key", m.Key) + populate(objectMap, "options", m.Options) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NodeGroupProperties. -func (n *NodeGroupProperties) 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &n.DiskSizeGB) - delete(rawMsg, key) - case "enableHa": - err = unpopulate(val, "EnableHa", &n.EnableHa) + case "key": + err = unpopulate(val, "Key", &m.Key) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &n.SKU) + case "options": + err = unpopulate(val, "Options", &m.Options) 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 NodeGroupSpec. -func (n NodeGroupSpec) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoIndexKeys. +func (m MongoIndexKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "diskSizeGB", n.DiskSizeGB) - populate(objectMap, "enableHa", n.EnableHa) - populate(objectMap, "kind", n.Kind) - populate(objectMap, "nodeCount", n.NodeCount) - populate(objectMap, "sku", n.SKU) + populate(objectMap, "keys", m.Keys) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NodeGroupSpec. -func (n *NodeGroupSpec) 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &n.DiskSizeGB) - delete(rawMsg, key) - case "enableHa": - err = unpopulate(val, "EnableHa", &n.EnableHa) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &n.Kind) - delete(rawMsg, key) - case "nodeCount": - err = unpopulate(val, "NodeCount", &n.NodeCount) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &n.SKU) + case "keys": + err = unpopulate(val, "Keys", &m.Keys) 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 NotebookWorkspace. -func (n NotebookWorkspace) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoIndexOptions. +func (m MongoIndexOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "type", n.Type) + populate(objectMap, "expireAfterSeconds", m.ExpireAfterSeconds) + populate(objectMap, "unique", m.Unique) 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 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", 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) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &n.Properties) + case "expireAfterSeconds": + err = unpopulate(val, "ExpireAfterSeconds", &m.ExpireAfterSeconds) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + case "unique": + err = unpopulate(val, "Unique", &m.Unique) 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 MongoRoleDefinitionCreateUpdateParameters. +func (m MongoRoleDefinitionCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authToken", n.AuthToken) - populate(objectMap, "notebookServerEndpoint", n.NotebookServerEndpoint) + populate(objectMap, "properties", m.Properties) 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 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", 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) - delete(rawMsg, key) - case "notebookServerEndpoint": - err = unpopulate(val, "NotebookServerEndpoint", &n.NotebookServerEndpoint) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) 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 MongoRoleDefinitionGetResults. +func (m MongoRoleDefinitionGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "name", n.Name) - populate(objectMap, "type", n.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 NotebookWorkspaceCreateUpdateParameters. -func (n *NotebookWorkspaceCreateUpdateParameters) 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", 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 "name": - err = unpopulate(val, "Name", &n.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", &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 NotebookWorkspaceListResult. -func (n NotebookWorkspaceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionListResult. +func (m MongoRoleDefinitionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", n.Value) + populate(objectMap, "value", m.Value) 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 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", 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) + err = unpopulate(val, "Value", &m.Value) 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 MongoRoleDefinitionResource. +func (m MongoRoleDefinitionResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "notebookServerEndpoint", n.NotebookServerEndpoint) - populate(objectMap, "status", n.Status) + 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 NotebookWorkspaceProperties. -func (n *NotebookWorkspaceProperties) 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", 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 "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &n.Status) + 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", 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 MongoUserDefinitionCreateUpdateParameters. +func (m MongoUserDefinitionCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "name", o.Name) + populate(objectMap, "properties", m.Properties) 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 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", 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) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) 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 MongoUserDefinitionGetResults. +func (m MongoUserDefinitionGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "Description", o.Description) - populate(objectMap, "Operation", o.Operation) - populate(objectMap, "Provider", o.Provider) - populate(objectMap, "Resource", o.Resource) + 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 OperationDisplay. -func (o *OperationDisplay) 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", 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) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "Operation": - err = unpopulate(val, "Operation", &o.Operation) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "Provider": - err = unpopulate(val, "Provider", &o.Provider) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) - case "Resource": - err = unpopulate(val, "Resource", &o.Resource) + 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 OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionListResult. +func (m MongoUserDefinitionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "value", m.Value) 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 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", 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) - delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &o.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 OptionsResource. -func (o OptionsResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionResource. +func (m MongoUserDefinitionResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoscaleSettings", o.AutoscaleSettings) - populate(objectMap, "throughput", o.Throughput) + 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 OptionsResource. -func (o *OptionsResource) 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", 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 "customData": + err = unpopulate(val, "CustomData", &m.CustomData) delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &o.Throughput) + 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", 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 NotebookWorkspace. +func (n NotebookWorkspace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endTime", p.EndTime) - populate(objectMap, "metricValues", p.MetricValues) - populate(objectMap, "name", p.Name) - populate(objectMap, "partitionId", p.PartitionID) - populate(objectMap, "partitionKeyRangeId", p.PartitionKeyRangeID) - populateDateTimeRFC3339(objectMap, "startTime", p.StartTime) - populate(objectMap, "timeGrain", p.TimeGrain) - populate(objectMap, "unit", p.Unit) + 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 PartitionMetric. -func (p *PartitionMetric) 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 "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &p.EndTime) - delete(rawMsg, key) - case "metricValues": - err = unpopulate(val, "MetricValues", &p.MetricValues) + case "id": + err = unpopulate(val, "ID", &n.ID) 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 = unpopulateDateTimeRFC3339(val, "StartTime", &p.StartTime) + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &p.TimeGrain) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &p.Unit) + 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 PartitionMetricListResult. -func (p PartitionMetricListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceConnectionInfoResult. +func (n NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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 PartitionMetricListResult. -func (p *PartitionMetricListResult) 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 PartitionUsage. -func (p PartitionUsage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceCreateUpdateParameters. +func (n NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "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 PartitionUsage. -func (p *PartitionUsage) 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 "currentValue": - err = unpopulate(val, "CurrentValue", &p.CurrentValue) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &p.Limit) + case "id": + err = unpopulate(val, "ID", &n.ID) 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) + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &p.Unit) + 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 PartitionUsagesResult. -func (p PartitionUsagesResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceListResult. +func (n NotebookWorkspaceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", p.Value) + populate(objectMap, "value", n.Value) 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 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 "value": - err = unpopulate(val, "Value", &p.Value) + err = unpopulate(val, "Value", &n.Value) 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 PercentileMetric. -func (p PercentileMetric) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceProperties. +func (n NotebookWorkspaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endTime", p.EndTime) - populate(objectMap, "metricValues", p.MetricValues) - populate(objectMap, "name", p.Name) - populateDateTimeRFC3339(objectMap, "startTime", p.StartTime) - populate(objectMap, "timeGrain", p.TimeGrain) - populate(objectMap, "unit", p.Unit) + populate(objectMap, "notebookServerEndpoint", n.NotebookServerEndpoint) + populate(objectMap, "status", n.Status) 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 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "endTime": - err = unpopulateDateTimeRFC3339(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) + case "notebookServerEndpoint": + err = unpopulate(val, "NotebookServerEndpoint", &n.NotebookServerEndpoint) delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &p.StartTime) + case "status": + err = unpopulate(val, "Status", &n.Status) delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &p.TimeGrain) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + return json.Marshal(objectMap) +} + +// 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &p.Unit) + case "name": + 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 PercentileMetricListResult. -func (p PercentileMetricListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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 PercentileMetricListResult. -func (p *PercentileMetricListResult) 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 PercentileMetricValue. -func (p PercentileMetricValue) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) - populateDateTimeRFC3339(objectMap, "timestamp", p.Timestamp) - populate(objectMap, "total", p.Total) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) 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 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 "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 = unpopulateDateTimeRFC3339(val, "Timestamp", &p.Timestamp) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "total": - err = unpopulate(val, "Total", &p.Total) + 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 PeriodicModeBackupPolicy. -func (p PeriodicModeBackupPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OptionsResource. +func (o OptionsResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "migrationState", p.MigrationState) - populate(objectMap, "periodicModeProperties", p.PeriodicModeProperties) - objectMap["type"] = BackupPolicyTypePeriodic + populate(objectMap, "autoscaleSettings", o.AutoscaleSettings) + populate(objectMap, "throughput", o.Throughput) 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 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 "migrationState": - err = unpopulate(val, "MigrationState", &p.MigrationState) - delete(rawMsg, key) - case "periodicModeProperties": - err = unpopulate(val, "PeriodicModeProperties", &p.PeriodicModeProperties) + case "autoscaleSettings": + err = unpopulate(val, "AutoscaleSettings", &o.AutoscaleSettings) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + 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 PeriodicModeProperties. -func (p PeriodicModeProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartitionMetric. +func (p PartitionMetric) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupIntervalInMinutes", p.BackupIntervalInMinutes) - populate(objectMap, "backupRetentionIntervalInHours", p.BackupRetentionIntervalInHours) - populate(objectMap, "backupStorageRedundancy", p.BackupStorageRedundancy) + populateDateTimeRFC3339(objectMap, "endTime", p.EndTime) + populate(objectMap, "metricValues", p.MetricValues) + populate(objectMap, "name", p.Name) + populate(objectMap, "partitionId", p.PartitionID) + populate(objectMap, "partitionKeyRangeId", p.PartitionKeyRangeID) + populateDateTimeRFC3339(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 PeriodicModeProperties. -func (p *PeriodicModeProperties) 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) @@ -8723,14 +6678,29 @@ func (p *PeriodicModeProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "backupIntervalInMinutes": - err = unpopulate(val, "BackupIntervalInMinutes", &p.BackupIntervalInMinutes) + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &p.EndTime) delete(rawMsg, key) - case "backupRetentionIntervalInHours": - err = unpopulate(val, "BackupRetentionIntervalInHours", &p.BackupRetentionIntervalInHours) + case "metricValues": + err = unpopulate(val, "MetricValues", &p.MetricValues) delete(rawMsg, key) - case "backupStorageRedundancy": - err = unpopulate(val, "BackupStorageRedundancy", &p.BackupStorageRedundancy) + 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 = unpopulateDateTimeRFC3339(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 { @@ -8740,16 +6710,15 @@ func (p *PeriodicModeProperties) UnmarshalJSON(data []byte) error { 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 PartitionMetricListResult. +func (p PartitionMetricListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataActions", p.DataActions) - populate(objectMap, "notDataActions", p.NotDataActions) + populate(objectMap, "value", p.Value) 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 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) @@ -8757,11 +6726,8 @@ func (p *Permission) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "dataActions": - err = unpopulate(val, "DataActions", &p.DataActions) - delete(rawMsg, key) - case "notDataActions": - err = unpopulate(val, "NotDataActions", &p.NotDataActions) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { @@ -8771,15 +6737,21 @@ func (p *Permission) UnmarshalJSON(data []byte) error { 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 PartitionUsage. +func (p PartitionUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) + 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) 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 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) @@ -8787,8 +6759,26 @@ func (p *PhysicalPartitionID) 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 "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 { @@ -8798,16 +6788,15 @@ func (p *PhysicalPartitionID) UnmarshalJSON(data []byte) error { 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 PartitionUsagesResult. +func (p PartitionUsagesResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "storageInKB", p.StorageInKB) + populate(objectMap, "value", p.Value) 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 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) @@ -8815,11 +6804,8 @@ func (p *PhysicalPartitionStorageInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "storageInKB": - err = unpopulate(val, "StorageInKB", &p.StorageInKB) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { @@ -8829,15 +6815,20 @@ func (p *PhysicalPartitionStorageInfo) UnmarshalJSON(data []byte) error { 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 PercentileMetric. +func (p PercentileMetric) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "physicalPartitionStorageInfoCollection", p.PhysicalPartitionStorageInfoCollection) + populateDateTimeRFC3339(objectMap, "endTime", p.EndTime) + populate(objectMap, "metricValues", p.MetricValues) + populate(objectMap, "name", p.Name) + populateDateTimeRFC3339(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 PhysicalPartitionStorageInfoCollection. -func (p *PhysicalPartitionStorageInfoCollection) 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", p, err) @@ -8845,8 +6836,23 @@ func (p *PhysicalPartitionStorageInfoCollection) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "physicalPartitionStorageInfoCollection": - err = unpopulate(val, "PhysicalPartitionStorageInfoCollection", &p.PhysicalPartitionStorageInfoCollection) + case "endTime": + err = unpopulateDateTimeRFC3339(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 = unpopulateDateTimeRFC3339(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 { @@ -8856,15 +6862,15 @@ func (p *PhysicalPartitionStorageInfoCollection) UnmarshalJSON(data []byte) erro 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 PercentileMetricListResult. +func (p PercentileMetricListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "physicalPartitionThroughputInfo", p.PhysicalPartitionThroughputInfo) + populate(objectMap, "value", p.Value) 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 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", p, err) @@ -8872,8 +6878,8 @@ func (p *PhysicalPartitionThroughputInfoProperties) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "physicalPartitionThroughputInfo": - err = unpopulate(val, "PhysicalPartitionThroughputInfo", &p.PhysicalPartitionThroughputInfo) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { @@ -8883,16 +6889,27 @@ func (p *PhysicalPartitionThroughputInfoProperties) UnmarshalJSON(data []byte) e 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 PercentileMetricValue. +func (p PercentileMetricValue) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "throughput", p.Throughput) + 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) + populateDateTimeRFC3339(objectMap, "timestamp", p.Timestamp) + populate(objectMap, "total", p.Total) 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 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", p, err) @@ -8900,11 +6917,44 @@ func (p *PhysicalPartitionThroughputInfoResource) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "average": + err = unpopulate(val, "Average", &p.Average) delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &p.Throughput) + 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 = unpopulateDateTimeRFC3339(val, "Timestamp", &p.Timestamp) + delete(rawMsg, key) + case "total": + err = unpopulate(val, "Total", &p.Total) delete(rawMsg, key) } if err != nil { @@ -8914,21 +6964,17 @@ func (p *PhysicalPartitionThroughputInfoResource) UnmarshalJSON(data []byte) 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 PeriodicModeBackupPolicy. +func (p PeriodicModeBackupPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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, "migrationState", p.MigrationState) + populate(objectMap, "periodicModeProperties", p.PeriodicModeProperties) + objectMap["type"] = BackupPolicyTypePeriodic 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 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", p, err) @@ -8936,23 +6982,11 @@ func (p *PhysicalPartitionThroughputInfoResult) UnmarshalJSON(data []byte) error 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) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "migrationState": + err = unpopulate(val, "MigrationState", &p.MigrationState) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "periodicModeProperties": + err = unpopulate(val, "PeriodicModeProperties", &p.PeriodicModeProperties) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) @@ -8965,15 +6999,17 @@ func (p *PhysicalPartitionThroughputInfoResult) UnmarshalJSON(data []byte) error 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 PeriodicModeProperties. +func (p PeriodicModeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "resource", p.Resource) + 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 PhysicalPartitionThroughputInfoResultProperties. -func (p *PhysicalPartitionThroughputInfoResultProperties) 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", p, err) @@ -8981,8 +7017,14 @@ func (p *PhysicalPartitionThroughputInfoResultProperties) UnmarshalJSON(data []b for key, val := range rawMsg { var err error switch key { - case "resource": - err = unpopulate(val, "Resource", &p.Resource) + 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) delete(rawMsg, key) } if err != nil { @@ -8992,15 +7034,16 @@ func (p *PhysicalPartitionThroughputInfoResultProperties) UnmarshalJSON(data []b 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 Permission. +func (p Permission) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "physicalPartitionThroughputInfo", p.PhysicalPartitionThroughputInfo) + populate(objectMap, "dataActions", p.DataActions) + populate(objectMap, "notDataActions", p.NotDataActions) 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 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", p, err) @@ -9008,8 +7051,11 @@ func (p *PhysicalPartitionThroughputInfoResultPropertiesResource) UnmarshalJSON( for key, val := range rawMsg { var err error switch key { - case "physicalPartitionThroughputInfo": - err = unpopulate(val, "PhysicalPartitionThroughputInfo", &p.PhysicalPartitionThroughputInfo) + case "dataActions": + err = unpopulate(val, "DataActions", &p.DataActions) + delete(rawMsg, key) + case "notDataActions": + err = unpopulate(val, "NotDataActions", &p.NotDataActions) delete(rawMsg, key) } if err != nil { @@ -9362,175 +7408,23 @@ func (p ProxyResource) MarshalJSON() ([]byte, error) { 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "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 ProxyResourceAutoGenerated. -func (p ProxyResourceAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceAutoGenerated. -func (p *ProxyResourceAutoGenerated) 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 "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) - delete(rawMsg, key) - case "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 RedistributeThroughputParameters. -func (r RedistributeThroughputParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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 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) - 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 RedistributeThroughputProperties. -func (r RedistributeThroughputProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "resource", r.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RedistributeThroughputProperties. -func (r *RedistributeThroughputProperties) 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 "resource": - err = unpopulate(val, "Resource", &r.Resource) - 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 RedistributeThroughputPropertiesResource. -func (r RedistributeThroughputPropertiesResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "sourcePhysicalPartitionThroughputInfo", r.SourcePhysicalPartitionThroughputInfo) - populate(objectMap, "targetPhysicalPartitionThroughputInfo", r.TargetPhysicalPartitionThroughputInfo) - populate(objectMap, "throughputPolicy", r.ThroughputPolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RedistributeThroughputPropertiesResource. -func (r *RedistributeThroughputPropertiesResource) 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) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "targetPhysicalPartitionThroughputInfo": - err = unpopulate(val, "TargetPhysicalPartitionThroughputInfo", &r.TargetPhysicalPartitionThroughputInfo) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "throughputPolicy": - err = unpopulate(val, "ThroughputPolicy", &r.ThroughputPolicy) + 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 @@ -9633,45 +7527,6 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated. -func (r ResourceAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated. -func (r *ResourceAutoGenerated) 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 "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) - 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 ResourceRestoreParameters. func (r ResourceRestoreParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -9889,6 +7744,8 @@ func (r *RestorableGremlinDatabaseProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RestorableGremlinDatabasePropertiesResource. func (r RestorableGremlinDatabasePropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "canUndelete", r.CanUndelete) + populate(objectMap, "canUndeleteReason", r.CanUndeleteReason) populate(objectMap, "eventTimestamp", r.EventTimestamp) populate(objectMap, "operationType", r.OperationType) populate(objectMap, "ownerId", r.OwnerID) @@ -9906,6 +7763,12 @@ func (r *RestorableGremlinDatabasePropertiesResource) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { + case "canUndelete": + err = unpopulate(val, "CanUndelete", &r.CanUndelete) + delete(rawMsg, key) + case "canUndeleteReason": + err = unpopulate(val, "CanUndeleteReason", &r.CanUndeleteReason) + delete(rawMsg, key) case "eventTimestamp": err = unpopulate(val, "EventTimestamp", &r.EventTimestamp) delete(rawMsg, key) @@ -10025,6 +7888,8 @@ func (r *RestorableGremlinGraphProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RestorableGremlinGraphPropertiesResource. func (r RestorableGremlinGraphPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "canUndelete", r.CanUndelete) + populate(objectMap, "canUndeleteReason", r.CanUndeleteReason) populate(objectMap, "eventTimestamp", r.EventTimestamp) populate(objectMap, "operationType", r.OperationType) populate(objectMap, "ownerId", r.OwnerID) @@ -10042,6 +7907,12 @@ func (r *RestorableGremlinGraphPropertiesResource) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { + case "canUndelete": + err = unpopulate(val, "CanUndelete", &r.CanUndelete) + delete(rawMsg, key) + case "canUndeleteReason": + err = unpopulate(val, "CanUndeleteReason", &r.CanUndeleteReason) + delete(rawMsg, key) case "eventTimestamp": err = unpopulate(val, "EventTimestamp", &r.EventTimestamp) delete(rawMsg, key) @@ -10270,6 +8141,8 @@ func (r *RestorableMongodbCollectionProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionPropertiesResource. func (r RestorableMongodbCollectionPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "canUndelete", r.CanUndelete) + populate(objectMap, "canUndeleteReason", r.CanUndeleteReason) populate(objectMap, "eventTimestamp", r.EventTimestamp) populate(objectMap, "operationType", r.OperationType) populate(objectMap, "ownerId", r.OwnerID) @@ -10287,6 +8160,12 @@ func (r *RestorableMongodbCollectionPropertiesResource) UnmarshalJSON(data []byt for key, val := range rawMsg { var err error switch key { + case "canUndelete": + err = unpopulate(val, "CanUndelete", &r.CanUndelete) + delete(rawMsg, key) + case "canUndeleteReason": + err = unpopulate(val, "CanUndeleteReason", &r.CanUndeleteReason) + delete(rawMsg, key) case "eventTimestamp": err = unpopulate(val, "EventTimestamp", &r.EventTimestamp) delete(rawMsg, key) @@ -10406,6 +8285,8 @@ func (r *RestorableMongodbDatabaseProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabasePropertiesResource. func (r RestorableMongodbDatabasePropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "canUndelete", r.CanUndelete) + populate(objectMap, "canUndeleteReason", r.CanUndeleteReason) populate(objectMap, "eventTimestamp", r.EventTimestamp) populate(objectMap, "operationType", r.OperationType) populate(objectMap, "ownerId", r.OwnerID) @@ -10423,6 +8304,12 @@ func (r *RestorableMongodbDatabasePropertiesResource) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { + case "canUndelete": + err = unpopulate(val, "CanUndelete", &r.CanUndelete) + delete(rawMsg, key) + case "canUndeleteReason": + err = unpopulate(val, "CanUndeleteReason", &r.CanUndeleteReason) + delete(rawMsg, key) case "eventTimestamp": err = unpopulate(val, "EventTimestamp", &r.EventTimestamp) delete(rawMsg, key) @@ -10612,6 +8499,8 @@ func (r *RestorableSQLContainerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerPropertiesResource. func (r RestorableSQLContainerPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "canUndelete", r.CanUndelete) + populate(objectMap, "canUndeleteReason", r.CanUndeleteReason) populate(objectMap, "container", r.Container) populate(objectMap, "eventTimestamp", r.EventTimestamp) populate(objectMap, "operationType", r.OperationType) @@ -10630,6 +8519,12 @@ func (r *RestorableSQLContainerPropertiesResource) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { + case "canUndelete": + err = unpopulate(val, "CanUndelete", &r.CanUndelete) + delete(rawMsg, key) + case "canUndeleteReason": + err = unpopulate(val, "CanUndeleteReason", &r.CanUndeleteReason) + delete(rawMsg, key) case "container": err = unpopulate(val, "Container", &r.Container) delete(rawMsg, key) @@ -10661,13 +8556,13 @@ func (r RestorableSQLContainerPropertiesResourceContainer) MarshalJSON() ([]byte objectMap := make(map[string]any) populate(objectMap, "analyticalStorageTtl", r.AnalyticalStorageTTL) populate(objectMap, "clientEncryptionPolicy", r.ClientEncryptionPolicy) + populate(objectMap, "computedProperties", r.ComputedProperties) populate(objectMap, "conflictResolutionPolicy", r.ConflictResolutionPolicy) populate(objectMap, "createMode", r.CreateMode) populate(objectMap, "defaultTtl", r.DefaultTTL) populate(objectMap, "_etag", r.Etag) populate(objectMap, "id", r.ID) populate(objectMap, "indexingPolicy", r.IndexingPolicy) - populate(objectMap, "materializedViewDefinition", r.MaterializedViewDefinition) populate(objectMap, "partitionKey", r.PartitionKey) populate(objectMap, "restoreParameters", r.RestoreParameters) populate(objectMap, "_rid", r.Rid) @@ -10692,6 +8587,9 @@ func (r *RestorableSQLContainerPropertiesResourceContainer) UnmarshalJSON(data [ case "clientEncryptionPolicy": err = unpopulate(val, "ClientEncryptionPolicy", &r.ClientEncryptionPolicy) delete(rawMsg, key) + case "computedProperties": + err = unpopulate(val, "ComputedProperties", &r.ComputedProperties) + delete(rawMsg, key) case "conflictResolutionPolicy": err = unpopulate(val, "ConflictResolutionPolicy", &r.ConflictResolutionPolicy) delete(rawMsg, key) @@ -10710,9 +8608,6 @@ func (r *RestorableSQLContainerPropertiesResourceContainer) UnmarshalJSON(data [ case "indexingPolicy": err = unpopulate(val, "IndexingPolicy", &r.IndexingPolicy) delete(rawMsg, key) - case "materializedViewDefinition": - err = unpopulate(val, "MaterializedViewDefinition", &r.MaterializedViewDefinition) - delete(rawMsg, key) case "partitionKey": err = unpopulate(val, "PartitionKey", &r.PartitionKey) delete(rawMsg, key) @@ -10835,6 +8730,8 @@ func (r *RestorableSQLDatabaseProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabasePropertiesResource. func (r RestorableSQLDatabasePropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "canUndelete", r.CanUndelete) + populate(objectMap, "canUndeleteReason", r.CanUndeleteReason) populate(objectMap, "database", r.Database) populate(objectMap, "eventTimestamp", r.EventTimestamp) populate(objectMap, "operationType", r.OperationType) @@ -10853,6 +8750,12 @@ func (r *RestorableSQLDatabasePropertiesResource) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { + case "canUndelete": + err = unpopulate(val, "CanUndelete", &r.CanUndelete) + delete(rawMsg, key) + case "canUndeleteReason": + err = unpopulate(val, "CanUndeleteReason", &r.CanUndeleteReason) + delete(rawMsg, key) case "database": err = unpopulate(val, "Database", &r.Database) delete(rawMsg, key) @@ -11104,6 +9007,8 @@ func (r *RestorableTableProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RestorableTablePropertiesResource. func (r RestorableTablePropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "canUndelete", r.CanUndelete) + populate(objectMap, "canUndeleteReason", r.CanUndeleteReason) populate(objectMap, "eventTimestamp", r.EventTimestamp) populate(objectMap, "operationType", r.OperationType) populate(objectMap, "ownerId", r.OwnerID) @@ -11121,6 +9026,12 @@ func (r *RestorableTablePropertiesResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "canUndelete": + err = unpopulate(val, "CanUndelete", &r.CanUndelete) + delete(rawMsg, key) + case "canUndeleteReason": + err = unpopulate(val, "CanUndeleteReason", &r.CanUndeleteReason) + delete(rawMsg, key) case "eventTimestamp": err = unpopulate(val, "EventTimestamp", &r.EventTimestamp) delete(rawMsg, key) @@ -11241,7 +9152,6 @@ func (r RestoreParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "restoreMode", r.RestoreMode) populate(objectMap, "restoreSource", r.RestoreSource) populateDateTimeRFC3339(objectMap, "restoreTimestampInUtc", r.RestoreTimestampInUTC) - populate(objectMap, "sourceBackupLocation", r.SourceBackupLocation) populate(objectMap, "tablesToRestore", r.TablesToRestore) return json.Marshal(objectMap) } @@ -11270,9 +9180,6 @@ func (r *RestoreParameters) UnmarshalJSON(data []byte) error { case "restoreTimestampInUtc": err = unpopulateDateTimeRFC3339(val, "RestoreTimestampInUTC", &r.RestoreTimestampInUTC) delete(rawMsg, key) - case "sourceBackupLocation": - err = unpopulate(val, "SourceBackupLocation", &r.SourceBackupLocation) - delete(rawMsg, key) case "tablesToRestore": err = unpopulate(val, "TablesToRestore", &r.TablesToRestore) delete(rawMsg, key) @@ -11315,111 +9222,6 @@ func (r *RestoreParametersBase) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RetrieveThroughputParameters. -func (r RetrieveThroughputParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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 { - 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) - 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 RetrieveThroughputProperties. -func (r RetrieveThroughputProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "resource", r.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveThroughputProperties. -func (r *RetrieveThroughputProperties) 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 "resource": - err = unpopulate(val, "Resource", &r.Resource) - 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 RetrieveThroughputPropertiesResource. -func (r RetrieveThroughputPropertiesResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "physicalPartitionIds", r.PhysicalPartitionIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveThroughputPropertiesResource. -func (r *RetrieveThroughputPropertiesResource) 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 "physicalPartitionIds": - err = unpopulate(val, "PhysicalPartitionIDs", &r.PhysicalPartitionIDs) - 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 Role. func (r Role) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11455,7 +9257,6 @@ func (r *Role) UnmarshalJSON(data []byte) error { func (s SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -11476,9 +9277,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) @@ -11600,13 +9398,13 @@ func (s SQLContainerGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "analyticalStorageTtl", s.AnalyticalStorageTTL) populate(objectMap, "clientEncryptionPolicy", s.ClientEncryptionPolicy) + populate(objectMap, "computedProperties", s.ComputedProperties) populate(objectMap, "conflictResolutionPolicy", s.ConflictResolutionPolicy) populate(objectMap, "createMode", s.CreateMode) populate(objectMap, "defaultTtl", s.DefaultTTL) populate(objectMap, "_etag", s.Etag) populate(objectMap, "id", s.ID) populate(objectMap, "indexingPolicy", s.IndexingPolicy) - populate(objectMap, "materializedViewDefinition", s.MaterializedViewDefinition) populate(objectMap, "partitionKey", s.PartitionKey) populate(objectMap, "restoreParameters", s.RestoreParameters) populate(objectMap, "_rid", s.Rid) @@ -11630,6 +9428,9 @@ func (s *SQLContainerGetPropertiesResource) UnmarshalJSON(data []byte) error { case "clientEncryptionPolicy": err = unpopulate(val, "ClientEncryptionPolicy", &s.ClientEncryptionPolicy) delete(rawMsg, key) + case "computedProperties": + err = unpopulate(val, "ComputedProperties", &s.ComputedProperties) + delete(rawMsg, key) case "conflictResolutionPolicy": err = unpopulate(val, "ConflictResolutionPolicy", &s.ConflictResolutionPolicy) delete(rawMsg, key) @@ -11648,9 +9449,6 @@ func (s *SQLContainerGetPropertiesResource) UnmarshalJSON(data []byte) error { case "indexingPolicy": err = unpopulate(val, "IndexingPolicy", &s.IndexingPolicy) delete(rawMsg, key) - case "materializedViewDefinition": - err = unpopulate(val, "MaterializedViewDefinition", &s.MaterializedViewDefinition) - delete(rawMsg, key) case "partitionKey": err = unpopulate(val, "PartitionKey", &s.PartitionKey) delete(rawMsg, key) @@ -11678,7 +9476,6 @@ func (s *SQLContainerGetPropertiesResource) UnmarshalJSON(data []byte) error { func (s SQLContainerGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -11699,9 +9496,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) @@ -11757,12 +9551,12 @@ func (s SQLContainerResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "analyticalStorageTtl", s.AnalyticalStorageTTL) populate(objectMap, "clientEncryptionPolicy", s.ClientEncryptionPolicy) + populate(objectMap, "computedProperties", s.ComputedProperties) populate(objectMap, "conflictResolutionPolicy", s.ConflictResolutionPolicy) populate(objectMap, "createMode", s.CreateMode) populate(objectMap, "defaultTtl", s.DefaultTTL) populate(objectMap, "id", s.ID) populate(objectMap, "indexingPolicy", s.IndexingPolicy) - populate(objectMap, "materializedViewDefinition", s.MaterializedViewDefinition) populate(objectMap, "partitionKey", s.PartitionKey) populate(objectMap, "restoreParameters", s.RestoreParameters) populate(objectMap, "uniqueKeyPolicy", s.UniqueKeyPolicy) @@ -11784,6 +9578,9 @@ func (s *SQLContainerResource) UnmarshalJSON(data []byte) error { case "clientEncryptionPolicy": err = unpopulate(val, "ClientEncryptionPolicy", &s.ClientEncryptionPolicy) delete(rawMsg, key) + case "computedProperties": + err = unpopulate(val, "ComputedProperties", &s.ComputedProperties) + delete(rawMsg, key) case "conflictResolutionPolicy": err = unpopulate(val, "ConflictResolutionPolicy", &s.ConflictResolutionPolicy) delete(rawMsg, key) @@ -11799,9 +9596,6 @@ func (s *SQLContainerResource) UnmarshalJSON(data []byte) error { case "indexingPolicy": err = unpopulate(val, "IndexingPolicy", &s.IndexingPolicy) delete(rawMsg, key) - case "materializedViewDefinition": - err = unpopulate(val, "MaterializedViewDefinition", &s.MaterializedViewDefinition) - delete(rawMsg, key) case "partitionKey": err = unpopulate(val, "PartitionKey", &s.PartitionKey) delete(rawMsg, key) @@ -11819,46 +9613,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]any) - 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]any) 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) @@ -11879,9 +9637,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) @@ -12057,7 +9812,6 @@ func (s *SQLDatabaseGetPropertiesResource) UnmarshalJSON(data []byte) error { func (s SQLDatabaseGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -12078,9 +9832,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) @@ -12562,7 +10313,6 @@ func (s *SQLRoleDefinitionResource) UnmarshalJSON(data []byte) error { func (s SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -12583,9 +10333,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) @@ -12714,7 +10461,6 @@ func (s *SQLStoredProcedureGetPropertiesResource) UnmarshalJSON(data []byte) err func (s SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -12735,9 +10481,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) @@ -12823,7 +10566,6 @@ func (s *SQLStoredProcedureResource) UnmarshalJSON(data []byte) error { func (s SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -12844,9 +10586,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) @@ -12983,7 +10722,6 @@ func (s *SQLTriggerGetPropertiesResource) UnmarshalJSON(data []byte) error { func (s SQLTriggerGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -13004,9 +10742,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) @@ -13100,7 +10835,6 @@ func (s *SQLTriggerResource) UnmarshalJSON(data []byte) error { func (s SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -13121,9 +10855,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) @@ -13252,7 +10983,6 @@ func (s *SQLUserDefinedFunctionGetPropertiesResource) UnmarshalJSON(data []byte) func (s SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -13273,9 +11003,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) @@ -13652,7 +11379,6 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { func (t TableCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -13673,9 +11399,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) @@ -13843,7 +11566,6 @@ func (t *TableGetPropertiesResource) UnmarshalJSON(data []byte) error { func (t TableGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -13864,9 +11586,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) @@ -14015,9 +11734,11 @@ func (t ThroughputSettingsGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "autoscaleSettings", t.AutoscaleSettings) populate(objectMap, "_etag", t.Etag) + populate(objectMap, "instantMaximumThroughput", t.InstantMaximumThroughput) populate(objectMap, "minimumThroughput", t.MinimumThroughput) populate(objectMap, "offerReplacePending", t.OfferReplacePending) populate(objectMap, "_rid", t.Rid) + populate(objectMap, "softAllowedMaximumThroughput", t.SoftAllowedMaximumThroughput) populate(objectMap, "throughput", t.Throughput) populate(objectMap, "_ts", t.Ts) return json.Marshal(objectMap) @@ -14038,6 +11759,9 @@ func (t *ThroughputSettingsGetPropertiesResource) UnmarshalJSON(data []byte) err case "_etag": err = unpopulate(val, "Etag", &t.Etag) delete(rawMsg, key) + case "instantMaximumThroughput": + err = unpopulate(val, "InstantMaximumThroughput", &t.InstantMaximumThroughput) + delete(rawMsg, key) case "minimumThroughput": err = unpopulate(val, "MinimumThroughput", &t.MinimumThroughput) delete(rawMsg, key) @@ -14047,6 +11771,9 @@ func (t *ThroughputSettingsGetPropertiesResource) UnmarshalJSON(data []byte) err case "_rid": err = unpopulate(val, "Rid", &t.Rid) delete(rawMsg, key) + case "softAllowedMaximumThroughput": + err = unpopulate(val, "SoftAllowedMaximumThroughput", &t.SoftAllowedMaximumThroughput) + delete(rawMsg, key) case "throughput": err = unpopulate(val, "Throughput", &t.Throughput) delete(rawMsg, key) @@ -14065,7 +11792,6 @@ func (t *ThroughputSettingsGetPropertiesResource) UnmarshalJSON(data []byte) err func (t ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -14086,9 +11812,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) @@ -14116,8 +11839,10 @@ func (t *ThroughputSettingsGetResults) UnmarshalJSON(data []byte) error { func (t ThroughputSettingsResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "autoscaleSettings", t.AutoscaleSettings) + populate(objectMap, "instantMaximumThroughput", t.InstantMaximumThroughput) populate(objectMap, "minimumThroughput", t.MinimumThroughput) populate(objectMap, "offerReplacePending", t.OfferReplacePending) + populate(objectMap, "softAllowedMaximumThroughput", t.SoftAllowedMaximumThroughput) populate(objectMap, "throughput", t.Throughput) return json.Marshal(objectMap) } @@ -14134,12 +11859,18 @@ func (t *ThroughputSettingsResource) UnmarshalJSON(data []byte) error { case "autoscaleSettings": err = unpopulate(val, "AutoscaleSettings", &t.AutoscaleSettings) delete(rawMsg, key) + case "instantMaximumThroughput": + err = unpopulate(val, "InstantMaximumThroughput", &t.InstantMaximumThroughput) + delete(rawMsg, key) case "minimumThroughput": err = unpopulate(val, "MinimumThroughput", &t.MinimumThroughput) delete(rawMsg, key) case "offerReplacePending": err = unpopulate(val, "OfferReplacePending", &t.OfferReplacePending) delete(rawMsg, key) + case "softAllowedMaximumThroughput": + err = unpopulate(val, "SoftAllowedMaximumThroughput", &t.SoftAllowedMaximumThroughput) + delete(rawMsg, key) case "throughput": err = unpopulate(val, "Throughput", &t.Throughput) delete(rawMsg, key) @@ -14155,7 +11886,6 @@ func (t *ThroughputSettingsResource) UnmarshalJSON(data []byte) error { func (t ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -14176,9 +11906,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) @@ -14229,53 +11956,6 @@ func (t *ThroughputSettingsUpdateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. -func (t *TrackedResource) 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", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &t.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type UniqueKey. func (u UniqueKey) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14441,16 +12121,6 @@ func populate(m map[string]any, k string, v any) { } } -func populateAny(m map[string]any, k string, v any) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else { - m[k] = v - } -} - func populateByteArray(m map[string]any, k string, b []byte, f runtime.Base64Encoding) { if azcore.IsNullValue(b) { m[k] = nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client.go b/sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client.go deleted file mode 100644 index b395cb31d0d1..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client.go +++ /dev/null @@ -1,898 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "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" -) - -// MongoClustersClient contains the methods for the MongoClusters group. -// Don't use this type directly, use NewMongoClustersClient() instead. -type MongoClustersClient struct { - internal *arm.Client - subscriptionID string -} - -// NewMongoClustersClient creates a new instance of MongoClustersClient 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 NewMongoClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MongoClustersClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &MongoClustersClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CheckNameAvailability - Check the availability of name for resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -// - location - The name of the Azure region. -// - parameters - The required parameters for checking if resource name is available. -// - options - MongoClustersClientCheckNameAvailabilityOptions contains the optional parameters for the MongoClustersClient.CheckNameAvailability -// method. -func (client *MongoClustersClient) CheckNameAvailability(ctx context.Context, location string, parameters CheckNameAvailabilityRequest, options *MongoClustersClientCheckNameAvailabilityOptions) (MongoClustersClientCheckNameAvailabilityResponse, error) { - var err error - const operationName = "MongoClustersClient.CheckNameAvailability" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.checkNameAvailabilityCreateRequest(ctx, location, parameters, options) - if err != nil { - return MongoClustersClientCheckNameAvailabilityResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return MongoClustersClientCheckNameAvailabilityResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return MongoClustersClientCheckNameAvailabilityResponse{}, err - } - resp, err := client.checkNameAvailabilityHandleResponse(httpResp) - return resp, err -} - -// checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. -func (client *MongoClustersClient) checkNameAvailabilityCreateRequest(ctx context.Context, location string, parameters CheckNameAvailabilityRequest, options *MongoClustersClientCheckNameAvailabilityOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/checkMongoClusterNameAvailability" - 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)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. -func (client *MongoClustersClient) checkNameAvailabilityHandleResponse(resp *http.Response) (MongoClustersClientCheckNameAvailabilityResponse, error) { - result := MongoClustersClientCheckNameAvailabilityResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CheckNameAvailabilityResponse); err != nil { - return MongoClustersClientCheckNameAvailabilityResponse{}, err - } - return result, nil -} - -// BeginCreateOrUpdate - Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify -// some of the properties, use PATCH. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - mongoClusterName - The name of the mongo cluster. -// - parameters - The required parameters for creating or updating a mongo cluster. -// - options - MongoClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the MongoClustersClient.BeginCreateOrUpdate -// method. -func (client *MongoClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, mongoClusterName string, parameters MongoCluster, options *MongoClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[MongoClustersClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, mongoClusterName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoClustersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MongoClustersClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some -// of the properties, use PATCH. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *MongoClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, mongoClusterName string, parameters MongoCluster, options *MongoClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "MongoClustersClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, mongoClusterName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *MongoClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, mongoClusterName string, parameters MongoCluster, options *MongoClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" - 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 mongoClusterName == "" { - return nil, errors.New("parameter mongoClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoClusterName}", url.PathEscape(mongoClusterName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginCreateOrUpdateFirewallRule - Creates a new firewall rule or updates an existing firewall rule on a mongo cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - mongoClusterName - The name of the mongo cluster. -// - firewallRuleName - The name of the mongo cluster firewall rule. -// - parameters - The required parameters for creating or updating a firewall rule. -// - options - MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions contains the optional parameters for the MongoClustersClient.BeginCreateOrUpdateFirewallRule -// method. -func (client *MongoClustersClient) BeginCreateOrUpdateFirewallRule(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, parameters FirewallRule, options *MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions) (*runtime.Poller[MongoClustersClientCreateOrUpdateFirewallRuleResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdateFirewallRule(ctx, resourceGroupName, mongoClusterName, firewallRuleName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoClustersClientCreateOrUpdateFirewallRuleResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MongoClustersClientCreateOrUpdateFirewallRuleResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdateFirewallRule - Creates a new firewall rule or updates an existing firewall rule on a mongo cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *MongoClustersClient) createOrUpdateFirewallRule(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, parameters FirewallRule, options *MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions) (*http.Response, error) { - var err error - const operationName = "MongoClustersClient.BeginCreateOrUpdateFirewallRule" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateFirewallRuleCreateRequest(ctx, resourceGroupName, mongoClusterName, firewallRuleName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateFirewallRuleCreateRequest creates the CreateOrUpdateFirewallRule request. -func (client *MongoClustersClient) createOrUpdateFirewallRuleCreateRequest(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, parameters FirewallRule, options *MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}" - 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 mongoClusterName == "" { - return nil, errors.New("parameter mongoClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoClusterName}", url.PathEscape(mongoClusterName)) - if firewallRuleName == "" { - return nil, errors.New("parameter firewallRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallRuleName}", url.PathEscape(firewallRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a mongo cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - mongoClusterName - The name of the mongo cluster. -// - options - MongoClustersClientBeginDeleteOptions contains the optional parameters for the MongoClustersClient.BeginDelete -// method. -func (client *MongoClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientBeginDeleteOptions) (*runtime.Poller[MongoClustersClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, mongoClusterName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoClustersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MongoClustersClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a mongo cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *MongoClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "MongoClustersClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, mongoClusterName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *MongoClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" - 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 mongoClusterName == "" { - return nil, errors.New("parameter mongoClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoClusterName}", url.PathEscape(mongoClusterName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDeleteFirewallRule - Deletes a mongo cluster firewall rule. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - mongoClusterName - The name of the mongo cluster. -// - firewallRuleName - The name of the mongo cluster firewall rule. -// - options - MongoClustersClientBeginDeleteFirewallRuleOptions contains the optional parameters for the MongoClustersClient.BeginDeleteFirewallRule -// method. -func (client *MongoClustersClient) BeginDeleteFirewallRule(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *MongoClustersClientBeginDeleteFirewallRuleOptions) (*runtime.Poller[MongoClustersClientDeleteFirewallRuleResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteFirewallRule(ctx, resourceGroupName, mongoClusterName, firewallRuleName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoClustersClientDeleteFirewallRuleResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MongoClustersClientDeleteFirewallRuleResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// DeleteFirewallRule - Deletes a mongo cluster firewall rule. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *MongoClustersClient) deleteFirewallRule(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *MongoClustersClientBeginDeleteFirewallRuleOptions) (*http.Response, error) { - var err error - const operationName = "MongoClustersClient.BeginDeleteFirewallRule" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteFirewallRuleCreateRequest(ctx, resourceGroupName, mongoClusterName, firewallRuleName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteFirewallRuleCreateRequest creates the DeleteFirewallRule request. -func (client *MongoClustersClient) deleteFirewallRuleCreateRequest(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *MongoClustersClientBeginDeleteFirewallRuleOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}" - 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 mongoClusterName == "" { - return nil, errors.New("parameter mongoClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoClusterName}", url.PathEscape(mongoClusterName)) - if firewallRuleName == "" { - return nil, errors.New("parameter firewallRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallRuleName}", url.PathEscape(firewallRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about a mongo cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - mongoClusterName - The name of the mongo cluster. -// - options - MongoClustersClientGetOptions contains the optional parameters for the MongoClustersClient.Get method. -func (client *MongoClustersClient) Get(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientGetOptions) (MongoClustersClientGetResponse, error) { - var err error - const operationName = "MongoClustersClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, mongoClusterName, options) - if err != nil { - return MongoClustersClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return MongoClustersClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return MongoClustersClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *MongoClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" - 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 mongoClusterName == "" { - return nil, errors.New("parameter mongoClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoClusterName}", url.PathEscape(mongoClusterName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 *MongoClustersClient) getHandleResponse(resp *http.Response) (MongoClustersClientGetResponse, error) { - result := MongoClustersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MongoCluster); err != nil { - return MongoClustersClientGetResponse{}, err - } - return result, nil -} - -// GetFirewallRule - Gets information about a mongo cluster firewall rule. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - mongoClusterName - The name of the mongo cluster. -// - firewallRuleName - The name of the mongo cluster firewall rule. -// - options - MongoClustersClientGetFirewallRuleOptions contains the optional parameters for the MongoClustersClient.GetFirewallRule -// method. -func (client *MongoClustersClient) GetFirewallRule(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *MongoClustersClientGetFirewallRuleOptions) (MongoClustersClientGetFirewallRuleResponse, error) { - var err error - const operationName = "MongoClustersClient.GetFirewallRule" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getFirewallRuleCreateRequest(ctx, resourceGroupName, mongoClusterName, firewallRuleName, options) - if err != nil { - return MongoClustersClientGetFirewallRuleResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return MongoClustersClientGetFirewallRuleResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return MongoClustersClientGetFirewallRuleResponse{}, err - } - resp, err := client.getFirewallRuleHandleResponse(httpResp) - return resp, err -} - -// getFirewallRuleCreateRequest creates the GetFirewallRule request. -func (client *MongoClustersClient) getFirewallRuleCreateRequest(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *MongoClustersClientGetFirewallRuleOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}" - 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 mongoClusterName == "" { - return nil, errors.New("parameter mongoClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoClusterName}", url.PathEscape(mongoClusterName)) - if firewallRuleName == "" { - return nil, errors.New("parameter firewallRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallRuleName}", url.PathEscape(firewallRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getFirewallRuleHandleResponse handles the GetFirewallRule response. -func (client *MongoClustersClient) getFirewallRuleHandleResponse(resp *http.Response) (MongoClustersClientGetFirewallRuleResponse, error) { - result := MongoClustersClientGetFirewallRuleResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FirewallRule); err != nil { - return MongoClustersClientGetFirewallRuleResponse{}, err - } - return result, nil -} - -// NewListPager - List all the mongo clusters in a given subscription. -// -// Generated from API version 2023-03-15-preview -// - options - MongoClustersClientListOptions contains the optional parameters for the MongoClustersClient.NewListPager method. -func (client *MongoClustersClient) NewListPager(options *MongoClustersClientListOptions) *runtime.Pager[MongoClustersClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[MongoClustersClientListResponse]{ - More: func(page MongoClustersClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *MongoClustersClientListResponse) (MongoClustersClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MongoClustersClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return MongoClustersClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *MongoClustersClient) listCreateRequest(ctx context.Context, options *MongoClustersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/mongoClusters" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-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 *MongoClustersClient) listHandleResponse(resp *http.Response) (MongoClustersClientListResponse, error) { - result := MongoClustersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MongoClusterListResult); err != nil { - return MongoClustersClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - List all the mongo clusters in a given resource group. -// -// Generated from API version 2023-03-15-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - MongoClustersClientListByResourceGroupOptions contains the optional parameters for the MongoClustersClient.NewListByResourceGroupPager -// method. -func (client *MongoClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *MongoClustersClientListByResourceGroupOptions) *runtime.Pager[MongoClustersClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[MongoClustersClientListByResourceGroupResponse]{ - More: func(page MongoClustersClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *MongoClustersClientListByResourceGroupResponse) (MongoClustersClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MongoClustersClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return MongoClustersClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *MongoClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *MongoClustersClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters" - 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)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *MongoClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (MongoClustersClientListByResourceGroupResponse, error) { - result := MongoClustersClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MongoClusterListResult); err != nil { - return MongoClustersClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// ListConnectionStrings - List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, -// as well as other connection strings supported by the cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - mongoClusterName - The name of the mongo cluster. -// - options - MongoClustersClientListConnectionStringsOptions contains the optional parameters for the MongoClustersClient.ListConnectionStrings -// method. -func (client *MongoClustersClient) ListConnectionStrings(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientListConnectionStringsOptions) (MongoClustersClientListConnectionStringsResponse, error) { - var err error - const operationName = "MongoClustersClient.ListConnectionStrings" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listConnectionStringsCreateRequest(ctx, resourceGroupName, mongoClusterName, options) - if err != nil { - return MongoClustersClientListConnectionStringsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return MongoClustersClientListConnectionStringsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return MongoClustersClientListConnectionStringsResponse{}, err - } - resp, err := client.listConnectionStringsHandleResponse(httpResp) - return resp, err -} - -// listConnectionStringsCreateRequest creates the ListConnectionStrings request. -func (client *MongoClustersClient) listConnectionStringsCreateRequest(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientListConnectionStringsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/listConnectionStrings" - 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 mongoClusterName == "" { - return nil, errors.New("parameter mongoClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoClusterName}", url.PathEscape(mongoClusterName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listConnectionStringsHandleResponse handles the ListConnectionStrings response. -func (client *MongoClustersClient) listConnectionStringsHandleResponse(resp *http.Response) (MongoClustersClientListConnectionStringsResponse, error) { - result := MongoClustersClientListConnectionStringsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListConnectionStringsResult); err != nil { - return MongoClustersClientListConnectionStringsResponse{}, err - } - return result, nil -} - -// NewListFirewallRulesPager - List all the firewall rules in a given mongo cluster. -// -// Generated from API version 2023-03-15-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - mongoClusterName - The name of the mongo cluster. -// - options - MongoClustersClientListFirewallRulesOptions contains the optional parameters for the MongoClustersClient.NewListFirewallRulesPager -// method. -func (client *MongoClustersClient) NewListFirewallRulesPager(resourceGroupName string, mongoClusterName string, options *MongoClustersClientListFirewallRulesOptions) *runtime.Pager[MongoClustersClientListFirewallRulesResponse] { - return runtime.NewPager(runtime.PagingHandler[MongoClustersClientListFirewallRulesResponse]{ - More: func(page MongoClustersClientListFirewallRulesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *MongoClustersClientListFirewallRulesResponse) (MongoClustersClientListFirewallRulesResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MongoClustersClient.NewListFirewallRulesPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listFirewallRulesCreateRequest(ctx, resourceGroupName, mongoClusterName, options) - }, nil) - if err != nil { - return MongoClustersClientListFirewallRulesResponse{}, err - } - return client.listFirewallRulesHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listFirewallRulesCreateRequest creates the ListFirewallRules request. -func (client *MongoClustersClient) listFirewallRulesCreateRequest(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientListFirewallRulesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules" - 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 mongoClusterName == "" { - return nil, errors.New("parameter mongoClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoClusterName}", url.PathEscape(mongoClusterName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listFirewallRulesHandleResponse handles the ListFirewallRules response. -func (client *MongoClustersClient) listFirewallRulesHandleResponse(resp *http.Response) (MongoClustersClientListFirewallRulesResponse, error) { - result := MongoClustersClientListFirewallRulesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FirewallRuleListResult); err != nil { - return MongoClustersClientListFirewallRulesResponse{}, err - } - return result, nil -} - -// BeginUpdate - Updates an existing mongo cluster. The request body can contain one to many of the properties present in -// the normal mongo cluster definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - mongoClusterName - The name of the mongo cluster. -// - parameters - The parameters for updating a mongo cluster. -// - options - MongoClustersClientBeginUpdateOptions contains the optional parameters for the MongoClustersClient.BeginUpdate -// method. -func (client *MongoClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, mongoClusterName string, parameters MongoClusterUpdate, options *MongoClustersClientBeginUpdateOptions) (*runtime.Poller[MongoClustersClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, mongoClusterName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoClustersClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MongoClustersClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal -// mongo cluster definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *MongoClustersClient) update(ctx context.Context, resourceGroupName string, mongoClusterName string, parameters MongoClusterUpdate, options *MongoClustersClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "MongoClustersClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, mongoClusterName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *MongoClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, mongoClusterName string, parameters MongoClusterUpdate, options *MongoClustersClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" - 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 mongoClusterName == "" { - return nil, errors.New("parameter mongoClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoClusterName}", url.PathEscape(mongoClusterName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client_example_test.go deleted file mode 100644 index 484a4ae5eb29..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client_example_test.go +++ /dev/null @@ -1,784 +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_test - -import ( - "context" - "log" - - "time" - - "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/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterList.json -func ExampleMongoClustersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMongoClustersClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MongoClusterListResult = armcosmos.MongoClusterListResult{ - // Value: []*armcosmos.MongoCluster{ - // { - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus2"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armcosmos.MongoClusterProperties{ - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - // { - // DiskSizeGB: to.Ptr[int64](128), - // EnableHa: to.Ptr(true), - // SKU: to.Ptr("M30"), - // Kind: to.Ptr(armcosmos.NodeKindShard), - // NodeCount: to.Ptr[int32](4), - // }}, - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // ServerVersion: to.Ptr("5.0"), - // }, - // }, - // { - // Name: to.Ptr("myMongoCluster2"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster2"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user2"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // }, - // Properties: &armcosmos.MongoClusterProperties{ - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-10T20:07:35Z"), - // NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - // { - // DiskSizeGB: to.Ptr[int64](256), - // EnableHa: to.Ptr(true), - // SKU: to.Ptr("M40"), - // Kind: to.Ptr(armcosmos.NodeKindShard), - // NodeCount: to.Ptr[int32](2), - // }}, - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // ServerVersion: to.Ptr("5.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterListByResourceGroup.json -func ExampleMongoClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMongoClustersClient().NewListByResourceGroupPager("TestResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MongoClusterListResult = armcosmos.MongoClusterListResult{ - // Value: []*armcosmos.MongoCluster{ - // { - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus2"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armcosmos.MongoClusterProperties{ - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - // { - // DiskSizeGB: to.Ptr[int64](128), - // EnableHa: to.Ptr(true), - // SKU: to.Ptr("M30"), - // Kind: to.Ptr(armcosmos.NodeKindShard), - // NodeCount: to.Ptr[int32](4), - // }}, - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // ServerVersion: to.Ptr("5.0"), - // }, - // }, - // { - // Name: to.Ptr("myMongoCluster2"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster2"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user2"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // }, - // Properties: &armcosmos.MongoClusterProperties{ - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster2.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-10T20:07:35Z"), - // NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - // { - // DiskSizeGB: to.Ptr[int64](256), - // EnableHa: to.Ptr(true), - // SKU: to.Ptr("M40"), - // Kind: to.Ptr(armcosmos.NodeKindShard), - // NodeCount: to.Ptr[int32](2), - // }}, - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // ServerVersion: to.Ptr("5.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterCreate.json -func ExampleMongoClustersClient_BeginCreateOrUpdate_createANewMongoCluster() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginCreateOrUpdate(ctx, "TestResourceGroup", "myMongoCluster", armcosmos.MongoCluster{ - Location: to.Ptr("westus2"), - Properties: &armcosmos.MongoClusterProperties{ - AdministratorLogin: to.Ptr("mongoAdmin"), - AdministratorLoginPassword: to.Ptr("password"), - NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - { - DiskSizeGB: to.Ptr[int64](128), - EnableHa: to.Ptr(true), - SKU: to.Ptr("M30"), - Kind: to.Ptr(armcosmos.NodeKindShard), - NodeCount: to.Ptr[int32](3), - }}, - ServerVersion: to.Ptr("5.0"), - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MongoCluster = armcosmos.MongoCluster{ - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus2"), - // Properties: &armcosmos.MongoClusterProperties{ - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - // { - // DiskSizeGB: to.Ptr[int64](128), - // EnableHa: to.Ptr(true), - // SKU: to.Ptr("M30"), - // Kind: to.Ptr(armcosmos.NodeKindShard), - // NodeCount: to.Ptr[int32](3), - // }}, - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // ServerVersion: to.Ptr("5.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterCreatePITR.json -func ExampleMongoClustersClient_BeginCreateOrUpdate_createANewMongoClusterWithPointInTimeRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginCreateOrUpdate(ctx, "TestResourceGroup", "myMongoCluster", armcosmos.MongoCluster{ - Location: to.Ptr("westus2"), - Properties: &armcosmos.MongoClusterProperties{ - CreateMode: to.Ptr(armcosmos.CreateModePointInTimeRestore), - RestoreParameters: &armcosmos.MongoClusterRestoreParameters{ - PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-13T20:07:35.000Z"); return t }()), - SourceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myOtherMongoCluster"), - }, - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MongoCluster = armcosmos.MongoCluster{ - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // Location: to.Ptr("westus2"), - // Properties: &armcosmos.MongoClusterProperties{ - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - // { - // DiskSizeGB: to.Ptr[int64](128), - // EnableHa: to.Ptr(true), - // SKU: to.Ptr("M30"), - // Kind: to.Ptr(armcosmos.NodeKindShard), - // NodeCount: to.Ptr[int32](3), - // }}, - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // ServerVersion: to.Ptr("5.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterGet.json -func ExampleMongoClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoClustersClient().Get(ctx, "TestResourceGroup", "myMongoCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MongoCluster = armcosmos.MongoCluster{ - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus2"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armcosmos.MongoClusterProperties{ - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - // { - // DiskSizeGB: to.Ptr[int64](128), - // EnableHa: to.Ptr(true), - // SKU: to.Ptr("M30"), - // Kind: to.Ptr(armcosmos.NodeKindShard), - // NodeCount: to.Ptr[int32](4), - // }}, - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // ServerVersion: to.Ptr("5.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterDelete.json -func ExampleMongoClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginDelete(ctx, "TestResourceGroup", "myMongoCluster", 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/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterAddNode.json -func ExampleMongoClustersClient_BeginUpdate_addNewShardNodes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginUpdate(ctx, "TestResourceGroup", "myMongoCluster", armcosmos.MongoClusterUpdate{ - Properties: &armcosmos.MongoClusterProperties{ - NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - { - Kind: to.Ptr(armcosmos.NodeKindShard), - NodeCount: to.Ptr[int32](4), - }}, - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MongoCluster = armcosmos.MongoCluster{ - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus2"), - // Properties: &armcosmos.MongoClusterProperties{ - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - // { - // DiskSizeGB: to.Ptr[int64](128), - // EnableHa: to.Ptr(true), - // SKU: to.Ptr("M30"), - // Kind: to.Ptr(armcosmos.NodeKindShard), - // NodeCount: to.Ptr[int32](4), - // }}, - // ServerVersion: to.Ptr("5.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterUpdate.json -func ExampleMongoClustersClient_BeginUpdate_updateTheMongoCluster() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginUpdate(ctx, "TestResourceGroup", "myMongoCluster", armcosmos.MongoClusterUpdate{ - Properties: &armcosmos.MongoClusterProperties{ - AdministratorLogin: to.Ptr("mongoAdmin"), - AdministratorLoginPassword: to.Ptr("password"), - NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - { - DiskSizeGB: to.Ptr[int64](256), - EnableHa: to.Ptr(true), - SKU: to.Ptr("M50"), - Kind: to.Ptr(armcosmos.NodeKindShard), - NodeCount: to.Ptr[int32](4), - }}, - ServerVersion: to.Ptr("5.0"), - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MongoCluster = armcosmos.MongoCluster{ - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus2"), - // Properties: &armcosmos.MongoClusterProperties{ - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // NodeGroupSpecs: []*armcosmos.NodeGroupSpec{ - // { - // DiskSizeGB: to.Ptr[int64](256), - // EnableHa: to.Ptr(true), - // SKU: to.Ptr("M50"), - // Kind: to.Ptr(armcosmos.NodeKindShard), - // NodeCount: to.Ptr[int32](4), - // }}, - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // ServerVersion: to.Ptr("5.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterFirewallRuleCreate.json -func ExampleMongoClustersClient_BeginCreateOrUpdateFirewallRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginCreateOrUpdateFirewallRule(ctx, "TestGroup", "myMongoCluster", "rule1", armcosmos.FirewallRule{ - Properties: &armcosmos.FirewallRuleProperties{ - EndIPAddress: to.Ptr("255.255.255.255"), - StartIPAddress: to.Ptr("0.0.0.0"), - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armcosmos.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Properties: &armcosmos.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterFirewallRuleDelete.json -func ExampleMongoClustersClient_BeginDeleteFirewallRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginDeleteFirewallRule(ctx, "TestGroup", "myMongoCluster", "rule1", 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/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterFirewallRuleGet.json -func ExampleMongoClustersClient_GetFirewallRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoClustersClient().GetFirewallRule(ctx, "TestGroup", "myMongoCluster", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armcosmos.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Properties: &armcosmos.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterFirewallRuleList.json -func ExampleMongoClustersClient_NewListFirewallRulesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMongoClustersClient().NewListFirewallRulesPager("TestGroup", "myMongoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallRuleListResult = armcosmos.FirewallRuleListResult{ - // Value: []*armcosmos.FirewallRule{ - // { - // Name: to.Ptr("rule1"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Properties: &armcosmos.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // }, - // { - // Name: to.Ptr("rule2"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule2"), - // SystemData: &armcosmos.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser), - // }, - // Properties: &armcosmos.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.0.0.0"), - // ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded), - // StartIPAddress: to.Ptr("1.0.0.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterNameAvailability.json -func ExampleMongoClustersClient_CheckNameAvailability_checkNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoClustersClient().CheckNameAvailability(ctx, "westus2", armcosmos.CheckNameAvailabilityRequest{ - Name: to.Ptr("newmongocluster"), - Type: to.Ptr("Microsoft.DocumentDB/mongoClusters"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResponse = armcosmos.CheckNameAvailabilityResponse{ - // NameAvailable: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterNameAvailability_AlreadyExists.json -func ExampleMongoClustersClient_CheckNameAvailability_checkNameAvailabilityAlreadyExistsResult() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoClustersClient().CheckNameAvailability(ctx, "westus2", armcosmos.CheckNameAvailabilityRequest{ - Name: to.Ptr("existingmongocluster"), - Type: to.Ptr("Microsoft.DocumentDB/mongoClusters"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResponse = armcosmos.CheckNameAvailabilityResponse{ - // Message: to.Ptr("Cluster name 'existingmongocluster' is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armcosmos.CheckNameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/mongo-cluster/CosmosDBMongoClusterListConnectionStrings.json -func ExampleMongoClustersClient_ListConnectionStrings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoClustersClient().ListConnectionStrings(ctx, "TestGroup", "myMongoCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListConnectionStringsResult = armcosmos.ListConnectionStringsResult{ - // ConnectionStrings: []*armcosmos.ConnectionString{ - // { - // Description: to.Ptr("default connection string"), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // }}, - // } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client.go index af17c74188a6..434442321342 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client.go @@ -46,7 +46,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -74,7 +74,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) createUpdateMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, createUpdateMongoDBCollectionParameters MongoDBCollectionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoDBCollectionOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginCreateUpdateMongoDBCollection" @@ -124,7 +124,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoDBCollectionCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateMongoDBCollectionParameters); err != nil { @@ -136,7 +136,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -163,7 +163,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) createUpdateMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateMongoDBDatabaseParameters MongoDBDatabaseCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoDBDatabaseOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginCreateUpdateMongoDBDatabase" @@ -209,7 +209,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoDBDatabaseCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateMongoDBDatabaseParameters); err != nil { @@ -221,7 +221,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -248,7 +248,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) createUpdateMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoRoleDefinitionParameters MongoRoleDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginCreateUpdateMongoRoleDefinition" @@ -294,7 +294,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoRoleDefinitionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateMongoRoleDefinitionParameters); err != nil { @@ -306,7 +306,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -333,7 +333,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) createUpdateMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoUserDefinitionParameters MongoUserDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginCreateUpdateMongoUserDefinition" @@ -379,7 +379,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoUserDefinitionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateMongoUserDefinitionParameters); err != nil { @@ -391,7 +391,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -418,7 +418,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) deleteMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginDeleteMongoDBCollectionOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginDeleteMongoDBCollection" @@ -468,7 +468,7 @@ func (client *MongoDBResourcesClient) deleteMongoDBCollectionCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -476,7 +476,7 @@ func (client *MongoDBResourcesClient) deleteMongoDBCollectionCreateRequest(ctx c // BeginDeleteMongoDBDatabase - Deletes an existing Azure Cosmos DB MongoDB database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -502,7 +502,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) deleteMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientBeginDeleteMongoDBDatabaseOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginDeleteMongoDBDatabase" @@ -548,7 +548,7 @@ func (client *MongoDBResourcesClient) deleteMongoDBDatabaseCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -556,7 +556,7 @@ func (client *MongoDBResourcesClient) deleteMongoDBDatabaseCreateRequest(ctx con // BeginDeleteMongoRoleDefinition - Deletes an existing Azure Cosmos DB Mongo Role Definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -582,7 +582,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) deleteMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginDeleteMongoRoleDefinition" @@ -628,7 +628,7 @@ func (client *MongoDBResourcesClient) deleteMongoRoleDefinitionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -637,7 +637,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -663,7 +663,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) deleteMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginDeleteMongoUserDefinition" @@ -709,7 +709,7 @@ func (client *MongoDBResourcesClient) deleteMongoUserDefinitionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -718,7 +718,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -775,7 +775,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -794,7 +794,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionHandleResponse(resp *h // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -851,7 +851,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionThroughputCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -869,7 +869,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -921,7 +921,7 @@ func (client *MongoDBResourcesClient) getMongoDBDatabaseCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -940,7 +940,7 @@ func (client *MongoDBResourcesClient) getMongoDBDatabaseHandleResponse(resp *htt // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -992,7 +992,7 @@ func (client *MongoDBResourcesClient) getMongoDBDatabaseThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1010,7 +1010,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -1062,7 +1062,7 @@ func (client *MongoDBResourcesClient) getMongoRoleDefinitionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1080,7 +1080,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -1132,7 +1132,7 @@ func (client *MongoDBResourcesClient) getMongoUserDefinitionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1147,100 +1147,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 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ListMongoDBCollectionPartitionMerge - Merges the partitions of a MongoDB Collection -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *MongoDBResourcesClient) listMongoDBCollectionPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (*http.Response, error) { - var err error - const operationName = "MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listMongoDBCollectionPartitionMergeCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, mergeParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, mergeParameters); err != nil { - return nil, err - } - return req, nil -} - // NewListMongoDBCollectionsPager - Lists the MongoDB collection under an existing Azure Cosmos DB database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1294,7 +1203,7 @@ func (client *MongoDBResourcesClient) listMongoDBCollectionsCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1311,7 +1220,7 @@ func (client *MongoDBResourcesClient) listMongoDBCollectionsHandleResponse(resp // NewListMongoDBDatabasesPager - Lists the MongoDB databases under an existing Azure Cosmos DB database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListMongoDBDatabasesPager @@ -1360,7 +1269,7 @@ func (client *MongoDBResourcesClient) listMongoDBDatabasesCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1377,7 +1286,7 @@ func (client *MongoDBResourcesClient) listMongoDBDatabasesHandleResponse(resp *h // NewListMongoRoleDefinitionsPager - Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListMongoRoleDefinitionsPager @@ -1426,7 +1335,7 @@ func (client *MongoDBResourcesClient) listMongoRoleDefinitionsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1443,7 +1352,7 @@ func (client *MongoDBResourcesClient) listMongoRoleDefinitionsHandleResponse(res // NewListMongoUserDefinitionsPager - Retrieves the list of all Azure Cosmos DB Mongo User Definition. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListMongoUserDefinitionsPager @@ -1492,7 +1401,7 @@ func (client *MongoDBResourcesClient) listMongoUserDefinitionsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1510,7 +1419,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1537,7 +1446,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) migrateMongoDBCollectionToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginMigrateMongoDBCollectionToAutoscale" @@ -1587,7 +1496,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToAutoscaleCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1597,7 +1506,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToAutoscaleCreateR // throughput // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1624,7 +1533,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) migrateMongoDBCollectionToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginMigrateMongoDBCollectionToManualThroughputOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginMigrateMongoDBCollectionToManualThroughput" @@ -1674,7 +1583,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToManualThroughput return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1683,7 +1592,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1709,7 +1618,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientBeginMigrateMongoDBDatabaseToAutoscaleOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginMigrateMongoDBDatabaseToAutoscale" @@ -1755,7 +1664,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToAutoscaleCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1764,7 +1673,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1790,7 +1699,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientBeginMigrateMongoDBDatabaseToManualThroughputOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginMigrateMongoDBDatabaseToManualThroughput" @@ -1836,458 +1745,16 @@ func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToManualThroughputCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - 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 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// MongoDBContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB container -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *MongoDBResourcesClient) mongoDBContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (*http.Response, error) { - var err error - const operationName = "MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.mongoDBContainerRedistributeThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, redistributeThroughputParameters); err != nil { - return nil, err - } - return req, nil -} - -// 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 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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 2023-03-15-preview -func (client *MongoDBResourcesClient) mongoDBContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (*http.Response, error) { - var err error - const operationName = "MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.mongoDBContainerRetrieveThroughputDistributionCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, retrieveThroughputParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginMongoDBDatabasePartitionMerge - Merges the partitions of a MongoDB database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-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. -// - mergeParameters - The parameters for the merge operation. -// - options - MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBDatabasePartitionMerge -// method. -func (client *MongoDBResourcesClient) BeginMongoDBDatabasePartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.mongoDBDatabasePartitionMerge(ctx, resourceGroupName, accountName, databaseName, mergeParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// MongoDBDatabasePartitionMerge - Merges the partitions of a MongoDB database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *MongoDBResourcesClient) mongoDBDatabasePartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions) (*http.Response, error) { - var err error - const operationName = "MongoDBResourcesClient.BeginMongoDBDatabasePartitionMerge" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.mongoDBDatabasePartitionMergeCreateRequest(ctx, resourceGroupName, accountName, databaseName, mergeParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// mongoDBDatabasePartitionMergeCreateRequest creates the MongoDBDatabasePartitionMerge request. -func (client *MongoDBResourcesClient) mongoDBDatabasePartitionMergeCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/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)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, mergeParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginMongoDBDatabaseRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-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. -// - redistributeThroughputParameters - The parameters to provide for redistributing throughput for the current MongoDB database. -// - options - MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions contains the optional parameters for -// the MongoDBResourcesClient.BeginMongoDBDatabaseRedistributeThroughput method. -func (client *MongoDBResourcesClient) BeginMongoDBDatabaseRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.mongoDBDatabaseRedistributeThroughput(ctx, resourceGroupName, accountName, databaseName, redistributeThroughputParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// MongoDBDatabaseRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *MongoDBResourcesClient) mongoDBDatabaseRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions) (*http.Response, error) { - var err error - const operationName = "MongoDBResourcesClient.BeginMongoDBDatabaseRedistributeThroughput" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.mongoDBDatabaseRedistributeThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, redistributeThroughputParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// mongoDBDatabaseRedistributeThroughputCreateRequest creates the MongoDBDatabaseRedistributeThroughput request. -func (client *MongoDBResourcesClient) mongoDBDatabaseRedistributeThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/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)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, redistributeThroughputParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginMongoDBDatabaseRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB MongoDB database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-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. -// - retrieveThroughputParameters - The parameters to provide for retrieving throughput distribution for the current MongoDB -// database. -// - options - MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions contains the optional parameters -// for the MongoDBResourcesClient.BeginMongoDBDatabaseRetrieveThroughputDistribution method. -func (client *MongoDBResourcesClient) BeginMongoDBDatabaseRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.mongoDBDatabaseRetrieveThroughputDistribution(ctx, resourceGroupName, accountName, databaseName, retrieveThroughputParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// MongoDBDatabaseRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB MongoDB database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *MongoDBResourcesClient) mongoDBDatabaseRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions) (*http.Response, error) { - var err error - const operationName = "MongoDBResourcesClient.BeginMongoDBDatabaseRetrieveThroughputDistribution" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.mongoDBDatabaseRetrieveThroughputDistributionCreateRequest(ctx, resourceGroupName, accountName, databaseName, retrieveThroughputParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// mongoDBDatabaseRetrieveThroughputDistributionCreateRequest creates the MongoDBDatabaseRetrieveThroughputDistribution request. -func (client *MongoDBResourcesClient) mongoDBDatabaseRetrieveThroughputDistributionCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/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)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, retrieveThroughputParameters); err != nil { - return nil, err - } return req, nil } // BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a Mongodb collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2316,7 +1783,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, location ContinuousBackupRestoreLocation, options *MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginRetrieveContinuousBackupInformation" @@ -2366,7 +1833,7 @@ func (client *MongoDBResourcesClient) retrieveContinuousBackupInformationCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, location); err != nil { @@ -2378,7 +1845,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2406,7 +1873,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) updateMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *MongoDBResourcesClientBeginUpdateMongoDBCollectionThroughputOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginUpdateMongoDBCollectionThroughput" @@ -2456,7 +1923,7 @@ func (client *MongoDBResourcesClient) updateMongoDBCollectionThroughputCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { @@ -2468,7 +1935,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2495,7 +1962,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *MongoDBResourcesClient) updateMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *MongoDBResourcesClientBeginUpdateMongoDBDatabaseThroughputOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginUpdateMongoDBDatabaseThroughput" @@ -2541,7 +2008,7 @@ func (client *MongoDBResourcesClient) updateMongoDBDatabaseThroughputCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client_example_test.go index 8b3fc9c77492..bf547c4f078d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client_example_test.go @@ -13,14 +13,12 @@ import ( "context" "log" - "time" - "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabaseList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBDatabaseList.json func ExampleMongoDBResourcesClient_NewListMongoDBDatabasesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,7 +59,7 @@ func ExampleMongoDBResourcesClient_NewListMongoDBDatabasesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabaseGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBDatabaseGet.json func ExampleMongoDBResourcesClient_GetMongoDBDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -97,8 +95,8 @@ func ExampleMongoDBResourcesClient_GetMongoDBDatabase() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBDatabase_cosmosDbMongoDbDatabaseCreateUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json +func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -143,58 +141,7 @@ func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBDatabase_cosmosDbMong // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabaseRestore.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBDatabase_cosmosDbMongoDbDatabaseRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().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{ - CreateMode: to.Ptr(armcosmos.CreateModeRestore), - ID: to.Ptr("databaseName"), - RestoreParameters: &armcosmos.ResourceRestoreParameters{ - RestoreSource: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId"), - RestoreTimestampInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-20T18:28:00.000Z"); return t }()), - }, - }, - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MongoDBDatabaseGetResults = armcosmos.MongoDBDatabaseGetResults{ - // Name: to.Ptr("databaseName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.MongoDBDatabaseGetProperties{ - // Resource: &armcosmos.MongoDBDatabaseGetPropertiesResource{ - // ID: to.Ptr("updatedDatabaseName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabaseDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBDatabaseDelete.json func ExampleMongoDBResourcesClient_BeginDeleteMongoDBDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -215,7 +162,7 @@ func ExampleMongoDBResourcesClient_BeginDeleteMongoDBDatabase() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json func ExampleMongoDBResourcesClient_GetMongoDBDatabaseThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -245,15 +192,17 @@ func ExampleMongoDBResourcesClient_GetMongoDBDatabaseThroughput() { // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), // Rid: to.Ptr("PD5DALigDgw="), // Ts: to.Ptr[float32](1459200611), + // InstantMaximumThroughput: to.Ptr("10000"), // MinimumThroughput: to.Ptr("400"), // OfferReplacePending: to.Ptr("true"), + // SoftAllowedMaximumThroughput: to.Ptr("1000000"), // Throughput: to.Ptr[int32](400), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json func ExampleMongoDBResourcesClient_BeginUpdateMongoDBDatabaseThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -303,7 +252,7 @@ func ExampleMongoDBResourcesClient_BeginUpdateMongoDBDatabaseThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -342,7 +291,7 @@ func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToAutoscale() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -378,249 +327,7 @@ func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToManualThroughput // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json -func ExampleMongoDBResourcesClient_BeginMongoDBDatabaseRetrieveThroughputDistribution() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginMongoDBDatabaseRetrieveThroughputDistribution(ctx, "rg1", "ddb1", "databaseName", 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{ - // Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{ - // Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{ - // PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ - // { - // ID: to.Ptr("0"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("1"), - // Throughput: to.Ptr[float64](5000), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json -func ExampleMongoDBResourcesClient_BeginMongoDBDatabaseRedistributeThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginMongoDBDatabaseRedistributeThroughput(ctx, "rg1", "ddb1", "databaseName", 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{ - // Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{ - // Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{ - // PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ - // { - // ID: to.Ptr("0"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("1"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("2"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("3"), - // Throughput: to.Ptr[float64](3000), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{ - // Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{ - // Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{ - // PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ - // { - // ID: to.Ptr("0"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("1"), - // Throughput: to.Ptr[float64](5000), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{ - // Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{ - // Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{ - // PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ - // { - // ID: to.Ptr("0"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("1"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("2"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("3"), - // Throughput: to.Ptr[float64](3000), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBCollectionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBCollectionList.json func ExampleMongoDBResourcesClient_NewListMongoDBCollectionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -653,7 +360,6 @@ func ExampleMongoDBResourcesClient_NewListMongoDBCollectionsPager() { // }, // Properties: &armcosmos.MongoDBCollectionGetProperties{ // Resource: &armcosmos.MongoDBCollectionGetPropertiesResource{ - // AnalyticalStorageTTL: to.Ptr[int32](500), // ID: to.Ptr("testcoll"), // Indexes: []*armcosmos.MongoIndex{ // { @@ -676,7 +382,7 @@ func ExampleMongoDBResourcesClient_NewListMongoDBCollectionsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBCollectionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBCollectionGet.json func ExampleMongoDBResourcesClient_GetMongoDBCollection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -706,7 +412,6 @@ func ExampleMongoDBResourcesClient_GetMongoDBCollection() { // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), // Rid: to.Ptr("PD5DALigDgw="), // Ts: to.Ptr[float32](1459200611), - // AnalyticalStorageTTL: to.Ptr[int32](500), // ID: to.Ptr("testcoll"), // Indexes: []*armcosmos.MongoIndex{ // { @@ -727,8 +432,8 @@ func ExampleMongoDBResourcesClient_GetMongoDBCollection() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBCollection_cosmosDbMongoDbCollectionCreateUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json +func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBCollection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -744,8 +449,7 @@ func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBCollection_cosmosDbMo Properties: &armcosmos.MongoDBCollectionCreateUpdateProperties{ Options: &armcosmos.CreateUpdateOptions{}, Resource: &armcosmos.MongoDBCollectionResource{ - AnalyticalStorageTTL: to.Ptr[int32](500), - ID: to.Ptr("collectionName"), + ID: to.Ptr("collectionName"), Indexes: []*armcosmos.MongoIndex{ { Key: &armcosmos.MongoIndexKeys{ @@ -788,79 +492,6 @@ func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBCollection_cosmosDbMo // }, // Properties: &armcosmos.MongoDBCollectionGetProperties{ // Resource: &armcosmos.MongoDBCollectionGetPropertiesResource{ - // 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"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBCollectionRestore.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBCollection_cosmosDbMongoDbCollectionRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().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{ - CreateMode: to.Ptr(armcosmos.CreateModeRestore), - ID: to.Ptr("collectionName"), - RestoreParameters: &armcosmos.ResourceRestoreParameters{ - RestoreSource: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId"), - RestoreTimestampInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-20T18:28:00.000Z"); return t }()), - }, - }, - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MongoDBCollectionGetResults = armcosmos.MongoDBCollectionGetResults{ - // Name: to.Ptr("collectionName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/mongodbCollections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/mongodbCollections/collectionName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.MongoDBCollectionGetProperties{ - // Resource: &armcosmos.MongoDBCollectionGetPropertiesResource{ - // AnalyticalStorageTTL: to.Ptr[int32](500), // ID: to.Ptr("collectionName"), // Indexes: []*armcosmos.MongoIndex{ // { @@ -887,7 +518,7 @@ func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBCollection_cosmosDbMo // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBCollectionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBCollectionDelete.json func ExampleMongoDBResourcesClient_BeginDeleteMongoDBCollection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -908,129 +539,7 @@ func ExampleMongoDBResourcesClient_BeginDeleteMongoDBCollection() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json -func ExampleMongoDBResourcesClient_BeginMongoDBDatabasePartitionMerge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginMongoDBDatabasePartitionMerge(ctx, "rgName", "ddb1", "databaseName", 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionStorageInfoCollection = armcosmos.PhysicalPartitionStorageInfoCollection{ - // PhysicalPartitionStorageInfoCollection: []*armcosmos.PhysicalPartitionStorageInfo{ - // { - // ID: to.Ptr("0"), - // StorageInKB: to.Ptr[float64](333), - // }, - // { - // ID: to.Ptr("1"), - // StorageInKB: to.Ptr[float64](305), - // }, - // { - // ID: to.Ptr("177"), - // StorageInKB: to.Ptr[float64](368), - // }, - // { - // ID: to.Ptr("178"), - // StorageInKB: to.Ptr[float64](96313), - // }, - // { - // ID: to.Ptr("5"), - // StorageInKB: to.Ptr[float64](194), - // }, - // { - // ID: to.Ptr("6"), - // StorageInKB: to.Ptr[float64](331), - // }, - // { - // ID: to.Ptr("7"), - // StorageInKB: to.Ptr[float64](384), - // }, - // { - // ID: to.Ptr("8"), - // StorageInKB: to.Ptr[float64](246), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionStorageInfoCollection = armcosmos.PhysicalPartitionStorageInfoCollection{ - // PhysicalPartitionStorageInfoCollection: []*armcosmos.PhysicalPartitionStorageInfo{ - // { - // ID: to.Ptr("0"), - // StorageInKB: to.Ptr[float64](333), - // }, - // { - // ID: to.Ptr("1"), - // StorageInKB: to.Ptr[float64](305), - // }, - // { - // ID: to.Ptr("177"), - // StorageInKB: to.Ptr[float64](368), - // }, - // { - // ID: to.Ptr("178"), - // StorageInKB: to.Ptr[float64](96313), - // }, - // { - // ID: to.Ptr("5"), - // StorageInKB: to.Ptr[float64](194), - // }, - // { - // ID: to.Ptr("6"), - // StorageInKB: to.Ptr[float64](331), - // }, - // { - // ID: to.Ptr("7"), - // StorageInKB: to.Ptr[float64](384), - // }, - // { - // ID: to.Ptr("8"), - // StorageInKB: to.Ptr[float64](246), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBCollectionThroughputGet.json func ExampleMongoDBResourcesClient_GetMongoDBCollectionThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1060,15 +569,17 @@ func ExampleMongoDBResourcesClient_GetMongoDBCollectionThroughput() { // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), // Rid: to.Ptr("PD5DALigDgw="), // Ts: to.Ptr[float32](1459200611), + // InstantMaximumThroughput: to.Ptr("10000"), // MinimumThroughput: to.Ptr("400"), // OfferReplacePending: to.Ptr("true"), + // SoftAllowedMaximumThroughput: to.Ptr("1000000"), // Throughput: to.Ptr[int32](400), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json func ExampleMongoDBResourcesClient_BeginUpdateMongoDBCollectionThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1118,7 +629,7 @@ func ExampleMongoDBResourcesClient_BeginUpdateMongoDBCollectionThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1157,7 +668,7 @@ func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToAutoscale() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1193,7 +704,7 @@ func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToManualThroughp // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBRoleDefinitionGet.json func ExampleMongoDBResourcesClient_GetMongoRoleDefinition() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1238,7 +749,7 @@ func ExampleMongoDBResourcesClient_GetMongoRoleDefinition() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoRoleDefinition() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1307,7 +818,7 @@ func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoRoleDefinition() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBRoleDefinitionDelete.json func ExampleMongoDBResourcesClient_BeginDeleteMongoRoleDefinition() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1328,7 +839,7 @@ func ExampleMongoDBResourcesClient_BeginDeleteMongoRoleDefinition() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBRoleDefinitionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBRoleDefinitionList.json func ExampleMongoDBResourcesClient_NewListMongoRoleDefinitionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1381,7 +892,7 @@ func ExampleMongoDBResourcesClient_NewListMongoRoleDefinitionsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBUserDefinitionGet.json func ExampleMongoDBResourcesClient_GetMongoUserDefinition() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1417,7 +928,7 @@ func ExampleMongoDBResourcesClient_GetMongoUserDefinition() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoUserDefinition() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1470,7 +981,7 @@ func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoUserDefinition() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBUserDefinitionDelete.json func ExampleMongoDBResourcesClient_BeginDeleteMongoUserDefinition() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1491,7 +1002,7 @@ func ExampleMongoDBResourcesClient_BeginDeleteMongoUserDefinition() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBUserDefinitionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBUserDefinitionList.json func ExampleMongoDBResourcesClient_NewListMongoUserDefinitionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1535,7 +1046,7 @@ func ExampleMongoDBResourcesClient_NewListMongoUserDefinitionsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMongoDBCollectionBackupInformation.json func ExampleMongoDBResourcesClient_BeginRetrieveContinuousBackupInformation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client.go b/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client.go index df98f1733766..baec68ff6ca6 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client.go @@ -46,7 +46,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -73,7 +73,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *NotebookWorkspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters, options *NotebookWorkspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "NotebookWorkspacesClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *NotebookWorkspacesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, notebookCreateUpdateParameters); err != nil { @@ -131,7 +131,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -157,7 +157,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *NotebookWorkspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NotebookWorkspacesClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *NotebookWorkspacesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -263,7 +263,7 @@ func (client *NotebookWorkspacesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *NotebookWorkspacesClient) getHandleResponse(resp *http.Response) ( // NewListByDatabaseAccountPager - Gets the notebook workspace resources of an existing Cosmos DB account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListByDatabaseAccountPager @@ -329,7 +329,7 @@ func (client *NotebookWorkspacesClient) listByDatabaseAccountCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +347,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -399,7 +399,7 @@ func (client *NotebookWorkspacesClient) listConnectionInfoCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -417,7 +417,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -443,7 +443,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *NotebookWorkspacesClient) regenerateAuthToken(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientBeginRegenerateAuthTokenOptions) (*http.Response, error) { var err error const operationName = "NotebookWorkspacesClient.BeginRegenerateAuthToken" @@ -489,7 +489,7 @@ func (client *NotebookWorkspacesClient) regenerateAuthTokenCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -498,7 +498,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -524,7 +524,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *NotebookWorkspacesClient) start(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "NotebookWorkspacesClient.BeginStart" @@ -570,7 +570,7 @@ func (client *NotebookWorkspacesClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index daedee935d21..9123885c6166 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBNotebookWorkspaceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBNotebookWorkspaceList.json func ExampleNotebookWorkspacesClient_NewListByDatabaseAccountPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -54,7 +54,7 @@ func ExampleNotebookWorkspacesClient_NewListByDatabaseAccountPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBNotebookWorkspaceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBNotebookWorkspaceGet.json func ExampleNotebookWorkspacesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -83,7 +83,7 @@ func ExampleNotebookWorkspacesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBNotebookWorkspaceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBNotebookWorkspaceCreate.json func ExampleNotebookWorkspacesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExampleNotebookWorkspacesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBNotebookWorkspaceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBNotebookWorkspaceDelete.json func ExampleNotebookWorkspacesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +137,7 @@ func ExampleNotebookWorkspacesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json func ExampleNotebookWorkspacesClient_ListConnectionInfo() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -161,7 +161,7 @@ func ExampleNotebookWorkspacesClient_ListConnectionInfo() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json func ExampleNotebookWorkspacesClient_BeginRegenerateAuthToken() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -182,7 +182,7 @@ func ExampleNotebookWorkspacesClient_BeginRegenerateAuthToken() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBNotebookWorkspaceStart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBNotebookWorkspaceStart.json func ExampleNotebookWorkspacesClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/operations_client.go b/sdk/resourcemanager/cosmos/armcosmos/operations_client.go index 981100ff2f01..b8d0177572a4 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/operations_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Cosmos DB Resource Provider operations. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 070c7d1a7150..4003879b70d7 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/operations_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/operations_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBOperationsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBOperationsList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/options.go b/sdk/resourcemanager/cosmos/armcosmos/options.go index 206b0031593e..a72459f6a8db 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/options.go +++ b/sdk/resourcemanager/cosmos/armcosmos/options.go @@ -49,22 +49,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.NewListBackupsPager -// method. -type CassandraClustersClientListBackupsOptions struct { - // placeholder for future optional parameters -} - // CassandraClustersClientListByResourceGroupOptions contains the optional parameters for the CassandraClustersClient.NewListByResourceGroupPager // method. type CassandraClustersClientListByResourceGroupOptions struct { @@ -128,13 +117,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 { @@ -149,13 +131,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 { @@ -184,20 +159,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 { @@ -212,13 +173,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 { @@ -243,18 +197,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.NewListCassandraKeyspacesPager // method. type CassandraResourcesClientListCassandraKeyspacesOptions struct { @@ -267,12 +209,6 @@ type CassandraResourcesClientListCassandraTablesOptions struct { // placeholder for future optional parameters } -// CassandraResourcesClientListCassandraViewsOptions contains the optional parameters for the CassandraResourcesClient.NewListCassandraViewsPager -// method. -type CassandraResourcesClientListCassandraViewsOptions struct { - // placeholder for future optional parameters -} - // CollectionClientListMetricDefinitionsOptions contains the optional parameters for the CollectionClient.NewListMetricDefinitionsPager // method. type CollectionClientListMetricDefinitionsOptions struct { @@ -317,37 +253,6 @@ type CollectionRegionClientListMetricsOptions struct { // placeholder for future optional parameters } -// 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 -} - -// DataTransferJobsClientListByDatabaseAccountOptions contains the optional parameters for the DataTransferJobsClient.NewListByDatabaseAccountPager -// method. -type DataTransferJobsClientListByDatabaseAccountOptions struct { - // placeholder for future optional parameters -} - -// DataTransferJobsClientPauseOptions contains the optional parameters for the DataTransferJobsClient.Pause method. -type DataTransferJobsClientPauseOptions struct { - // placeholder for future optional parameters -} - -// DataTransferJobsClientResumeOptions contains the optional parameters for the DataTransferJobsClient.Resume method. -type DataTransferJobsClientResumeOptions struct { - // placeholder for future optional parameters -} - // DatabaseAccountRegionClientListMetricsOptions contains the optional parameters for the DatabaseAccountRegionClient.NewListMetricsPager // method. type DatabaseAccountRegionClientListMetricsOptions struct { @@ -484,31 +389,6 @@ type DatabaseClientListUsagesOptions struct { Filter *string } -// 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.NewListGraphsPager -// method. -type GraphResourcesClientListGraphsOptions struct { - // placeholder for future optional parameters -} - // GremlinResourcesClientBeginCreateUpdateGremlinDatabaseOptions contains the optional parameters for the GremlinResourcesClient.BeginCreateUpdateGremlinDatabase // method. type GremlinResourcesClientBeginCreateUpdateGremlinDatabaseOptions struct { @@ -632,79 +512,6 @@ type LocationsClientListOptions struct { // placeholder for future optional parameters } -// MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions contains the optional parameters for the MongoClustersClient.BeginCreateOrUpdateFirewallRule -// method. -type MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the MongoClustersClient.BeginCreateOrUpdate -// method. -type MongoClustersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoClustersClientBeginDeleteFirewallRuleOptions contains the optional parameters for the MongoClustersClient.BeginDeleteFirewallRule -// method. -type MongoClustersClientBeginDeleteFirewallRuleOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoClustersClientBeginDeleteOptions contains the optional parameters for the MongoClustersClient.BeginDelete method. -type MongoClustersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoClustersClientBeginUpdateOptions contains the optional parameters for the MongoClustersClient.BeginUpdate method. -type MongoClustersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoClustersClientCheckNameAvailabilityOptions contains the optional parameters for the MongoClustersClient.CheckNameAvailability -// method. -type MongoClustersClientCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// MongoClustersClientGetFirewallRuleOptions contains the optional parameters for the MongoClustersClient.GetFirewallRule -// method. -type MongoClustersClientGetFirewallRuleOptions struct { - // placeholder for future optional parameters -} - -// MongoClustersClientGetOptions contains the optional parameters for the MongoClustersClient.Get method. -type MongoClustersClientGetOptions struct { - // placeholder for future optional parameters -} - -// MongoClustersClientListByResourceGroupOptions contains the optional parameters for the MongoClustersClient.NewListByResourceGroupPager -// method. -type MongoClustersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// MongoClustersClientListConnectionStringsOptions contains the optional parameters for the MongoClustersClient.ListConnectionStrings -// method. -type MongoClustersClientListConnectionStringsOptions struct { - // placeholder for future optional parameters -} - -// MongoClustersClientListFirewallRulesOptions contains the optional parameters for the MongoClustersClient.NewListFirewallRulesPager -// method. -type MongoClustersClientListFirewallRulesOptions struct { - // placeholder for future optional parameters -} - -// MongoClustersClientListOptions contains the optional parameters for the MongoClustersClient.NewListPager method. -type MongoClustersClientListOptions struct { - // placeholder for future optional parameters -} - // MongoDBResourcesClientBeginCreateUpdateMongoDBCollectionOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoDBCollection // method. type MongoDBResourcesClientBeginCreateUpdateMongoDBCollectionOptions struct { @@ -761,13 +568,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 { @@ -796,41 +596,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 -} - -// MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBDatabasePartitionMerge -// method. -type MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBDatabaseRedistributeThroughput -// method. -type MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions contains the optional parameters for the -// MongoDBResourcesClient.BeginMongoDBDatabaseRetrieveThroughputDistribution method. -type MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the MongoDBResourcesClient.BeginRetrieveContinuousBackupInformation // method. type MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions struct { @@ -1257,13 +1022,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 { @@ -1299,41 +1057,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 -} - -// SQLResourcesClientBeginSQLDatabasePartitionMergeOptions contains the optional parameters for the SQLResourcesClient.BeginSQLDatabasePartitionMerge -// method. -type SQLResourcesClientBeginSQLDatabasePartitionMergeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginSQLDatabaseRedistributeThroughput -// method. -type SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions contains the optional parameters for the SQLResourcesClient.BeginSQLDatabaseRetrieveThroughputDistribution -// method. -type SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // SQLResourcesClientBeginUpdateSQLContainerThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginUpdateSQLContainerThroughput // method. type SQLResourcesClientBeginUpdateSQLContainerThroughputOptions struct { diff --git a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client.go b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client.go index 0691452733ab..bbc22b6b0a1f 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client.go @@ -45,7 +45,7 @@ func NewPartitionKeyRangeIDClient(subscriptionID string, credential azcore.Token // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given partition key range id. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -112,7 +112,7 @@ func (client *PartitionKeyRangeIDClient) listMetricsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index c68b26798b1e..51db4801b210 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBPKeyRangeIdGetMetrics.json func ExamplePartitionKeyRangeIDClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client.go index f6badd9c3c8b..ed30081497bf 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client.go @@ -45,7 +45,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. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -117,7 +117,7 @@ func (client *PartitionKeyRangeIDRegionClient) listMetricsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 34f44ec69ced..166e64eff6b0 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json func ExamplePartitionKeyRangeIDRegionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentile_client.go b/sdk/resourcemanager/cosmos/armcosmos/percentile_client.go index 38cf295cb604..28fca2ca1e36 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/percentile_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/percentile_client.go @@ -46,7 +46,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 // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -98,7 +98,7 @@ func (client *PercentileClient) listMetricsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 2ac4f779afb0..106f36aff6a2 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/percentile_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/percentile_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBPercentileGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBPercentileGetMetrics.json func ExamplePercentileClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client.go b/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client.go index 8cbac1d34ba4..93b776ad59b7 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client.go @@ -46,7 +46,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 // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -108,7 +108,7 @@ func (client *PercentileSourceTargetClient) listMetricsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index e672c5f22d41..6cab226de0aa 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json func ExamplePercentileSourceTargetClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client.go b/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client.go index 373496cb8aa6..c2c6f6a7cc6a 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client.go @@ -46,7 +46,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 // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -103,7 +103,7 @@ func (client *PercentileTargetClient) listMetricsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 3555c39082dc..afa5bfb67ebb 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBPercentileTargetGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBPercentileTargetGetMetrics.json func ExamplePercentileTargetClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/polymorphic_helpers.go b/sdk/resourcemanager/cosmos/armcosmos/polymorphic_helpers.go index 60ec26fd4ff1..ada396623b7f 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/polymorphic_helpers.go +++ b/sdk/resourcemanager/cosmos/armcosmos/polymorphic_helpers.go @@ -33,33 +33,6 @@ func unmarshalBackupPolicyClassification(rawMsg json.RawMessage) (BackupPolicyCl return b, nil } -func unmarshalDataTransferDataSourceSinkClassification(rawMsg json.RawMessage) (DataTransferDataSourceSinkClassification, error) { - if rawMsg == nil { - return nil, nil - } - var m map[string]any - 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(DataTransferComponentCosmosDBMongo): - b = &MongoDataTransferDataSourceSink{} - case string(DataTransferComponentCosmosDBSQL): - b = &SQLDataTransferDataSourceSink{} - default: - b = &DataTransferDataSourceSink{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - 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 e9c70a6e68de..49ff315d32ed 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client.go @@ -46,7 +46,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -72,7 +72,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +130,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -156,7 +156,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginDelete" @@ -202,7 +202,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -263,7 +263,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByDatabaseAccountPager - List all private endpoint connections on a Cosmos DB account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListByDatabaseAccountPager @@ -329,7 +329,7 @@ func (client *PrivateEndpointConnectionsClient) listByDatabaseAccountCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index cc8414045fb8..503f02dd9d05 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBPrivateEndpointConnectionListGet.json func ExamplePrivateEndpointConnectionsClient_NewListByDatabaseAccountPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -80,7 +80,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListByDatabaseAccountPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBPrivateEndpointConnectionGet.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -117,7 +117,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -165,7 +165,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBPrivateEndpointConnectionDelete.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client.go index dd022e0e42af..06610767e61c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client.go @@ -46,7 +46,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -98,7 +98,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByDatabaseAccountPager - Gets the private link resources that need to be created for a Cosmos DB account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListByDatabaseAccountPager @@ -164,7 +164,7 @@ func (client *PrivateLinkResourcesClient) listByDatabaseAccountCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 05ff7e0d8dee..4ca011b0885f 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBPrivateLinkResourceListGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBPrivateLinkResourceListGet.json func ExamplePrivateLinkResourcesClient_NewListByDatabaseAccountPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -58,7 +58,7 @@ func ExamplePrivateLinkResourcesClient_NewListByDatabaseAccountPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBPrivateLinkResourceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBPrivateLinkResourceGet.json func ExamplePrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/response_types.go b/sdk/resourcemanager/cosmos/armcosmos/response_types.go index 9b3860a6e71e..ae0249938975 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/response_types.go +++ b/sdk/resourcemanager/cosmos/armcosmos/response_types.go @@ -24,12 +24,6 @@ type CassandraClustersClientDeleteResponse struct { // placeholder for future response values } -// CassandraClustersClientGetBackupResponse contains the response from method CassandraClustersClient.GetBackup. -type CassandraClustersClientGetBackupResponse struct { - // A restorable backup of a Cassandra cluster. - BackupResource -} - // CassandraClustersClientGetResponse contains the response from method CassandraClustersClient.Get. type CassandraClustersClientGetResponse struct { // Representation of a managed Cassandra cluster. @@ -42,12 +36,6 @@ type CassandraClustersClientInvokeCommandResponse struct { CommandOutput } -// CassandraClustersClientListBackupsResponse contains the response from method CassandraClustersClient.NewListBackupsPager. -type CassandraClustersClientListBackupsResponse struct { - // List of restorable backups for a Cassandra cluster. - ListBackups -} - // CassandraClustersClientListByResourceGroupResponse contains the response from method CassandraClustersClient.NewListByResourceGroupPager. type CassandraClustersClientListByResourceGroupResponse struct { // List of managed Cassandra clusters. @@ -118,12 +106,6 @@ type CassandraResourcesClientCreateUpdateCassandraTableResponse struct { CassandraTableGetResults } -// CassandraResourcesClientCreateUpdateCassandraViewResponse contains the response from method CassandraResourcesClient.BeginCreateUpdateCassandraView. -type CassandraResourcesClientCreateUpdateCassandraViewResponse struct { - // An Azure Cosmos DB Cassandra view. - CassandraViewGetResults -} - // CassandraResourcesClientDeleteCassandraKeyspaceResponse contains the response from method CassandraResourcesClient.BeginDeleteCassandraKeyspace. type CassandraResourcesClientDeleteCassandraKeyspaceResponse struct { // placeholder for future response values @@ -134,11 +116,6 @@ type CassandraResourcesClientDeleteCassandraTableResponse struct { // placeholder for future response values } -// CassandraResourcesClientDeleteCassandraViewResponse contains the response from method CassandraResourcesClient.BeginDeleteCassandraView. -type CassandraResourcesClientDeleteCassandraViewResponse struct { - // placeholder for future response values -} - // CassandraResourcesClientGetCassandraKeyspaceResponse contains the response from method CassandraResourcesClient.GetCassandraKeyspace. type CassandraResourcesClientGetCassandraKeyspaceResponse struct { // An Azure Cosmos DB Cassandra keyspace. @@ -163,18 +140,6 @@ type CassandraResourcesClientGetCassandraTableThroughputResponse struct { ThroughputSettingsGetResults } -// CassandraResourcesClientGetCassandraViewResponse contains the response from method CassandraResourcesClient.GetCassandraView. -type CassandraResourcesClientGetCassandraViewResponse struct { - // An Azure Cosmos DB Cassandra view. - CassandraViewGetResults -} - -// CassandraResourcesClientGetCassandraViewThroughputResponse contains the response from method CassandraResourcesClient.GetCassandraViewThroughput. -type CassandraResourcesClientGetCassandraViewThroughputResponse struct { - // An Azure Cosmos DB resource throughput. - ThroughputSettingsGetResults -} - // CassandraResourcesClientListCassandraKeyspacesResponse contains the response from method CassandraResourcesClient.NewListCassandraKeyspacesPager. type CassandraResourcesClientListCassandraKeyspacesResponse struct { // The List operation response, that contains the Cassandra keyspaces and their properties. @@ -187,12 +152,6 @@ type CassandraResourcesClientListCassandraTablesResponse struct { CassandraTableListResult } -// CassandraResourcesClientListCassandraViewsResponse contains the response from method CassandraResourcesClient.NewListCassandraViewsPager. -type CassandraResourcesClientListCassandraViewsResponse struct { - // The List operation response, that contains the Cassandra views and their properties. - CassandraViewListResult -} - // CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse contains the response from method CassandraResourcesClient.BeginMigrateCassandraKeyspaceToAutoscale. type CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse struct { // An Azure Cosmos DB resource throughput. @@ -217,18 +176,6 @@ type CassandraResourcesClientMigrateCassandraTableToManualThroughputResponse str ThroughputSettingsGetResults } -// CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse contains the response from method CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale. -type CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse struct { - // An Azure Cosmos DB resource throughput. - ThroughputSettingsGetResults -} - -// CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse contains the response from method CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput. -type CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse struct { - // An Azure Cosmos DB resource throughput. - ThroughputSettingsGetResults -} - // CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse contains the response from method CassandraResourcesClient.BeginUpdateCassandraKeyspaceThroughput. type CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse struct { // An Azure Cosmos DB resource throughput. @@ -241,12 +188,6 @@ type CassandraResourcesClientUpdateCassandraTableThroughputResponse struct { ThroughputSettingsGetResults } -// CassandraResourcesClientUpdateCassandraViewThroughputResponse contains the response from method CassandraResourcesClient.BeginUpdateCassandraViewThroughput. -type CassandraResourcesClientUpdateCassandraViewThroughputResponse struct { - // An Azure Cosmos DB resource throughput. - ThroughputSettingsGetResults -} - // CollectionClientListMetricDefinitionsResponse contains the response from method CollectionClient.NewListMetricDefinitionsPager. type CollectionClientListMetricDefinitionsResponse struct { // The response to a list metric definitions request. @@ -289,42 +230,6 @@ type CollectionRegionClientListMetricsResponse struct { MetricListResult } -// DataTransferJobsClientCancelResponse contains the response from method DataTransferJobsClient.Cancel. -type DataTransferJobsClientCancelResponse struct { - // A Cosmos DB Data Transfer Job - DataTransferJobGetResults -} - -// DataTransferJobsClientCreateResponse contains the response from method DataTransferJobsClient.Create. -type DataTransferJobsClientCreateResponse struct { - // A Cosmos DB Data Transfer Job - DataTransferJobGetResults -} - -// DataTransferJobsClientGetResponse contains the response from method DataTransferJobsClient.Get. -type DataTransferJobsClientGetResponse struct { - // A Cosmos DB Data Transfer Job - DataTransferJobGetResults -} - -// DataTransferJobsClientListByDatabaseAccountResponse contains the response from method DataTransferJobsClient.NewListByDatabaseAccountPager. -type DataTransferJobsClientListByDatabaseAccountResponse struct { - // The List operation response, that contains the Data Transfer jobs and their properties. - DataTransferJobFeedResults -} - -// DataTransferJobsClientPauseResponse contains the response from method DataTransferJobsClient.Pause. -type DataTransferJobsClientPauseResponse struct { - // A Cosmos DB Data Transfer Job - DataTransferJobGetResults -} - -// DataTransferJobsClientResumeResponse contains the response from method DataTransferJobsClient.Resume. -type DataTransferJobsClientResumeResponse struct { - // A Cosmos DB Data Transfer Job - DataTransferJobGetResults -} - // DatabaseAccountRegionClientListMetricsResponse contains the response from method DatabaseAccountRegionClient.NewListMetricsPager. type DatabaseAccountRegionClientListMetricsResponse struct { // The response to a list metrics request. @@ -452,29 +357,6 @@ type DatabaseClientListUsagesResponse struct { UsagesResult } -// GraphResourcesClientCreateUpdateGraphResponse contains the response from method GraphResourcesClient.BeginCreateUpdateGraph. -type GraphResourcesClientCreateUpdateGraphResponse struct { - // An Azure Cosmos DB Graph resource. - GraphResourceGetResults -} - -// GraphResourcesClientDeleteGraphResourceResponse contains the response from method GraphResourcesClient.BeginDeleteGraphResource. -type GraphResourcesClientDeleteGraphResourceResponse struct { - // placeholder for future response values -} - -// GraphResourcesClientGetGraphResponse contains the response from method GraphResourcesClient.GetGraph. -type GraphResourcesClientGetGraphResponse struct { - // An Azure Cosmos DB Graph resource. - GraphResourceGetResults -} - -// GraphResourcesClientListGraphsResponse contains the response from method GraphResourcesClient.NewListGraphsPager. -type GraphResourcesClientListGraphsResponse struct { - // The List operation response, that contains the Graph resource and their properties. - GraphResourcesListResult -} - // GremlinResourcesClientCreateUpdateGremlinDatabaseResponse contains the response from method GremlinResourcesClient.BeginCreateUpdateGremlinDatabase. type GremlinResourcesClientCreateUpdateGremlinDatabaseResponse struct { // An Azure Cosmos DB Gremlin database. @@ -587,76 +469,6 @@ type LocationsClientListResponse struct { LocationListResult } -// MongoClustersClientCheckNameAvailabilityResponse contains the response from method MongoClustersClient.CheckNameAvailability. -type MongoClustersClientCheckNameAvailabilityResponse struct { - // The check availability result. - CheckNameAvailabilityResponse -} - -// MongoClustersClientCreateOrUpdateFirewallRuleResponse contains the response from method MongoClustersClient.BeginCreateOrUpdateFirewallRule. -type MongoClustersClientCreateOrUpdateFirewallRuleResponse struct { - // Represents a mongo cluster firewall rule. - FirewallRule -} - -// MongoClustersClientCreateOrUpdateResponse contains the response from method MongoClustersClient.BeginCreateOrUpdate. -type MongoClustersClientCreateOrUpdateResponse struct { - // Represents a mongo cluster resource. - MongoCluster -} - -// MongoClustersClientDeleteFirewallRuleResponse contains the response from method MongoClustersClient.BeginDeleteFirewallRule. -type MongoClustersClientDeleteFirewallRuleResponse struct { - // placeholder for future response values -} - -// MongoClustersClientDeleteResponse contains the response from method MongoClustersClient.BeginDelete. -type MongoClustersClientDeleteResponse struct { - // placeholder for future response values -} - -// MongoClustersClientGetFirewallRuleResponse contains the response from method MongoClustersClient.GetFirewallRule. -type MongoClustersClientGetFirewallRuleResponse struct { - // Represents a mongo cluster firewall rule. - FirewallRule -} - -// MongoClustersClientGetResponse contains the response from method MongoClustersClient.Get. -type MongoClustersClientGetResponse struct { - // Represents a mongo cluster resource. - MongoCluster -} - -// MongoClustersClientListByResourceGroupResponse contains the response from method MongoClustersClient.NewListByResourceGroupPager. -type MongoClustersClientListByResourceGroupResponse struct { - // A list of mongo clusters. - MongoClusterListResult -} - -// MongoClustersClientListConnectionStringsResponse contains the response from method MongoClustersClient.ListConnectionStrings. -type MongoClustersClientListConnectionStringsResponse struct { - // The connection strings for the given mongo cluster. - ListConnectionStringsResult -} - -// MongoClustersClientListFirewallRulesResponse contains the response from method MongoClustersClient.NewListFirewallRulesPager. -type MongoClustersClientListFirewallRulesResponse struct { - // A list of firewall rules. - FirewallRuleListResult -} - -// MongoClustersClientListResponse contains the response from method MongoClustersClient.NewListPager. -type MongoClustersClientListResponse struct { - // A list of mongo clusters. - MongoClusterListResult -} - -// MongoClustersClientUpdateResponse contains the response from method MongoClustersClient.BeginUpdate. -type MongoClustersClientUpdateResponse struct { - // Represents a mongo cluster resource. - MongoCluster -} - // MongoDBResourcesClientCreateUpdateMongoDBCollectionResponse contains the response from method MongoDBResourcesClient.BeginCreateUpdateMongoDBCollection. type MongoDBResourcesClientCreateUpdateMongoDBCollectionResponse struct { // An Azure Cosmos DB MongoDB collection. @@ -737,12 +549,6 @@ type MongoDBResourcesClientGetMongoUserDefinitionResponse struct { MongoUserDefinitionGetResults } -// MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse contains the response from method MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge. -type MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse struct { - // List of physical partitions and their properties returned by a merge operation. - PhysicalPartitionStorageInfoCollection -} - // MongoDBResourcesClientListMongoDBCollectionsResponse contains the response from method MongoDBResourcesClient.NewListMongoDBCollectionsPager. type MongoDBResourcesClientListMongoDBCollectionsResponse struct { // The List operation response, that contains the MongoDB collections and their properties. @@ -791,36 +597,6 @@ type MongoDBResourcesClientMigrateMongoDBDatabaseToManualThroughputResponse stru ThroughputSettingsGetResults } -// MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse contains the response from method MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput. -type MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse struct { - // An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. - PhysicalPartitionThroughputInfoResult -} - -// MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse contains the response from method MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution. -type MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse struct { - // An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. - PhysicalPartitionThroughputInfoResult -} - -// MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse contains the response from method MongoDBResourcesClient.BeginMongoDBDatabasePartitionMerge. -type MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse struct { - // List of physical partitions and their properties returned by a merge operation. - PhysicalPartitionStorageInfoCollection -} - -// MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse contains the response from method MongoDBResourcesClient.BeginMongoDBDatabaseRedistributeThroughput. -type MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse struct { - // An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. - PhysicalPartitionThroughputInfoResult -} - -// MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse contains the response from method MongoDBResourcesClient.BeginMongoDBDatabaseRetrieveThroughputDistribution. -type MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse struct { - // An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. - PhysicalPartitionThroughputInfoResult -} - // MongoDBResourcesClientRetrieveContinuousBackupInformationResponse contains the response from method MongoDBResourcesClient.BeginRetrieveContinuousBackupInformation. type MongoDBResourcesClientRetrieveContinuousBackupInformationResponse struct { // Backup information of a resource. @@ -1183,12 +959,6 @@ type SQLResourcesClientListClientEncryptionKeysResponse struct { ClientEncryptionKeysListResult } -// SQLResourcesClientListSQLContainerPartitionMergeResponse contains the response from method SQLResourcesClient.BeginListSQLContainerPartitionMerge. -type SQLResourcesClientListSQLContainerPartitionMergeResponse struct { - // List of physical partitions and their properties returned by a merge operation. - PhysicalPartitionStorageInfoCollection -} - // SQLResourcesClientListSQLContainersResponse contains the response from method SQLResourcesClient.NewListSQLContainersPager. type SQLResourcesClientListSQLContainersResponse struct { // The List operation response, that contains the containers and their properties. @@ -1261,36 +1031,6 @@ type SQLResourcesClientRetrieveContinuousBackupInformationResponse struct { BackupInformation } -// SQLResourcesClientSQLContainerRedistributeThroughputResponse contains the response from method SQLResourcesClient.BeginSQLContainerRedistributeThroughput. -type SQLResourcesClientSQLContainerRedistributeThroughputResponse struct { - // An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. - PhysicalPartitionThroughputInfoResult -} - -// SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse contains the response from method SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution. -type SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse struct { - // An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. - PhysicalPartitionThroughputInfoResult -} - -// SQLResourcesClientSQLDatabasePartitionMergeResponse contains the response from method SQLResourcesClient.BeginSQLDatabasePartitionMerge. -type SQLResourcesClientSQLDatabasePartitionMergeResponse struct { - // List of physical partitions and their properties returned by a merge operation. - PhysicalPartitionStorageInfoCollection -} - -// SQLResourcesClientSQLDatabaseRedistributeThroughputResponse contains the response from method SQLResourcesClient.BeginSQLDatabaseRedistributeThroughput. -type SQLResourcesClientSQLDatabaseRedistributeThroughputResponse struct { - // An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. - PhysicalPartitionThroughputInfoResult -} - -// SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse contains the response from method SQLResourcesClient.BeginSQLDatabaseRetrieveThroughputDistribution. -type SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse struct { - // An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. - PhysicalPartitionThroughputInfoResult -} - // SQLResourcesClientUpdateSQLContainerThroughputResponse contains the response from method SQLResourcesClient.BeginUpdateSQLContainerThroughput. type SQLResourcesClientUpdateSQLContainerThroughputResponse struct { // An Azure Cosmos DB resource throughput. diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client.go index 9d8b8c427e38..e673655d134b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client.go @@ -47,7 +47,7 @@ func NewRestorableDatabaseAccountsClient(subscriptionID string, credential azcor // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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 @@ -94,7 +94,7 @@ func (client *RestorableDatabaseAccountsClient) getByLocationCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,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. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - options - RestorableDatabaseAccountsClientListOptions contains the optional parameters for the RestorableDatabaseAccountsClient.NewListPager // method. func (client *RestorableDatabaseAccountsClient) NewListPager(options *RestorableDatabaseAccountsClientListOptions) *runtime.Pager[RestorableDatabaseAccountsClientListResponse] { @@ -151,7 +151,7 @@ func (client *RestorableDatabaseAccountsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +170,7 @@ func (client *RestorableDatabaseAccountsClient) listHandleResponse(resp *http.Re // in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' // permission. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - location - Cosmos DB region, with spaces between words and each word capitalized. // - options - RestorableDatabaseAccountsClientListByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.NewListByLocationPager // method. @@ -214,7 +214,7 @@ func (client *RestorableDatabaseAccountsClient) listByLocationCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 316d33875b87..8bbdb2cc2966 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableDatabaseAccountList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableDatabaseAccountList.json func ExampleRestorableDatabaseAccountsClient_NewListByLocationPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -51,7 +51,7 @@ func ExampleRestorableDatabaseAccountsClient_NewListByLocationPager() { // APIType: to.Ptr(armcosmos.APITypeSQL), // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-11T21:56:15.000Z"); return t}()), // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), - // OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-01T22:05:09.000Z"); return t}()), + // OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), // RestorableLocations: []*armcosmos.RestorableLocationResource{ // { // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), @@ -75,7 +75,7 @@ func ExampleRestorableDatabaseAccountsClient_NewListByLocationPager() { // AccountName: to.Ptr("ddb2"), // APIType: to.Ptr(armcosmos.APITypeSQL), // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T08:05:18.000Z"); return t}()), - // OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-01T22:05:09.000Z"); return t}()), + // OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T08:05:18.000Z"); return t}()), // RestorableLocations: []*armcosmos.RestorableLocationResource{ // { // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), @@ -94,7 +94,7 @@ func ExampleRestorableDatabaseAccountsClient_NewListByLocationPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json func ExampleRestorableDatabaseAccountsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleRestorableDatabaseAccountsClient_NewListPager() { // APIType: to.Ptr(armcosmos.APITypeSQL), // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-11T21:56:15.000Z"); return t}()), // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), - // OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-01T22:05:09.000Z"); return t}()), + // OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()), // RestorableLocations: []*armcosmos.RestorableLocationResource{ // { // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), @@ -152,7 +152,7 @@ func ExampleRestorableDatabaseAccountsClient_NewListPager() { // AccountName: to.Ptr("ddb2"), // APIType: to.Ptr(armcosmos.APITypeSQL), // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T08:05:18.000Z"); return t}()), - // OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-01T22:05:09.000Z"); return t}()), + // OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T08:05:18.000Z"); return t}()), // RestorableLocations: []*armcosmos.RestorableLocationResource{ // { // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), @@ -171,7 +171,7 @@ func ExampleRestorableDatabaseAccountsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableDatabaseAccountGet.json func ExampleRestorableDatabaseAccountsClient_GetByLocation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client.go index b3884f6e5fb9..f2b79b142975 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client.go @@ -47,7 +47,7 @@ func NewRestorableGremlinDatabasesClient(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 // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - 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.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableGremlinDatabasesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client_example_test.go index 615a1c02df8f..1b69671cd1ea 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableGremlinDatabaseList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json func ExampleRestorableGremlinDatabasesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -48,6 +48,7 @@ func ExampleRestorableGremlinDatabasesClient_NewListPager() { // Properties: &armcosmos.RestorableGremlinDatabaseProperties{ // Resource: &armcosmos.RestorableGremlinDatabasePropertiesResource{ // Rid: to.Ptr("DLB14gAAAA=="), + // CanUndelete: to.Ptr("invalid"), // EventTimestamp: to.Ptr("2020-09-02T19:45:03Z"), // OperationType: to.Ptr(armcosmos.OperationTypeCreate), // OwnerID: to.Ptr("Database1"), @@ -62,6 +63,8 @@ func ExampleRestorableGremlinDatabasesClient_NewListPager() { // Properties: &armcosmos.RestorableGremlinDatabaseProperties{ // Resource: &armcosmos.RestorableGremlinDatabasePropertiesResource{ // Rid: to.Ptr("ESXNLAAAAA=="), + // CanUndelete: to.Ptr("notRestorable"), + // CanUndeleteReason: to.Ptr("Database already exists. Only deleted resources can be restored within same account."), // EventTimestamp: to.Ptr("2020-09-02T19:53:42Z"), // OperationType: to.Ptr(armcosmos.OperationTypeDelete), // OwnerID: to.Ptr("Database1"), diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client.go index 3e52c6d170e9..48a3f8f7d8c8 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client.go @@ -47,7 +47,7 @@ func NewRestorableGremlinGraphsClient(subscriptionID string, credential azcore.T // This helps in scenario where container was accidentally deleted. This API requires // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - 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.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableGremlinGraphsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") if options != nil && options.RestorableGremlinDatabaseRid != nil { reqQP.Set("restorableGremlinDatabaseRid", *options.RestorableGremlinDatabaseRid) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client_example_test.go index 67bc24019103..18a457f5929c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableGremlinGraphList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableGremlinGraphList.json func ExampleRestorableGremlinGraphsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -52,12 +52,29 @@ func ExampleRestorableGremlinGraphsClient_NewListPager() { // Properties: &armcosmos.RestorableGremlinGraphProperties{ // Resource: &armcosmos.RestorableGremlinGraphPropertiesResource{ // Rid: to.Ptr("zAyAPQAAAA=="), + // CanUndelete: to.Ptr("invalid"), // EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"), // OperationType: to.Ptr(armcosmos.OperationTypeCreate), // OwnerID: to.Ptr("Graph1"), // OwnerResourceID: to.Ptr("V18LoLrv-qA="), // }, // }, + // }, + // { + // Name: to.Ptr("79609a98-3394-41f8-911f-cfab0c075c86"), + // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGraphs"), + // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableGraphs/79609a98-3394-41f8-911f-cfab0c075c86"), + // Properties: &armcosmos.RestorableGremlinGraphProperties{ + // Resource: &armcosmos.RestorableGremlinGraphPropertiesResource{ + // Rid: to.Ptr("zAyAPQAAAA=="), + // CanUndelete: to.Ptr("notRestorable"), + // CanUndeleteReason: to.Ptr("Individual shared database collections restore is not supported. Please restore shared database to restore its collections that share the throughput."), + // EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"), + // OperationType: to.Ptr(armcosmos.OperationTypeDelete), + // OwnerID: to.Ptr("Graph1"), + // OwnerResourceID: to.Ptr("V18LoLrv-qA="), + // }, + // }, // }}, // } } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client.go index f5abc7ccdf72..d3184b3f3ca1 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client.go @@ -47,7 +47,7 @@ func NewRestorableGremlinResourcesClient(subscriptionID string, credential azcor // location. This helps in scenarios to validate what resources exist at given timestamp and // location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - 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.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableGremlinResourcesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") if options != nil && options.RestoreLocation != nil { reqQP.Set("restoreLocation", *options.RestoreLocation) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client_example_test.go index 7c444cd1b60e..9e7edecc1622 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableGremlinResourceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableGremlinResourceList.json func ExampleRestorableGremlinResourcesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client.go index 1e540998a83d..42fa5e30e949 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client.go @@ -47,7 +47,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 // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableMongodbCollectionsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") if options != nil && options.RestorableMongodbDatabaseRid != nil { reqQP.Set("restorableMongodbDatabaseRid", *options.RestorableMongodbDatabaseRid) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client_example_test.go index 310d530f4c90..fc1793bad047 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableMongodbCollectionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableMongodbCollectionList.json func ExampleRestorableMongodbCollectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -52,12 +52,29 @@ func ExampleRestorableMongodbCollectionsClient_NewListPager() { // Properties: &armcosmos.RestorableMongodbCollectionProperties{ // Resource: &armcosmos.RestorableMongodbCollectionPropertiesResource{ // Rid: to.Ptr("zAyAPQAAAA=="), + // CanUndelete: to.Ptr("invalid"), // EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"), // OperationType: to.Ptr(armcosmos.OperationTypeCreate), // OwnerID: to.Ptr("Collection1"), // OwnerResourceID: to.Ptr("V18LoLrv-qA="), // }, // }, + // }, + // { + // Name: to.Ptr("79609a98-3394-41f8-911f-cfab0c075c86"), + // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbCollections"), + // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableMongodbCollections/79609a98-3394-41f8-911f-cfab0c075c86"), + // Properties: &armcosmos.RestorableMongodbCollectionProperties{ + // Resource: &armcosmos.RestorableMongodbCollectionPropertiesResource{ + // Rid: to.Ptr("zAyAPQAAAA=="), + // CanUndelete: to.Ptr("notRestorable"), + // CanUndeleteReason: to.Ptr("Individual shared database collections restore is not supported. Please restore shared database to restore its collections that share the throughput."), + // EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"), + // OperationType: to.Ptr(armcosmos.OperationTypeDelete), + // OwnerID: to.Ptr("Collection1"), + // OwnerResourceID: to.Ptr("V18LoLrv-qA="), + // }, + // }, // }}, // } } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client.go index e697ecb33ada..ae1c4a7581f2 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client.go @@ -47,7 +47,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 // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableMongodbDatabasesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 3f7d446a1d89..b2b7c7fba5cf 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableMongodbDatabaseList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableMongodbDatabaseList.json func ExampleRestorableMongodbDatabasesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -48,6 +48,7 @@ func ExampleRestorableMongodbDatabasesClient_NewListPager() { // Properties: &armcosmos.RestorableMongodbDatabaseProperties{ // Resource: &armcosmos.RestorableMongodbDatabasePropertiesResource{ // Rid: to.Ptr("DLB14gAAAA=="), + // CanUndelete: to.Ptr("invalid"), // EventTimestamp: to.Ptr("2020-09-02T19:45:03Z"), // OperationType: to.Ptr(armcosmos.OperationTypeCreate), // OwnerID: to.Ptr("Database1"), @@ -62,6 +63,8 @@ func ExampleRestorableMongodbDatabasesClient_NewListPager() { // Properties: &armcosmos.RestorableMongodbDatabaseProperties{ // Resource: &armcosmos.RestorableMongodbDatabasePropertiesResource{ // Rid: to.Ptr("ESXNLAAAAA=="), + // CanUndelete: to.Ptr("notRestorable"), + // CanUndeleteReason: to.Ptr("Database already exists. Only deleted resources can be restored within same account."), // EventTimestamp: to.Ptr("2020-09-02T19:53:42Z"), // OperationType: to.Ptr(armcosmos.OperationTypeDelete), // OwnerID: to.Ptr("Database1"), diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client.go index 5da3b2696b2e..b53454b46d89 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client.go @@ -47,7 +47,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. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableMongodbResourcesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 0164f595ae54..a34ebf357995 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableMongodbResourceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableMongodbResourceList.json func ExampleRestorableMongodbResourcesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client.go index 10f26fec8da0..32f1ab9abb13 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client.go @@ -47,7 +47,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 // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableSQLContainersClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 26002f888102..b09fef00e35a 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableSqlContainerList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableSqlContainerList.json func ExampleRestorableSQLContainersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -52,6 +52,7 @@ func ExampleRestorableSQLContainersClient_NewListPager() { // Properties: &armcosmos.RestorableSQLContainerProperties{ // Resource: &armcosmos.RestorableSQLContainerPropertiesResource{ // Rid: to.Ptr("zAyAPQAAAA=="), + // CanUndelete: to.Ptr("invalid"), // Container: &armcosmos.RestorableSQLContainerPropertiesResourceContainer{ // Etag: to.Ptr("\"00003e00-0000-0700-0000-5f85338a0000\""), // Rid: to.Ptr("V18LoLrv-qA="), @@ -92,6 +93,7 @@ func ExampleRestorableSQLContainersClient_NewListPager() { // Properties: &armcosmos.RestorableSQLContainerProperties{ // Resource: &armcosmos.RestorableSQLContainerPropertiesResource{ // Rid: to.Ptr("PrArcgAAAA=="), + // CanUndelete: to.Ptr("invalid"), // Container: &armcosmos.RestorableSQLContainerPropertiesResourceContainer{ // Etag: to.Ptr("\"00004400-0000-0700-0000-5f85351f0000\""), // Rid: to.Ptr("V18LoLrv-qA="), diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client.go index 84e6a790d41c..1f17aef2adf0 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client.go @@ -47,7 +47,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 // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableSQLDatabasesClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index 3d70aa3bdb32..ca11b676b082 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableSqlDatabaseList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableSqlDatabaseList.json func ExampleRestorableSQLDatabasesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -48,6 +48,7 @@ func ExampleRestorableSQLDatabasesClient_NewListPager() { // Properties: &armcosmos.RestorableSQLDatabaseProperties{ // Resource: &armcosmos.RestorableSQLDatabasePropertiesResource{ // Rid: to.Ptr("DLB14gAAAA=="), + // CanUndelete: to.Ptr("invalid"), // Database: &armcosmos.RestorableSQLDatabasePropertiesResourceDatabase{ // Etag: to.Ptr("\"0000c20a-0000-0700-0000-5f4ff63f0000\""), // Rid: to.Ptr("3fu-hg=="), @@ -70,6 +71,8 @@ func ExampleRestorableSQLDatabasesClient_NewListPager() { // Properties: &armcosmos.RestorableSQLDatabaseProperties{ // Resource: &armcosmos.RestorableSQLDatabasePropertiesResource{ // Rid: to.Ptr("ESXNLAAAAA=="), + // CanUndelete: to.Ptr("notRestorable"), + // CanUndeleteReason: to.Ptr("Database already exists. Only deleted resources can be restored within same account."), // Database: &armcosmos.RestorableSQLDatabasePropertiesResourceDatabase{ // Etag: to.Ptr("\"0000c20a-0000-0700-0000-5f4ff63f0000\""), // Rid: to.Ptr("3fu-hg=="), @@ -93,6 +96,7 @@ func ExampleRestorableSQLDatabasesClient_NewListPager() { // Properties: &armcosmos.RestorableSQLDatabaseProperties{ // Resource: &armcosmos.RestorableSQLDatabasePropertiesResource{ // Rid: to.Ptr("aXFqUQAAAA=="), + // CanUndelete: to.Ptr("invalid"), // Database: &armcosmos.RestorableSQLDatabasePropertiesResourceDatabase{ // Etag: to.Ptr("\"0000ca0a-0000-0700-0000-5f4ff82b0000\""), // Rid: to.Ptr("0SziSg=="), diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client.go index 47c79ef68859..ba04bca0ce71 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client.go @@ -47,7 +47,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. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableSQLResourcesClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index cabe7c52957e..eb1602e5cc9e 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableSqlResourceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableSqlResourceList.json func ExampleRestorableSQLResourcesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client.go index 9e75a7e34f8c..f0416b1d2d7a 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client.go @@ -47,7 +47,7 @@ func NewRestorableTableResourcesClient(subscriptionID string, credential azcore. // to validate what resources exist at given timestamp and location. This API requires // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - 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.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableTableResourcesClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") if options != nil && options.RestoreLocation != nil { reqQP.Set("restoreLocation", *options.RestoreLocation) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client_example_test.go index 31b1b3913869..f8b54a992fc2 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableTableResourceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableTableResourceList.json func ExampleRestorableTableResourcesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client.go index 2b4577e6d383..d4e011cb6e41 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client.go @@ -47,7 +47,7 @@ func NewRestorableTablesClient(subscriptionID string, credential azcore.TokenCre // table was accidentally deleted. This API requires // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - 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.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableTablesClient) listCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") if options != nil && options.StartTime != nil { reqQP.Set("startTime", *options.StartTime) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client_example_test.go index 6df5b317758a..9d5c55a9be3b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBRestorableTableList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBRestorableTableList.json func ExampleRestorableTablesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -50,12 +50,29 @@ func ExampleRestorableTablesClient_NewListPager() { // Properties: &armcosmos.RestorableTableProperties{ // Resource: &armcosmos.RestorableTablePropertiesResource{ // Rid: to.Ptr("zAyAPQAAAA=="), + // CanUndelete: to.Ptr("invalid"), // EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"), // OperationType: to.Ptr(armcosmos.OperationTypeCreate), // OwnerID: to.Ptr("Table1"), // OwnerResourceID: to.Ptr("V18LoLrv-qA="), // }, // }, + // }, + // { + // Name: to.Ptr("79609a98-3394-41f8-911f-cfab0c075c86"), + // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableTables"), + // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableTables/79609a98-3394-41f8-911f-cfab0c075c86"), + // Properties: &armcosmos.RestorableTableProperties{ + // Resource: &armcosmos.RestorableTablePropertiesResource{ + // Rid: to.Ptr("zAyAPQAAAA=="), + // CanUndelete: to.Ptr("notRestorable"), + // CanUndeleteReason: to.Ptr("Collection with same name already exist as live collection."), + // EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"), + // OperationType: to.Ptr(armcosmos.OperationTypeDelete), + // OwnerID: to.Ptr("Table1"), + // OwnerResourceID: to.Ptr("V18LoLrv-qA="), + // }, + // }, // }}, // } } diff --git a/sdk/resourcemanager/cosmos/armcosmos/service_client.go b/sdk/resourcemanager/cosmos/armcosmos/service_client.go index bcc07a16aea1..0b948199a800 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/service_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/service_client.go @@ -46,7 +46,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - serviceName - Cosmos DB service name. @@ -72,7 +72,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *ServiceClient) create(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResourceCreateUpdateParameters, options *ServiceClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ServiceClient.BeginCreate" @@ -118,7 +118,7 @@ func (client *ServiceClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateParameters); err != nil { @@ -130,7 +130,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - serviceName - Cosmos DB service name. @@ -155,7 +155,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *ServiceClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, serviceName string, options *ServiceClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServiceClient.BeginDelete" @@ -201,7 +201,7 @@ func (client *ServiceClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -210,7 +210,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - serviceName - Cosmos DB service name. @@ -261,7 +261,7 @@ func (client *ServiceClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *ServiceClient) getHandleResponse(resp *http.Response) (ServiceClie // NewListPager - Gets the status of service. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListPager method. @@ -326,7 +326,7 @@ func (client *ServiceClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-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 index a203002436d1..d8e5acfa706c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/service_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/service_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBServicesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBServicesList.json func ExampleServiceClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleServiceClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDataTransferServiceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDataTransferServiceCreate.json func ExampleServiceClient_BeginCreate_dataTransferServiceCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -114,7 +114,7 @@ func ExampleServiceClient_BeginCreate_dataTransferServiceCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGraphAPIComputeServiceCreate.json func ExampleServiceClient_BeginCreate_graphApiComputeServiceCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -164,7 +164,7 @@ func ExampleServiceClient_BeginCreate_graphApiComputeServiceCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json func ExampleServiceClient_BeginCreate_materializedViewsBuilderServiceCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -212,7 +212,7 @@ func ExampleServiceClient_BeginCreate_materializedViewsBuilderServiceCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlDedicatedGatewayServiceCreate.json func ExampleServiceClient_BeginCreate_sqlDedicatedGatewayServiceCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -262,7 +262,7 @@ func ExampleServiceClient_BeginCreate_sqlDedicatedGatewayServiceCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDataTransferServiceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDataTransferServiceGet.json func ExampleServiceClient_Get_dataTransferServiceGet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -300,7 +300,7 @@ func ExampleServiceClient_Get_dataTransferServiceGet() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGraphAPIComputeServiceGet.json func ExampleServiceClient_Get_graphApiComputeServiceGet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -340,7 +340,7 @@ func ExampleServiceClient_Get_graphApiComputeServiceGet() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json func ExampleServiceClient_Get_materializedViewsBuilderServiceGet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -378,7 +378,7 @@ func ExampleServiceClient_Get_materializedViewsBuilderServiceGet() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlDedicatedGatewayServiceGet.json func ExampleServiceClient_Get_sqlDedicatedGatewayServiceGet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -418,7 +418,7 @@ func ExampleServiceClient_Get_sqlDedicatedGatewayServiceGet() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBDataTransferServiceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBDataTransferServiceDelete.json func ExampleServiceClient_BeginDelete_dataTransferServiceDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -439,7 +439,7 @@ func ExampleServiceClient_BeginDelete_dataTransferServiceDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBGraphAPIComputeServiceDelete.json func ExampleServiceClient_BeginDelete_graphApiComputeServiceDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -460,7 +460,7 @@ func ExampleServiceClient_BeginDelete_graphApiComputeServiceDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json func ExampleServiceClient_BeginDelete_materializedViewsBuilderServiceDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -481,7 +481,7 @@ func ExampleServiceClient_BeginDelete_materializedViewsBuilderServiceDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlDedicatedGatewayServiceDelete.json func ExampleServiceClient_BeginDelete_sqlDedicatedGatewayServiceDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client.go index 7cbc38781c7e..9805795fea14 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client.go @@ -47,7 +47,7 @@ func NewSQLResourcesClient(subscriptionID string, credential azcore.TokenCredent // such as the Azure Powershell (instead of directly). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -76,7 +76,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateClientEncryptionKey(ctx conte // as the Azure Powershell (instead of directly). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) createUpdateClientEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, createUpdateClientEncryptionKeyParameters ClientEncryptionKeyCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginCreateUpdateClientEncryptionKey" @@ -126,7 +126,7 @@ func (client *SQLResourcesClient) createUpdateClientEncryptionKeyCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateClientEncryptionKeyParameters); err != nil { @@ -138,7 +138,7 @@ func (client *SQLResourcesClient) createUpdateClientEncryptionKeyCreateRequest(c // BeginCreateUpdateSQLContainer - Create or update an Azure Cosmos DB SQL container // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -166,7 +166,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) createUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLContainerOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginCreateUpdateSQLContainer" @@ -216,7 +216,7 @@ func (client *SQLResourcesClient) createUpdateSQLContainerCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateSQLContainerParameters); err != nil { @@ -228,7 +228,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -255,7 +255,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) createUpdateSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters SQLDatabaseCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLDatabaseOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginCreateUpdateSQLDatabase" @@ -301,7 +301,7 @@ func (client *SQLResourcesClient) createUpdateSQLDatabaseCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateSQLDatabaseParameters); err != nil { @@ -313,7 +313,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -340,7 +340,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) createUpdateSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, createUpdateSQLRoleAssignmentParameters SQLRoleAssignmentCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLRoleAssignmentOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginCreateUpdateSQLRoleAssignment" @@ -386,7 +386,7 @@ func (client *SQLResourcesClient) createUpdateSQLRoleAssignmentCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateSQLRoleAssignmentParameters); err != nil { @@ -398,7 +398,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -425,7 +425,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) createUpdateSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, createUpdateSQLRoleDefinitionParameters SQLRoleDefinitionCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLRoleDefinitionOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginCreateUpdateSQLRoleDefinition" @@ -471,7 +471,7 @@ func (client *SQLResourcesClient) createUpdateSQLRoleDefinitionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateSQLRoleDefinitionParameters); err != nil { @@ -483,7 +483,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -512,7 +512,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 2023-03-15-preview +// Generated from API version 2023-11-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) { var err error const operationName = "SQLResourcesClient.BeginCreateUpdateSQLStoredProcedure" @@ -566,7 +566,7 @@ func (client *SQLResourcesClient) createUpdateSQLStoredProcedureCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateSQLStoredProcedureParameters); err != nil { @@ -578,7 +578,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -607,7 +607,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 2023-03-15-preview +// Generated from API version 2023-11-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) { var err error const operationName = "SQLResourcesClient.BeginCreateUpdateSQLTrigger" @@ -661,7 +661,7 @@ func (client *SQLResourcesClient) createUpdateSQLTriggerCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateSQLTriggerParameters); err != nil { @@ -673,7 +673,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -702,7 +702,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 2023-03-15-preview +// Generated from API version 2023-11-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) { var err error const operationName = "SQLResourcesClient.BeginCreateUpdateSQLUserDefinedFunction" @@ -756,7 +756,7 @@ func (client *SQLResourcesClient) createUpdateSQLUserDefinedFunctionCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateSQLUserDefinedFunctionParameters); err != nil { @@ -768,7 +768,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -795,7 +795,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) deleteSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginDeleteSQLContainerOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginDeleteSQLContainer" @@ -845,7 +845,7 @@ func (client *SQLResourcesClient) deleteSQLContainerCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -853,7 +853,7 @@ func (client *SQLResourcesClient) deleteSQLContainerCreateRequest(ctx context.Co // BeginDeleteSQLDatabase - Deletes an existing Azure Cosmos DB SQL database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -879,7 +879,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) deleteSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginDeleteSQLDatabaseOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginDeleteSQLDatabase" @@ -925,7 +925,7 @@ func (client *SQLResourcesClient) deleteSQLDatabaseCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -933,7 +933,7 @@ func (client *SQLResourcesClient) deleteSQLDatabaseCreateRequest(ctx context.Con // BeginDeleteSQLRoleAssignment - Deletes an existing Azure Cosmos DB SQL Role Assignment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -959,7 +959,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) deleteSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, options *SQLResourcesClientBeginDeleteSQLRoleAssignmentOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginDeleteSQLRoleAssignment" @@ -1005,7 +1005,7 @@ func (client *SQLResourcesClient) deleteSQLRoleAssignmentCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1014,7 +1014,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -1040,7 +1040,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) deleteSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, options *SQLResourcesClientBeginDeleteSQLRoleDefinitionOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginDeleteSQLRoleDefinition" @@ -1086,7 +1086,7 @@ func (client *SQLResourcesClient) deleteSQLRoleDefinitionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1095,7 +1095,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1123,7 +1123,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) deleteSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, options *SQLResourcesClientBeginDeleteSQLStoredProcedureOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginDeleteSQLStoredProcedure" @@ -1177,7 +1177,7 @@ func (client *SQLResourcesClient) deleteSQLStoredProcedureCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -1185,7 +1185,7 @@ func (client *SQLResourcesClient) deleteSQLStoredProcedureCreateRequest(ctx cont // BeginDeleteSQLTrigger - Deletes an existing Azure Cosmos DB SQL trigger. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1213,7 +1213,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) deleteSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, options *SQLResourcesClientBeginDeleteSQLTriggerOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginDeleteSQLTrigger" @@ -1267,7 +1267,7 @@ func (client *SQLResourcesClient) deleteSQLTriggerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -1275,7 +1275,7 @@ func (client *SQLResourcesClient) deleteSQLTriggerCreateRequest(ctx context.Cont // BeginDeleteSQLUserDefinedFunction - Deletes an existing Azure Cosmos DB SQL userDefinedFunction. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1303,7 +1303,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) deleteSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, options *SQLResourcesClientBeginDeleteSQLUserDefinedFunctionOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginDeleteSQLUserDefinedFunction" @@ -1357,7 +1357,7 @@ func (client *SQLResourcesClient) deleteSQLUserDefinedFunctionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -1365,7 +1365,7 @@ func (client *SQLResourcesClient) deleteSQLUserDefinedFunctionCreateRequest(ctx // 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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1422,7 +1422,7 @@ func (client *SQLResourcesClient) getClientEncryptionKeyCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1440,7 +1440,7 @@ func (client *SQLResourcesClient) getClientEncryptionKeyHandleResponse(resp *htt // 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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1497,7 +1497,7 @@ func (client *SQLResourcesClient) getSQLContainerCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1515,7 +1515,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1572,7 +1572,7 @@ func (client *SQLResourcesClient) getSQLContainerThroughputCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1590,7 +1590,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1642,7 +1642,7 @@ func (client *SQLResourcesClient) getSQLDatabaseCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1661,7 +1661,7 @@ func (client *SQLResourcesClient) getSQLDatabaseHandleResponse(resp *http.Respon // with the provided name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1713,7 +1713,7 @@ func (client *SQLResourcesClient) getSQLDatabaseThroughputCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1731,7 +1731,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -1783,7 +1783,7 @@ func (client *SQLResourcesClient) getSQLRoleAssignmentCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1801,7 +1801,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 2023-03-15-preview +// Generated from API version 2023-11-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. @@ -1853,7 +1853,7 @@ func (client *SQLResourcesClient) getSQLRoleDefinitionCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1871,7 +1871,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1933,7 +1933,7 @@ func (client *SQLResourcesClient) getSQLStoredProcedureCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1951,7 +1951,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2013,7 +2013,7 @@ func (client *SQLResourcesClient) getSQLTriggerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2031,7 +2031,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2093,7 +2093,7 @@ func (client *SQLResourcesClient) getSQLUserDefinedFunctionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2110,7 +2110,7 @@ func (client *SQLResourcesClient) getSQLUserDefinedFunctionHandleResponse(resp * // NewListClientEncryptionKeysPager - Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2164,7 +2164,7 @@ func (client *SQLResourcesClient) listClientEncryptionKeysCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2179,100 +2179,9 @@ func (client *SQLResourcesClient) listClientEncryptionKeysHandleResponse(resp *h 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 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLResourcesClientListSQLContainerPartitionMergeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SQLResourcesClientListSQLContainerPartitionMergeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ListSQLContainerPartitionMerge - Merges the partitions of a SQL Container -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *SQLResourcesClient) listSQLContainerPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (*http.Response, error) { - var err error - const operationName = "SQLResourcesClient.BeginListSQLContainerPartitionMerge" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listSQLContainerPartitionMergeCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, mergeParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, mergeParameters); err != nil { - return nil, err - } - return req, nil -} - // NewListSQLContainersPager - Lists the SQL container under an existing Azure Cosmos DB database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2326,7 +2235,7 @@ func (client *SQLResourcesClient) listSQLContainersCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2343,7 +2252,7 @@ func (client *SQLResourcesClient) listSQLContainersHandleResponse(resp *http.Res // NewListSQLDatabasesPager - Lists the SQL databases under an existing Azure Cosmos DB database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListSQLDatabasesPager @@ -2392,7 +2301,7 @@ func (client *SQLResourcesClient) listSQLDatabasesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2409,7 +2318,7 @@ func (client *SQLResourcesClient) listSQLDatabasesHandleResponse(resp *http.Resp // NewListSQLRoleAssignmentsPager - Retrieves the list of all Azure Cosmos DB SQL Role Assignments. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListSQLRoleAssignmentsPager @@ -2458,7 +2367,7 @@ func (client *SQLResourcesClient) listSQLRoleAssignmentsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2475,7 +2384,7 @@ func (client *SQLResourcesClient) listSQLRoleAssignmentsHandleResponse(resp *htt // NewListSQLRoleDefinitionsPager - Retrieves the list of all Azure Cosmos DB SQL Role Definitions. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListSQLRoleDefinitionsPager @@ -2524,7 +2433,7 @@ func (client *SQLResourcesClient) listSQLRoleDefinitionsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2541,7 +2450,7 @@ func (client *SQLResourcesClient) listSQLRoleDefinitionsHandleResponse(resp *htt // NewListSQLStoredProceduresPager - Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2600,7 +2509,7 @@ func (client *SQLResourcesClient) listSQLStoredProceduresCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2617,7 +2526,7 @@ func (client *SQLResourcesClient) listSQLStoredProceduresHandleResponse(resp *ht // NewListSQLTriggersPager - Lists the SQL trigger under an existing Azure Cosmos DB database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2676,7 +2585,7 @@ func (client *SQLResourcesClient) listSQLTriggersCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2693,7 +2602,7 @@ func (client *SQLResourcesClient) listSQLTriggersHandleResponse(resp *http.Respo // NewListSQLUserDefinedFunctionsPager - Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2752,7 +2661,7 @@ func (client *SQLResourcesClient) listSQLUserDefinedFunctionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2770,7 +2679,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2797,7 +2706,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) migrateSQLContainerToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginMigrateSQLContainerToAutoscale" @@ -2847,7 +2756,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToAutoscaleCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2856,7 +2765,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2883,7 +2792,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) migrateSQLContainerToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginMigrateSQLContainerToManualThroughputOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginMigrateSQLContainerToManualThroughput" @@ -2933,7 +2842,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToManualThroughputCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2942,7 +2851,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2968,7 +2877,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) migrateSQLDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginMigrateSQLDatabaseToAutoscaleOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginMigrateSQLDatabaseToAutoscale" @@ -3014,7 +2923,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToAutoscaleCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -3023,7 +2932,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3049,7 +2958,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) migrateSQLDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginMigrateSQLDatabaseToManualThroughputOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginMigrateSQLDatabaseToManualThroughput" @@ -3095,7 +3004,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToManualThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -3104,7 +3013,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3133,7 +3042,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, location ContinuousBackupRestoreLocation, options *SQLResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginRetrieveContinuousBackupInformation" @@ -3183,7 +3092,7 @@ func (client *SQLResourcesClient) retrieveContinuousBackupInformationCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, location); err != nil { @@ -3192,450 +3101,10 @@ func (client *SQLResourcesClient) retrieveContinuousBackupInformationCreateReque return req, nil } -// BeginSQLContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL container -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLResourcesClientSQLContainerRedistributeThroughputResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SQLResourcesClientSQLContainerRedistributeThroughputResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// SQLContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL container -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *SQLResourcesClient) sQLContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (*http.Response, error) { - var err error - const operationName = "SQLResourcesClient.BeginSQLContainerRedistributeThroughput" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.sqlContainerRedistributeThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, redistributeThroughputParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, redistributeThroughputParameters); err != nil { - return nil, err - } - return req, nil -} - -// 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 2023-03-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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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 2023-03-15-preview -func (client *SQLResourcesClient) sQLContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (*http.Response, error) { - var err error - const operationName = "SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.sqlContainerRetrieveThroughputDistributionCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, retrieveThroughputParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginSQLDatabasePartitionMerge - Merges the partitions of a SQL database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-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. -// - mergeParameters - The parameters for the merge operation. -// - options - SQLResourcesClientBeginSQLDatabasePartitionMergeOptions contains the optional parameters for the SQLResourcesClient.BeginSQLDatabasePartitionMerge -// method. -func (client *SQLResourcesClient) BeginSQLDatabasePartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginSQLDatabasePartitionMergeOptions) (*runtime.Poller[SQLResourcesClientSQLDatabasePartitionMergeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.sQLDatabasePartitionMerge(ctx, resourceGroupName, accountName, databaseName, mergeParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLResourcesClientSQLDatabasePartitionMergeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SQLResourcesClientSQLDatabasePartitionMergeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// SQLDatabasePartitionMerge - Merges the partitions of a SQL database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *SQLResourcesClient) sQLDatabasePartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginSQLDatabasePartitionMergeOptions) (*http.Response, error) { - var err error - const operationName = "SQLResourcesClient.BeginSQLDatabasePartitionMerge" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.sqlDatabasePartitionMergeCreateRequest(ctx, resourceGroupName, accountName, databaseName, mergeParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// sqlDatabasePartitionMergeCreateRequest creates the SQLDatabasePartitionMerge request. -func (client *SQLResourcesClient) sqlDatabasePartitionMergeCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginSQLDatabasePartitionMergeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/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)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, mergeParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginSQLDatabaseRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-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. -// - redistributeThroughputParameters - The parameters to provide for redistributing throughput for the current SQL database. -// - options - SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginSQLDatabaseRedistributeThroughput -// method. -func (client *SQLResourcesClient) BeginSQLDatabaseRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions) (*runtime.Poller[SQLResourcesClientSQLDatabaseRedistributeThroughputResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.sQLDatabaseRedistributeThroughput(ctx, resourceGroupName, accountName, databaseName, redistributeThroughputParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLResourcesClientSQLDatabaseRedistributeThroughputResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SQLResourcesClientSQLDatabaseRedistributeThroughputResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// SQLDatabaseRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *SQLResourcesClient) sQLDatabaseRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions) (*http.Response, error) { - var err error - const operationName = "SQLResourcesClient.BeginSQLDatabaseRedistributeThroughput" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.sqlDatabaseRedistributeThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, redistributeThroughputParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// sqlDatabaseRedistributeThroughputCreateRequest creates the SQLDatabaseRedistributeThroughput request. -func (client *SQLResourcesClient) sqlDatabaseRedistributeThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/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)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, redistributeThroughputParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginSQLDatabaseRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB SQL database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-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. -// - retrieveThroughputParameters - The parameters to provide for retrieving throughput distribution for the current SQL database. -// - options - SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions contains the optional parameters for -// the SQLResourcesClient.BeginSQLDatabaseRetrieveThroughputDistribution method. -func (client *SQLResourcesClient) BeginSQLDatabaseRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions) (*runtime.Poller[SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.sQLDatabaseRetrieveThroughputDistribution(ctx, resourceGroupName, accountName, databaseName, retrieveThroughputParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// SQLDatabaseRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB SQL database -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-03-15-preview -func (client *SQLResourcesClient) sQLDatabaseRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions) (*http.Response, error) { - var err error - const operationName = "SQLResourcesClient.BeginSQLDatabaseRetrieveThroughputDistribution" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.sqlDatabaseRetrieveThroughputDistributionCreateRequest(ctx, resourceGroupName, accountName, databaseName, retrieveThroughputParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// sqlDatabaseRetrieveThroughputDistributionCreateRequest creates the SQLDatabaseRetrieveThroughputDistribution request. -func (client *SQLResourcesClient) sqlDatabaseRetrieveThroughputDistributionCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/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)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, retrieveThroughputParameters); err != nil { - return nil, err - } - return req, nil -} - // 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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3663,7 +3132,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) updateSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *SQLResourcesClientBeginUpdateSQLContainerThroughputOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginUpdateSQLContainerThroughput" @@ -3713,7 +3182,7 @@ func (client *SQLResourcesClient) updateSQLContainerThroughputCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { @@ -3725,7 +3194,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3752,7 +3221,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *SQLResourcesClient) updateSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *SQLResourcesClientBeginUpdateSQLDatabaseThroughputOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginUpdateSQLDatabaseThroughput" @@ -3798,7 +3267,7 @@ func (client *SQLResourcesClient) updateSQLDatabaseThroughputCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client_example_test.go index ab8f43d56c3e..ae23b9d0fa14 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client_example_test.go @@ -13,14 +13,12 @@ import ( "context" "log" - "time" - "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabaseList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlDatabaseList.json func ExampleSQLResourcesClient_NewListSQLDatabasesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +64,7 @@ func ExampleSQLResourcesClient_NewListSQLDatabasesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabaseGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlDatabaseGet.json func ExampleSQLResourcesClient_GetSQLDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -104,8 +102,8 @@ func ExampleSQLResourcesClient_GetSQLDatabase() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLDatabase_cosmosDbSqlDatabaseCreateUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlDatabaseCreateUpdate.json +func ExampleSQLResourcesClient_BeginCreateUpdateSQLDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -153,61 +151,7 @@ func ExampleSQLResourcesClient_BeginCreateUpdateSQLDatabase_cosmosDbSqlDatabaseC // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabaseRestore.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLDatabase_cosmosDbSqlDatabaseRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLDatabase(ctx, "rg1", "ddb1", "databaseName", armcosmos.SQLDatabaseCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.SQLDatabaseCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.SQLDatabaseResource{ - CreateMode: to.Ptr(armcosmos.CreateModeRestore), - ID: to.Ptr("databaseName"), - RestoreParameters: &armcosmos.ResourceRestoreParameters{ - RestoreSource: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId"), - RestoreTimestampInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-20T18:28:00.000Z"); return t }()), - }, - }, - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SQLDatabaseGetResults = armcosmos.SQLDatabaseGetResults{ - // Name: to.Ptr("databaseName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.SQLDatabaseGetProperties{ - // Resource: &armcosmos.SQLDatabaseGetPropertiesResource{ - // Etag: to.Ptr("\"00000a00-0000-0000-0000-56672f920000\""), - // Rid: to.Ptr("CqNBAA=="), - // Ts: to.Ptr[float32](1449602962), - // ID: to.Ptr("databaseName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabaseDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlDatabaseDelete.json func ExampleSQLResourcesClient_BeginDeleteSQLDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -228,7 +172,7 @@ func ExampleSQLResourcesClient_BeginDeleteSQLDatabase() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabaseThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlDatabaseThroughputGet.json func ExampleSQLResourcesClient_GetSQLDatabaseThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -258,15 +202,17 @@ func ExampleSQLResourcesClient_GetSQLDatabaseThroughput() { // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), // Rid: to.Ptr("PD5DALigDgw="), // Ts: to.Ptr[float32](1459200611), + // InstantMaximumThroughput: to.Ptr("10000"), // MinimumThroughput: to.Ptr("400"), // OfferReplacePending: to.Ptr("true"), + // SoftAllowedMaximumThroughput: to.Ptr("1000000"), // Throughput: to.Ptr[int32](400), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json func ExampleSQLResourcesClient_BeginUpdateSQLDatabaseThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -316,7 +262,7 @@ func ExampleSQLResourcesClient_BeginUpdateSQLDatabaseThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json func ExampleSQLResourcesClient_BeginMigrateSQLDatabaseToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -355,7 +301,7 @@ func ExampleSQLResourcesClient_BeginMigrateSQLDatabaseToAutoscale() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json func ExampleSQLResourcesClient_BeginMigrateSQLDatabaseToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -391,177 +337,7 @@ func ExampleSQLResourcesClient_BeginMigrateSQLDatabaseToManualThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSQLResourcesClient().NewListClientEncryptionKeysPager("rgName", "accountName", "databaseName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClientEncryptionKeysListResult = armcosmos.ClientEncryptionKeysListResult{ - // Value: []*armcosmos.ClientEncryptionKeyGetResults{ - // { - // Name: to.Ptr("cekName1"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName1"), - // Properties: &armcosmos.ClientEncryptionKeyGetProperties{ - // Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{ - // EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"), - // ID: to.Ptr("cekName1"), - // KeyWrapMetadata: &armcosmos.KeyWrapMetadata{ - // Name: to.Ptr("customerManagedKey1"), - // Type: to.Ptr("AzureKeyVault"), - // Algorithm: to.Ptr("RSA-OAEP"), - // Value: to.Ptr("AzureKeyVault Key URL for customerManagedKey1"), - // }, - // WrappedDataEncryptionKey: []byte("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), - // Etag: to.Ptr("00000000-0000-0000-7a1f-bc0828e801d7"), - // Rid: to.Ptr("nAMyAAAAAADPw1kKAgAAAA=="), - // Ts: to.Ptr[float32](1626425552), - // }, - // }, - // }, - // { - // Name: to.Ptr("cekName2"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName2"), - // Properties: &armcosmos.ClientEncryptionKeyGetProperties{ - // Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{ - // EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"), - // ID: to.Ptr("cekName2"), - // KeyWrapMetadata: &armcosmos.KeyWrapMetadata{ - // Name: to.Ptr("customerManagedKey2"), - // Type: to.Ptr("AzureKeyVault"), - // Algorithm: to.Ptr("RSA-OAEP"), - // Value: to.Ptr("AzureKeyVault Key URL for customerManagedKey2"), - // }, - // WrappedDataEncryptionKey: []byte("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), - // Etag: to.Ptr("00000000-0000-0000-7a21-7788a38c01d7"), - // Rid: to.Ptr("nAMyAAAAAAAWWfxHAgAAAA=="), - // Ts: to.Ptr[float32](1626425631), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLResourcesClient().GetClientEncryptionKey(ctx, "rgName", "accountName", "databaseName", "cekName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClientEncryptionKeyGetResults = armcosmos.ClientEncryptionKeyGetResults{ - // Name: to.Ptr("cekName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName"), - // Properties: &armcosmos.ClientEncryptionKeyGetProperties{ - // Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{ - // 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("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), - // Etag: to.Ptr("00000000-0000-0000-7a1f-bc0828e801d7"), - // Rid: to.Ptr("tNc4AAAAAAAQkjzWAgAAAA=="), - // Ts: to.Ptr[float32](1626425552), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-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() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLResourcesClient().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("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), - }, - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClientEncryptionKeyGetResults = armcosmos.ClientEncryptionKeyGetResults{ - // Name: to.Ptr("cekName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName"), - // Properties: &armcosmos.ClientEncryptionKeyGetProperties{ - // Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{ - // 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("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), - // Etag: to.Ptr("00000000-0000-0000-7a1f-bc0828e801d7"), - // Rid: to.Ptr("tNc4AAAAAAAQkjzWAgAAAA=="), - // Ts: to.Ptr[float32](1626425552), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlContainerList.json func ExampleSQLResourcesClient_NewListSQLContainersPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -607,6 +383,11 @@ func ExampleSQLResourcesClient_NewListSQLContainersPager() { // }}, // PolicyFormatVersion: to.Ptr[int32](1), // }, + // ComputedProperties: []*armcosmos.ComputedProperty{ + // { + // Name: to.Ptr("cp_lowerName"), + // Query: to.Ptr("SELECT VALUE LOWER(c.name) FROM c"), + // }}, // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ // ConflictResolutionPath: to.Ptr("/path"), // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), @@ -671,6 +452,8 @@ func ExampleSQLResourcesClient_NewListSQLContainersPager() { // }}, // PolicyFormatVersion: to.Ptr[int32](1), // }, + // ComputedProperties: []*armcosmos.ComputedProperty{ + // }, // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ // ConflictResolutionPath: to.Ptr("/path"), // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), @@ -785,7 +568,7 @@ func ExampleSQLResourcesClient_NewListSQLContainersPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlContainerGet.json func ExampleSQLResourcesClient_GetSQLContainer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -828,6 +611,11 @@ func ExampleSQLResourcesClient_GetSQLContainer() { // }}, // PolicyFormatVersion: to.Ptr[int32](1), // }, + // ComputedProperties: []*armcosmos.ComputedProperty{ + // { + // Name: to.Ptr("cp_lowerName"), + // Query: to.Ptr("SELECT VALUE LOWER(c.name) FROM c"), + // }}, // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ // ConflictResolutionPath: to.Ptr("/path"), // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), @@ -872,8 +660,8 @@ func ExampleSQLResourcesClient_GetSQLContainer() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerCreateUpdate.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLContainer_cosmosDbSqlContainerCreateUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlContainerCreateUpdate.json +func ExampleSQLResourcesClient_BeginCreateUpdateSQLContainer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -899,6 +687,11 @@ func ExampleSQLResourcesClient_BeginCreateUpdateSQLContainer_cosmosDbSqlContaine }}, PolicyFormatVersion: to.Ptr[int32](2), }, + ComputedProperties: []*armcosmos.ComputedProperty{ + { + Name: to.Ptr("cp_lowerName"), + Query: to.Ptr("SELECT VALUE LOWER(c.name) FROM c"), + }}, ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ ConflictResolutionPath: to.Ptr("/path"), Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), @@ -972,6 +765,11 @@ func ExampleSQLResourcesClient_BeginCreateUpdateSQLContainer_cosmosDbSqlContaine // }}, // PolicyFormatVersion: to.Ptr[int32](1), // }, + // ComputedProperties: []*armcosmos.ComputedProperty{ + // { + // Name: to.Ptr("cp_lowerName"), + // Query: to.Ptr("SELECT VALUE LOWER(c.name) FROM c"), + // }}, // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ // ConflictResolutionPath: to.Ptr("/path"), // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), @@ -1016,8 +814,8 @@ func ExampleSQLResourcesClient_BeginCreateUpdateSQLContainer_cosmosDbSqlContaine // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerRestore.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLContainer_cosmosDbSqlContainerRestore() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlContainerDelete.json +func ExampleSQLResourcesClient_BeginDeleteSQLContainer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1027,349 +825,31 @@ func ExampleSQLResourcesClient_BeginCreateUpdateSQLContainer_cosmosDbSqlContaine if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLContainer(ctx, "rg1", "ddb1", "databaseName", "containerName", armcosmos.SQLContainerCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.SQLContainerCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.SQLContainerResource{ - CreateMode: to.Ptr(armcosmos.CreateModeRestore), - ID: to.Ptr("containerName"), - RestoreParameters: &armcosmos.ResourceRestoreParameters{ - RestoreSource: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId"), - RestoreTimestampInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-20T18:28:00.000Z"); return t }()), - }, - }, - }, - }, nil) + poller, err := clientFactory.NewSQLResourcesClient().BeginDeleteSQLContainer(ctx, "rg1", "ddb1", "databaseName", "containerName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SQLContainerGetResults = armcosmos.SQLContainerGetResults{ - // Name: to.Ptr("containerName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/containers/containerName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.SQLContainerGetProperties{ - // Resource: &armcosmos.SQLContainerGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // ClientEncryptionPolicy: &armcosmos.ClientEncryptionPolicy{ - // IncludedPaths: []*armcosmos.ClientEncryptionIncludedPath{ - // { - // Path: to.Ptr("/path"), - // ClientEncryptionKeyID: to.Ptr("keyId"), - // EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"), - // EncryptionType: to.Ptr("Deterministic"), - // }}, - // PolicyFormatVersion: to.Ptr[int32](1), - // }, - // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ - // ConflictResolutionPath: to.Ptr("/path"), - // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), - // }, - // DefaultTTL: to.Ptr[int32](100), - // ID: to.Ptr("containerName"), - // 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")}, - // }}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLContainer_cosmosDbSqlMaterializedViewCreateUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLContainer(ctx, "rg1", "ddb1", "databaseName", "mvContainerName", armcosmos.SQLContainerCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.SQLContainerCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.SQLContainerResource{ - ID: to.Ptr("mvContainerName"), - 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), - }, - MaterializedViewDefinition: &armcosmos.MaterializedViewDefinition{ - Definition: to.Ptr("select * from ROOT"), - SourceCollectionID: to.Ptr("sourceContainerName"), - }, - PartitionKey: &armcosmos.ContainerPartitionKey{ - Kind: to.Ptr(armcosmos.PartitionKindHash), - Paths: []*string{ - to.Ptr("/mvpk")}, - }, - }, - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SQLContainerGetResults = armcosmos.SQLContainerGetResults{ - // Name: to.Ptr("mvContainerName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/containers/mvContainerName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.SQLContainerGetProperties{ - // Resource: &armcosmos.SQLContainerGetPropertiesResource{ - // Etag: to.Ptr("\"00000800-0000-0200-0000-639ff6480000\""), - // Rid: to.Ptr("vb0sn8MDxLw="), - // Ts: to.Ptr[float32](1671427656), - // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ - // ConflictResolutionPath: to.Ptr("/_ts"), - // ConflictResolutionProcedure: to.Ptr(""), - // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), - // }, - // DefaultTTL: to.Ptr[int32](-1), - // ID: to.Ptr("mvContainerName"), - // IndexingPolicy: &armcosmos.IndexingPolicy{ - // Automatic: to.Ptr(true), - // ExcludedPaths: []*armcosmos.ExcludedPath{ - // { - // Path: to.Ptr("/\"_etag\"/?"), - // }}, - // IncludedPaths: []*armcosmos.IncludedPath{ - // { - // Path: to.Ptr("/*"), - // }}, - // IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent), - // }, - // MaterializedViewDefinition: &armcosmos.MaterializedViewDefinition{ - // Definition: to.Ptr("select * from ROOT"), - // SourceCollectionID: to.Ptr("sourceContainerName"), - // SourceCollectionRid: to.Ptr("vb0sn6nEu9A="), - // }, - // PartitionKey: &armcosmos.ContainerPartitionKey{ - // Kind: to.Ptr(armcosmos.PartitionKindHash), - // Paths: []*string{ - // to.Ptr("/mvpk")}, - // }, - // UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{ - // UniqueKeys: []*armcosmos.UniqueKey{ - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerDelete.json -func ExampleSQLResourcesClient_BeginDeleteSQLContainer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLResourcesClient().BeginDeleteSQLContainer(ctx, "rg1", "ddb1", "databaseName", "containerName", 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/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabasePartitionMerge.json -func ExampleSQLResourcesClient_BeginSQLDatabasePartitionMerge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLResourcesClient().BeginSQLDatabasePartitionMerge(ctx, "rgName", "ddb1", "databaseName", 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionStorageInfoCollection = armcosmos.PhysicalPartitionStorageInfoCollection{ - // PhysicalPartitionStorageInfoCollection: []*armcosmos.PhysicalPartitionStorageInfo{ - // { - // ID: to.Ptr("0"), - // StorageInKB: to.Ptr[float64](333), - // }, - // { - // ID: to.Ptr("1"), - // StorageInKB: to.Ptr[float64](305), - // }, - // { - // ID: to.Ptr("177"), - // StorageInKB: to.Ptr[float64](368), - // }, - // { - // ID: to.Ptr("178"), - // StorageInKB: to.Ptr[float64](96313), - // }, - // { - // ID: to.Ptr("5"), - // StorageInKB: to.Ptr[float64](194), - // }, - // { - // ID: to.Ptr("6"), - // StorageInKB: to.Ptr[float64](331), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerPartitionMerge.json -func ExampleSQLResourcesClient_BeginListSQLContainerPartitionMerge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLResourcesClient().BeginListSQLContainerPartitionMerge(ctx, "rgName", "ddb1", "databaseName", "containerName", 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionStorageInfoCollection = armcosmos.PhysicalPartitionStorageInfoCollection{ - // PhysicalPartitionStorageInfoCollection: []*armcosmos.PhysicalPartitionStorageInfo{ - // { - // ID: to.Ptr("0"), - // StorageInKB: to.Ptr[float64](333), - // }, - // { - // ID: to.Ptr("1"), - // StorageInKB: to.Ptr[float64](305), - // }, - // { - // ID: to.Ptr("177"), - // StorageInKB: to.Ptr[float64](368), - // }, - // { - // ID: to.Ptr("178"), - // StorageInKB: to.Ptr[float64](96313), - // }, - // { - // ID: to.Ptr("5"), - // StorageInKB: to.Ptr[float64](194), - // }, - // { - // ID: to.Ptr("6"), - // StorageInKB: to.Ptr[float64](331), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerThroughputGet.json -func ExampleSQLResourcesClient_GetSQLContainerThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLResourcesClient().GetSQLContainerThroughput(ctx, "rg1", "ddb1", "databaseName", "containerName", 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/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlContainerThroughputGet.json +func ExampleSQLResourcesClient_GetSQLContainerThroughput() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcosmos.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewSQLResourcesClient().GetSQLContainerThroughput(ctx, "rg1", "ddb1", "databaseName", "containerName", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. @@ -1385,15 +865,17 @@ func ExampleSQLResourcesClient_GetSQLContainerThroughput() { // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), // Rid: to.Ptr("PD5DALigDgw="), // Ts: to.Ptr[float32](1459200611), + // InstantMaximumThroughput: to.Ptr("10000"), // MinimumThroughput: to.Ptr("400"), // OfferReplacePending: to.Ptr("true"), + // SoftAllowedMaximumThroughput: to.Ptr("1000000"), // Throughput: to.Ptr[int32](400), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlContainerThroughputUpdate.json func ExampleSQLResourcesClient_BeginUpdateSQLContainerThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1443,7 +925,7 @@ func ExampleSQLResourcesClient_BeginUpdateSQLContainerThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json func ExampleSQLResourcesClient_BeginMigrateSQLContainerToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1482,7 +964,7 @@ func ExampleSQLResourcesClient_BeginMigrateSQLContainerToAutoscale() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json func ExampleSQLResourcesClient_BeginMigrateSQLContainerToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1518,59 +1000,8 @@ func ExampleSQLResourcesClient_BeginMigrateSQLContainerToManualThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json -func ExampleSQLResourcesClient_BeginSQLDatabaseRetrieveThroughputDistribution() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLResourcesClient().BeginSQLDatabaseRetrieveThroughputDistribution(ctx, "rg1", "ddb1", "databaseName", 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{ - // Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{ - // Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{ - // PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ - // { - // ID: to.Ptr("0"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("1"), - // Throughput: to.Ptr[float64](5000), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json -func ExampleSQLResourcesClient_BeginSQLDatabaseRedistributeThroughput() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlClientEncryptionKeysList.json +func ExampleSQLResourcesClient_NewListClientEncryptionKeysPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1580,67 +1011,67 @@ func ExampleSQLResourcesClient_BeginSQLDatabaseRedistributeThroughput() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSQLResourcesClient().BeginSQLDatabaseRedistributeThroughput(ctx, "rg1", "ddb1", "databaseName", 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) + pager := clientFactory.NewSQLResourcesClient().NewListClientEncryptionKeysPager("rgName", "accountName", "databaseName", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ClientEncryptionKeysListResult = armcosmos.ClientEncryptionKeysListResult{ + // Value: []*armcosmos.ClientEncryptionKeyGetResults{ + // { + // Name: to.Ptr("cekName1"), + // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"), + // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName1"), + // Properties: &armcosmos.ClientEncryptionKeyGetProperties{ + // Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{ + // EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"), + // ID: to.Ptr("cekName1"), + // KeyWrapMetadata: &armcosmos.KeyWrapMetadata{ + // Name: to.Ptr("customerManagedKey1"), + // Type: to.Ptr("AzureKeyVault"), + // Algorithm: to.Ptr("RSA-OAEP"), + // Value: to.Ptr("AzureKeyVault Key URL for customerManagedKey1"), + // }, + // WrappedDataEncryptionKey: []byte("U3dhZ2dlciByb2Nrcw=="), + // Etag: to.Ptr("00000000-0000-0000-7a1f-bc0828e801d7"), + // Rid: to.Ptr("nAMyAAAAAADPw1kKAgAAAA=="), + // Ts: to.Ptr[float32](1626425552), + // }, + // }, + // }, + // { + // Name: to.Ptr("cekName2"), + // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"), + // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName2"), + // Properties: &armcosmos.ClientEncryptionKeyGetProperties{ + // Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{ + // EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"), + // ID: to.Ptr("cekName2"), + // KeyWrapMetadata: &armcosmos.KeyWrapMetadata{ + // Name: to.Ptr("customerManagedKey2"), + // Type: to.Ptr("AzureKeyVault"), + // Algorithm: to.Ptr("RSA-OAEP"), + // Value: to.Ptr("AzureKeyVault Key URL for customerManagedKey2"), + // }, + // WrappedDataEncryptionKey: []byte("U3dhZ2dlciByb2Nrcw=="), + // Etag: to.Ptr("00000000-0000-0000-7a21-7788a38c01d7"), + // Rid: to.Ptr("nAMyAAAAAAAWWfxHAgAAAA=="), + // Ts: to.Ptr[float32](1626425631), + // }, + // }, + // }}, + // } } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{ - // Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{ - // Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{ - // PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ - // { - // ID: to.Ptr("0"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("1"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("2"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("3"), - // Throughput: to.Ptr[float64](3000), - // }}, - // }, - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json -func ExampleSQLResourcesClient_BeginSQLContainerRetrieveThroughputDistribution() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlClientEncryptionKeyGet.json +func ExampleSQLResourcesClient_GetClientEncryptionKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1650,48 +1081,38 @@ func ExampleSQLResourcesClient_BeginSQLContainerRetrieveThroughputDistribution() if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSQLResourcesClient().BeginSQLContainerRetrieveThroughputDistribution(ctx, "rg1", "ddb1", "databaseName", "containerName", armcosmos.RetrieveThroughputParameters{ - Properties: &armcosmos.RetrieveThroughputProperties{ - Resource: &armcosmos.RetrieveThroughputPropertiesResource{ - PhysicalPartitionIDs: []*armcosmos.PhysicalPartitionID{ - { - ID: to.Ptr("0"), - }, - { - ID: to.Ptr("1"), - }}, - }, - }, - }, nil) + res, err := clientFactory.NewSQLResourcesClient().GetClientEncryptionKey(ctx, "rgName", "accountName", "databaseName", "cekName", 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) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{ - // Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{ - // Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{ - // PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ - // { - // ID: to.Ptr("0"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("1"), - // Throughput: to.Ptr[float64](5000), - // }}, + // res.ClientEncryptionKeyGetResults = armcosmos.ClientEncryptionKeyGetResults{ + // Name: to.Ptr("cekName"), + // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"), + // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName"), + // Properties: &armcosmos.ClientEncryptionKeyGetProperties{ + // Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{ + // 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("U3dhZ2dlciByb2Nrcw=="), + // Etag: to.Ptr("00000000-0000-0000-7a1f-bc0828e801d7"), + // Rid: to.Ptr("tNc4AAAAAAAQkjzWAgAAAA=="), + // Ts: to.Ptr[float32](1626425552), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json -func ExampleSQLResourcesClient_BeginSQLContainerRedistributeThroughput() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json +func ExampleSQLResourcesClient_BeginCreateUpdateClientEncryptionKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1701,27 +1122,18 @@ func ExampleSQLResourcesClient_BeginSQLContainerRedistributeThroughput() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSQLResourcesClient().BeginSQLContainerRedistributeThroughput(ctx, "rg1", "ddb1", "databaseName", "containerName", 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), + poller, err := clientFactory.NewSQLResourcesClient().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("U3dhZ2dlciByb2Nrcw=="), }, }, }, nil) @@ -1735,32 +1147,30 @@ func ExampleSQLResourcesClient_BeginSQLContainerRedistributeThroughput() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{ - // Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{ - // Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{ - // PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ - // { - // ID: to.Ptr("0"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("1"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("2"), - // Throughput: to.Ptr[float64](5000), - // }, - // { - // ID: to.Ptr("3"), - // Throughput: to.Ptr[float64](3000), - // }}, + // res.ClientEncryptionKeyGetResults = armcosmos.ClientEncryptionKeyGetResults{ + // Name: to.Ptr("cekName"), + // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"), + // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName"), + // Properties: &armcosmos.ClientEncryptionKeyGetProperties{ + // Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{ + // 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("U3dhZ2dlciByb2Nrcw=="), + // Etag: to.Ptr("00000000-0000-0000-7a1f-bc0828e801d7"), + // Rid: to.Ptr("tNc4AAAAAAAQkjzWAgAAAA=="), + // Ts: to.Ptr[float32](1626425552), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlStoredProcedureList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlStoredProcedureList.json func ExampleSQLResourcesClient_NewListSQLStoredProceduresPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1802,7 +1212,7 @@ func ExampleSQLResourcesClient_NewListSQLStoredProceduresPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlStoredProcedureGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlStoredProcedureGet.json func ExampleSQLResourcesClient_GetSQLStoredProcedure() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1836,7 +1246,7 @@ func ExampleSQLResourcesClient_GetSQLStoredProcedure() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json func ExampleSQLResourcesClient_BeginCreateUpdateSQLStoredProcedure() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1882,7 +1292,7 @@ func ExampleSQLResourcesClient_BeginCreateUpdateSQLStoredProcedure() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlStoredProcedureDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlStoredProcedureDelete.json func ExampleSQLResourcesClient_BeginDeleteSQLStoredProcedure() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1903,7 +1313,7 @@ func ExampleSQLResourcesClient_BeginDeleteSQLStoredProcedure() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlUserDefinedFunctionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlUserDefinedFunctionList.json func ExampleSQLResourcesClient_NewListSQLUserDefinedFunctionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1945,7 +1355,7 @@ func ExampleSQLResourcesClient_NewListSQLUserDefinedFunctionsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlUserDefinedFunctionGet.json func ExampleSQLResourcesClient_GetSQLUserDefinedFunction() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1979,7 +1389,7 @@ func ExampleSQLResourcesClient_GetSQLUserDefinedFunction() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json func ExampleSQLResourcesClient_BeginCreateUpdateSQLUserDefinedFunction() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2025,7 +1435,7 @@ func ExampleSQLResourcesClient_BeginCreateUpdateSQLUserDefinedFunction() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json func ExampleSQLResourcesClient_BeginDeleteSQLUserDefinedFunction() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2046,7 +1456,7 @@ func ExampleSQLResourcesClient_BeginDeleteSQLUserDefinedFunction() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlTriggerList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlTriggerList.json func ExampleSQLResourcesClient_NewListSQLTriggersPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2090,7 +1500,7 @@ func ExampleSQLResourcesClient_NewListSQLTriggersPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlTriggerGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlTriggerGet.json func ExampleSQLResourcesClient_GetSQLTrigger() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2126,7 +1536,7 @@ func ExampleSQLResourcesClient_GetSQLTrigger() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlTriggerCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlTriggerCreateUpdate.json func ExampleSQLResourcesClient_BeginCreateUpdateSQLTrigger() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2176,7 +1586,7 @@ func ExampleSQLResourcesClient_BeginCreateUpdateSQLTrigger() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlTriggerDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlTriggerDelete.json func ExampleSQLResourcesClient_BeginDeleteSQLTrigger() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2197,7 +1607,7 @@ func ExampleSQLResourcesClient_BeginDeleteSQLTrigger() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlRoleDefinitionGet.json func ExampleSQLResourcesClient_GetSQLRoleDefinition() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2237,7 +1647,7 @@ func ExampleSQLResourcesClient_GetSQLRoleDefinition() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json func ExampleSQLResourcesClient_BeginCreateUpdateSQLRoleDefinition() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2294,7 +1704,7 @@ func ExampleSQLResourcesClient_BeginCreateUpdateSQLRoleDefinition() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlRoleDefinitionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlRoleDefinitionDelete.json func ExampleSQLResourcesClient_BeginDeleteSQLRoleDefinition() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2315,7 +1725,7 @@ func ExampleSQLResourcesClient_BeginDeleteSQLRoleDefinition() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlRoleDefinitionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlRoleDefinitionList.json func ExampleSQLResourcesClient_NewListSQLRoleDefinitionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2363,7 +1773,7 @@ func ExampleSQLResourcesClient_NewListSQLRoleDefinitionsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlRoleAssignmentGet.json func ExampleSQLResourcesClient_GetSQLRoleAssignment() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2393,7 +1803,7 @@ func ExampleSQLResourcesClient_GetSQLRoleAssignment() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json func ExampleSQLResourcesClient_BeginCreateUpdateSQLRoleAssignment() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2433,7 +1843,7 @@ func ExampleSQLResourcesClient_BeginCreateUpdateSQLRoleAssignment() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlRoleAssignmentDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlRoleAssignmentDelete.json func ExampleSQLResourcesClient_BeginDeleteSQLRoleAssignment() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2454,7 +1864,7 @@ func ExampleSQLResourcesClient_BeginDeleteSQLRoleAssignment() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlRoleAssignmentList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlRoleAssignmentList.json func ExampleSQLResourcesClient_NewListSQLRoleAssignmentsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2492,7 +1902,7 @@ func ExampleSQLResourcesClient_NewListSQLRoleAssignmentsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBSqlContainerBackupInformation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBSqlContainerBackupInformation.json func ExampleSQLResourcesClient_BeginRetrieveContinuousBackupInformation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/tableresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/tableresources_client.go index 2a9b62201f18..8dbfb1d17f4c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/tableresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/tableresources_client.go @@ -46,7 +46,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -73,7 +73,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *TableResourcesClient) createUpdateTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, createUpdateTableParameters TableCreateUpdateParameters, options *TableResourcesClientBeginCreateUpdateTableOptions) (*http.Response, error) { var err error const operationName = "TableResourcesClient.BeginCreateUpdateTable" @@ -119,7 +119,7 @@ func (client *TableResourcesClient) createUpdateTableCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateTableParameters); err != nil { @@ -131,7 +131,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -157,7 +157,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *TableResourcesClient) deleteTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientBeginDeleteTableOptions) (*http.Response, error) { var err error const operationName = "TableResourcesClient.BeginDeleteTable" @@ -203,7 +203,7 @@ func (client *TableResourcesClient) deleteTableCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -211,7 +211,7 @@ func (client *TableResourcesClient) deleteTableCreateRequest(ctx context.Context // 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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -262,7 +262,7 @@ func (client *TableResourcesClient) getTableCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *TableResourcesClient) getTableHandleResponse(resp *http.Response) // name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -333,7 +333,7 @@ func (client *TableResourcesClient) getTableThroughputCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +350,7 @@ func (client *TableResourcesClient) getTableThroughputHandleResponse(resp *http. // NewListTablesPager - Lists the Tables under an existing Azure Cosmos DB database account. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-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.NewListTablesPager @@ -399,7 +399,7 @@ func (client *TableResourcesClient) listTablesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -417,7 +417,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -443,7 +443,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *TableResourcesClient) migrateTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientBeginMigrateTableToAutoscaleOptions) (*http.Response, error) { var err error const operationName = "TableResourcesClient.BeginMigrateTableToAutoscale" @@ -489,7 +489,7 @@ func (client *TableResourcesClient) migrateTableToAutoscaleCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -498,7 +498,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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -524,7 +524,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *TableResourcesClient) migrateTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientBeginMigrateTableToManualThroughputOptions) (*http.Response, error) { var err error const operationName = "TableResourcesClient.BeginMigrateTableToManualThroughput" @@ -570,7 +570,7 @@ func (client *TableResourcesClient) migrateTableToManualThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -579,7 +579,7 @@ func (client *TableResourcesClient) migrateTableToManualThroughputCreateRequest( // BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -607,7 +607,7 @@ func (client *TableResourcesClient) BeginRetrieveContinuousBackupInformation(ctx // RetrieveContinuousBackupInformation - Retrieves continuous backup information for a table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *TableResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, tableName string, location ContinuousBackupRestoreLocation, options *TableResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { var err error const operationName = "TableResourcesClient.BeginRetrieveContinuousBackupInformation" @@ -653,7 +653,7 @@ func (client *TableResourcesClient) retrieveContinuousBackupInformationCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, location); err != nil { @@ -665,7 +665,7 @@ func (client *TableResourcesClient) retrieveContinuousBackupInformationCreateReq // 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 2023-03-15-preview +// Generated from API version 2023-11-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -692,7 +692,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 2023-03-15-preview +// Generated from API version 2023-11-15 func (client *TableResourcesClient) updateTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *TableResourcesClientBeginUpdateTableThroughputOptions) (*http.Response, error) { var err error const operationName = "TableResourcesClient.BeginUpdateTableThroughput" @@ -738,7 +738,7 @@ func (client *TableResourcesClient) updateTableThroughputCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-15-preview") + reqQP.Set("api-version", "2023-11-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/tableresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/tableresources_client_example_test.go index 03e6043673a9..02eae93c36d6 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/tableresources_client_example_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/tableresources_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBTableList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBTableList.json func ExampleTableResourcesClient_NewListTablesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -59,7 +59,7 @@ func ExampleTableResourcesClient_NewListTablesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBTableGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBTableGet.json func ExampleTableResourcesClient_GetTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -95,7 +95,7 @@ func ExampleTableResourcesClient_GetTable() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBTableCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBTableCreateUpdate.json func ExampleTableResourcesClient_BeginCreateUpdateTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -139,7 +139,7 @@ func ExampleTableResourcesClient_BeginCreateUpdateTable() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBTableDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBTableDelete.json func ExampleTableResourcesClient_BeginDeleteTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -160,7 +160,7 @@ func ExampleTableResourcesClient_BeginDeleteTable() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBTableThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBTableThroughputGet.json func ExampleTableResourcesClient_GetTableThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -190,15 +190,17 @@ func ExampleTableResourcesClient_GetTableThroughput() { // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), // Rid: to.Ptr("PD5DALigDgw="), // Ts: to.Ptr[float32](1459200611), + // InstantMaximumThroughput: to.Ptr("10000"), // MinimumThroughput: to.Ptr("400"), // OfferReplacePending: to.Ptr("true"), + // SoftAllowedMaximumThroughput: to.Ptr("1000000"), // Throughput: to.Ptr[int32](400), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBTableThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBTableThroughputUpdate.json func ExampleTableResourcesClient_BeginUpdateTableThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -248,7 +250,7 @@ func ExampleTableResourcesClient_BeginUpdateTableThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBTableMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBTableMigrateToAutoscale.json func ExampleTableResourcesClient_BeginMigrateTableToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -287,7 +289,7 @@ func ExampleTableResourcesClient_BeginMigrateTableToAutoscale() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBTableMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBTableMigrateToManualThroughput.json func ExampleTableResourcesClient_BeginMigrateTableToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -323,7 +325,7 @@ func ExampleTableResourcesClient_BeginMigrateTableToManualThroughput() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/examples/CosmosDBTableBackupInformation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBTableBackupInformation.json func ExampleTableResourcesClient_BeginRetrieveContinuousBackupInformation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { From 3ec46cd3143660c8ea3dd0783112e26aabee1348 Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Wed, 3 Jan 2024 10:37:46 +0800 Subject: [PATCH 2/3] fix module version --- .../cosmos/armcosmos/cassandraresources_live_test.go | 2 +- .../cosmos/armcosmos/databaseaccounts_live_test.go | 2 +- .../cosmos/armcosmos/fake/cassandraclusters_server.go | 2 +- .../cosmos/armcosmos/fake/cassandradatacenters_server.go | 2 +- .../cosmos/armcosmos/fake/cassandraresources_server.go | 2 +- sdk/resourcemanager/cosmos/armcosmos/fake/collection_server.go | 2 +- .../cosmos/armcosmos/fake/collectionpartition_server.go | 2 +- .../cosmos/armcosmos/fake/collectionpartitionregion_server.go | 2 +- .../cosmos/armcosmos/fake/collectionregion_server.go | 2 +- sdk/resourcemanager/cosmos/armcosmos/fake/database_server.go | 2 +- .../cosmos/armcosmos/fake/databaseaccountregion_server.go | 2 +- .../cosmos/armcosmos/fake/databaseaccounts_server.go | 2 +- .../cosmos/armcosmos/fake/gremlinresources_server.go | 2 +- sdk/resourcemanager/cosmos/armcosmos/fake/locations_server.go | 2 +- .../cosmos/armcosmos/fake/mongodbresources_server.go | 2 +- .../cosmos/armcosmos/fake/notebookworkspaces_server.go | 2 +- sdk/resourcemanager/cosmos/armcosmos/fake/operations_server.go | 2 +- .../cosmos/armcosmos/fake/partitionkeyrangeid_server.go | 2 +- .../cosmos/armcosmos/fake/partitionkeyrangeidregion_server.go | 2 +- sdk/resourcemanager/cosmos/armcosmos/fake/percentile_server.go | 2 +- .../cosmos/armcosmos/fake/percentilesourcetarget_server.go | 2 +- .../cosmos/armcosmos/fake/percentiletarget_server.go | 2 +- .../cosmos/armcosmos/fake/privateendpointconnections_server.go | 2 +- .../cosmos/armcosmos/fake/privatelinkresources_server.go | 2 +- .../cosmos/armcosmos/fake/restorabledatabaseaccounts_server.go | 2 +- .../cosmos/armcosmos/fake/restorablegremlindatabases_server.go | 2 +- .../cosmos/armcosmos/fake/restorablegremlingraphs_server.go | 2 +- .../cosmos/armcosmos/fake/restorablegremlinresources_server.go | 2 +- .../armcosmos/fake/restorablemongodbcollections_server.go | 2 +- .../cosmos/armcosmos/fake/restorablemongodbdatabases_server.go | 2 +- .../cosmos/armcosmos/fake/restorablemongodbresources_server.go | 2 +- .../cosmos/armcosmos/fake/restorablesqlcontainers_server.go | 2 +- .../cosmos/armcosmos/fake/restorablesqldatabases_server.go | 2 +- .../cosmos/armcosmos/fake/restorablesqlresources_server.go | 2 +- .../cosmos/armcosmos/fake/restorabletableresources_server.go | 2 +- .../cosmos/armcosmos/fake/restorabletables_server.go | 2 +- sdk/resourcemanager/cosmos/armcosmos/fake/service_server.go | 2 +- .../cosmos/armcosmos/fake/sqlresources_server.go | 2 +- .../cosmos/armcosmos/fake/tableresources_server.go | 2 +- sdk/resourcemanager/cosmos/armcosmos/go.mod | 1 - sdk/resourcemanager/cosmos/armcosmos/go.sum | 2 -- .../cosmos/armcosmos/gremlinresources_live_test.go | 2 +- .../cosmos/armcosmos/mongodbresources_live_test.go | 2 +- sdk/resourcemanager/cosmos/armcosmos/operations_live_test.go | 2 +- .../cosmos/armcosmos/privateendpointconnection_live_test.go | 2 +- sdk/resourcemanager/cosmos/armcosmos/services_live_test.go | 2 +- sdk/resourcemanager/cosmos/armcosmos/sqlresources_live_test.go | 2 +- .../cosmos/armcosmos/tableresources_live_test.go | 2 +- 48 files changed, 46 insertions(+), 49 deletions(-) diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_live_test.go b/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_live_test.go index 1d799b900962..bf0c3d97d37b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_live_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_live_test.go b/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_live_test.go index e4ae7cda763f..fef8d536d9d4 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_live_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraclusters_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraclusters_server.go index df83f25b3dc1..a7979a7c6483 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraclusters_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraclusters_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/cassandradatacenters_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/cassandradatacenters_server.go index da54815b1101..c89050c87c24 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/cassandradatacenters_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/cassandradatacenters_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraresources_server.go index b68f6c1bff8e..438d832355af 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/cassandraresources_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/collection_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/collection_server.go index 408c6e30a054..34fe5fe250f2 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/collection_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/collection_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/collectionpartition_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/collectionpartition_server.go index 77b1fb3a35ae..9081aecd9a83 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/collectionpartition_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/collectionpartition_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/collectionpartitionregion_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/collectionpartitionregion_server.go index efdc1323b128..74dadc75fdd0 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/collectionpartitionregion_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/collectionpartitionregion_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/collectionregion_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/collectionregion_server.go index e71b4f3c07ae..cd8f5df7c68f 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/collectionregion_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/collectionregion_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/database_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/database_server.go index e9530d3b0624..25e86df96f0d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/database_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/database_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/databaseaccountregion_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/databaseaccountregion_server.go index a14f671dc0fc..9dfdc62c1f9c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/databaseaccountregion_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/databaseaccountregion_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/databaseaccounts_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/databaseaccounts_server.go index ae22897705c1..e02543f59c42 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/databaseaccounts_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/databaseaccounts_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/gremlinresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/gremlinresources_server.go index 94ac206e38b9..988307080584 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/gremlinresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/gremlinresources_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/locations_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/locations_server.go index d367d80d02ef..5b3ee713cb62 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/locations_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/locations_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/mongodbresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/mongodbresources_server.go index 43c14652a385..7be24df9a39c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/mongodbresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/mongodbresources_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/notebookworkspaces_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/notebookworkspaces_server.go index 405f6ac23dec..10599c6eec30 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/notebookworkspaces_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/notebookworkspaces_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/operations_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/operations_server.go index e7e38f1fbb5c..61413409ea44 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/operations_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/operations_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" ) diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/partitionkeyrangeid_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/partitionkeyrangeid_server.go index 005ba6dcfb14..4360863a716f 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/partitionkeyrangeid_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/partitionkeyrangeid_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/partitionkeyrangeidregion_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/partitionkeyrangeidregion_server.go index a7c45d02233b..eac632da8d6a 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/partitionkeyrangeidregion_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/partitionkeyrangeidregion_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/percentile_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/percentile_server.go index a642522f4601..fccd2eb5e664 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/percentile_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/percentile_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/percentilesourcetarget_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/percentilesourcetarget_server.go index 85f2ea4b7d96..8d3bb61f261d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/percentilesourcetarget_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/percentilesourcetarget_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/percentiletarget_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/percentiletarget_server.go index 621f732f2840..3badcdc32af7 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/percentiletarget_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/percentiletarget_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/privateendpointconnections_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/privateendpointconnections_server.go index bbc492810b9f..75d179f5092e 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/privateendpointconnections_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/privatelinkresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/privatelinkresources_server.go index 4d0eafdf6a5a..ac7c6d05de7f 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/privatelinkresources_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorabledatabaseaccounts_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorabledatabaseaccounts_server.go index 8e49bd42b11b..e52775b91eef 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorabledatabaseaccounts_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorabledatabaseaccounts_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlindatabases_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlindatabases_server.go index 192929f3fcdc..0291dd8ab211 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlindatabases_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlindatabases_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlingraphs_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlingraphs_server.go index e5cbecbe9458..f87941e3be50 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlingraphs_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlingraphs_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlinresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlinresources_server.go index e3517c29f22b..669d952483da 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlinresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablegremlinresources_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbcollections_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbcollections_server.go index 96429f917ef2..b932de9f64e5 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbcollections_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbcollections_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbdatabases_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbdatabases_server.go index fd2f5faa7054..bd22cdad59fe 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbdatabases_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbdatabases_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbresources_server.go index 359a9fe7f00c..ba50cae57413 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablemongodbresources_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqlcontainers_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqlcontainers_server.go index e737f292b929..77427e857719 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqlcontainers_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqlcontainers_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqldatabases_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqldatabases_server.go index c51cd023f82b..eca8e763394f 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqldatabases_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqldatabases_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqlresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqlresources_server.go index 9d9d0f4c826f..037b8846a0fd 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqlresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorablesqlresources_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorabletableresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorabletableresources_server.go index a63c544e9c3e..7ae18bd7eb7a 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorabletableresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorabletableresources_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/restorabletables_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/restorabletables_server.go index 048154e1a37c..b24abc1197a4 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/restorabletables_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/restorabletables_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/service_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/service_server.go index 24f955a38121..6e3b511136ef 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/service_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/service_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/sqlresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/sqlresources_server.go index aefd6a39ef5c..93e1da676567 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/sqlresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/sqlresources_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/fake/tableresources_server.go b/sdk/resourcemanager/cosmos/armcosmos/fake/tableresources_server.go index 58c9dbbef480..55c45773c15b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/fake/tableresources_server.go +++ b/sdk/resourcemanager/cosmos/armcosmos/fake/tableresources_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/cosmos/armcosmos/go.mod b/sdk/resourcemanager/cosmos/armcosmos/go.mod index 2c90d4f29bf4..89f058d9339d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/go.mod +++ b/sdk/resourcemanager/cosmos/armcosmos/go.mod @@ -6,7 +6,6 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3 v3.0.0-beta.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 github.com/stretchr/testify v1.8.4 diff --git a/sdk/resourcemanager/cosmos/armcosmos/go.sum b/sdk/resourcemanager/cosmos/armcosmos/go.sum index d817759222f4..88bb72abf2ba 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/go.sum +++ b/sdk/resourcemanager/cosmos/armcosmos/go.sum @@ -4,8 +4,6 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZM github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 h1:d81/ng9rET2YqdVkVwkb6EXeRrLJIwyGnJcAlAWKwhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3 v3.0.0-beta.2 h1:ANwoUvNPWo/MWJcG95cOCQPEbKrdkDNxzUHe45PuNvo= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3 v3.0.0-beta.2/go.mod h1:xwERKmt+vSVHIhVI1RzLI6QAQwdFEEJfu89ZUHXWcKA= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= diff --git a/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_live_test.go b/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_live_test.go index 07183c659eed..3de17be7fab4 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_live_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_live_test.go b/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_live_test.go index e5a609e66e53..c06222bfe705 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_live_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cosmos/armcosmos/operations_live_test.go b/sdk/resourcemanager/cosmos/armcosmos/operations_live_test.go index 8c563c0b2b3e..7988734f0ff1 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/operations_live_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/operations_live_test.go @@ -14,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnection_live_test.go b/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnection_live_test.go index d1cd6f5b5913..c7c88ac5de35 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnection_live_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnection_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2/testutil" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/stretchr/testify/suite" diff --git a/sdk/resourcemanager/cosmos/armcosmos/services_live_test.go b/sdk/resourcemanager/cosmos/armcosmos/services_live_test.go index 3e7428b09510..44ee0527f409 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/services_live_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/services_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_live_test.go b/sdk/resourcemanager/cosmos/armcosmos/sqlresources_live_test.go index f54462df5822..a800ba026cd9 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_live_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/sqlresources_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cosmos/armcosmos/tableresources_live_test.go b/sdk/resourcemanager/cosmos/armcosmos/tableresources_live_test.go index 6a524fad2d4d..88f8cb2a265d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/tableresources_live_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/tableresources_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2/testutil" "github.com/stretchr/testify/suite" ) From a25537b4228d1c44682ce76e0806ca13e258580f Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Wed, 3 Jan 2024 10:37:53 +0800 Subject: [PATCH 3/3] assets --- sdk/resourcemanager/cosmos/armcosmos/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/resourcemanager/cosmos/armcosmos/assets.json b/sdk/resourcemanager/cosmos/armcosmos/assets.json index 314ed621eb96..6fc2c9a47749 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/assets.json +++ b/sdk/resourcemanager/cosmos/armcosmos/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/resourcemanager/cosmos/armcosmos", - "Tag": "go/resourcemanager/cosmos/armcosmos_ce4b820b08" + "Tag": "go/resourcemanager/cosmos/armcosmos_3999eea54f" }