From cced59df476a141455bdb6ccac007f88d6cf862e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 15 Apr 2024 03:47:23 +0000 Subject: [PATCH] CodeGen from PR 28368 in Azure/azure-rest-api-specs Merge e5658f3666c731e1ad5fcfd4c9ea5ae2bbeb8131 into b54ffc9278eff071455b1dbb4ad2e772afce885d --- .../cosmos/armcosmos/CHANGELOG.md | 21 + .../cosmos/armcosmos/autorest.md | 7 +- .../armcosmos/cassandraclusters_client.go | 74 +- .../cassandraclusters_client_example_test.go | 913 ------ .../armcosmos/cassandradatacenters_client.go | 26 +- ...assandradatacenters_client_example_test.go | 237 -- .../armcosmos/cassandraresources_client.go | 126 +- .../cassandraresources_client_example_test.go | 993 ------- .../cosmos/armcosmos/collection_client.go | 12 +- .../collection_client_example_test.go | 170 -- .../armcosmos/collectionpartition_client.go | 8 +- ...collectionpartition_client_example_test.go | 124 - .../collectionpartitionregion_client.go | 4 +- ...tionpartitionregion_client_example_test.go | 83 - .../armcosmos/collectionregion_client.go | 4 +- .../collectionregion_client_example_test.go | 81 - .../cosmos/armcosmos/constants.go | 46 +- .../cosmos/armcosmos/database_client.go | 12 +- .../armcosmos/database_client_example_test.go | 170 -- .../armcosmos/databaseaccountregion_client.go | 4 +- ...tabaseaccountregion_client_example_test.go | 81 - .../armcosmos/databaseaccounts_client.go | 86 +- .../databaseaccounts_client_example_test.go | 1603 ----------- .../armcosmos/datatransferjobs_client.go | 28 +- .../datatransferjobs_client_example_test.go | 334 --- sdk/resourcemanager/cosmos/armcosmos/go.mod | 2 +- .../cosmos/armcosmos/graphresources_client.go | 20 +- .../graphresources_client_example_test.go | 160 -- .../armcosmos/gremlinresources_client.go | 90 +- .../gremlinresources_client_example_test.go | 825 ------ .../cosmos/armcosmos/locations_client.go | 8 +- .../locations_client_example_test.go | 111 - .../cosmos/armcosmos/models.go | 63 +- .../cosmos/armcosmos/models_serde.go | 141 +- .../cosmos/armcosmos/mongoclusters_client.go | 58 +- .../mongoclusters_client_example_test.go | 784 ----- .../armcosmos/mongodbresources_client.go | 166 +- .../mongodbresources_client_example_test.go | 1573 ---------- .../armcosmos/notebookworkspaces_client.go | 36 +- .../notebookworkspaces_client_example_test.go | 204 -- .../cosmos/armcosmos/operations_client.go | 4 +- .../operations_client_example_test.go | 55 - .../armcosmos/partitionkeyrangeid_client.go | 4 +- ...partitionkeyrangeid_client_example_test.go | 83 - .../partitionkeyrangeidregion_client.go | 4 +- ...ionkeyrangeidregion_client_example_test.go | 83 - .../cosmos/armcosmos/percentile_client.go | 4 +- .../percentile_client_example_test.go | 88 - .../percentilesourcetarget_client.go | 4 +- ...centilesourcetarget_client_example_test.go | 67 - .../armcosmos/percentiletarget_client.go | 4 +- .../percentiletarget_client_example_test.go | 88 - .../privateendpointconnections_client.go | 20 +- ...endpointconnections_client_example_test.go | 187 -- .../armcosmos/privatelinkresources_client.go | 8 +- ...rivatelinkresources_client_example_test.go | 92 - .../restorabledatabaseaccounts_client.go | 12 +- ...bledatabaseaccounts_client_example_test.go | 217 -- .../restorablegremlindatabases_client.go | 4 +- ...blegremlindatabases_client_example_test.go | 77 - .../restorablegremlingraphs_client.go | 4 +- ...orablegremlingraphs_client_example_test.go | 81 - .../restorablegremlinresources_client.go | 4 +- ...blegremlinresources_client_example_test.go | 74 - .../restorablemongodbcollections_client.go | 4 +- ...emongodbcollections_client_example_test.go | 81 - .../restorablemongodbdatabases_client.go | 4 +- ...blemongodbdatabases_client_example_test.go | 77 - .../restorablemongodbresources_client.go | 4 +- ...blemongodbresources_client_example_test.go | 74 - .../restorablesqlcontainers_client.go | 4 +- ...orablesqlcontainers_client_example_test.go | 133 - .../restorablesqldatabases_client.go | 4 +- ...torablesqldatabases_client_example_test.go | 117 - .../restorablesqlresources_client.go | 4 +- ...torablesqlresources_client_example_test.go | 74 - .../restorabletableresources_client.go | 4 +- ...rabletableresources_client_example_test.go | 59 - .../armcosmos/restorabletables_client.go | 4 +- .../restorabletables_client_example_test.go | 79 - .../cosmos/armcosmos/service_client.go | 20 +- .../armcosmos/service_client_example_test.go | 503 ---- .../cosmos/armcosmos/sqlresources_client.go | 240 +- .../sqlresources_client_example_test.go | 2552 ----------------- .../cosmos/armcosmos/tableresources_client.go | 48 +- .../tableresources_client_example_test.go | 357 --- .../cosmos/armcosmos/throughputpool_client.go | 22 +- .../throughputpool_client_example_test.go | 163 -- .../armcosmos/throughputpoolaccount_client.go | 16 +- ...roughputpoolaccount_client_example_test.go | 107 - .../throughputpoolaccounts_client.go | 4 +- ...oughputpoolaccounts_client_example_test.go | 62 - .../armcosmos/throughputpools_client.go | 8 +- .../throughputpools_client_example_test.go | 74 - 94 files changed, 790 insertions(+), 14868 deletions(-) delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/collection_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/collectionregion_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/database_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/graphresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/locations_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/percentile_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/restorabletables_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/service_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/sqlresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/tableresources_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/throughputpool_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccount_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccounts_client_example_test.go delete mode 100644 sdk/resourcemanager/cosmos/armcosmos/throughputpools_client_example_test.go diff --git a/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md b/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md index e0e790be095c..8725cd2dbdfb 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md +++ b/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md @@ -1,5 +1,26 @@ # Release History +## 3.0.0-beta.5 (2024-04-15) +### Breaking Changes + +- Struct `ProxyResourceAutoGenerated` has been removed +- Struct `ResourceAutoGenerated` has been removed + +### Features Added + +- New value `ServerVersionFive0`, `ServerVersionSix0` added to enum type `ServerVersion` +- New enum type `CapacityMode` with values `CapacityModeNone`, `CapacityModeProvisioned`, `CapacityModeServerless` +- New enum type `CapacityModeTransitionStatus` with values `CapacityModeTransitionStatusCompleted`, `CapacityModeTransitionStatusFailed`, `CapacityModeTransitionStatusInProgress`, `CapacityModeTransitionStatusInitialized`, `CapacityModeTransitionStatusInvalid` +- New function `PossibleCapacityModeValues() []CapacityMode` +- New struct `CapacityModeChangeTransitionState` +- New field `CapacityMode` in struct `DatabaseAccountCreateUpdateProperties` +- New field `CapacityMode`, `CapacityModeChangeTransitionState` in struct `DatabaseAccountGetProperties` +- New field `CapacityMode` in struct `DatabaseAccountUpdateProperties` +- New field `SystemData` in struct `PrivateEndpointConnection` +- New field `SystemData` in struct `ProxyResource` +- New field `SystemData` in struct `Resource` + + ## 3.0.0-beta.4 (2024-03-22) ### Breaking Changes diff --git a/sdk/resourcemanager/cosmos/armcosmos/autorest.md b/sdk/resourcemanager/cosmos/armcosmos/autorest.md index 1a3e25668b0f..b3ab96d5e50c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/autorest.md +++ b/sdk/resourcemanager/cosmos/armcosmos/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.0.0-beta.4 -tag: package-preview-2024-02 +module-version: 3.0.0-beta.5 ``` \ 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 da453e603691..b91e1581400a 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.XMSForceDeallocate != nil { @@ -211,7 +211,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 @@ -236,7 +236,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *CassandraClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CassandraClustersClient.BeginDelete" @@ -278,7 +278,7 @@ func (client *CassandraClustersClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +287,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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. @@ -333,7 +333,7 @@ func (client *CassandraClustersClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *CassandraClustersClient) getHandleResponse(resp *http.Response) (C // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - Managed Cassandra cluster name. // - backupID - Id of a restorable backup of a Cassandra cluster. @@ -403,7 +403,7 @@ func (client *CassandraClustersClient) getBackupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -421,7 +421,7 @@ func (client *CassandraClustersClient) getBackupHandleResponse(resp *http.Respon // GetCommandAsync - Get details about a specified command that was run asynchronously. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - Managed Cassandra cluster name. // - commandID - Managed Cassandra cluster command id. @@ -473,7 +473,7 @@ func (client *CassandraClustersClient) getCommandAsyncCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -491,7 +491,7 @@ func (client *CassandraClustersClient) getCommandAsyncHandleResponse(resp *http. // BeginInvokeCommand - Invoke a command like nodetool for cassandra maintenance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - Managed Cassandra cluster name. // - body - Specification which command to run where @@ -517,7 +517,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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" @@ -559,7 +559,7 @@ func (client *CassandraClustersClient) invokeCommandCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -571,7 +571,7 @@ func (client *CassandraClustersClient) invokeCommandCreateRequest(ctx context.Co // BeginInvokeCommandAsync - Invoke a command like nodetool for cassandra maintenance asynchronously // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - Managed Cassandra cluster name. // - body - Specification which command to run where @@ -597,7 +597,7 @@ func (client *CassandraClustersClient) BeginInvokeCommandAsync(ctx context.Conte // InvokeCommandAsync - Invoke a command like nodetool for cassandra maintenance asynchronously // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *CassandraClustersClient) invokeCommandAsync(ctx context.Context, resourceGroupName string, clusterName string, body CommandPostBody, options *CassandraClustersClientBeginInvokeCommandAsyncOptions) (*http.Response, error) { var err error const operationName = "CassandraClustersClient.BeginInvokeCommandAsync" @@ -639,7 +639,7 @@ func (client *CassandraClustersClient) invokeCommandAsyncCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -650,7 +650,7 @@ func (client *CassandraClustersClient) invokeCommandAsyncCreateRequest(ctx conte // NewListBackupsPager - List the backups of this cluster that are available to restore. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - Managed Cassandra cluster name. // - options - CassandraClustersClientListBackupsOptions contains the optional parameters for the CassandraClustersClient.NewListBackupsPager @@ -699,7 +699,7 @@ func (client *CassandraClustersClient) listBackupsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -716,7 +716,7 @@ func (client *CassandraClustersClient) listBackupsHandleResponse(resp *http.Resp // NewListByResourceGroupPager - List all managed Cassandra clusters in this resource group. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CassandraClustersClientListByResourceGroupOptions contains the optional parameters for the CassandraClustersClient.NewListByResourceGroupPager // method. @@ -760,7 +760,7 @@ func (client *CassandraClustersClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -777,7 +777,7 @@ func (client *CassandraClustersClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - List all managed Cassandra clusters in this subscription. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - options - CassandraClustersClientListBySubscriptionOptions contains the optional parameters for the CassandraClustersClient.NewListBySubscriptionPager // method. func (client *CassandraClustersClient) NewListBySubscriptionPager(options *CassandraClustersClientListBySubscriptionOptions) *runtime.Pager[CassandraClustersClientListBySubscriptionResponse] { @@ -816,7 +816,7 @@ func (client *CassandraClustersClient) listBySubscriptionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -833,7 +833,7 @@ func (client *CassandraClustersClient) listBySubscriptionHandleResponse(resp *ht // NewListCommandPager - List all commands currently running on ring info // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - Managed Cassandra cluster name. // - options - CassandraClustersClientListCommandOptions contains the optional parameters for the CassandraClustersClient.NewListCommandPager @@ -882,7 +882,7 @@ func (client *CassandraClustersClient) listCommandCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -902,7 +902,7 @@ func (client *CassandraClustersClient) listCommandHandleResponse(resp *http.Resp // cluster. Use Deallocate to deallocate the cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 @@ -929,7 +929,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *CassandraClustersClient) start(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "CassandraClustersClient.BeginStart" @@ -971,7 +971,7 @@ func (client *CassandraClustersClient) startCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -980,7 +980,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 @@ -1027,7 +1027,7 @@ func (client *CassandraClustersClient) statusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1045,7 +1045,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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. @@ -1071,7 +1071,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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" @@ -1113,7 +1113,7 @@ func (client *CassandraClustersClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 deleted file mode 100644 index d4c2895d5614..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client_example_test.go +++ /dev/null @@ -1,913 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json -func ExampleCassandraClustersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCassandraClustersClient().NewListBySubscriptionPager(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.ListClusters = armcosmos.ListClusters{ - // Value: []*armcosmos.ClusterResource{ - // { - // Name: to.Ptr("cassandra-prod"), - // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/cassandraClusters"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ClusterResourceProperties{ - // AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra), - // CassandraVersion: to.Ptr("3.11"), - // ClientCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"), - // DelegatedManagementSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"), - // ExternalGossipCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // ExternalSeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("10.52.221.2"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.3"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.4"), - // }}, - // GossipCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // HoursBetweenBackups: to.Ptr[int32](24), - // ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded), - // SeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("10.52.221.2"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.3"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.4"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.2"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.3"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.4"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json -func ExampleCassandraClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCassandraClustersClient().NewListByResourceGroupPager("cassandra-prod-rg", 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.ListClusters = armcosmos.ListClusters{ - // Value: []*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"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ClusterResourceProperties{ - // AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra), - // CassandraVersion: to.Ptr("3.11"), - // ClientCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"), - // DelegatedManagementSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"), - // ExternalGossipCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // ExternalSeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("10.52.221.2"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.3"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.4"), - // }}, - // GossipCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // HoursBetweenBackups: to.Ptr[int32](24), - // ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded), - // SeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("10.52.221.2"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.3"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.4"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.2"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.3"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.4"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterGet.json -func ExampleCassandraClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCassandraClustersClient().Get(ctx, "cassandra-prod-rg", "cassandra-prod", 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.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"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ClusterResourceProperties{ - // AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra), - // CassandraVersion: to.Ptr("3.11"), - // ClientCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"), - // DelegatedManagementSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"), - // ExternalGossipCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // ExternalSeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("10.52.221.2"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.3"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.4"), - // }}, - // GossipCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // HoursBetweenBackups: to.Ptr[int32](24), - // ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded), - // SeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("10.52.221.2"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.3"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.4"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.2"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.3"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.4"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterDelete.json -func ExampleCassandraClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraClustersClient().BeginDelete(ctx, "cassandra-prod-rg", "cassandra-prod", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterCreate.json -func ExampleCassandraClustersClient_BeginCreateUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraClustersClient().BeginCreateUpdate(ctx, "cassandra-prod-rg", "cassandra-prod", armcosmos.ClusterResource{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ClusterResourceProperties{ - AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra), - CassandraVersion: to.Ptr("3.11"), - ClientCertificates: []*armcosmos.Certificate{ - { - Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - }}, - ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"), - DelegatedManagementSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"), - ExternalGossipCertificates: []*armcosmos.Certificate{ - { - Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - }}, - ExternalSeedNodes: []*armcosmos.SeedNode{ - { - IPAddress: to.Ptr("10.52.221.2"), - }, - { - IPAddress: to.Ptr("10.52.221.3"), - }, - { - IPAddress: to.Ptr("10.52.221.4"), - }}, - HoursBetweenBackups: to.Ptr[int32](24), - InitialCassandraAdminPassword: to.Ptr("mypassword"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.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"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ClusterResourceProperties{ - // AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra), - // CassandraVersion: to.Ptr("3.11"), - // ClientCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"), - // DelegatedManagementSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"), - // ExternalGossipCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // ExternalSeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("10.52.221.2"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.3"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.4"), - // }}, - // GossipCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // HoursBetweenBackups: to.Ptr[int32](24), - // ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded), - // SeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("10.52.221.2"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.3"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.4"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.2"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.3"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.4"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterPatch.json -func ExampleCassandraClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraClustersClient().BeginUpdate(ctx, "cassandra-prod-rg", "cassandra-prod", armcosmos.ClusterResource{ - Tags: map[string]*string{ - "owner": to.Ptr("mike"), - }, - Properties: &armcosmos.ClusterResourceProperties{ - AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodNone), - ExternalGossipCertificates: []*armcosmos.Certificate{ - { - Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - }}, - ExternalSeedNodes: []*armcosmos.SeedNode{ - { - IPAddress: to.Ptr("10.52.221.2"), - }, - { - IPAddress: to.Ptr("10.52.221.3"), - }, - { - IPAddress: to.Ptr("10.52.221.4"), - }}, - HoursBetweenBackups: to.Ptr[int32](12), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.ClusterResource = armcosmos.ClusterResource{ - // Name: to.Ptr("cassandra-prod"), - // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters"), - // 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{ - // }, - // Properties: &armcosmos.ClusterResourceProperties{ - // AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra), - // CassandraVersion: to.Ptr("3.11"), - // ClientCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"), - // DelegatedManagementSubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"), - // ExternalGossipCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // ExternalSeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("10.52.221.2"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.3"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.4"), - // }}, - // GossipCertificates: []*armcosmos.Certificate{ - // { - // Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - // }}, - // HoursBetweenBackups: to.Ptr[int32](24), - // ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded), - // SeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("10.52.221.2"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.3"), - // }, - // { - // IPAddress: to.Ptr("10.52.221.4"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.2"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.3"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.4"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraCommand.json -func ExampleCassandraClustersClient_BeginInvokeCommand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraClustersClient().BeginInvokeCommand(ctx, "cassandra-prod-rg", "cassandra-prod", armcosmos.CommandPostBody{ - Arguments: map[string]any{ - "status": "", - }, - Command: to.Ptr("nodetool"), - Host: to.Ptr("10.0.1.12"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraCommandAsync.json -func ExampleCassandraClustersClient_BeginInvokeCommandAsync() { - 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.NewCassandraClustersClient().BeginInvokeCommandAsync(ctx, "cassandra-prod-rg", "cassandra-prod", armcosmos.CommandPostBody{ - Arguments: map[string]any{ - "status": "", - }, - Command: to.Ptr("nodetool"), - Host: to.Ptr("10.0.1.12"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.CommandPublicResource = armcosmos.CommandPublicResource{ - // Arguments: map[string]any{ - // "status": "", - // }, - // CassandraStopStart: to.Ptr(false), - // Command: to.Ptr("nodetool"), - // Host: to.Ptr("10.0.1.12"), - // IsAdmin: to.Ptr(false), - // OutputFile: to.Ptr("301fc7c1-397f-4e4a-89db-478f61f89d67"), - // ReadWrite: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraListCommand.json -func ExampleCassandraClustersClient_NewListCommandPager() { - 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().NewListCommandPager("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.ListCommands = armcosmos.ListCommands{ - // Value: []*armcosmos.CommandPublicResource{ - // { - // Arguments: map[string]any{ - // "status": "", - // }, - // CassandraStopStart: to.Ptr(false), - // Command: to.Ptr("nodetool"), - // CommandID: to.Ptr("1234"), - // Host: to.Ptr("10.0.1.12"), - // ReadWrite: to.Ptr(true), - // Status: to.Ptr(armcosmos.CommandStatus("Enqueued")), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraCommandResult.json -func ExampleCassandraClustersClient_GetCommandAsync() { - 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().GetCommandAsync(ctx, "cassandra-prod-rg", "cassandra-prod", "318653d0-3da5-4814-b8f6-429f2af0b2a4", 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.ListCommands = armcosmos.ListCommands{ - // Value: []*armcosmos.CommandPublicResource{ - // { - // Arguments: map[string]any{ - // "status": "", - // }, - // CassandraStopStart: to.Ptr(false), - // Command: to.Ptr("nodetool"), - // Host: to.Ptr("10.0.1.12"), - // IsAdmin: to.Ptr(false), - // OutputFile: to.Ptr("318653d0-3da5-4814-b8f6-429f2af0b2a4"), - // ReadWrite: to.Ptr(false), - // Result: to.Ptr("{\"exitCode\":0, \"CommandOutput\":\"RESULT\"}"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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{ - // { - // BackupExpiryTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T20:10:17.296Z"); return t}()), - // BackupID: to.Ptr("2517222701827037570"), - // BackupStartTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:10:17.296Z"); return t}()), - // BackupState: to.Ptr(armcosmos.BackupStateInitiated), - // }, - // { - // BackupExpiryTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T20:05:22.384Z"); return t}()), - // BackupID: to.Ptr("2517222704776158382"), - // BackupStartTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()), - // BackupState: to.Ptr(armcosmos.BackupStateInProgress), - // }, - // { - // BackupExpiryTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T20:05:22.384Z"); return t}()), - // BackupID: to.Ptr("2517222704776158383"), - // BackupStartTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()), - // BackupState: to.Ptr(armcosmos.BackupStateSucceeded), - // BackupStopTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()), - // }, - // { - // BackupExpiryTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T20:05:22.384Z"); return t}()), - // BackupID: to.Ptr("2517222704776158384"), - // BackupStartTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()), - // BackupState: to.Ptr(armcosmos.BackupStateFailed), - // BackupStopTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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{ - // BackupExpiryTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T20:05:22.384Z"); return t}()), - // BackupID: to.Ptr("2517222704776158383"), - // BackupStartTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()), - // BackupState: to.Ptr(armcosmos.BackupStateSucceeded), - // BackupStopTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json -func ExampleCassandraClustersClient_BeginDeallocate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraClustersClient().BeginDeallocate(ctx, "cassandra-prod-rg", "cassandra-prod", &armcosmos.CassandraClustersClientBeginDeallocateOptions{XMSForceDeallocate: 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterStart.json -func ExampleCassandraClustersClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraClustersClient().BeginStart(ctx, "cassandra-prod-rg", "cassandra-prod", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraStatus.json -func ExampleCassandraClustersClient_Status() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCassandraClustersClient().Status(ctx, "cassandra-prod-rg", "cassandra-prod", 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.CassandraClusterPublicStatus = armcosmos.CassandraClusterPublicStatus{ - // ConnectionErrors: []*armcosmos.ConnectionError{ - // }, - // DataCenters: []*armcosmos.CassandraClusterPublicStatusDataCentersItem{ - // { - // Name: to.Ptr("cassandra-westus2-vmss"), - // Nodes: []*armcosmos.ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems{ - // { - // Address: to.Ptr("10.0.8.10"), - // CassandraProcessStatus: to.Ptr("Running"), - // CPUUsage: to.Ptr[float64](0.9), - // DiskFreeKB: to.Ptr[int64](1001260056), - // DiskUsedKB: to.Ptr[int64](749836), - // HostID: to.Ptr("8ccc00a7-9e22-4ac2-aa63-e5327aa0dc51"), - // Load: to.Ptr("84.61 MiB"), - // MemoryBuffersAndCachedKB: to.Ptr[int64](10817580), - // MemoryFreeKB: to.Ptr[int64](35731832), - // MemoryTotalKB: to.Ptr[int64](57610444), - // MemoryUsedKB: to.Ptr[int64](11061032), - // Rack: to.Ptr("rack1"), - // Size: to.Ptr[int32](16), - // State: to.Ptr(armcosmos.NodeStateNormal), - // Status: to.Ptr("Up"), - // Timestamp: to.Ptr("10/05/2021, 14:35:20.028"), - // Tokens: []*string{ - // to.Ptr("-7785254003841681178"), - // to.Ptr("-6756518164561476165"), - // to.Ptr("-4269720020504480060"), - // to.Ptr("-2697657908817852783"), - // to.Ptr("-2622387897201218249"), - // to.Ptr("-2177258200443022948"), - // to.Ptr("-129203941752875603"), - // to.Ptr("1738406920822650025"), - // to.Ptr("2598053056312400240"), - // to.Ptr("3227346424117996872"), - // to.Ptr("3644347038875498376"), - // to.Ptr("4823546474906050895"), - // to.Ptr("5293156680707616627"), - // to.Ptr("5485806686603256557"), - // to.Ptr("6250058817756969464"), - // to.Ptr("7991328665766267709")}, - // }, - // { - // Address: to.Ptr("10.0.8.11"), - // CassandraProcessStatus: to.Ptr("Running"), - // CPUUsage: to.Ptr[float64](1.2), - // DiskFreeKB: to.Ptr[int64](1001283028), - // DiskUsedKB: to.Ptr[int64](726864), - // HostID: to.Ptr("14092117-4f77-4ec0-8984-c5b860b88a47"), - // Load: to.Ptr("59.67 MiB"), - // MemoryBuffersAndCachedKB: to.Ptr[int64](10691520), - // MemoryFreeKB: to.Ptr[int64](35863248), - // MemoryTotalKB: to.Ptr[int64](57610444), - // MemoryUsedKB: to.Ptr[int64](11055676), - // Rack: to.Ptr("rack2"), - // Size: to.Ptr[int32](16), - // State: to.Ptr(armcosmos.NodeStateNormal), - // Status: to.Ptr("Up"), - // Timestamp: to.Ptr("10/05/2021, 14:35:20.028"), - // Tokens: []*string{ - // to.Ptr("-8726238055665903210"), - // to.Ptr("-6687985003871487470"), - // to.Ptr("-5269140854976433359"), - // to.Ptr("-3989177686905645288"), - // to.Ptr("-3957362495277148220"), - // to.Ptr("-2539287458896988944"), - // to.Ptr("-2460716365393303466"), - // to.Ptr("-1848370030729221440"), - // to.Ptr("137707733677015122"), - // to.Ptr("579467328507000597"), - // to.Ptr("1698264534774619627"), - // to.Ptr("1904235159942090722"), - // to.Ptr("3312208865519999146"), - // to.Ptr("4035940456270983993"), - // to.Ptr("4412314431151736777"), - // to.Ptr("8232565668795426078")}, - // }, - // { - // Address: to.Ptr("10.0.8.12"), - // CassandraProcessStatus: to.Ptr("Running"), - // CPUUsage: to.Ptr[float64](0.4), - // DiskFreeKB: to.Ptr[int64](1001252352), - // DiskUsedKB: to.Ptr[int64](757540), - // HostID: to.Ptr("e16ada14-39db-462b-9f9e-5b5f6beb8bbd"), - // IsLatestModel: to.Ptr(true), - // Load: to.Ptr("93.2 MiB"), - // MemoryBuffersAndCachedKB: to.Ptr[int64](10453856), - // MemoryFreeKB: to.Ptr[int64](36104980), - // MemoryTotalKB: to.Ptr[int64](57610444), - // MemoryUsedKB: to.Ptr[int64](11051608), - // Rack: to.Ptr("rack3"), - // Size: to.Ptr[int32](16), - // State: to.Ptr(armcosmos.NodeStateNormal), - // Status: to.Ptr("Up"), - // Timestamp: to.Ptr("10/05/2021, 14:35:20.028"), - // Tokens: []*string{ - // to.Ptr("-5679481051867296621"), - // to.Ptr("-4574115287969297989"), - // to.Ptr("-3444578133211470522"), - // to.Ptr("-2755931580714972271"), - // to.Ptr("-2304431590844389550"), - // to.Ptr("-1961946736975068713"), - // to.Ptr("-940120277889446704"), - // to.Ptr("554469308917912318"), - // to.Ptr("1030447162050118004"), - // to.Ptr("2745632329542596589"), - // to.Ptr("4564547712926446283"), - // to.Ptr("5185613478135944116"), - // to.Ptr("7280237939830623824"), - // to.Ptr("7504213835759531710"), - // to.Ptr("7631994478195429959"), - // to.Ptr("8139769477321226157")}, - // }}, - // SeedNodes: []*string{ - // to.Ptr("10.0.8.10"), - // to.Ptr("10.0.8.11"), - // to.Ptr("10.0.8.12")}, - // }}, - // ETag: to.Ptr("A350A2CE7E91B6D5A102A5E5EC222B882D981092"), - // ReaperStatus: &armcosmos.ManagedCassandraReaperStatus{ - // Healthy: to.Ptr(true), - // RepairRunIDs: map[string]*string{ - // }, - // RepairSchedules: map[string]*string{ - // "00000000-0000-0001-0000-000000000000": to.Ptr("ACTIVE"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client.go b/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client.go index efc6648a25a4..fd452064b5a7 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 deleted file mode 100644 index 809ddb2e8cba..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client_example_test.go +++ /dev/null @@ -1,237 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraDataCenterList.json -func ExampleCassandraDataCentersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCassandraDataCentersClient().NewListPager("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.ListDataCenters = armcosmos.ListDataCenters{ - // Value: []*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"), - // Properties: &armcosmos.DataCenterResourceProperties{ - // Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="), - // DataCenterLocation: to.Ptr("West US 2"), - // DelegatedSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1"), - // NodeCount: to.Ptr[int32](9), - // ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded), - // SeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("192.168.12.2"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.3"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.4"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json -func ExampleCassandraDataCentersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCassandraDataCentersClient().Get(ctx, "cassandra-prod-rg", "cassandra-prod", "dc1", 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.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"), - // Properties: &armcosmos.DataCenterResourceProperties{ - // Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="), - // DataCenterLocation: to.Ptr("West US 2"), - // DelegatedSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1"), - // NodeCount: to.Ptr[int32](9), - // ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded), - // SeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("192.168.12.2"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.3"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.4"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json -func ExampleCassandraDataCentersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraDataCentersClient().BeginDelete(ctx, "cassandra-prod-rg", "cassandra-prod", "dc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json -func ExampleCassandraDataCentersClient_BeginCreateUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraDataCentersClient().BeginCreateUpdate(ctx, "cassandra-prod-rg", "cassandra-prod", "dc1", armcosmos.DataCenterResource{ - Properties: &armcosmos.DataCenterResourceProperties{ - Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="), - DataCenterLocation: to.Ptr("West US 2"), - DelegatedSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1-subnet"), - NodeCount: to.Ptr[int32](9), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.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"), - // 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"), - // NodeCount: to.Ptr[int32](9), - // ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded), - // SeedNodes: []*armcosmos.SeedNode{ - // { - // IPAddress: to.Ptr("192.168.12.2"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.3"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.4"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json -func ExampleCassandraDataCentersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraDataCentersClient().BeginUpdate(ctx, "cassandra-prod-rg", "cassandra-prod", "dc1", armcosmos.DataCenterResource{ - Properties: &armcosmos.DataCenterResourceProperties{ - Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="), - DataCenterLocation: to.Ptr("West US 2"), - DelegatedSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1-subnet"), - NodeCount: to.Ptr[int32](9), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.DataCenterResource = armcosmos.DataCenterResource{ - // Name: to.Ptr("dc1"), - // Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters/dataCenters"), - // 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"), - // DelegatedSubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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{ - // { - // IPAddress: to.Ptr("192.168.12.2"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.3"), - // }, - // { - // IPAddress: to.Ptr("192.168.12.4"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client.go index 3c31a020fd76..2596f4bf297e 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateCassandraTableParameters); err != nil { @@ -221,7 +221,7 @@ func (client *CassandraResourcesClient) createUpdateCassandraTableCreateRequest( // BeginCreateUpdateCassandraView - Create or update an Azure Cosmos DB Cassandra View // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -249,7 +249,7 @@ func (client *CassandraResourcesClient) BeginCreateUpdateCassandraView(ctx conte // CreateUpdateCassandraView - Create or update an Azure Cosmos DB Cassandra View // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *CassandraResourcesClient) createUpdateCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters CassandraViewCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginCreateUpdateCassandraView" @@ -299,7 +299,7 @@ func (client *CassandraResourcesClient) createUpdateCassandraViewCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateCassandraViewParameters); err != nil { @@ -311,7 +311,7 @@ func (client *CassandraResourcesClient) createUpdateCassandraViewCreateRequest(c // BeginDeleteCassandraKeyspace - Deletes an existing Azure Cosmos DB Cassandra keyspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -337,7 +337,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +383,7 @@ func (client *CassandraResourcesClient) deleteCassandraKeyspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -391,7 +391,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -418,7 +418,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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,7 +468,7 @@ func (client *CassandraResourcesClient) deleteCassandraTableCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -476,7 +476,7 @@ func (client *CassandraResourcesClient) deleteCassandraTableCreateRequest(ctx co // BeginDeleteCassandraView - Deletes an existing Azure Cosmos DB Cassandra view. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -503,7 +503,7 @@ func (client *CassandraResourcesClient) BeginDeleteCassandraView(ctx context.Con // DeleteCassandraView - Deletes an existing Azure Cosmos DB Cassandra view. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -553,7 +553,7 @@ func (client *CassandraResourcesClient) deleteCassandraViewCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -562,7 +562,7 @@ func (client *CassandraResourcesClient) deleteCassandraViewCreateRequest(ctx con // name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -614,7 +614,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -633,7 +633,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -685,7 +685,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -703,7 +703,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -760,7 +760,7 @@ func (client *CassandraResourcesClient) getCassandraTableCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -779,7 +779,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -836,7 +836,7 @@ func (client *CassandraResourcesClient) getCassandraTableThroughputCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -854,7 +854,7 @@ func (client *CassandraResourcesClient) getCassandraTableThroughputHandleRespons // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -911,7 +911,7 @@ func (client *CassandraResourcesClient) getCassandraViewCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -930,7 +930,7 @@ func (client *CassandraResourcesClient) getCassandraViewHandleResponse(resp *htt // with the provided name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -987,7 +987,7 @@ func (client *CassandraResourcesClient) getCassandraViewThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1004,7 +1004,7 @@ func (client *CassandraResourcesClient) getCassandraViewThroughputHandleResponse // NewListCassandraKeyspacesPager - Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 +1053,7 @@ func (client *CassandraResourcesClient) listCassandraKeyspacesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1070,7 +1070,7 @@ func (client *CassandraResourcesClient) listCassandraKeyspacesHandleResponse(res // NewListCassandraTablesPager - Lists the Cassandra table under an existing Azure Cosmos DB database account. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1124,7 +1124,7 @@ func (client *CassandraResourcesClient) listCassandraTablesCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1141,7 +1141,7 @@ func (client *CassandraResourcesClient) listCassandraTablesHandleResponse(resp * // NewListCassandraViewsPager - Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1195,7 +1195,7 @@ func (client *CassandraResourcesClient) listCassandraViewsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1213,7 +1213,7 @@ func (client *CassandraResourcesClient) listCassandraViewsHandleResponse(resp *h // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1239,7 +1239,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +1285,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToAutoscaleCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1295,7 +1295,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToAutoscaleCreat // throughput // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1321,7 +1321,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +1367,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToManualThroughp return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1376,7 +1376,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1403,7 +1403,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +1453,7 @@ func (client *CassandraResourcesClient) migrateCassandraTableToAutoscaleCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1462,7 +1462,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1489,7 +1489,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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,7 +1539,7 @@ func (client *CassandraResourcesClient) migrateCassandraTableToManualThroughputC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1548,7 +1548,7 @@ func (client *CassandraResourcesClient) migrateCassandraTableToManualThroughputC // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1575,7 +1575,7 @@ func (client *CassandraResourcesClient) BeginMigrateCassandraViewToAutoscale(ctx // 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 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -1625,7 +1625,7 @@ func (client *CassandraResourcesClient) migrateCassandraViewToAutoscaleCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1634,7 +1634,7 @@ func (client *CassandraResourcesClient) migrateCassandraViewToAutoscaleCreateReq // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1661,7 +1661,7 @@ func (client *CassandraResourcesClient) BeginMigrateCassandraViewToManualThrough // 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 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -1711,7 +1711,7 @@ func (client *CassandraResourcesClient) migrateCassandraViewToManualThroughputCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1720,7 +1720,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1747,7 +1747,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +1793,7 @@ func (client *CassandraResourcesClient) updateCassandraKeyspaceThroughputCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { @@ -1805,7 +1805,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1833,7 +1833,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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,7 +1883,7 @@ func (client *CassandraResourcesClient) updateCassandraTableThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { @@ -1895,7 +1895,7 @@ func (client *CassandraResourcesClient) updateCassandraTableThroughputCreateRequ // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - keyspaceName - Cosmos DB keyspace name. @@ -1923,7 +1923,7 @@ func (client *CassandraResourcesClient) BeginUpdateCassandraViewThroughput(ctx c // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *CassandraResourcesClient) updateCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (*http.Response, error) { var err error const operationName = "CassandraResourcesClient.BeginUpdateCassandraViewThroughput" @@ -1973,7 +1973,7 @@ func (client *CassandraResourcesClient) updateCassandraViewThroughputCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 deleted file mode 100644 index dd8e90d5ce2f..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client_example_test.go +++ /dev/null @@ -1,993 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceList.json -func ExampleCassandraResourcesClient_NewListCassandraKeyspacesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCassandraResourcesClient().NewListCassandraKeyspacesPager("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.CassandraKeyspaceListResult = armcosmos.CassandraKeyspaceListResult{ - // Value: []*armcosmos.CassandraKeyspaceGetResults{ - // { - // Name: to.Ptr("keyspaceName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.CassandraKeyspaceGetProperties{ - // Resource: &armcosmos.CassandraKeyspaceGetPropertiesResource{ - // ID: to.Ptr("keyspaceName"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceGet.json -func ExampleCassandraResourcesClient_GetCassandraKeyspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCassandraResourcesClient().GetCassandraKeyspace(ctx, "rg1", "ddb1", "keyspaceName", 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.CassandraKeyspaceGetResults = armcosmos.CassandraKeyspaceGetResults{ - // Name: to.Ptr("keyspaceName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.CassandraKeyspaceGetProperties{ - // Resource: &armcosmos.CassandraKeyspaceGetPropertiesResource{ - // ID: to.Ptr("keyspaceName"), - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json -func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraKeyspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().BeginCreateUpdateCassandraKeyspace(ctx, "rg1", "ddb1", "keyspaceName", armcosmos.CassandraKeyspaceCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.CassandraKeyspaceCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.CassandraKeyspaceResource{ - ID: to.Ptr("keyspaceName"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.CassandraKeyspaceGetResults = armcosmos.CassandraKeyspaceGetResults{ - // Name: to.Ptr("keyspaceName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.CassandraKeyspaceGetProperties{ - // Resource: &armcosmos.CassandraKeyspaceGetPropertiesResource{ - // ID: to.Ptr("keyspaceName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceDelete.json -func ExampleCassandraResourcesClient_BeginDeleteCassandraKeyspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().BeginDeleteCassandraKeyspace(ctx, "rg1", "ddb1", "keyspaceName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json -func ExampleCassandraResourcesClient_GetCassandraKeyspaceThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCassandraResourcesClient().GetCassandraKeyspaceThroughput(ctx, "rg1", "ddb1", "keyspaceName", 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/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json -func ExampleCassandraResourcesClient_BeginUpdateCassandraKeyspaceThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().BeginUpdateCassandraKeyspaceThroughput(ctx, "rg1", "ddb1", "keyspaceName", armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json -func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().BeginMigrateCassandraKeyspaceToAutoscale(ctx, "rg1", "ddb1", "keyspaceName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json -func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().BeginMigrateCassandraKeyspaceToManualThroughput(ctx, "rg1", "ddb1", "keyspaceName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // MinimumThroughput: to.Ptr("400"), - // OfferReplacePending: to.Ptr("false"), - // Throughput: to.Ptr[int32](400), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableList.json -func ExampleCassandraResourcesClient_NewListCassandraTablesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCassandraResourcesClient().NewListCassandraTablesPager("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.CassandraTableListResult = armcosmos.CassandraTableListResult{ - // Value: []*armcosmos.CassandraTableGetResults{ - // { - // Name: to.Ptr("tableName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/cassandraTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/cassandraTables/tableName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.CassandraTableGetProperties{ - // Resource: &armcosmos.CassandraTableGetPropertiesResource{ - // Schema: &armcosmos.CassandraSchema{ - // ClusterKeys: []*armcosmos.ClusterKey{ - // { - // Name: to.Ptr("columnA"), - // OrderBy: to.Ptr("Asc"), - // }}, - // Columns: []*armcosmos.Column{ - // { - // Name: to.Ptr("columnA"), - // Type: to.Ptr("Ascii"), - // }}, - // PartitionKeys: []*armcosmos.CassandraPartitionKey{ - // { - // Name: to.Ptr("columnA"), - // }}, - // }, - // AnalyticalStorageTTL: to.Ptr[int32](500), - // DefaultTTL: to.Ptr[int32](100), - // ID: to.Ptr("tableName"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableGet.json -func ExampleCassandraResourcesClient_GetCassandraTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCassandraResourcesClient().GetCassandraTable(ctx, "rg1", "ddb1", "keyspaceName", "tableName", 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.CassandraTableGetResults = armcosmos.CassandraTableGetResults{ - // Name: to.Ptr("tableName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/cassandraTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/cassandraTables/tableName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.CassandraTableGetProperties{ - // Resource: &armcosmos.CassandraTableGetPropertiesResource{ - // Schema: &armcosmos.CassandraSchema{ - // ClusterKeys: []*armcosmos.ClusterKey{ - // { - // Name: to.Ptr("columnA"), - // OrderBy: to.Ptr("Asc"), - // }}, - // Columns: []*armcosmos.Column{ - // { - // Name: to.Ptr("columnA"), - // Type: to.Ptr("Ascii"), - // }}, - // PartitionKeys: []*armcosmos.CassandraPartitionKey{ - // { - // Name: to.Ptr("columnA"), - // }}, - // }, - // AnalyticalStorageTTL: to.Ptr[int32](500), - // DefaultTTL: to.Ptr[int32](100), - // ID: to.Ptr("tableName"), - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableCreateUpdate.json -func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().BeginCreateUpdateCassandraTable(ctx, "rg1", "ddb1", "keyspaceName", "tableName", armcosmos.CassandraTableCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.CassandraTableCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.CassandraTableResource{ - Schema: &armcosmos.CassandraSchema{ - ClusterKeys: []*armcosmos.ClusterKey{ - { - Name: to.Ptr("columnA"), - OrderBy: to.Ptr("Asc"), - }}, - Columns: []*armcosmos.Column{ - { - Name: to.Ptr("columnA"), - Type: to.Ptr("Ascii"), - }}, - PartitionKeys: []*armcosmos.CassandraPartitionKey{ - { - Name: to.Ptr("columnA"), - }}, - }, - AnalyticalStorageTTL: to.Ptr[int32](500), - DefaultTTL: to.Ptr[int32](100), - ID: to.Ptr("tableName"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.CassandraTableGetResults = armcosmos.CassandraTableGetResults{ - // Name: to.Ptr("tableName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/cassandraTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/cassandraTables/tableName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.CassandraTableGetProperties{ - // Resource: &armcosmos.CassandraTableGetPropertiesResource{ - // Schema: &armcosmos.CassandraSchema{ - // ClusterKeys: []*armcosmos.ClusterKey{ - // { - // Name: to.Ptr("columnA"), - // OrderBy: to.Ptr("Asc"), - // }}, - // Columns: []*armcosmos.Column{ - // { - // Name: to.Ptr("columnA"), - // Type: to.Ptr("Ascii"), - // }}, - // PartitionKeys: []*armcosmos.CassandraPartitionKey{ - // { - // Name: to.Ptr("columnA"), - // }}, - // }, - // AnalyticalStorageTTL: to.Ptr[int32](500), - // DefaultTTL: to.Ptr[int32](100), - // ID: to.Ptr("tableName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableDelete.json -func ExampleCassandraResourcesClient_BeginDeleteCassandraTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().BeginDeleteCassandraTable(ctx, "rg1", "ddb1", "keyspaceName", "tableName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableThroughputGet.json -func ExampleCassandraResourcesClient_GetCassandraTableThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCassandraResourcesClient().GetCassandraTableThroughput(ctx, "rg1", "ddb1", "keyspaceName", "tableName", 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/cassandraTables/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/cassandraTables/tableName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableThroughputUpdate.json -func ExampleCassandraResourcesClient_BeginUpdateCassandraTableThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().BeginUpdateCassandraTableThroughput(ctx, "rg1", "ddb1", "keyspaceName", "tableName", armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/cassandraTables/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/cassandraTables/tableName/throughputSettings/default"), - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json -func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().BeginMigrateCassandraTableToAutoscale(ctx, "rg1", "ddb1", "keyspaceName", "tableName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json -func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCassandraResourcesClient().BeginMigrateCassandraTableToManualThroughput(ctx, "rg1", "ddb1", "keyspaceName", "tableName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // MinimumThroughput: to.Ptr("400"), - // OfferReplacePending: to.Ptr("false"), - // Throughput: to.Ptr[int32](400), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/collection_client.go b/sdk/resourcemanager/cosmos/armcosmos/collection_client.go index e7a007d6730f..3125c9e980b7 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 *CollectionClient) listMetricsCreateRequest(ctx context.Context, re } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -263,7 +263,7 @@ func (client *CollectionClient) listUsagesCreateRequest(ctx context.Context, res if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/collection_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/collection_client_example_test.go deleted file mode 100644 index 1d8e2ebedbaf..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/collection_client_example_test.go +++ /dev/null @@ -1,170 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionGetMetrics.json -func ExampleCollectionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCollectionClient().NewListMetricsPager("rg1", "ddb1", "databaseRid", "collectionRid", "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", nil) - for pager.More() { - 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.MetricListResult = armcosmos.MetricListResult{ - // Value: []*armcosmos.Metric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Total Requests"), - // Value: to.Ptr("Total Requests"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()), - // MetricValues: []*armcosmos.MetricValue{ - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:03:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:08:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT5M"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionGetUsages.json -func ExampleCollectionClient_NewListUsagesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCollectionClient().NewListUsagesPager("rg1", "ddb1", "databaseRid", "collectionRid", &armcosmos.CollectionClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Storage'")}) - 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.UsagesResult = armcosmos.UsagesResult{ - // Value: []*armcosmos.Usage{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Storage"), - // Value: to.Ptr("Storage"), - // }, - // CurrentValue: to.Ptr[int64](0), - // Limit: to.Ptr[int64](10737418240), - // QuotaPeriod: to.Ptr("P1D"), - // Unit: to.Ptr(armcosmos.UnitTypeBytes), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionGetMetricDefinitions.json -func ExampleCollectionClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCollectionClient().NewListMetricDefinitionsPager("rg1", "ddb1", "databaseRid", "collectionRid", 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.MetricDefinitionsListResult = armcosmos.MetricDefinitionsListResult{ - // Value: []*armcosmos.MetricDefinition{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Total Requests"), - // Value: to.Ptr("Total Requests"), - // }, - // MetricAvailabilities: []*armcosmos.MetricAvailability{ - // { - // Retention: to.Ptr("P2D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P60D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armcosmos.PrimaryAggregationTypeTotal), - // ResourceURI: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client.go b/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client.go index 13aeab1b1d2a..d44c4cf162fe 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -108,7 +108,7 @@ func (client *CollectionPartitionClient) listMetricsCreateRequest(ctx context.Co } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -187,7 +187,7 @@ func (client *CollectionPartitionClient) listUsagesCreateRequest(ctx context.Con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client_example_test.go deleted file mode 100644 index 695d5845eea9..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client_example_test.go +++ /dev/null @@ -1,124 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionPartitionGetMetrics.json -func ExampleCollectionPartitionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCollectionPartitionClient().NewListMetricsPager("rg1", "ddb1", "databaseRid", "collectionRid", "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", nil) - for pager.More() { - 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.PartitionMetricListResult = armcosmos.PartitionMetricListResult{ - // Value: []*armcosmos.PartitionMetric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Max RUs Per Second"), - // Value: to.Ptr("Max RUs Per Second"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T23:58:55.278Z"); return t}()), - // MetricValues: []*armcosmos.MetricValue{ - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:54:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:55:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:56:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:57:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT1M"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // PartitionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PartitionKeyRangeID: to.Ptr("0"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionPartitionGetUsages.json -func ExampleCollectionPartitionClient_NewListUsagesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCollectionPartitionClient().NewListUsagesPager("rg1", "ddb1", "databaseRid", "collectionRid", &armcosmos.CollectionPartitionClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Partition Storage'")}) - 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.PartitionUsagesResult = armcosmos.PartitionUsagesResult{ - // Value: []*armcosmos.PartitionUsage{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Storage"), - // Value: to.Ptr("Storage"), - // }, - // CurrentValue: to.Ptr[int64](0), - // Limit: to.Ptr[int64](10737418240), - // QuotaPeriod: to.Ptr("P1D"), - // Unit: to.Ptr(armcosmos.UnitTypeBytes), - // PartitionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PartitionKeyRangeID: to.Ptr("0"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client.go index 636fc6d44e79..aae79d0eb4b9 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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. @@ -114,7 +114,7 @@ func (client *CollectionPartitionRegionClient) listMetricsCreateRequest(ctx cont } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client_example_test.go deleted file mode 100644 index 3e797e9cd828..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client_example_test.go +++ /dev/null @@ -1,83 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json -func ExampleCollectionPartitionRegionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCollectionPartitionRegionClient().NewListMetricsPager("rg1", "ddb1", "North Europe", "databaseRid", "collectionRid", "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", nil) - for pager.More() { - 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.PartitionMetricListResult = armcosmos.PartitionMetricListResult{ - // Value: []*armcosmos.PartitionMetric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Max RUs Per Second"), - // Value: to.Ptr("Max RUs Per Second"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T23:58:55.278Z"); return t}()), - // MetricValues: []*armcosmos.MetricValue{ - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:54:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:55:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:56:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:57:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT1M"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // PartitionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PartitionKeyRangeID: to.Ptr("0"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client.go index 2705c5d09bf8..3ca10e71d497 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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. @@ -114,7 +114,7 @@ func (client *CollectionRegionClient) listMetricsCreateRequest(ctx context.Conte } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client_example_test.go deleted file mode 100644 index f6a62a6df40b..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client_example_test.go +++ /dev/null @@ -1,81 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRegionCollectionGetMetrics.json -func ExampleCollectionRegionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCollectionRegionClient().NewListMetricsPager("rg1", "ddb1", "North Europe", "databaseRid", "collectionRid", "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", nil) - for pager.More() { - 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.MetricListResult = armcosmos.MetricListResult{ - // Value: []*armcosmos.Metric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Total Requests"), - // Value: to.Ptr("Total Requests"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()), - // MetricValues: []*armcosmos.MetricValue{ - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:03:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:08:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT5M"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/constants.go b/sdk/resourcemanager/cosmos/armcosmos/constants.go index 6694dfcebe47..6e301f9ab1d9 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.4" + moduleVersion = "v3.0.0-beta.5" ) // APIType - Enum to indicate the API type of the restorable database account. @@ -181,6 +181,46 @@ func PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy { } } +// CapacityMode - Indicates the capacity mode of the account. +type CapacityMode string + +const ( + CapacityModeNone CapacityMode = "None" + CapacityModeProvisioned CapacityMode = "Provisioned" + CapacityModeServerless CapacityMode = "Serverless" +) + +// PossibleCapacityModeValues returns the possible values for the CapacityMode const type. +func PossibleCapacityModeValues() []CapacityMode { + return []CapacityMode{ + CapacityModeNone, + CapacityModeProvisioned, + CapacityModeServerless, + } +} + +// CapacityModeTransitionStatus - The transition status of capacity mode. +type CapacityModeTransitionStatus string + +const ( + CapacityModeTransitionStatusCompleted CapacityModeTransitionStatus = "Completed" + CapacityModeTransitionStatusFailed CapacityModeTransitionStatus = "Failed" + CapacityModeTransitionStatusInProgress CapacityModeTransitionStatus = "InProgress" + CapacityModeTransitionStatusInitialized CapacityModeTransitionStatus = "Initialized" + CapacityModeTransitionStatusInvalid CapacityModeTransitionStatus = "Invalid" +) + +// PossibleCapacityModeTransitionStatusValues returns the possible values for the CapacityModeTransitionStatus const type. +func PossibleCapacityModeTransitionStatusValues() []CapacityModeTransitionStatus { + return []CapacityModeTransitionStatus{ + CapacityModeTransitionStatusCompleted, + CapacityModeTransitionStatusFailed, + CapacityModeTransitionStatusInProgress, + CapacityModeTransitionStatusInitialized, + CapacityModeTransitionStatusInvalid, + } +} + // CheckNameAvailabilityReason - The reason why the given name is not available. type CheckNameAvailabilityReason string @@ -933,8 +973,10 @@ func PossibleScheduledEventStrategyValues() []ScheduledEventStrategy { type ServerVersion string const ( + ServerVersionFive0 ServerVersion = "5.0" ServerVersionFour0 ServerVersion = "4.0" ServerVersionFour2 ServerVersion = "4.2" + ServerVersionSix0 ServerVersion = "6.0" ServerVersionThree2 ServerVersion = "3.2" ServerVersionThree6 ServerVersion = "3.6" ) @@ -942,8 +984,10 @@ const ( // PossibleServerVersionValues returns the possible values for the ServerVersion const type. func PossibleServerVersionValues() []ServerVersion { return []ServerVersion{ + ServerVersionFive0, ServerVersionFour0, ServerVersionFour2, + ServerVersionSix0, ServerVersionThree2, ServerVersionThree6, } diff --git a/sdk/resourcemanager/cosmos/armcosmos/database_client.go b/sdk/resourcemanager/cosmos/armcosmos/database_client.go index 5b5dbe76c567..1e256f93bc15 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -174,7 +174,7 @@ func (client *DatabaseClient) listMetricsCreateRequest(ctx context.Context, reso } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -247,7 +247,7 @@ func (client *DatabaseClient) listUsagesCreateRequest(ctx context.Context, resou if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/database_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/database_client_example_test.go deleted file mode 100644 index 305c52812319..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/database_client_example_test.go +++ /dev/null @@ -1,170 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseGetMetrics.json -func ExampleDatabaseClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseClient().NewListMetricsPager("rg1", "ddb1", "rid", "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", nil) - for pager.More() { - 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.MetricListResult = armcosmos.MetricListResult{ - // Value: []*armcosmos.Metric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Total Requests"), - // Value: to.Ptr("Total Requests"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()), - // MetricValues: []*armcosmos.MetricValue{ - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:03:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:08:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT5M"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseGetUsages.json -func ExampleDatabaseClient_NewListUsagesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseClient().NewListUsagesPager("rg1", "ddb1", "databaseRid", &armcosmos.DatabaseClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Storage'")}) - 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.UsagesResult = armcosmos.UsagesResult{ - // Value: []*armcosmos.Usage{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Storage"), - // Value: to.Ptr("Storage"), - // }, - // CurrentValue: to.Ptr[int64](0), - // Limit: to.Ptr[int64](10737418240), - // QuotaPeriod: to.Ptr("P1D"), - // Unit: to.Ptr(armcosmos.UnitTypeBytes), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json -func ExampleDatabaseClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseClient().NewListMetricDefinitionsPager("rg1", "ddb1", "databaseRid", 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.MetricDefinitionsListResult = armcosmos.MetricDefinitionsListResult{ - // Value: []*armcosmos.MetricDefinition{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Total Requests"), - // Value: to.Ptr("Total Requests"), - // }, - // MetricAvailabilities: []*armcosmos.MetricAvailability{ - // { - // Retention: to.Ptr("P2D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P60D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armcosmos.PrimaryAggregationTypeTotal), - // ResourceURI: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client.go index 7e5319848e15..ca8d54ea4ae4 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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. @@ -103,7 +103,7 @@ func (client *DatabaseAccountRegionClient) listMetricsCreateRequest(ctx context. } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client_example_test.go deleted file mode 100644 index 6e8beecd99df..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client_example_test.go +++ /dev/null @@ -1,81 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json -func ExampleDatabaseAccountRegionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseAccountRegionClient().NewListMetricsPager("rg1", "ddb1", "North Europe", "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", nil) - for pager.More() { - 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.MetricListResult = armcosmos.MetricListResult{ - // Value: []*armcosmos.Metric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Total Requests"), - // Value: to.Ptr("Total Requests"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()), - // MetricValues: []*armcosmos.MetricValue{ - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:03:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:08:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT5M"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client.go b/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client.go index 4d2df3d612f1..e6d934acdb2f 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 @@ -825,7 +825,7 @@ func (client *DatabaseAccountsClient) listMetricsCreateRequest(ctx context.Conte } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 @@ -959,7 +959,7 @@ func (client *DatabaseAccountsClient) listUsagesCreateRequest(ctx context.Contex if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 deleted file mode 100644 index 06d73a49f701..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client_example_test.go +++ /dev/null @@ -1,1603 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountGet.json -func ExampleDatabaseAccountsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAccountsClient().Get(ctx, "rg1", "ddb1", 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.DatabaseAccountGetResults = armcosmos.DatabaseAccountGetResults{ - // Name: to.Ptr("ddb1"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), - // Identity: &armcosmos.ManagedServiceIdentity{ - // Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"), - // TenantID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"), - // 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("33e01921-4d64-4f8c-a055-5bdaffd5e33d"), - // }, - // }, - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB), - // Properties: &armcosmos.DatabaseAccountGetProperties{ - // AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ - // SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined), - // }, - // APIProperties: &armcosmos.APIProperties{ - // }, - // BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{ - // Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic), - // MigrationState: &armcosmos.BackupPolicyMigrationState{ - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T21:07:16.000Z"); return t}()), - // Status: to.Ptr(armcosmos.BackupPolicyMigrationStatusInProgress), - // TargetType: to.Ptr(armcosmos.BackupPolicyTypeContinuous), - // }, - // PeriodicModeProperties: &armcosmos.PeriodicModeProperties{ - // BackupIntervalInMinutes: to.Ptr[int32](240), - // BackupRetentionIntervalInHours: to.Ptr[int32](8), - // BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo), - // }, - // }, - // ConsistencyPolicy: &armcosmos.ConsistencyPolicy{ - // DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelSession), - // MaxIntervalInSeconds: to.Ptr[int32](5), - // MaxStalenessPrefix: to.Ptr[int64](100), - // }, - // Cors: []*armcosmos.CorsPolicy{ - // }, - // CreateMode: to.Ptr(armcosmos.CreateModeDefault), - // DatabaseAccountOfferType: to.Ptr("Standard"), - // DefaultIdentity: to.Ptr("FirstPartyIdentity"), - // DefaultPriorityLevel: to.Ptr(armcosmos.DefaultPriorityLevelLow), - // 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), - // EnablePerRegionPerPartitionAutoscale: to.Ptr(true), - // EnablePriorityBasedExecution: 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{ - // }, - // IsVirtualNetworkFilterEnabled: to.Ptr(false), - // 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}()), - // }, - // PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.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}()), - // }, - // SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), - // }, - // }, - // Locations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS), - // NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassNone), - // NetworkACLBypassResourceIDs: []*string{ - // }, - // PrivateEndpointConnections: []*armcosmos.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.DocumentDB/databaseAccounts/account1/privateEndpointConnections/pe1"), - // Properties: &armcosmos.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcosmos.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/privateEndpoints/pe1"), - // }, - // PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // ReadLocations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{ - // }, - // WriteLocations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountPatch.json -func ExampleDatabaseAccountsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabaseAccountsClient().BeginUpdate(ctx, "rg1", "ddb1", armcosmos.DatabaseAccountUpdateParameters{ - Identity: &armcosmos.ManagedServiceIdentity{ - Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - Location: to.Ptr("westus"), - Properties: &armcosmos.DatabaseAccountUpdateProperties{ - AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ - SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined), - }, - BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{ - Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic), - PeriodicModeProperties: &armcosmos.PeriodicModeProperties{ - BackupIntervalInMinutes: to.Ptr[int32](240), - BackupRetentionIntervalInHours: to.Ptr[int32](720), - BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo), - }, - }, - Capacity: &armcosmos.Capacity{ - TotalThroughputLimit: to.Ptr[int32](2000), - }, - ConsistencyPolicy: &armcosmos.ConsistencyPolicy{ - DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness), - MaxIntervalInSeconds: to.Ptr[int32](10), - MaxStalenessPrefix: to.Ptr[int64](200), - }, - DefaultIdentity: to.Ptr("FirstPartyIdentity"), - DefaultPriorityLevel: to.Ptr(armcosmos.DefaultPriorityLevelLow), - DiagnosticLogSettings: &armcosmos.DiagnosticLogSettings{ - EnableFullTextQuery: to.Ptr(armcosmos.EnableFullTextQueryTrue), - }, - EnableAnalyticalStorage: to.Ptr(true), - EnableBurstCapacity: to.Ptr(true), - EnableFreeTier: to.Ptr(false), - EnablePartitionMerge: to.Ptr(true), - EnablePerRegionPerPartitionAutoscale: to.Ptr(true), - EnablePriorityBasedExecution: to.Ptr(true), - IPRules: []*armcosmos.IPAddressOrRange{ - { - IPAddressOrRange: to.Ptr("23.43.230.120"), - }, - { - IPAddressOrRange: to.Ptr("110.12.240.0/12"), - }}, - IsVirtualNetworkFilterEnabled: to.Ptr(true), - MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS), - NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassAzureServices), - NetworkACLBypassResourceIDs: []*string{ - to.Ptr("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")}, - VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{ - { - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - IgnoreMissingVNetServiceEndpoint: to.Ptr(false), - }}, - }, - Tags: map[string]*string{ - "dept": to.Ptr("finance"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.DatabaseAccountGetResults = armcosmos.DatabaseAccountGetResults{ - // Name: to.Ptr("ddb1"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), - // Identity: &armcosmos.ManagedServiceIdentity{ - // Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"), - // TenantID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"), - // 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"), - // }, - // }, - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "dept": to.Ptr("finance"), - // }, - // Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB), - // Properties: &armcosmos.DatabaseAccountGetProperties{ - // AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ - // SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined), - // }, - // APIProperties: &armcosmos.APIProperties{ - // }, - // BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{ - // Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic), - // PeriodicModeProperties: &armcosmos.PeriodicModeProperties{ - // BackupIntervalInMinutes: to.Ptr[int32](240), - // BackupRetentionIntervalInHours: to.Ptr[int32](720), - // BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo), - // }, - // }, - // Capacity: &armcosmos.Capacity{ - // TotalThroughputLimit: to.Ptr[int32](2000), - // }, - // ConsistencyPolicy: &armcosmos.ConsistencyPolicy{ - // DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness), - // MaxIntervalInSeconds: to.Ptr[int32](10), - // MaxStalenessPrefix: to.Ptr[int64](200), - // }, - // Cors: []*armcosmos.CorsPolicy{ - // }, - // CreateMode: to.Ptr(armcosmos.CreateModeDefault), - // DatabaseAccountOfferType: to.Ptr("Standard"), - // DefaultIdentity: to.Ptr("FirstPartyIdentity"), - // DefaultPriorityLevel: to.Ptr(armcosmos.DefaultPriorityLevelLow), - // 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), - // EnablePerRegionPerPartitionAutoscale: to.Ptr(true), - // EnablePriorityBasedExecution: 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"), - // }, - // { - // IPAddressOrRange: to.Ptr("110.12.240.0/12"), - // }}, - // IsVirtualNetworkFilterEnabled: to.Ptr(true), - // 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}()), - // }, - // PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.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}()), - // }, - // SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), - // }, - // }, - // Locations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS), - // NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassAzureServices), - // NetworkACLBypassResourceIDs: []*string{ - // to.Ptr("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")}, - // PrivateEndpointConnections: []*armcosmos.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.DocumentDB/databaseAccounts/account1/privateEndpointConnections/pe1"), - // Properties: &armcosmos.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcosmos.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/privateEndpoints/pe1"), - // }, - // PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // ReadLocations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // IgnoreMissingVNetServiceEndpoint: to.Ptr(false), - // }}, - // WriteLocations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountCreateMax.json -func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCreateMax() { - 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.NewDatabaseAccountsClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", armcosmos.DatabaseAccountCreateUpdateParameters{ - Identity: &armcosmos.ManagedServiceIdentity{ - Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - Location: to.Ptr("westus"), - Tags: map[string]*string{}, - Kind: to.Ptr(armcosmos.DatabaseAccountKindMongoDB), - Properties: &armcosmos.DatabaseAccountCreateUpdateProperties{ - AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ - SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined), - }, - APIProperties: &armcosmos.APIProperties{ - ServerVersion: to.Ptr(armcosmos.ServerVersionThree2), - }, - BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{ - Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic), - PeriodicModeProperties: &armcosmos.PeriodicModeProperties{ - BackupIntervalInMinutes: to.Ptr[int32](240), - BackupRetentionIntervalInHours: to.Ptr[int32](8), - BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo), - }, - }, - Capacity: &armcosmos.Capacity{ - TotalThroughputLimit: to.Ptr[int32](2000), - }, - ConsistencyPolicy: &armcosmos.ConsistencyPolicy{ - DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness), - MaxIntervalInSeconds: to.Ptr[int32](10), - MaxStalenessPrefix: to.Ptr[int64](200), - }, - Cors: []*armcosmos.CorsPolicy{ - { - AllowedOrigins: to.Ptr("https://test"), - }}, - CreateMode: to.Ptr(armcosmos.CreateModeDefault), - DatabaseAccountOfferType: to.Ptr("Standard"), - DefaultIdentity: to.Ptr("FirstPartyIdentity"), - DefaultPriorityLevel: to.Ptr(armcosmos.DefaultPriorityLevelLow), - EnableAnalyticalStorage: to.Ptr(true), - EnableBurstCapacity: to.Ptr(true), - EnableFreeTier: to.Ptr(false), - EnableMaterializedViews: to.Ptr(false), - EnablePerRegionPerPartitionAutoscale: to.Ptr(true), - EnablePriorityBasedExecution: to.Ptr(true), - IPRules: []*armcosmos.IPAddressOrRange{ - { - IPAddressOrRange: to.Ptr("23.43.230.120"), - }, - { - IPAddressOrRange: to.Ptr("110.12.240.0/12"), - }}, - IsVirtualNetworkFilterEnabled: to.Ptr(true), - KeyVaultKeyURI: to.Ptr("https://myKeyVault.vault.azure.net"), - Locations: []*armcosmos.Location{ - { - FailoverPriority: to.Ptr[int32](0), - IsZoneRedundant: to.Ptr(false), - LocationName: to.Ptr("southcentralus"), - }, - { - FailoverPriority: to.Ptr[int32](1), - IsZoneRedundant: to.Ptr(false), - LocationName: to.Ptr("eastus"), - }}, - MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTls12), - NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassAzureServices), - NetworkACLBypassResourceIDs: []*string{ - to.Ptr("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")}, - PublicNetworkAccess: to.Ptr(armcosmos.PublicNetworkAccessEnabled), - VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{ - { - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - IgnoreMissingVNetServiceEndpoint: to.Ptr(false), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.DatabaseAccountGetResults = armcosmos.DatabaseAccountGetResults{ - // Name: to.Ptr("ddb1"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), - // Identity: &armcosmos.ManagedServiceIdentity{ - // Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"), - // TenantID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"), - // 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"), - // }, - // }, - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr(armcosmos.DatabaseAccountKindMongoDB), - // Properties: &armcosmos.DatabaseAccountGetProperties{ - // AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ - // SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined), - // }, - // APIProperties: &armcosmos.APIProperties{ - // ServerVersion: to.Ptr(armcosmos.ServerVersionThree2), - // }, - // BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{ - // Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic), - // PeriodicModeProperties: &armcosmos.PeriodicModeProperties{ - // BackupIntervalInMinutes: to.Ptr[int32](240), - // BackupRetentionIntervalInHours: to.Ptr[int32](8), - // BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo), - // }, - // }, - // Capacity: &armcosmos.Capacity{ - // TotalThroughputLimit: to.Ptr[int32](2000), - // }, - // ConsistencyPolicy: &armcosmos.ConsistencyPolicy{ - // DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness), - // MaxIntervalInSeconds: to.Ptr[int32](10), - // MaxStalenessPrefix: to.Ptr[int64](200), - // }, - // Cors: []*armcosmos.CorsPolicy{ - // { - // AllowedOrigins: to.Ptr("https://test"), - // }}, - // CreateMode: to.Ptr(armcosmos.CreateModeDefault), - // DatabaseAccountOfferType: to.Ptr("Standard"), - // DefaultIdentity: to.Ptr("FirstPartyIdentity"), - // DefaultPriorityLevel: to.Ptr(armcosmos.DefaultPriorityLevelLow), - // DisableKeyBasedMetadataWriteAccess: to.Ptr(false), - // EnableAnalyticalStorage: to.Ptr(true), - // EnableBurstCapacity: to.Ptr(true), - // EnableFreeTier: to.Ptr(false), - // EnableMaterializedViews: to.Ptr(false), - // EnablePerRegionPerPartitionAutoscale: to.Ptr(true), - // EnablePriorityBasedExecution: to.Ptr(true), - // FailoverPolicies: []*armcosmos.FailoverPolicy{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // LocationName: to.Ptr("South Central US"), - // }, - // { - // FailoverPriority: to.Ptr[int32](1), - // 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"), - // }, - // { - // IPAddressOrRange: to.Ptr("110.12.240.0/12"), - // }}, - // IsVirtualNetworkFilterEnabled: to.Ptr(true), - // 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}()), - // }, - // PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.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}()), - // }, - // SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), - // }, - // }, - // Locations: []*armcosmos.Location{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // IsZoneRedundant: to.Ptr(false), - // LocationName: to.Ptr("South Central US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // { - // FailoverPriority: to.Ptr[int32](1), - // ID: to.Ptr("ddb1-eastus"), - // IsZoneRedundant: to.Ptr(false), - // LocationName: to.Ptr("East US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTls12), - // NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassAzureServices), - // NetworkACLBypassResourceIDs: []*string{ - // to.Ptr("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")}, - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armcosmos.PublicNetworkAccessEnabled), - // ReadLocations: []*armcosmos.Location{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // IsZoneRedundant: to.Ptr(false), - // LocationName: to.Ptr("South Central US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // { - // FailoverPriority: to.Ptr[int32](1), - // ID: to.Ptr("ddb1-eastus"), - // IsZoneRedundant: to.Ptr(false), - // LocationName: to.Ptr("East US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }}, - // WriteLocations: []*armcosmos.Location{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // IsZoneRedundant: to.Ptr(false), - // LocationName: to.Ptr("South Central US"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountCreateMin.json -func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbDatabaseAccountCreateMin() { - 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.NewDatabaseAccountsClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", armcosmos.DatabaseAccountCreateUpdateParameters{ - Location: to.Ptr("westus"), - Properties: &armcosmos.DatabaseAccountCreateUpdateProperties{ - CreateMode: to.Ptr(armcosmos.CreateModeDefault), - DatabaseAccountOfferType: to.Ptr("Standard"), - Locations: []*armcosmos.Location{ - { - FailoverPriority: to.Ptr[int32](0), - IsZoneRedundant: to.Ptr(false), - LocationName: to.Ptr("southcentralus"), - }}, - }, - }, 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.DatabaseAccountGetResults = armcosmos.DatabaseAccountGetResults{ - // 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{ - // }, - // Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB), - // Properties: &armcosmos.DatabaseAccountGetProperties{ - // APIProperties: &armcosmos.APIProperties{ - // }, - // 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), - // MaxStalenessPrefix: to.Ptr[int64](100), - // }, - // Cors: []*armcosmos.CorsPolicy{ - // }, - // CreateMode: to.Ptr(armcosmos.CreateModeDefault), - // DatabaseAccountOfferType: to.Ptr("Standard"), - // DisableKeyBasedMetadataWriteAccess: to.Ptr(false), - // EnableAnalyticalStorage: to.Ptr(false), - // EnableFreeTier: to.Ptr(false), - // EnableMaterializedViews: to.Ptr(false), - // FailoverPolicies: []*armcosmos.FailoverPolicy{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // LocationName: to.Ptr("South Central US"), - // }}, - // InstanceID: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"), - // IPRules: []*armcosmos.IPAddressOrRange{ - // }, - // 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}()), - // }, - // PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.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}()), - // }, - // SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), - // }, - // }, - // Locations: []*armcosmos.Location{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // IsZoneRedundant: to.Ptr(false), - // LocationName: to.Ptr("South Central US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS), - // NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassNone), - // NetworkACLBypassResourceIDs: []*string{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ReadLocations: []*armcosmos.Location{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // IsZoneRedundant: to.Ptr(false), - // LocationName: to.Ptr("South Central US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // WriteLocations: []*armcosmos.Location{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // IsZoneRedundant: to.Ptr(false), - // LocationName: to.Ptr("South Central US"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json -func ExampleDatabaseAccountsClient_BeginCreateOrUpdate_cosmosDbRestoreDatabaseAccountCreateUpdateJson() { - 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.NewDatabaseAccountsClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", armcosmos.DatabaseAccountCreateUpdateParameters{ - Location: to.Ptr("westus"), - Tags: map[string]*string{}, - Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB), - Properties: &armcosmos.DatabaseAccountCreateUpdateProperties{ - APIProperties: &armcosmos.APIProperties{ - ServerVersion: to.Ptr(armcosmos.ServerVersionThree2), - }, - BackupPolicy: &armcosmos.ContinuousModeBackupPolicy{ - Type: to.Ptr(armcosmos.BackupPolicyTypeContinuous), - ContinuousModeProperties: &armcosmos.ContinuousModeProperties{ - Tier: to.Ptr(armcosmos.ContinuousTierContinuous30Days), - }, - }, - ConsistencyPolicy: &armcosmos.ConsistencyPolicy{ - DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness), - MaxIntervalInSeconds: to.Ptr[int32](10), - MaxStalenessPrefix: to.Ptr[int64](200), - }, - CreateMode: to.Ptr(armcosmos.CreateModeRestore), - 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{ - { - FailoverPriority: to.Ptr[int32](0), - IsZoneRedundant: to.Ptr(false), - LocationName: to.Ptr("southcentralus"), - }}, - MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS), - RestoreParameters: &armcosmos.RestoreParameters{ - RestoreSource: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc"), - RestoreTimestampInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-11T22:05:09.000Z"); return t }()), - RestoreWithTTLDisabled: to.Ptr(false), - DatabasesToRestore: []*armcosmos.DatabaseRestoreResource{ - { - CollectionNames: []*string{ - to.Ptr("collection1"), - to.Ptr("collection2")}, - DatabaseName: to.Ptr("db1"), - }, - { - CollectionNames: []*string{ - to.Ptr("collection3"), - to.Ptr("collection4")}, - DatabaseName: to.Ptr("db2"), - }}, - RestoreMode: to.Ptr(armcosmos.RestoreModePointInTime), - SourceBackupLocation: to.Ptr("westus"), - }, - }, - }, 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.DatabaseAccountGetResults = armcosmos.DatabaseAccountGetResults{ - // 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{ - // }, - // Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB), - // Properties: &armcosmos.DatabaseAccountGetProperties{ - // APIProperties: &armcosmos.APIProperties{ - // }, - // BackupPolicy: &armcosmos.ContinuousModeBackupPolicy{ - // Type: to.Ptr(armcosmos.BackupPolicyTypeContinuous), - // ContinuousModeProperties: &armcosmos.ContinuousModeProperties{ - // Tier: to.Ptr(armcosmos.ContinuousTierContinuous30Days), - // }, - // }, - // ConsistencyPolicy: &armcosmos.ConsistencyPolicy{ - // DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelSession), - // MaxIntervalInSeconds: to.Ptr[int32](5), - // MaxStalenessPrefix: to.Ptr[int64](100), - // }, - // CreateMode: to.Ptr(armcosmos.CreateModeRestore), - // DatabaseAccountOfferType: to.Ptr("Standard"), - // DisableKeyBasedMetadataWriteAccess: to.Ptr(false), - // EnableAnalyticalStorage: to.Ptr(false), - // EnableFreeTier: to.Ptr(false), - // EnableMaterializedViews: to.Ptr(false), - // FailoverPolicies: []*armcosmos.FailoverPolicy{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // LocationName: to.Ptr("South Central US"), - // }}, - // InstanceID: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"), - // IPRules: []*armcosmos.IPAddressOrRange{ - // }, - // 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}()), - // }, - // PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.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}()), - // }, - // SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), - // }, - // }, - // Locations: []*armcosmos.Location{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // IsZoneRedundant: to.Ptr(false), - // LocationName: to.Ptr("South Central US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS), - // NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassNone), - // NetworkACLBypassResourceIDs: []*string{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ReadLocations: []*armcosmos.Location{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // IsZoneRedundant: to.Ptr(false), - // LocationName: to.Ptr("South Central US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // WriteLocations: []*armcosmos.Location{ - // { - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-southcentralus"), - // IsZoneRedundant: to.Ptr(false), - // LocationName: to.Ptr("South Central US"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountDelete.json -func ExampleDatabaseAccountsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabaseAccountsClient().BeginDelete(ctx, "rg1", "ddb1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json -func ExampleDatabaseAccountsClient_BeginFailoverPriorityChange() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabaseAccountsClient().BeginFailoverPriorityChange(ctx, "rg1", "ddb1-failover", armcosmos.FailoverPolicies{ - FailoverPolicies: []*armcosmos.FailoverPolicy{ - { - FailoverPriority: to.Ptr[int32](0), - LocationName: to.Ptr("eastus"), - }, - { - FailoverPriority: to.Ptr[int32](1), - LocationName: to.Ptr("westus"), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountList.json -func ExampleDatabaseAccountsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseAccountsClient().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.DatabaseAccountsListResult = armcosmos.DatabaseAccountsListResult{ - // Value: []*armcosmos.DatabaseAccountGetResults{ - // { - // Name: to.Ptr("ddb1"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), - // Identity: &armcosmos.ManagedServiceIdentity{ - // Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"), - // TenantID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"), - // 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("33e01921-4d64-4f8c-a055-5bdaffd5e33d"), - // }, - // }, - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB), - // Properties: &armcosmos.DatabaseAccountGetProperties{ - // AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ - // SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined), - // }, - // APIProperties: &armcosmos.APIProperties{ - // }, - // 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), - // MaxStalenessPrefix: to.Ptr[int64](100), - // }, - // Cors: []*armcosmos.CorsPolicy{ - // }, - // CreateMode: to.Ptr(armcosmos.CreateModeDefault), - // DatabaseAccountOfferType: to.Ptr("Standard"), - // DefaultIdentity: to.Ptr("FirstPartyIdentity"), - // DefaultPriorityLevel: to.Ptr(armcosmos.DefaultPriorityLevelLow), - // 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), - // EnablePerRegionPerPartitionAutoscale: to.Ptr(true), - // EnablePriorityBasedExecution: 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{ - // }, - // 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}()), - // }, - // PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.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}()), - // }, - // SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()), - // }, - // }, - // Locations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS), - // NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassNone), - // NetworkACLBypassResourceIDs: []*string{ - // }, - // PrivateEndpointConnections: []*armcosmos.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.DocumentDB/databaseAccounts/account1/privateEndpointConnections/pe1"), - // Properties: &armcosmos.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcosmos.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/privateEndpoints/pe1"), - // }, - // PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // ReadLocations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // WriteLocations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json -func ExampleDatabaseAccountsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseAccountsClient().NewListByResourceGroupPager("rg1", 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.DatabaseAccountsListResult = armcosmos.DatabaseAccountsListResult{ - // Value: []*armcosmos.DatabaseAccountGetResults{ - // { - // Name: to.Ptr("ddb1"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), - // Identity: &armcosmos.ManagedServiceIdentity{ - // Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"), - // TenantID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"), - // 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("33e01921-4d64-4f8c-a055-5bdaffd5e33d"), - // }, - // }, - // }, - // 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), - // MaxStalenessPrefix: to.Ptr[int64](100), - // }, - // 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{ - // PrimaryMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.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}()), - // }, - // SecondaryMasterKey: &armcosmos.AccountKeyMetadata{ - // GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.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}()), - // }, - // }, - // Locations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS), - // NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassNone), - // NetworkACLBypassResourceIDs: []*string{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ReadLocations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // ProvisioningState: to.Ptr("Succeeded"), - // }}, - // WriteLocations: []*armcosmos.Location{ - // { - // DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"), - // FailoverPriority: to.Ptr[int32](0), - // ID: to.Ptr("ddb1-eastus"), - // LocationName: to.Ptr("East US"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountListKeys.json -func ExampleDatabaseAccountsClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAccountsClient().ListKeys(ctx, "rg1", "ddb1", 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.DatabaseAccountListKeysResult = armcosmos.DatabaseAccountListKeysResult{ - // PrimaryReadonlyMasterKey: to.Ptr("primaryReadonlyMasterKey"), - // SecondaryReadonlyMasterKey: to.Ptr("secondaryReadonlyMasterKey"), - // PrimaryMasterKey: to.Ptr("primaryMasterKey"), - // SecondaryMasterKey: to.Ptr("secondaryMasterKey"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json -func ExampleDatabaseAccountsClient_ListConnectionStrings_cosmosDbDatabaseAccountListConnectionStrings() { - 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.NewDatabaseAccountsClient().ListConnectionStrings(ctx, "rg1", "ddb1", 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.DatabaseAccountListConnectionStringsResult = armcosmos.DatabaseAccountListConnectionStringsResult{ - // ConnectionStrings: []*armcosmos.DatabaseAccountConnectionString{ - // { - // Type: to.Ptr(armcosmos.TypeSQL), - // Description: to.Ptr("Primary SQL Connection String"), - // ConnectionString: to.Ptr("connection-string"), - // KeyKind: to.Ptr(armcosmos.KindPrimary), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json -func ExampleDatabaseAccountsClient_ListConnectionStrings_cosmosDbDatabaseAccountListConnectionStringsMongo() { - 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.NewDatabaseAccountsClient().ListConnectionStrings(ctx, "rg1", "mongo-ddb1", 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.DatabaseAccountListConnectionStringsResult = armcosmos.DatabaseAccountListConnectionStringsResult{ - // ConnectionStrings: []*armcosmos.DatabaseAccountConnectionString{ - // { - // Description: to.Ptr("Name of the connection string"), - // ConnectionString: to.Ptr("connection-string"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json -func ExampleDatabaseAccountsClient_BeginOfflineRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabaseAccountsClient().BeginOfflineRegion(ctx, "rg1", "ddb1", armcosmos.RegionForOnlineOffline{ - Region: to.Ptr("North Europe"), - }, 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json -func ExampleDatabaseAccountsClient_BeginOnlineRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabaseAccountsClient().BeginOnlineRegion(ctx, "rg1", "ddb1", armcosmos.RegionForOnlineOffline{ - Region: to.Ptr("North Europe"), - }, 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json -func ExampleDatabaseAccountsClient_GetReadOnlyKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAccountsClient().GetReadOnlyKeys(ctx, "rg1", "ddb1", 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.DatabaseAccountListReadOnlyKeysResult = armcosmos.DatabaseAccountListReadOnlyKeysResult{ - // PrimaryReadonlyMasterKey: to.Ptr("primaryReadonlyMasterKey"), - // SecondaryReadonlyMasterKey: to.Ptr("secondaryReadonlyMasterKey"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json -func ExampleDatabaseAccountsClient_BeginRegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabaseAccountsClient().BeginRegenerateKey(ctx, "rg1", "ddb1", armcosmos.DatabaseAccountRegenerateKeyParameters{ - KeyKind: to.Ptr(armcosmos.KeyKindPrimary), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json -func ExampleDatabaseAccountsClient_CheckNameExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDatabaseAccountsClient().CheckNameExists(ctx, "ddb1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountGetMetrics.json -func ExampleDatabaseAccountsClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseAccountsClient().NewListMetricsPager("rg1", "ddb1", "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", nil) - for pager.More() { - 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.MetricListResult = armcosmos.MetricListResult{ - // Value: []*armcosmos.Metric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Total Requests"), - // Value: to.Ptr("Total Requests"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()), - // MetricValues: []*armcosmos.MetricValue{ - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:03:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Count: to.Ptr[int32](0), - // Average: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:08:55.278Z"); return t}()), - // Total: to.Ptr[float64](0), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT5M"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountGetUsages.json -func ExampleDatabaseAccountsClient_NewListUsagesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseAccountsClient().NewListUsagesPager("rg1", "ddb1", &armcosmos.DatabaseAccountsClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Storage'")}) - 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.UsagesResult = armcosmos.UsagesResult{ - // Value: []*armcosmos.Usage{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Storage"), - // Value: to.Ptr("Storage"), - // }, - // CurrentValue: to.Ptr[int64](0), - // Limit: to.Ptr[int64](10737418240), - // QuotaPeriod: to.Ptr("P1D"), - // Unit: to.Ptr(armcosmos.UnitTypeBytes), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json -func ExampleDatabaseAccountsClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseAccountsClient().NewListMetricDefinitionsPager("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.MetricDefinitionsListResult = armcosmos.MetricDefinitionsListResult{ - // Value: []*armcosmos.MetricDefinition{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Total Requests"), - // Value: to.Ptr("Total Requests"), - // }, - // MetricAvailabilities: []*armcosmos.MetricAvailability{ - // { - // Retention: to.Ptr("P2D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P60D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armcosmos.PrimaryAggregationTypeTotal), - // ResourceURI: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client.go b/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client.go index 421831c7a324..7275f81f9b7c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client.go @@ -46,7 +46,7 @@ func NewDataTransferJobsClient(subscriptionID string, credential azcore.TokenCre // Cancel - Cancels a Data Transfer Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - jobName - Name of the Data Transfer Job @@ -97,7 +97,7 @@ func (client *DataTransferJobsClient) cancelCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *DataTransferJobsClient) cancelHandleResponse(resp *http.Response) // Complete - Completes a Data Transfer Online Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - jobName - Name of the Data Transfer Job @@ -167,7 +167,7 @@ func (client *DataTransferJobsClient) completeCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -185,7 +185,7 @@ func (client *DataTransferJobsClient) completeHandleResponse(resp *http.Response // Create - Creates a Data Transfer Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - jobName - Name of the Data Transfer Job @@ -236,7 +236,7 @@ func (client *DataTransferJobsClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, jobCreateParameters); err != nil { @@ -257,7 +257,7 @@ func (client *DataTransferJobsClient) createHandleResponse(resp *http.Response) // Get - Get a Data Transfer Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - jobName - Name of the Data Transfer Job @@ -308,7 +308,7 @@ func (client *DataTransferJobsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +325,7 @@ func (client *DataTransferJobsClient) getHandleResponse(resp *http.Response) (Da // NewListByDatabaseAccountPager - Get a list of Data Transfer jobs. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - options - DataTransferJobsClientListByDatabaseAccountOptions contains the optional parameters for the DataTransferJobsClient.NewListByDatabaseAccountPager @@ -373,7 +373,7 @@ func (client *DataTransferJobsClient) listByDatabaseAccountCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -391,7 +391,7 @@ func (client *DataTransferJobsClient) listByDatabaseAccountHandleResponse(resp * // Pause - Pause a Data Transfer Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - jobName - Name of the Data Transfer Job @@ -442,7 +442,7 @@ func (client *DataTransferJobsClient) pauseCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -460,7 +460,7 @@ func (client *DataTransferJobsClient) pauseHandleResponse(resp *http.Response) ( // Resume - Resumes a Data Transfer Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - jobName - Name of the Data Transfer Job @@ -511,7 +511,7 @@ func (client *DataTransferJobsClient) resumeCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, 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 087474dde5d1..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client_example_test.go +++ /dev/null @@ -1,334 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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"), - // }, - // Duration: to.Ptr("00:00:00"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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"), - // }, - // Duration: to.Ptr("01:23:56"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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"), - // }, - // Duration: to.Ptr("00:11:25"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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"), - // }, - // Duration: to.Ptr("00:21:50"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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"), - // }, - // Duration: to.Ptr("00:34:10"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json -func ExampleDataTransferJobsClient_Complete() { - 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().Complete(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"), - // }, - // Duration: to.Ptr("00:34:10"), - // 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("Completed"), - // TotalCount: to.Ptr[int64](100), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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"), - // }, - // Duration: to.Ptr("00:00:00"), - // 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/go.mod b/sdk/resourcemanager/cosmos/armcosmos/go.mod index 37d819f358f4..892aafee4a32 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/go.mod +++ b/sdk/resourcemanager/cosmos/armcosmos/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.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 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dnaeon/go-vcr v1.2.0 // indirect diff --git a/sdk/resourcemanager/cosmos/armcosmos/graphresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/graphresources_client.go index 52489181bf7c..7365adc05af6 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/graphresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/graphresources_client.go @@ -46,7 +46,7 @@ func NewGraphResourcesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateUpdateGraph - Create or update an Azure Cosmos DB Graph. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - graphName - Cosmos DB graph resource name. @@ -73,7 +73,7 @@ func (client *GraphResourcesClient) BeginCreateUpdateGraph(ctx context.Context, // CreateUpdateGraph - Create or update an Azure Cosmos DB Graph. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -119,7 +119,7 @@ func (client *GraphResourcesClient) createUpdateGraphCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createUpdateGraphParameters); err != nil { @@ -131,7 +131,7 @@ func (client *GraphResourcesClient) createUpdateGraphCreateRequest(ctx context.C // BeginDeleteGraphResource - Deletes an existing Azure Cosmos DB Graph Resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - graphName - Cosmos DB graph resource name. @@ -157,7 +157,7 @@ func (client *GraphResourcesClient) BeginDeleteGraphResource(ctx context.Context // DeleteGraphResource - Deletes an existing Azure Cosmos DB Graph Resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -203,7 +203,7 @@ func (client *GraphResourcesClient) deleteGraphResourceCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -211,7 +211,7 @@ func (client *GraphResourcesClient) deleteGraphResourceCreateRequest(ctx context // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - graphName - Cosmos DB graph resource name. @@ -262,7 +262,7 @@ func (client *GraphResourcesClient) getGraphCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *GraphResourcesClient) getGraphHandleResponse(resp *http.Response) // NewListGraphsPager - Lists the graphs under an existing Azure Cosmos DB database account. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - options - GraphResourcesClientListGraphsOptions contains the optional parameters for the GraphResourcesClient.NewListGraphsPager @@ -328,7 +328,7 @@ func (client *GraphResourcesClient) listGraphsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, 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 3b5542a949ca..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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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 d975446a987a..25c06e32ffa9 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -438,7 +438,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -509,7 +509,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -584,7 +584,7 @@ func (client *GremlinResourcesClient) getGremlinGraphCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -660,7 +660,7 @@ func (client *GremlinResourcesClient) getGremlinGraphThroughputCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -797,7 +797,7 @@ func (client *GremlinResourcesClient) listGremlinGraphsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *GremlinResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, location ContinuousBackupRestoreLocation, options *GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 deleted file mode 100644 index 509e19cd79e2..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client_example_test.go +++ /dev/null @@ -1,825 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseList.json -func ExampleGremlinResourcesClient_NewListGremlinDatabasesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGremlinResourcesClient().NewListGremlinDatabasesPager("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.GremlinDatabaseListResult = armcosmos.GremlinDatabaseListResult{ - // Value: []*armcosmos.GremlinDatabaseGetResults{ - // { - // Name: to.Ptr("databaseName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.GremlinDatabaseGetProperties{ - // Resource: &armcosmos.GremlinDatabaseGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseGet.json -func ExampleGremlinResourcesClient_GetGremlinDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGremlinResourcesClient().GetGremlinDatabase(ctx, "rg1", "ddb1", "databaseName", 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.GremlinDatabaseGetResults = armcosmos.GremlinDatabaseGetResults{ - // Name: to.Ptr("databaseName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.GremlinDatabaseGetProperties{ - // Resource: &armcosmos.GremlinDatabaseGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json -func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGremlinResourcesClient().BeginCreateUpdateGremlinDatabase(ctx, "rg1", "ddb1", "databaseName", armcosmos.GremlinDatabaseCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.GremlinDatabaseCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.GremlinDatabaseResource{ - ID: to.Ptr("databaseName"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.GremlinDatabaseGetResults = armcosmos.GremlinDatabaseGetResults{ - // Name: to.Ptr("databaseName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.GremlinDatabaseGetProperties{ - // Resource: &armcosmos.GremlinDatabaseGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseDelete.json -func ExampleGremlinResourcesClient_BeginDeleteGremlinDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGremlinResourcesClient().BeginDeleteGremlinDatabase(ctx, "rg1", "ddb1", "databaseName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json -func ExampleGremlinResourcesClient_GetGremlinDatabaseThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGremlinResourcesClient().GetGremlinDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", 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/gremlinDatabases/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json -func ExampleGremlinResourcesClient_BeginUpdateGremlinDatabaseThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGremlinResourcesClient().BeginUpdateGremlinDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/gremlinDatabases/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json -func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGremlinResourcesClient().BeginMigrateGremlinDatabaseToAutoscale(ctx, "rg1", "ddb1", "databaseName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json -func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGremlinResourcesClient().BeginMigrateGremlinDatabaseToManualThroughput(ctx, "rg1", "ddb1", "databaseName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphList.json -func ExampleGremlinResourcesClient_NewListGremlinGraphsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGremlinResourcesClient().NewListGremlinGraphsPager("rgName", "ddb1", "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.GremlinGraphListResult = armcosmos.GremlinGraphListResult{ - // Value: []*armcosmos.GremlinGraphGetResults{ - // { - // Name: to.Ptr("testgrf"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/apis/databases/graphs"), - // ID: to.Ptr("testgrf"), - // Properties: &armcosmos.GremlinGraphGetProperties{ - // Resource: &armcosmos.GremlinGraphGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ - // ConflictResolutionPath: to.Ptr("/path"), - // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), - // }, - // DefaultTTL: to.Ptr[int32](100), - // ID: to.Ptr("testgrf"), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphGet.json -func ExampleGremlinResourcesClient_GetGremlinGraph() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGremlinResourcesClient().GetGremlinGraph(ctx, "rgName", "ddb1", "databaseName", "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.GremlinGraphGetResults = armcosmos.GremlinGraphGetResults{ - // Name: to.Ptr("graphName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/apis/databases/graphs"), - // ID: to.Ptr("graphName"), - // Properties: &armcosmos.GremlinGraphGetProperties{ - // Resource: &armcosmos.GremlinGraphGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ - // ConflictResolutionPath: to.Ptr("/path"), - // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), - // }, - // DefaultTTL: to.Ptr[int32](100), - // ID: to.Ptr("graphName"), - // IndexingPolicy: &armcosmos.IndexingPolicy{ - // Automatic: to.Ptr(true), - // ExcludedPaths: []*armcosmos.ExcludedPath{ - // }, - // IncludedPaths: []*armcosmos.IncludedPath{ - // { - // Path: to.Ptr("/*"), - // Indexes: []*armcosmos.Indexes{ - // { - // DataType: to.Ptr(armcosmos.DataTypeString), - // Kind: to.Ptr(armcosmos.IndexKindRange), - // Precision: to.Ptr[int32](-1), - // }, - // { - // DataType: to.Ptr(armcosmos.DataTypeNumber), - // Kind: to.Ptr(armcosmos.IndexKindRange), - // Precision: to.Ptr[int32](-1), - // }}, - // }}, - // IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent), - // }, - // PartitionKey: &armcosmos.ContainerPartitionKey{ - // Kind: to.Ptr(armcosmos.PartitionKindHash), - // Paths: []*string{ - // to.Ptr("/AccountNumber")}, - // }, - // UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{ - // UniqueKeys: []*armcosmos.UniqueKey{ - // { - // Paths: []*string{ - // to.Ptr("/testPath")}, - // }}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphCreateUpdate.json -func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinGraph() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGremlinResourcesClient().BeginCreateUpdateGremlinGraph(ctx, "rg1", "ddb1", "databaseName", "graphName", armcosmos.GremlinGraphCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.GremlinGraphCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.GremlinGraphResource{ - ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ - ConflictResolutionPath: to.Ptr("/path"), - Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), - }, - DefaultTTL: to.Ptr[int32](100), - ID: to.Ptr("graphName"), - IndexingPolicy: &armcosmos.IndexingPolicy{ - Automatic: to.Ptr(true), - ExcludedPaths: []*armcosmos.ExcludedPath{}, - IncludedPaths: []*armcosmos.IncludedPath{ - { - Path: to.Ptr("/*"), - Indexes: []*armcosmos.Indexes{ - { - DataType: to.Ptr(armcosmos.DataTypeString), - Kind: to.Ptr(armcosmos.IndexKindRange), - Precision: to.Ptr[int32](-1), - }, - { - DataType: to.Ptr(armcosmos.DataTypeNumber), - Kind: to.Ptr(armcosmos.IndexKindRange), - Precision: to.Ptr[int32](-1), - }}, - }}, - IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent), - }, - PartitionKey: &armcosmos.ContainerPartitionKey{ - Kind: to.Ptr(armcosmos.PartitionKindHash), - Paths: []*string{ - to.Ptr("/AccountNumber")}, - }, - UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{ - UniqueKeys: []*armcosmos.UniqueKey{ - { - Paths: []*string{ - to.Ptr("/testPath")}, - }}, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.GremlinGraphGetResults = armcosmos.GremlinGraphGetResults{ - // Name: to.Ptr("graphName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/gremlinGraphs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName/gremlinGraphs/graphName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.GremlinGraphGetProperties{ - // Resource: &armcosmos.GremlinGraphGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ - // ConflictResolutionPath: to.Ptr("/path"), - // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), - // }, - // DefaultTTL: to.Ptr[int32](100), - // ID: to.Ptr("graphName"), - // IndexingPolicy: &armcosmos.IndexingPolicy{ - // Automatic: to.Ptr(true), - // ExcludedPaths: []*armcosmos.ExcludedPath{ - // }, - // IncludedPaths: []*armcosmos.IncludedPath{ - // { - // Path: to.Ptr("/*"), - // Indexes: []*armcosmos.Indexes{ - // { - // DataType: to.Ptr(armcosmos.DataTypeString), - // Kind: to.Ptr(armcosmos.IndexKindRange), - // Precision: to.Ptr[int32](-1), - // }, - // { - // DataType: to.Ptr(armcosmos.DataTypeNumber), - // Kind: to.Ptr(armcosmos.IndexKindRange), - // Precision: to.Ptr[int32](-1), - // }}, - // }}, - // IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent), - // }, - // PartitionKey: &armcosmos.ContainerPartitionKey{ - // Kind: to.Ptr(armcosmos.PartitionKindHash), - // Paths: []*string{ - // to.Ptr("/AccountNumber")}, - // }, - // UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{ - // UniqueKeys: []*armcosmos.UniqueKey{ - // { - // Paths: []*string{ - // to.Ptr("/testPath")}, - // }}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphDelete.json -func ExampleGremlinResourcesClient_BeginDeleteGremlinGraph() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGremlinResourcesClient().BeginDeleteGremlinGraph(ctx, "rg1", "ddb1", "databaseName", "graphName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphThroughputGet.json -func ExampleGremlinResourcesClient_GetGremlinGraphThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGremlinResourcesClient().GetGremlinGraphThroughput(ctx, "rg1", "ddb1", "databaseName", "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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName/gremlinGraphs/graphName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json -func ExampleGremlinResourcesClient_BeginUpdateGremlinGraphThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGremlinResourcesClient().BeginUpdateGremlinGraphThroughput(ctx, "rg1", "ddb1", "databaseName", "graphName", armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/gremlinDatabases/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName/gremlinGraphs/graphName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json -func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGremlinResourcesClient().BeginMigrateGremlinGraphToAutoscale(ctx, "rg1", "ddb1", "databaseName", "graphName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json -func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGremlinResourcesClient().BeginMigrateGremlinGraphToManualThroughput(ctx, "rg1", "ddb1", "databaseName", "graphName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphBackupInformation.json -func ExampleGremlinResourcesClient_BeginRetrieveContinuousBackupInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGremlinResourcesClient().BeginRetrieveContinuousBackupInformation(ctx, "rgName", "ddb1", "databaseName", "graphName", armcosmos.ContinuousBackupRestoreLocation{ - Location: to.Ptr("North Europe"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.BackupInformation = armcosmos.BackupInformation{ - // ContinuousBackupInformation: &armcosmos.ContinuousBackupInformation{ - // LatestRestorableTimestamp: to.Ptr("2021-02-05T02:40:50Z"), - // }, - // } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/locations_client.go b/sdk/resourcemanager/cosmos/armcosmos/locations_client.go index ab5d7f4ca1cb..285bf96d8226 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/locations_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/locations_client_example_test.go deleted file mode 100644 index 71c63dc441f8..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/locations_client_example_test.go +++ /dev/null @@ -1,111 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBLocationList.json -func ExampleLocationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationsClient().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.LocationListResult = armcosmos.LocationListResult{ - // Value: []*armcosmos.LocationGetResult{ - // { - // Name: to.Ptr("westus"), - // Type: to.Ptr("Microsoft.DocumentDB/locations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus"), - // Properties: &armcosmos.LocationProperties{ - // BackupStorageRedundancies: []*armcosmos.BackupStorageRedundancy{ - // to.Ptr(armcosmos.BackupStorageRedundancyLocal), - // to.Ptr(armcosmos.BackupStorageRedundancyGeo)}, - // IsResidencyRestricted: to.Ptr(false), - // IsSubscriptionRegionAccessAllowedForAz: to.Ptr(false), - // IsSubscriptionRegionAccessAllowedForRegular: to.Ptr(true), - // Status: to.Ptr(armcosmos.StatusOnline), - // SupportsAvailabilityZone: to.Ptr(false), - // }, - // }, - // { - // Name: to.Ptr("centralus"), - // Type: to.Ptr("Microsoft.DocumentDB/locations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/centralus"), - // Properties: &armcosmos.LocationProperties{ - // BackupStorageRedundancies: []*armcosmos.BackupStorageRedundancy{ - // to.Ptr(armcosmos.BackupStorageRedundancyZone), - // to.Ptr(armcosmos.BackupStorageRedundancyGeo)}, - // IsResidencyRestricted: to.Ptr(false), - // IsSubscriptionRegionAccessAllowedForAz: to.Ptr(true), - // IsSubscriptionRegionAccessAllowedForRegular: to.Ptr(false), - // Status: to.Ptr(armcosmos.StatusOnline), - // SupportsAvailabilityZone: to.Ptr(true), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBLocationGet.json -func ExampleLocationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().Get(ctx, "westus", 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.LocationGetResult = armcosmos.LocationGetResult{ - // Name: to.Ptr("westus"), - // Type: to.Ptr("Microsoft.DocumentDB/locations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus"), - // Properties: &armcosmos.LocationProperties{ - // BackupStorageRedundancies: []*armcosmos.BackupStorageRedundancy{ - // to.Ptr(armcosmos.BackupStorageRedundancyLocal), - // to.Ptr(armcosmos.BackupStorageRedundancyGeo)}, - // IsResidencyRestricted: to.Ptr(true), - // IsSubscriptionRegionAccessAllowedForAz: to.Ptr(true), - // IsSubscriptionRegionAccessAllowedForRegular: to.Ptr(true), - // Status: to.Ptr(armcosmos.StatusOnline), - // SupportsAvailabilityZone: to.Ptr(true), - // }, - // } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/models.go b/sdk/resourcemanager/cosmos/armcosmos/models.go index 64454e10b145..ff33904fcfd9 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/models.go +++ b/sdk/resourcemanager/cosmos/armcosmos/models.go @@ -225,6 +225,27 @@ type Capacity struct { TotalThroughputLimit *int32 } +// CapacityModeChangeTransitionState - The transition state information related capacity mode change with update request. +type CapacityModeChangeTransitionState struct { + // The transition status of capacity mode. + CapacityModeTransitionStatus *CapacityModeTransitionStatus + + // Indicates the current capacity mode of the account. + CurrentCapacityMode *CapacityMode + + // Indicates the previous capacity mode of the account before successful transition. + PreviousCapacityMode *CapacityMode + + // READ-ONLY; End time in UTC of the last successful capacity mode change. + CapacityModeLastSuccessfulTransitionEndTimestamp *time.Time + + // READ-ONLY; Begin time in UTC of the capacity mode change. + CapacityModeTransitionBeginTimestamp *time.Time + + // READ-ONLY; End time in UTC of the capacity mode change. + CapacityModeTransitionEndTimestamp *time.Time +} + // CassandraClusterPublicStatus - Properties of a managed Cassandra cluster public status. type CassandraClusterPublicStatus struct { // List relevant information about any connection errors to the Datacenters. @@ -1485,6 +1506,9 @@ type DatabaseAccountCreateUpdateProperties struct { // The object that represents all properties related to capacity enforcement on an account. Capacity *Capacity + // Indicates the capacityMode of the Cosmos DB account. + CapacityMode *CapacityMode + // The cassandra connector offer type for the Cosmos DB database C* account. ConnectorOffer *ConnectorOffer @@ -1600,6 +1624,12 @@ type DatabaseAccountGetProperties struct { // The object that represents all properties related to capacity enforcement on an account. Capacity *Capacity + // Indicates the capacityMode of the Cosmos DB account. + CapacityMode *CapacityMode + + // The object that represents the migration state for the CapacityMode of the Cosmos DB account. + CapacityModeChangeTransitionState *CapacityModeChangeTransitionState + // The cassandra connector offer type for the Cosmos DB database C* account. ConnectorOffer *ConnectorOffer @@ -1850,6 +1880,9 @@ type DatabaseAccountUpdateProperties struct { // The object that represents all properties related to capacity enforcement on an account. Capacity *Capacity + // Indicates the capacityMode of the Cosmos DB account. + CapacityMode *CapacityMode + // The cassandra connector offer type for the Cosmos DB database C* account. ConnectorOffer *ConnectorOffer @@ -3792,12 +3825,15 @@ type PrivateEndpointConnection struct { // Resource properties. Properties *PrivateEndpointConnectionProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // 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 } @@ -3895,19 +3931,6 @@ type PrivilegeResource struct { // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - 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 @@ -3987,18 +4010,6 @@ type RegionalServiceResource struct { // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - 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 diff --git a/sdk/resourcemanager/cosmos/armcosmos/models_serde.go b/sdk/resourcemanager/cosmos/armcosmos/models_serde.go index 8ef5b4086a22..d7ec9db2d88f 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/models_serde.go +++ b/sdk/resourcemanager/cosmos/armcosmos/models_serde.go @@ -614,6 +614,53 @@ func (c *Capacity) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CapacityModeChangeTransitionState. +func (c CapacityModeChangeTransitionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "capacityModeLastSuccessfulTransitionEndTimestamp", c.CapacityModeLastSuccessfulTransitionEndTimestamp) + populateDateTimeRFC3339(objectMap, "capacityModeTransitionBeginTimestamp", c.CapacityModeTransitionBeginTimestamp) + populateDateTimeRFC3339(objectMap, "capacityModeTransitionEndTimestamp", c.CapacityModeTransitionEndTimestamp) + populate(objectMap, "capacityModeTransitionStatus", c.CapacityModeTransitionStatus) + populate(objectMap, "currentCapacityMode", c.CurrentCapacityMode) + populate(objectMap, "previousCapacityMode", c.PreviousCapacityMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityModeChangeTransitionState. +func (c *CapacityModeChangeTransitionState) UnmarshalJSON(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 "capacityModeLastSuccessfulTransitionEndTimestamp": + err = unpopulateDateTimeRFC3339(val, "CapacityModeLastSuccessfulTransitionEndTimestamp", &c.CapacityModeLastSuccessfulTransitionEndTimestamp) + delete(rawMsg, key) + case "capacityModeTransitionBeginTimestamp": + err = unpopulateDateTimeRFC3339(val, "CapacityModeTransitionBeginTimestamp", &c.CapacityModeTransitionBeginTimestamp) + delete(rawMsg, key) + case "capacityModeTransitionEndTimestamp": + err = unpopulateDateTimeRFC3339(val, "CapacityModeTransitionEndTimestamp", &c.CapacityModeTransitionEndTimestamp) + delete(rawMsg, key) + case "capacityModeTransitionStatus": + err = unpopulate(val, "CapacityModeTransitionStatus", &c.CapacityModeTransitionStatus) + delete(rawMsg, key) + case "currentCapacityMode": + err = unpopulate(val, "CurrentCapacityMode", &c.CurrentCapacityMode) + delete(rawMsg, key) + case "previousCapacityMode": + err = unpopulate(val, "PreviousCapacityMode", &c.PreviousCapacityMode) + 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 CassandraClusterPublicStatus. func (c CassandraClusterPublicStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3625,6 +3672,7 @@ func (d DatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "backupPolicy", d.BackupPolicy) populate(objectMap, "capabilities", d.Capabilities) populate(objectMap, "capacity", d.Capacity) + populate(objectMap, "capacityMode", d.CapacityMode) populate(objectMap, "connectorOffer", d.ConnectorOffer) populate(objectMap, "consistencyPolicy", d.ConsistencyPolicy) populate(objectMap, "cors", d.Cors) @@ -3684,6 +3732,9 @@ func (d *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(data []byte) error case "capacity": err = unpopulate(val, "Capacity", &d.Capacity) delete(rawMsg, key) + case "capacityMode": + err = unpopulate(val, "CapacityMode", &d.CapacityMode) + delete(rawMsg, key) case "connectorOffer": err = unpopulate(val, "ConnectorOffer", &d.ConnectorOffer) delete(rawMsg, key) @@ -3796,6 +3847,8 @@ func (d DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "backupPolicy", d.BackupPolicy) populate(objectMap, "capabilities", d.Capabilities) populate(objectMap, "capacity", d.Capacity) + populate(objectMap, "capacityMode", d.CapacityMode) + populate(objectMap, "capacityModeChangeTransitionState", d.CapacityModeChangeTransitionState) populate(objectMap, "connectorOffer", d.ConnectorOffer) populate(objectMap, "consistencyPolicy", d.ConsistencyPolicy) populate(objectMap, "cors", d.Cors) @@ -3862,6 +3915,12 @@ func (d *DatabaseAccountGetProperties) UnmarshalJSON(data []byte) error { case "capacity": err = unpopulate(val, "Capacity", &d.Capacity) delete(rawMsg, key) + case "capacityMode": + err = unpopulate(val, "CapacityMode", &d.CapacityMode) + delete(rawMsg, key) + case "capacityModeChangeTransitionState": + err = unpopulate(val, "CapacityModeChangeTransitionState", &d.CapacityModeChangeTransitionState) + delete(rawMsg, key) case "connectorOffer": err = unpopulate(val, "ConnectorOffer", &d.ConnectorOffer) delete(rawMsg, key) @@ -4256,6 +4315,7 @@ func (d DatabaseAccountUpdateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "backupPolicy", d.BackupPolicy) populate(objectMap, "capabilities", d.Capabilities) populate(objectMap, "capacity", d.Capacity) + populate(objectMap, "capacityMode", d.CapacityMode) populate(objectMap, "connectorOffer", d.ConnectorOffer) populate(objectMap, "consistencyPolicy", d.ConsistencyPolicy) populate(objectMap, "cors", d.Cors) @@ -4312,6 +4372,9 @@ func (d *DatabaseAccountUpdateProperties) UnmarshalJSON(data []byte) error { case "capacity": err = unpopulate(val, "Capacity", &d.Capacity) delete(rawMsg, key) + case "capacityMode": + err = unpopulate(val, "CapacityMode", &d.CapacityMode) + delete(rawMsg, key) case "connectorOffer": err = unpopulate(val, "ConnectorOffer", &d.ConnectorOffer) delete(rawMsg, key) @@ -9301,6 +9364,7 @@ func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -9323,6 +9387,9 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &p.Properties) 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) @@ -9630,48 +9697,13 @@ func (p ProxyResource) 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 ProxyResource. func (p *ProxyResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", 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) @@ -9879,48 +9911,13 @@ func (r Resource) 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 Resource. func (r *Resource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - 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 "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 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) diff --git a/sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client.go b/sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client.go index dc87e8b28173..e8798e5c29af 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/mongoclusters_client.go @@ -46,7 +46,7 @@ func NewMongoClustersClient(subscriptionID string, credential azcore.TokenCreden // CheckNameAvailability - Check the availability of name for resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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 @@ -89,7 +89,7 @@ func (client *MongoClustersClient) checkNameAvailabilityCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -111,7 +111,7 @@ func (client *MongoClustersClient) checkNameAvailabilityHandleResponse(resp *htt // some of the properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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. @@ -139,7 +139,7 @@ func (client *MongoClustersClient) BeginCreateOrUpdate(ctx context.Context, reso // of the properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -181,7 +181,7 @@ func (client *MongoClustersClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -193,7 +193,7 @@ func (client *MongoClustersClient) createOrUpdateCreateRequest(ctx context.Conte // 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 2024-02-15-preview +// Generated from API version 2024-05-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. @@ -221,7 +221,7 @@ func (client *MongoClustersClient) BeginCreateOrUpdateFirewallRule(ctx context.C // 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 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -267,7 +267,7 @@ func (client *MongoClustersClient) createOrUpdateFirewallRuleCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -279,7 +279,7 @@ func (client *MongoClustersClient) createOrUpdateFirewallRuleCreateRequest(ctx c // BeginDelete - Deletes a mongo cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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 @@ -305,7 +305,7 @@ func (client *MongoClustersClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes a mongo cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -347,7 +347,7 @@ func (client *MongoClustersClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -356,7 +356,7 @@ func (client *MongoClustersClient) deleteCreateRequest(ctx context.Context, reso // BeginDeleteFirewallRule - Deletes a mongo cluster firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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. @@ -383,7 +383,7 @@ func (client *MongoClustersClient) BeginDeleteFirewallRule(ctx context.Context, // DeleteFirewallRule - Deletes a mongo cluster firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -429,7 +429,7 @@ func (client *MongoClustersClient) deleteFirewallRuleCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -438,7 +438,7 @@ func (client *MongoClustersClient) deleteFirewallRuleCreateRequest(ctx context.C // Get - Gets information about a mongo cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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. @@ -484,7 +484,7 @@ func (client *MongoClustersClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -502,7 +502,7 @@ func (client *MongoClustersClient) getHandleResponse(resp *http.Response) (Mongo // GetFirewallRule - Gets information about a mongo cluster firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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. @@ -554,7 +554,7 @@ func (client *MongoClustersClient) getFirewallRuleCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -571,7 +571,7 @@ func (client *MongoClustersClient) getFirewallRuleHandleResponse(resp *http.Resp // NewListPager - List all the mongo clusters in a given subscription. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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]{ @@ -608,7 +608,7 @@ func (client *MongoClustersClient) listCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -625,7 +625,7 @@ func (client *MongoClustersClient) listHandleResponse(resp *http.Response) (Mong // NewListByResourceGroupPager - List all the mongo clusters in a given resource group. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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. @@ -668,7 +668,7 @@ func (client *MongoClustersClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -687,7 +687,7 @@ func (client *MongoClustersClient) listByResourceGroupHandleResponse(resp *http. // as well as other connection strings supported by the cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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 @@ -734,7 +734,7 @@ func (client *MongoClustersClient) listConnectionStringsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -751,7 +751,7 @@ func (client *MongoClustersClient) listConnectionStringsHandleResponse(resp *htt // NewListFirewallRulesPager - List all the firewall rules in a given mongo cluster. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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 @@ -799,7 +799,7 @@ func (client *MongoClustersClient) listFirewallRulesCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -818,7 +818,7 @@ func (client *MongoClustersClient) listFirewallRulesHandleResponse(resp *http.Re // the normal mongo cluster definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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. @@ -846,7 +846,7 @@ func (client *MongoClustersClient) BeginUpdate(ctx context.Context, resourceGrou // mongo cluster definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -888,7 +888,7 @@ func (client *MongoClustersClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != 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 b5901c517164..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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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 6fdfbfea434b..66ceb4299573 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -775,7 +775,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -851,7 +851,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionThroughputCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -921,7 +921,7 @@ func (client *MongoDBResourcesClient) getMongoDBDatabaseCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -992,7 +992,7 @@ func (client *MongoDBResourcesClient) getMongoDBDatabaseThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1150,7 +1150,7 @@ func (client *MongoDBResourcesClient) getMongoUserDefinitionHandleResponse(resp // BeginListMongoDBCollectionPartitionMerge - Merges the partitions of a MongoDB Collection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1179,7 +1179,7 @@ func (client *MongoDBResourcesClient) BeginListMongoDBCollectionPartitionMerge(c // ListMongoDBCollectionPartitionMerge - Merges the partitions of a MongoDB Collection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *MongoDBResourcesClient) listMongoDBCollectionPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge" @@ -1229,7 +1229,7 @@ func (client *MongoDBResourcesClient) listMongoDBCollectionPartitionMergeCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, mergeParameters); err != nil { @@ -1240,7 +1240,7 @@ func (client *MongoDBResourcesClient) listMongoDBCollectionPartitionMergeCreateR // NewListMongoDBCollectionsPager - Lists the MongoDB collection under an existing Azure Cosmos DB database account. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1294,7 +1294,7 @@ func (client *MongoDBResourcesClient) listMongoDBCollectionsCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1311,7 +1311,7 @@ func (client *MongoDBResourcesClient) listMongoDBCollectionsHandleResponse(resp // NewListMongoDBDatabasesPager - Lists the MongoDB databases under an existing Azure Cosmos DB database account. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 +1360,7 @@ func (client *MongoDBResourcesClient) listMongoDBDatabasesCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1377,7 +1377,7 @@ func (client *MongoDBResourcesClient) listMongoDBDatabasesHandleResponse(resp *h // NewListMongoRoleDefinitionsPager - Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 +1426,7 @@ func (client *MongoDBResourcesClient) listMongoRoleDefinitionsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1443,7 +1443,7 @@ func (client *MongoDBResourcesClient) listMongoRoleDefinitionsHandleResponse(res // NewListMongoUserDefinitionsPager - Retrieves the list of all Azure Cosmos DB Mongo User Definition. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 +1492,7 @@ func (client *MongoDBResourcesClient) listMongoUserDefinitionsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1510,7 +1510,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1537,7 +1537,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +1587,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToAutoscaleCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1597,7 +1597,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToAutoscaleCreateR // throughput // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1624,7 +1624,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +1674,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToManualThroughput return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1683,7 +1683,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1709,7 +1709,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +1755,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToAutoscaleCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1764,7 +1764,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1790,7 +1790,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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,7 +1836,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToManualThroughputCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1845,7 +1845,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToManualThroughputCr // BeginMongoDBContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB container // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1874,7 +1874,7 @@ func (client *MongoDBResourcesClient) BeginMongoDBContainerRedistributeThroughpu // MongoDBContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB container // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *MongoDBResourcesClient) mongoDBContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput" @@ -1924,7 +1924,7 @@ func (client *MongoDBResourcesClient) mongoDBContainerRedistributeThroughputCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, redistributeThroughputParameters); err != nil { @@ -1936,7 +1936,7 @@ func (client *MongoDBResourcesClient) mongoDBContainerRedistributeThroughputCrea // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1966,7 +1966,7 @@ func (client *MongoDBResourcesClient) BeginMongoDBContainerRetrieveThroughputDis // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *MongoDBResourcesClient) mongoDBContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (*http.Response, error) { var err error const operationName = "MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution" @@ -2016,7 +2016,7 @@ func (client *MongoDBResourcesClient) mongoDBContainerRetrieveThroughputDistribu return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, retrieveThroughputParameters); err != nil { @@ -2028,7 +2028,7 @@ func (client *MongoDBResourcesClient) mongoDBContainerRetrieveThroughputDistribu // BeginMongoDBDatabasePartitionMerge - Merges the partitions of a MongoDB database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2056,7 +2056,7 @@ func (client *MongoDBResourcesClient) BeginMongoDBDatabasePartitionMerge(ctx con // MongoDBDatabasePartitionMerge - Merges the partitions of a MongoDB database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -2102,7 +2102,7 @@ func (client *MongoDBResourcesClient) mongoDBDatabasePartitionMergeCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, mergeParameters); err != nil { @@ -2114,7 +2114,7 @@ func (client *MongoDBResourcesClient) mongoDBDatabasePartitionMergeCreateRequest // BeginMongoDBDatabaseRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2142,7 +2142,7 @@ func (client *MongoDBResourcesClient) BeginMongoDBDatabaseRedistributeThroughput // MongoDBDatabaseRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -2188,7 +2188,7 @@ func (client *MongoDBResourcesClient) mongoDBDatabaseRedistributeThroughputCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, redistributeThroughputParameters); err != nil { @@ -2200,7 +2200,7 @@ func (client *MongoDBResourcesClient) mongoDBDatabaseRedistributeThroughputCreat // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2229,7 +2229,7 @@ func (client *MongoDBResourcesClient) BeginMongoDBDatabaseRetrieveThroughputDist // 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 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -2275,7 +2275,7 @@ func (client *MongoDBResourcesClient) mongoDBDatabaseRetrieveThroughputDistribut return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, retrieveThroughputParameters); err != nil { @@ -2287,7 +2287,7 @@ func (client *MongoDBResourcesClient) mongoDBDatabaseRetrieveThroughputDistribut // BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a Mongodb collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2316,7 +2316,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +2366,7 @@ func (client *MongoDBResourcesClient) retrieveContinuousBackupInformationCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, location); err != nil { @@ -2378,7 +2378,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2406,7 +2406,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +2456,7 @@ func (client *MongoDBResourcesClient) updateMongoDBCollectionThroughputCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { @@ -2468,7 +2468,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2495,7 +2495,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +2541,7 @@ func (client *MongoDBResourcesClient) updateMongoDBDatabaseThroughputCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 deleted file mode 100644 index a9b66d08fb9f..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client_example_test.go +++ /dev/null @@ -1,1573 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseList.json -func ExampleMongoDBResourcesClient_NewListMongoDBDatabasesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMongoDBResourcesClient().NewListMongoDBDatabasesPager("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.MongoDBDatabaseListResult = armcosmos.MongoDBDatabaseListResult{ - // Value: []*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("databaseName"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseGet.json -func ExampleMongoDBResourcesClient_GetMongoDBDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoDBResourcesClient().GetMongoDBDatabase(ctx, "rg1", "ddb1", "databaseName", 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.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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // ID: to.Ptr("databaseName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBDatabase_cosmosDbMongoDbDatabaseCreateUpdate() { - 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{ - ID: to.Ptr("databaseName"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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 }()), - RestoreWithTTLDisabled: 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.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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseDelete.json -func ExampleMongoDBResourcesClient_BeginDeleteMongoDBDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginDeleteMongoDBDatabase(ctx, "rg1", "ddb1", "databaseName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json -func ExampleMongoDBResourcesClient_GetMongoDBDatabaseThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoDBResourcesClient().GetMongoDBDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", 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/mongodbDatabases/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json -func ExampleMongoDBResourcesClient_BeginUpdateMongoDBDatabaseThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginUpdateMongoDBDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/mongodbDatabases/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json -func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginMigrateMongoDBDatabaseToAutoscale(ctx, "rg1", "ddb1", "databaseName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json -func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginMigrateMongoDBDatabaseToManualThroughput(ctx, "rg1", "ddb1", "databaseName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionList.json -func ExampleMongoDBResourcesClient_NewListMongoDBCollectionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMongoDBResourcesClient().NewListMongoDBCollectionsPager("rgName", "ddb1", "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.MongoDBCollectionListResult = armcosmos.MongoDBCollectionListResult{ - // Value: []*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("testcoll"), - // Indexes: []*armcosmos.MongoIndex{ - // { - // Key: &armcosmos.MongoIndexKeys{ - // Keys: []*string{ - // to.Ptr("testKey")}, - // }, - // Options: &armcosmos.MongoIndexOptions{ - // ExpireAfterSeconds: to.Ptr[int32](100), - // Unique: to.Ptr(true), - // }, - // }}, - // ShardKey: map[string]*string{ - // "testKey": to.Ptr("Hash"), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionGet.json -func ExampleMongoDBResourcesClient_GetMongoDBCollection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoDBResourcesClient().GetMongoDBCollection(ctx, "rgName", "ddb1", "databaseName", "collectionName", 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.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{ - // 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{ - // { - // Key: &armcosmos.MongoIndexKeys{ - // Keys: []*string{ - // to.Ptr("testKey")}, - // }, - // Options: &armcosmos.MongoIndexOptions{ - // ExpireAfterSeconds: to.Ptr[int32](100), - // Unique: to.Ptr(true), - // }, - // }}, - // ShardKey: map[string]*string{ - // "testKey": to.Ptr("Hash"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBCollection_cosmosDbMongoDbCollectionCreateUpdate() { - 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{ - AnalyticalStorageTTL: to.Ptr[int32](500), - ID: to.Ptr("collectionName"), - Indexes: []*armcosmos.MongoIndex{ - { - Key: &armcosmos.MongoIndexKeys{ - Keys: []*string{ - to.Ptr("_ts")}, - }, - Options: &armcosmos.MongoIndexOptions{ - ExpireAfterSeconds: to.Ptr[int32](100), - Unique: to.Ptr(true), - }, - }, - { - Key: &armcosmos.MongoIndexKeys{ - Keys: []*string{ - to.Ptr("_id")}, - }, - }}, - ShardKey: map[string]*string{ - "testKey": to.Ptr("Hash"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // { - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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 }()), - RestoreWithTTLDisabled: 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.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{ - // { - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionDelete.json -func ExampleMongoDBResourcesClient_BeginDeleteMongoDBCollection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginDeleteMongoDBCollection(ctx, "rg1", "ddb1", "databaseName", "collectionName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json -func ExampleMongoDBResourcesClient_GetMongoDBCollectionThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoDBResourcesClient().GetMongoDBCollectionThroughput(ctx, "rg1", "ddb1", "databaseName", "collectionName", 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/mongodbDatabases/mongodbCollections/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/mongodbCollections/collectionName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json -func ExampleMongoDBResourcesClient_BeginUpdateMongoDBCollectionThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginUpdateMongoDBCollectionThroughput(ctx, "rg1", "ddb1", "databaseName", "collectionName", armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/mongodbDatabases/mongodbCollections/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/mongodbCollections/collectionName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json -func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginMigrateMongoDBCollectionToAutoscale(ctx, "rg1", "ddb1", "databaseName", "collectionName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json -func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginMigrateMongoDBCollectionToManualThroughput(ctx, "rg1", "ddb1", "databaseName", "collectionName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json -func ExampleMongoDBResourcesClient_GetMongoRoleDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoDBResourcesClient().GetMongoRoleDefinition(ctx, "myMongoRoleDefinitionId", "myResourceGroupName", "myAccountName", 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.MongoRoleDefinitionGetResults = armcosmos.MongoRoleDefinitionGetResults{ - // Name: to.Ptr("myMongoRoleDefinitionId"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbRoleDefinitions/myMongoDbRoleDefinitionId"), - // Properties: &armcosmos.MongoRoleDefinitionResource{ - // Type: to.Ptr(armcosmos.MongoRoleDefinitionTypeCustomRole), - // DatabaseName: to.Ptr("sales"), - // Privileges: []*armcosmos.Privilege{ - // { - // Actions: []*string{ - // to.Ptr("find"), - // to.Ptr("insert")}, - // Resource: &armcosmos.PrivilegeResource{ - // Collection: to.Ptr("coll"), - // Db: to.Ptr("sales"), - // }, - // }}, - // RoleName: to.Ptr("myRoleName"), - // Roles: []*armcosmos.Role{ - // { - // Db: to.Ptr("sales"), - // Role: to.Ptr("myReadRole"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoRoleDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginCreateUpdateMongoRoleDefinition(ctx, "myMongoRoleDefinitionId", "myResourceGroupName", "myAccountName", armcosmos.MongoRoleDefinitionCreateUpdateParameters{ - Properties: &armcosmos.MongoRoleDefinitionResource{ - DatabaseName: to.Ptr("sales"), - Privileges: []*armcosmos.Privilege{ - { - Actions: []*string{ - to.Ptr("insert"), - to.Ptr("find")}, - Resource: &armcosmos.PrivilegeResource{ - Collection: to.Ptr("sales"), - Db: to.Ptr("sales"), - }, - }}, - RoleName: to.Ptr("myRoleName"), - Roles: []*armcosmos.Role{ - { - Db: to.Ptr("sales"), - Role: to.Ptr("myInheritedRole"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.MongoRoleDefinitionGetResults = armcosmos.MongoRoleDefinitionGetResults{ - // Name: to.Ptr("myMongoDbRoleDefinitionId"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongoDbRoleDefinitionId"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbRoleDefinitions/myMongoDbRoleDefinitionId"), - // Properties: &armcosmos.MongoRoleDefinitionResource{ - // Type: to.Ptr(armcosmos.MongoRoleDefinitionTypeCustomRole), - // DatabaseName: to.Ptr("sales"), - // Privileges: []*armcosmos.Privilege{ - // { - // Actions: []*string{ - // to.Ptr("find"), - // to.Ptr("insert")}, - // Resource: &armcosmos.PrivilegeResource{ - // Collection: to.Ptr("coll"), - // Db: to.Ptr("sales"), - // }, - // }}, - // RoleName: to.Ptr("myRoleName"), - // Roles: []*armcosmos.Role{ - // { - // Db: to.Ptr("sales"), - // Role: to.Ptr("myReadRole"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json -func ExampleMongoDBResourcesClient_BeginDeleteMongoRoleDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginDeleteMongoRoleDefinition(ctx, "myMongoRoleDefinitionId", "myResourceGroupName", "myAccountName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionList.json -func ExampleMongoDBResourcesClient_NewListMongoRoleDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMongoDBResourcesClient().NewListMongoRoleDefinitionsPager("myResourceGroupName", "myAccountName", 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.MongoRoleDefinitionListResult = armcosmos.MongoRoleDefinitionListResult{ - // Value: []*armcosmos.MongoRoleDefinitionGetResults{ - // { - // Name: to.Ptr("myRoleDefinitionId"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbRoleDefinitions/myRoleDefinitionId"), - // Properties: &armcosmos.MongoRoleDefinitionResource{ - // Type: to.Ptr(armcosmos.MongoRoleDefinitionTypeCustomRole), - // DatabaseName: to.Ptr("sales"), - // Privileges: []*armcosmos.Privilege{ - // { - // Actions: []*string{ - // to.Ptr("find"), - // to.Ptr("insert")}, - // Resource: &armcosmos.PrivilegeResource{ - // Collection: to.Ptr("coll"), - // Db: to.Ptr("sales"), - // }, - // }}, - // RoleName: to.Ptr("myRoleName"), - // Roles: []*armcosmos.Role{ - // { - // Db: to.Ptr("sales"), - // Role: to.Ptr("myReadRole"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json -func ExampleMongoDBResourcesClient_GetMongoUserDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoDBResourcesClient().GetMongoUserDefinition(ctx, "myMongoUserDefinitionId", "myResourceGroupName", "myAccountName", 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.MongoUserDefinitionGetResults = armcosmos.MongoUserDefinitionGetResults{ - // Name: to.Ptr("myUserId"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbUserDefinitions/myUserId"), - // Properties: &armcosmos.MongoUserDefinitionResource{ - // CustomData: to.Ptr("My custom data"), - // DatabaseName: to.Ptr("sales"), - // Mechanisms: to.Ptr("SCRAM-SHA-256"), - // Roles: []*armcosmos.Role{ - // { - // Db: to.Ptr("sales"), - // Role: to.Ptr("myReadRole"), - // }}, - // UserName: to.Ptr("myUserName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoUserDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginCreateUpdateMongoUserDefinition(ctx, "myMongoUserDefinitionId", "myResourceGroupName", "myAccountName", armcosmos.MongoUserDefinitionCreateUpdateParameters{ - Properties: &armcosmos.MongoUserDefinitionResource{ - CustomData: to.Ptr("My custom data"), - DatabaseName: to.Ptr("sales"), - Mechanisms: to.Ptr("SCRAM-SHA-256"), - Password: to.Ptr("myPassword"), - Roles: []*armcosmos.Role{ - { - Db: to.Ptr("sales"), - Role: to.Ptr("myReadRole"), - }}, - UserName: to.Ptr("myUserName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.MongoUserDefinitionGetResults = armcosmos.MongoUserDefinitionGetResults{ - // Name: to.Ptr("myUserName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbUserDefinitions/myUserId"), - // Properties: &armcosmos.MongoUserDefinitionResource{ - // CustomData: to.Ptr("My custom data"), - // DatabaseName: to.Ptr("sales"), - // Mechanisms: to.Ptr("SCRAM-SHA-256"), - // Roles: []*armcosmos.Role{ - // { - // Db: to.Ptr("sales"), - // Role: to.Ptr("myReadRole"), - // }}, - // UserName: to.Ptr("myUserName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json -func ExampleMongoDBResourcesClient_BeginDeleteMongoUserDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginDeleteMongoUserDefinition(ctx, "myMongoUserDefinitionId", "myResourceGroupName", "myAccountName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBUserDefinitionList.json -func ExampleMongoDBResourcesClient_NewListMongoUserDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMongoDBResourcesClient().NewListMongoUserDefinitionsPager("myResourceGroupName", "myAccountName", 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.MongoUserDefinitionListResult = armcosmos.MongoUserDefinitionListResult{ - // Value: []*armcosmos.MongoUserDefinitionGetResults{ - // { - // Name: to.Ptr("myUserId"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbUserDefinitions/myUserId"), - // Properties: &armcosmos.MongoUserDefinitionResource{ - // CustomData: to.Ptr("My custom data"), - // DatabaseName: to.Ptr("sales"), - // Mechanisms: to.Ptr("SCRAM-SHA-256"), - // Roles: []*armcosmos.Role{ - // { - // Db: to.Ptr("sales"), - // Role: to.Ptr("myReadRole"), - // }}, - // UserName: to.Ptr("myUserName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json -func ExampleMongoDBResourcesClient_BeginRetrieveContinuousBackupInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoDBResourcesClient().BeginRetrieveContinuousBackupInformation(ctx, "rgName", "ddb1", "databaseName", "collectionName", armcosmos.ContinuousBackupRestoreLocation{ - Location: to.Ptr("North Europe"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.BackupInformation = armcosmos.BackupInformation{ - // ContinuousBackupInformation: &armcosmos.ContinuousBackupInformation{ - // LatestRestorableTimestamp: to.Ptr("2021-02-05T02:40:50Z"), - // }, - // } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client.go b/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client.go index c7f8693b25ea..58282f8a3127 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client_example_test.go deleted file mode 100644 index 58e563f2b245..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client_example_test.go +++ /dev/null @@ -1,204 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceList.json -func ExampleNotebookWorkspacesClient_NewListByDatabaseAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNotebookWorkspacesClient().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.NotebookWorkspaceListResult = armcosmos.NotebookWorkspaceListResult{ - // Value: []*armcosmos.NotebookWorkspace{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/notebookWorkspaces/default"), - // Properties: &armcosmos.NotebookWorkspaceProperties{ - // NotebookServerEndpoint: to.Ptr("endpoint"), - // Status: to.Ptr("Online"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceGet.json -func ExampleNotebookWorkspacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNotebookWorkspacesClient().Get(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, 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.NotebookWorkspace = armcosmos.NotebookWorkspace{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/notebookWorkspaces/default"), - // Properties: &armcosmos.NotebookWorkspaceProperties{ - // NotebookServerEndpoint: to.Ptr("endpoint"), - // Status: to.Ptr("Online"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceCreate.json -func ExampleNotebookWorkspacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNotebookWorkspacesClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, armcosmos.NotebookWorkspaceCreateUpdateParameters{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.NotebookWorkspace = armcosmos.NotebookWorkspace{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/notebookWorkspaces/default"), - // Properties: &armcosmos.NotebookWorkspaceProperties{ - // NotebookServerEndpoint: to.Ptr("endpoint"), - // Status: to.Ptr("Online"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceDelete.json -func ExampleNotebookWorkspacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNotebookWorkspacesClient().BeginDelete(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json -func ExampleNotebookWorkspacesClient_ListConnectionInfo() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNotebookWorkspacesClient().ListConnectionInfo(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, 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.NotebookWorkspaceConnectionInfoResult = armcosmos.NotebookWorkspaceConnectionInfoResult{ - // AuthToken: to.Ptr("auth-token"), - // NotebookServerEndpoint: to.Ptr("notebook endpoint"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json -func ExampleNotebookWorkspacesClient_BeginRegenerateAuthToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNotebookWorkspacesClient().BeginRegenerateAuthToken(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceStart.json -func ExampleNotebookWorkspacesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNotebookWorkspacesClient().BeginStart(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/operations_client.go b/sdk/resourcemanager/cosmos/armcosmos/operations_client.go index a97d1eab07e5..ea622f62f92e 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/operations_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/operations_client_example_test.go deleted file mode 100644 index babc46658bf5..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/operations_client_example_test.go +++ /dev/null @@ -1,55 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBOperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().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.OperationListResult = armcosmos.OperationListResult{ - // Value: []*armcosmos.Operation{ - // { - // Name: to.Ptr("operationName"), - // Display: &armcosmos.OperationDisplay{ - // Description: to.Ptr("description"), - // Operation: to.Ptr("operationName"), - // Provider: to.Ptr("providerName"), - // Resource: to.Ptr("resourceName"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client.go b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client.go index 3166f46f7b20..b3c5e0104c4d 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseRid - Cosmos DB database rid. @@ -113,7 +113,7 @@ func (client *PartitionKeyRangeIDClient) listMetricsCreateRequest(ctx context.Co } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client_example_test.go deleted file mode 100644 index 17df27168aa0..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client_example_test.go +++ /dev/null @@ -1,83 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json -func ExamplePartitionKeyRangeIDClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPartitionKeyRangeIDClient().NewListMetricsPager("rg1", "ddb1", "databaseRid", "collectionRid", "0", "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", nil) - for pager.More() { - 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.PartitionMetricListResult = armcosmos.PartitionMetricListResult{ - // Value: []*armcosmos.PartitionMetric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Max RUs Per Second"), - // Value: to.Ptr("Max RUs Per Second"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T23:58:55.278Z"); return t}()), - // MetricValues: []*armcosmos.MetricValue{ - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:54:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:55:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:56:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:57:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT1M"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // PartitionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PartitionKeyRangeID: to.Ptr("0"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client.go index 240ccf1725ed..d3956f1ec70c 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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. @@ -118,7 +118,7 @@ func (client *PartitionKeyRangeIDRegionClient) listMetricsCreateRequest(ctx cont } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client_example_test.go deleted file mode 100644 index 23ad1732148b..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client_example_test.go +++ /dev/null @@ -1,83 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json -func ExamplePartitionKeyRangeIDRegionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPartitionKeyRangeIDRegionClient().NewListMetricsPager("rg1", "ddb1", "West US", "databaseRid", "collectionRid", "0", "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", nil) - for pager.More() { - 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.PartitionMetricListResult = armcosmos.PartitionMetricListResult{ - // Value: []*armcosmos.PartitionMetric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Max RUs Per Second"), - // Value: to.Ptr("Max RUs Per Second"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T23:58:55.278Z"); return t}()), - // MetricValues: []*armcosmos.MetricValue{ - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:54:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:55:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:56:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:57:55.278Z"); return t}()), - // }, - // { - // Maximum: to.Ptr[float64](5), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT1M"), - // Unit: to.Ptr(armcosmos.UnitTypeCount), - // PartitionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PartitionKeyRangeID: to.Ptr("0"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentile_client.go b/sdk/resourcemanager/cosmos/armcosmos/percentile_client.go index e0df8410e31a..7792fce9723d 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 @@ -99,7 +99,7 @@ func (client *PercentileClient) listMetricsCreateRequest(ctx context.Context, re } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentile_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/percentile_client_example_test.go deleted file mode 100644 index ae5bebcfe903..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/percentile_client_example_test.go +++ /dev/null @@ -1,88 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPercentileGetMetrics.json -func ExamplePercentileClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPercentileClient().NewListMetricsPager("rg1", "ddb1", "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", nil) - for pager.More() { - 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.PercentileMetricListResult = armcosmos.PercentileMetricListResult{ - // Value: []*armcosmos.PercentileMetric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"), - // Value: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()), - // MetricValues: []*armcosmos.PercentileMetricValue{ - // { - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // P10: to.Ptr[float64](1.11), - // P25: to.Ptr[float64](2.5), - // P50: to.Ptr[float64](4.34), - // P75: to.Ptr[float64](5.2), - // P90: to.Ptr[float64](6.77), - // P95: to.Ptr[float64](7.1), - // P99: to.Ptr[float64](8.3), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT5M"), - // Unit: to.Ptr(armcosmos.UnitTypeMilliseconds), - // }, - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-West US"), - // Value: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-West US"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()), - // MetricValues: []*armcosmos.PercentileMetricValue{ - // { - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // P10: to.Ptr[float64](1.11), - // P25: to.Ptr[float64](2.5), - // P50: to.Ptr[float64](4.34), - // P75: to.Ptr[float64](5.2), - // P90: to.Ptr[float64](6.77), - // P95: to.Ptr[float64](7.1), - // P99: to.Ptr[float64](8.3), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT5M"), - // Unit: to.Ptr(armcosmos.UnitTypeMilliseconds), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client.go b/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client.go index 9975e20b2072..f19ab2f0cb91 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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. @@ -109,7 +109,7 @@ func (client *PercentileSourceTargetClient) listMetricsCreateRequest(ctx context } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client_example_test.go deleted file mode 100644 index 3fc48f540cc9..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client_example_test.go +++ /dev/null @@ -1,67 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json -func ExamplePercentileSourceTargetClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPercentileSourceTargetClient().NewListMetricsPager("rg1", "ddb1", "West Central US", "East US", "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", nil) - for pager.More() { - 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.PercentileMetricListResult = armcosmos.PercentileMetricListResult{ - // Value: []*armcosmos.PercentileMetric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"), - // Value: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()), - // MetricValues: []*armcosmos.PercentileMetricValue{ - // { - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // P10: to.Ptr[float64](1.11), - // P25: to.Ptr[float64](2.5), - // P50: to.Ptr[float64](4.34), - // P75: to.Ptr[float64](5.2), - // P90: to.Ptr[float64](6.77), - // P95: to.Ptr[float64](7.1), - // P99: to.Ptr[float64](8.3), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT5M"), - // Unit: to.Ptr(armcosmos.UnitTypeMilliseconds), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client.go b/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client.go index d68b41a16266..359fe4d23073 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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. @@ -104,7 +104,7 @@ func (client *PercentileTargetClient) listMetricsCreateRequest(ctx context.Conte } reqQP := req.Raw().URL.Query() reqQP.Set("$filter", filter) - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client_example_test.go deleted file mode 100644 index 22016afc0595..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client_example_test.go +++ /dev/null @@ -1,88 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPercentileTargetGetMetrics.json -func ExamplePercentileTargetClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPercentileTargetClient().NewListMetricsPager("rg1", "ddb1", "East US", "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", nil) - for pager.More() { - 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.PercentileMetricListResult = armcosmos.PercentileMetricListResult{ - // Value: []*armcosmos.PercentileMetric{ - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"), - // Value: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()), - // MetricValues: []*armcosmos.PercentileMetricValue{ - // { - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // P10: to.Ptr[float64](1.11), - // P25: to.Ptr[float64](2.5), - // P50: to.Ptr[float64](4.34), - // P75: to.Ptr[float64](5.2), - // P90: to.Ptr[float64](6.77), - // P95: to.Ptr[float64](7.1), - // P99: to.Ptr[float64](8.3), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT5M"), - // Unit: to.Ptr(armcosmos.UnitTypeMilliseconds), - // }, - // { - // Name: &armcosmos.MetricName{ - // LocalizedValue: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-West US"), - // Value: to.Ptr("Probabilistic Bounded Staleness-S-West US-T-East US"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()), - // MetricValues: []*armcosmos.PercentileMetricValue{ - // { - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // P10: to.Ptr[float64](1.11), - // P25: to.Ptr[float64](2.5), - // P50: to.Ptr[float64](4.34), - // P75: to.Ptr[float64](5.2), - // P90: to.Ptr[float64](6.77), - // P95: to.Ptr[float64](7.1), - // P99: to.Ptr[float64](8.3), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()), - // TimeGrain: to.Ptr("PT5M"), - // Unit: to.Ptr(armcosmos.UnitTypeMilliseconds), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client.go b/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client.go index 3d9d75588023..65d09b9fc552 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client_example_test.go deleted file mode 100644 index aba77e879fbb..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,187 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json -func ExamplePrivateEndpointConnectionsClient_NewListByDatabaseAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().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.PrivateEndpointConnectionListResult = armcosmos.PrivateEndpointConnectionListResult{ - // Value: []*armcosmos.PrivateEndpointConnection{ - // { - // Name: to.Ptr("privateEndpointConnectionName"), - // Type: to.Ptr("Microsoft.DocumentDb/databaseAccounts/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateEndpointConnections/privateEndpointConnectionName"), - // Properties: &armcosmos.PrivateEndpointConnectionProperties{ - // GroupID: to.Ptr("Sql"), - // PrivateEndpoint: &armcosmos.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName"), - // }, - // PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }, - // { - // Name: to.Ptr("privateEndpointConnectionName"), - // Type: to.Ptr("Microsoft.DocumentDb/databaseAccounts/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateEndpointConnections/privateEndpointConnectionName2"), - // Properties: &armcosmos.PrivateEndpointConnectionProperties{ - // GroupID: to.Ptr("Sql"), - // PrivateEndpoint: &armcosmos.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName2"), - // }, - // PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "rg1", "ddb1", "privateEndpointConnectionName", 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.PrivateEndpointConnection = armcosmos.PrivateEndpointConnection{ - // Name: to.Ptr("privateEndpointConnectionName"), - // Type: to.Ptr("Microsoft.DocumentDb/databaseAccounts/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateEndpointConnections/privateEndpointConnectionName"), - // Properties: &armcosmos.PrivateEndpointConnectionProperties{ - // GroupID: to.Ptr("Sql"), - // PrivateEndpoint: &armcosmos.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName"), - // }, - // PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", "privateEndpointConnectionName", armcosmos.PrivateEndpointConnection{ - Properties: &armcosmos.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.PrivateEndpointConnection = armcosmos.PrivateEndpointConnection{ - // Name: to.Ptr("privateEndpointConnectionName"), - // Type: to.Ptr("Microsoft.DocumentDb/databaseAccounts/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateEndpointConnections/privateEndpointConnectionName"), - // Properties: &armcosmos.PrivateEndpointConnectionProperties{ - // GroupID: to.Ptr("Sql"), - // PrivateEndpoint: &armcosmos.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName"), - // }, - // PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "rg1", "ddb1", "privateEndpointConnectionName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client.go index 9c9ac4032b77..c982fdf78a9f 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client_example_test.go deleted file mode 100644 index d2cf5963bfe1..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,92 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateLinkResourceListGet.json -func ExamplePrivateLinkResourcesClient_NewListByDatabaseAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().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.PrivateLinkResourceListResult = armcosmos.PrivateLinkResourceListResult{ - // Value: []*armcosmos.PrivateLinkResource{ - // { - // Name: to.Ptr("sql"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateLinkResources/sql"), - // Properties: &armcosmos.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("sql"), - // RequiredMembers: []*string{ - // to.Ptr("ddb1"), - // to.Ptr("ddb1-westus")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.documents.azure.net")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateLinkResourceGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "rg1", "ddb1", "sql", 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.PrivateLinkResource = armcosmos.PrivateLinkResource{ - // Name: to.Ptr("sql"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateLinkResources/sql"), - // Properties: &armcosmos.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("sql"), - // RequiredMembers: []*string{ - // to.Ptr("ddb1"), - // to.Ptr("ddb1-westus")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.documents.azure.net")}, - // }, - // } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client.go index af970bed3b67..99468e90b3e2 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client_example_test.go deleted file mode 100644 index b159c4bbcf3f..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client_example_test.go +++ /dev/null @@ -1,217 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableDatabaseAccountList.json -func ExampleRestorableDatabaseAccountsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableDatabaseAccountsClient().NewListByLocationPager("West US", 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.RestorableDatabaseAccountsListResult = armcosmos.RestorableDatabaseAccountsListResult{ - // Value: []*armcosmos.RestorableDatabaseAccountGetResult{ - // { - // Name: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/West US/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d"), - // Location: to.Ptr("West US"), - // Properties: &armcosmos.RestorableDatabaseAccountProperties{ - // AccountName: to.Ptr("ddb1"), - // 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}()), - // RestorableLocations: []*armcosmos.RestorableLocationResource{ - // { - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), - // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:35.000Z"); return t}()), - // LocationName: to.Ptr("South Central US"), - // RegionalDatabaseAccountInstanceID: to.Ptr("d7a01f78-606f-45c6-9dac-0df32f433bb5"), - // }, - // { - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), - // LocationName: to.Ptr("West US"), - // RegionalDatabaseAccountInstanceID: to.Ptr("fdb43d84-1572-4697-b6e7-2bcda0c51b2c"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("4f9e6ace-ac7a-446c-98bc-194c502a06b4"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/West US/restorableDatabaseAccounts/4f9e6ace-ac7a-446c-98bc-194c502a06b4"), - // Location: to.Ptr("West US"), - // Properties: &armcosmos.RestorableDatabaseAccountProperties{ - // 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}()), - // RestorableLocations: []*armcosmos.RestorableLocationResource{ - // { - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), - // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:35.000Z"); return t}()), - // LocationName: to.Ptr("South Central US"), - // RegionalDatabaseAccountInstanceID: to.Ptr("d7a01f78-606f-45c6-9dac-0df32f433bb5"), - // }, - // { - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), - // LocationName: to.Ptr("West US"), - // RegionalDatabaseAccountInstanceID: to.Ptr("fdb43d84-1572-4697-b6e7-2bcda0c51b2c"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json -func ExampleRestorableDatabaseAccountsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableDatabaseAccountsClient().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.RestorableDatabaseAccountsListResult = armcosmos.RestorableDatabaseAccountsListResult{ - // Value: []*armcosmos.RestorableDatabaseAccountGetResult{ - // { - // Name: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/West US/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d"), - // Location: to.Ptr("West US"), - // Properties: &armcosmos.RestorableDatabaseAccountProperties{ - // AccountName: to.Ptr("ddb1"), - // 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}()), - // RestorableLocations: []*armcosmos.RestorableLocationResource{ - // { - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), - // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:35.000Z"); return t}()), - // LocationName: to.Ptr("South Central US"), - // RegionalDatabaseAccountInstanceID: to.Ptr("d7a01f78-606f-45c6-9dac-0df32f433bb5"), - // }, - // { - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), - // LocationName: to.Ptr("West US"), - // RegionalDatabaseAccountInstanceID: to.Ptr("fdb43d84-1572-4697-b6e7-2bcda0c51b2c"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("4f9e6ace-ac7a-446c-98bc-194c502a06b4"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/West US/restorableDatabaseAccounts/4f9e6ace-ac7a-446c-98bc-194c502a06b4"), - // Location: to.Ptr("East US"), - // Properties: &armcosmos.RestorableDatabaseAccountProperties{ - // 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}()), - // RestorableLocations: []*armcosmos.RestorableLocationResource{ - // { - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), - // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:35.000Z"); return t}()), - // LocationName: to.Ptr("South Central US"), - // RegionalDatabaseAccountInstanceID: to.Ptr("d7a01f78-606f-45c6-9dac-0df32f433bb5"), - // }, - // { - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), - // LocationName: to.Ptr("West US"), - // RegionalDatabaseAccountInstanceID: to.Ptr("fdb43d84-1572-4697-b6e7-2bcda0c51b2c"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json -func ExampleRestorableDatabaseAccountsClient_GetByLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorableDatabaseAccountsClient().GetByLocation(ctx, "West US", "d9b26648-2f53-4541-b3d8-3044f4f9810d", 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.RestorableDatabaseAccountGetResult = armcosmos.RestorableDatabaseAccountGetResult{ - // Name: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/West US/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d"), - // Location: to.Ptr("West US"), - // Properties: &armcosmos.RestorableDatabaseAccountProperties{ - // AccountName: to.Ptr("ddb1"), - // 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}()), - // RestorableLocations: []*armcosmos.RestorableLocationResource{ - // { - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), - // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:35.000Z"); return t}()), - // LocationName: to.Ptr("South Central US"), - // RegionalDatabaseAccountInstanceID: to.Ptr("d7a01f78-606f-45c6-9dac-0df32f433bb5"), - // }, - // { - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()), - // LocationName: to.Ptr("West US"), - // RegionalDatabaseAccountInstanceID: to.Ptr("fdb43d84-1572-4697-b6e7-2bcda0c51b2c"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client.go index 38c695cdac5a..1ed287c86bec 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - RestorableGremlinDatabasesClientListOptions contains the optional parameters for the RestorableGremlinDatabasesClient.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableGremlinDatabasesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 deleted file mode 100644 index 3ffa1b545f1f..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client_example_test.go +++ /dev/null @@ -1,77 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableGremlinDatabaseList.json -func ExampleRestorableGremlinDatabasesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableGremlinDatabasesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", 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.RestorableGremlinDatabasesListResult = armcosmos.RestorableGremlinDatabasesListResult{ - // Value: []*armcosmos.RestorableGremlinDatabaseGetResult{ - // { - // Name: to.Ptr("59c21367-b98b-4a8e-abb7-b6f46600decc"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinDatabases"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/36f09704-6be3-4f33-aa05-17b73e504c75/restorableGremlinDatabases/59c21367-b98b-4a8e-abb7-b6f46600decc"), - // 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"), - // OwnerResourceID: to.Ptr("PD5DALigDgw="), - // }, - // }, - // }, - // { - // Name: to.Ptr("8456cb17-cdb0-4c6a-8db8-d0ff3f886257"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinDatabases"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinDatabases/8456cb17-cdb0-4c6a-8db8-d0ff3f886257"), - // 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"), - // OwnerResourceID: to.Ptr("PD5DALigDgw="), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client.go index 8c2a710bd60f..3349830ddd3a 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - RestorableGremlinGraphsClientListOptions contains the optional parameters for the RestorableGremlinGraphsClient.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableGremlinGraphsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") if options != nil && options.EndTime != nil { reqQP.Set("endTime", *options.EndTime) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client_example_test.go deleted file mode 100644 index 5f0baa967512..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client_example_test.go +++ /dev/null @@ -1,81 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableGremlinGraphList.json -func ExampleRestorableGremlinGraphsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableGremlinGraphsClient().NewListPager("WestUS", "98a570f2-63db-4117-91f0-366327b7b353", &armcosmos.RestorableGremlinGraphsClientListOptions{RestorableGremlinDatabaseRid: to.Ptr("PD5DALigDgw="), - StartTime: nil, - EndTime: 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.RestorableGremlinGraphsListResult = armcosmos.RestorableGremlinGraphsListResult{ - // Value: []*armcosmos.RestorableGremlinGraphGetResult{ - // { - // 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("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 9c67bde3f414..fff462b0c98d 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - RestorableGremlinResourcesClientListOptions contains the optional parameters for the RestorableGremlinResourcesClient.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableGremlinResourcesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 deleted file mode 100644 index c7f2d808d555..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client_example_test.go +++ /dev/null @@ -1,74 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableGremlinResourceList.json -func ExampleRestorableGremlinResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableGremlinResourcesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", &armcosmos.RestorableGremlinResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"), - RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"), - }) - 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.RestorableGremlinResourcesListResult = armcosmos.RestorableGremlinResourcesListResult{ - // Value: []*armcosmos.RestorableGremlinResourcesGetResult{ - // { - // Name: to.Ptr("Database1"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinResources"), - // DatabaseName: to.Ptr("Database1"), - // GraphNames: []*string{ - // to.Ptr("Graph1")}, - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinResources/Database1"), - // }, - // { - // Name: to.Ptr("Database2"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinResources"), - // DatabaseName: to.Ptr("Database2"), - // GraphNames: []*string{ - // to.Ptr("Graph1"), - // to.Ptr("Graph2")}, - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinResources/Database2"), - // }, - // { - // Name: to.Ptr("Database3"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinResources"), - // DatabaseName: to.Ptr("Database3"), - // GraphNames: []*string{ - // }, - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinResources/Database3"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client.go index c75f5671f35d..83a93bb6da55 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") if options != nil && options.EndTime != nil { reqQP.Set("endTime", *options.EndTime) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client_example_test.go deleted file mode 100644 index cc7e5c04095f..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client_example_test.go +++ /dev/null @@ -1,81 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableMongodbCollectionList.json -func ExampleRestorableMongodbCollectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableMongodbCollectionsClient().NewListPager("WestUS", "98a570f2-63db-4117-91f0-366327b7b353", &armcosmos.RestorableMongodbCollectionsClientListOptions{RestorableMongodbDatabaseRid: to.Ptr("PD5DALigDgw="), - StartTime: nil, - EndTime: 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.RestorableMongodbCollectionsListResult = armcosmos.RestorableMongodbCollectionsListResult{ - // Value: []*armcosmos.RestorableMongodbCollectionGetResult{ - // { - // 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("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 39e8875cbe34..c7ecdf5ae1ad 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client_example_test.go deleted file mode 100644 index e37c021ace38..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client_example_test.go +++ /dev/null @@ -1,77 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableMongodbDatabaseList.json -func ExampleRestorableMongodbDatabasesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableMongodbDatabasesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", 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.RestorableMongodbDatabasesListResult = armcosmos.RestorableMongodbDatabasesListResult{ - // Value: []*armcosmos.RestorableMongodbDatabaseGetResult{ - // { - // Name: to.Ptr("59c21367-b98b-4a8e-abb7-b6f46600decc"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbDatabases"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/36f09704-6be3-4f33-aa05-17b73e504c75/restorableMongodbDatabases/59c21367-b98b-4a8e-abb7-b6f46600decc"), - // 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"), - // OwnerResourceID: to.Ptr("PD5DALigDgw="), - // }, - // }, - // }, - // { - // Name: to.Ptr("8456cb17-cdb0-4c6a-8db8-d0ff3f886257"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbDatabases"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableMongodbDatabases/8456cb17-cdb0-4c6a-8db8-d0ff3f886257"), - // 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"), - // OwnerResourceID: to.Ptr("PD5DALigDgw="), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client.go index bfb46913e5ed..f17de3f8489a 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") if options != nil && options.RestoreLocation != nil { reqQP.Set("restoreLocation", *options.RestoreLocation) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client_example_test.go deleted file mode 100644 index 0abf4b78aab6..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client_example_test.go +++ /dev/null @@ -1,74 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableMongodbResourceList.json -func ExampleRestorableMongodbResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableMongodbResourcesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", &armcosmos.RestorableMongodbResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"), - RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"), - }) - 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.RestorableMongodbResourcesListResult = armcosmos.RestorableMongodbResourcesListResult{ - // Value: []*armcosmos.RestorableMongodbResourcesGetResult{ - // { - // Name: to.Ptr("Database1"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablemongodbresources"), - // CollectionNames: []*string{ - // to.Ptr("Collection1")}, - // DatabaseName: to.Ptr("Database1"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablemongodbresources/Database1"), - // }, - // { - // Name: to.Ptr("Database2"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablemongodbresources"), - // CollectionNames: []*string{ - // to.Ptr("Collection1"), - // to.Ptr("Collection2")}, - // DatabaseName: to.Ptr("Database2"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablemongodbresources/Database2"), - // }, - // { - // Name: to.Ptr("Database3"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablemongodbresources"), - // CollectionNames: []*string{ - // }, - // DatabaseName: to.Ptr("Database3"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablemongodbresources/Database3"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client.go index 3be6a5f372d3..c74c0dd19251 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") if options != nil && options.EndTime != nil { reqQP.Set("endTime", *options.EndTime) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client_example_test.go deleted file mode 100644 index 314990dcc3fe..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client_example_test.go +++ /dev/null @@ -1,133 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableSqlContainerList.json -func ExampleRestorableSQLContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableSQLContainersClient().NewListPager("WestUS", "98a570f2-63db-4117-91f0-366327b7b353", &armcosmos.RestorableSQLContainersClientListOptions{RestorableSQLDatabaseRid: to.Ptr("3fu-hg=="), - StartTime: nil, - EndTime: 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.RestorableSQLContainersListResult = armcosmos.RestorableSQLContainersListResult{ - // Value: []*armcosmos.RestorableSQLContainerGetResult{ - // { - // Name: to.Ptr("79609a98-3394-41f8-911f-cfab0c075c86"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlContainers"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableSqlContainers/79609a98-3394-41f8-911f-cfab0c075c86"), - // 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="), - // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ - // ConflictResolutionPath: to.Ptr("/_ts"), - // ConflictResolutionProcedure: to.Ptr(""), - // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), - // }, - // ID: to.Ptr("Container1"), - // IndexingPolicy: &armcosmos.IndexingPolicy{ - // Automatic: to.Ptr(true), - // ExcludedPaths: []*armcosmos.ExcludedPath{ - // { - // Path: to.Ptr("/\"_etag\"/?"), - // }}, - // IncludedPaths: []*armcosmos.IncludedPath{ - // { - // Path: to.Ptr("/*"), - // }, - // { - // Path: to.Ptr("/\"_ts\"/?"), - // }}, - // IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent), - // }, - // Self: to.Ptr("dbs/V18LoA==/colls/V18LoLrv-qA=/"), - // }, - // EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"), - // OperationType: to.Ptr(armcosmos.OperationTypeCreate), - // OwnerID: to.Ptr("Container1"), - // OwnerResourceID: to.Ptr("V18LoLrv-qA="), - // }, - // }, - // }, - // { - // Name: to.Ptr("e85298a1-c631-4726-825e-a7ca092e9098"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlContainers"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableSqlContainers/e85298a1-c631-4726-825e-a7ca092e9098"), - // 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="), - // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ - // ConflictResolutionPath: to.Ptr("/_ts"), - // ConflictResolutionProcedure: to.Ptr(""), - // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), - // }, - // DefaultTTL: to.Ptr[int32](12345), - // ID: to.Ptr("Container1"), - // IndexingPolicy: &armcosmos.IndexingPolicy{ - // Automatic: to.Ptr(true), - // ExcludedPaths: []*armcosmos.ExcludedPath{ - // { - // Path: to.Ptr("/\"_etag\"/?"), - // }}, - // IncludedPaths: []*armcosmos.IncludedPath{ - // { - // Path: to.Ptr("/*"), - // }, - // { - // Path: to.Ptr("/\"_ts\"/?"), - // }}, - // IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent), - // }, - // Self: to.Ptr("dbs/V18LoA==/colls/V18LoLrv-qA=/"), - // }, - // EventTimestamp: to.Ptr("2020-10-13T05:03:27Z"), - // OperationType: to.Ptr(armcosmos.OperationTypeReplace), - // OwnerID: to.Ptr("Container1"), - // OwnerResourceID: to.Ptr("V18LoLrv-qA="), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client.go index 940d8537ac70..6ef31d3073c9 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client_example_test.go deleted file mode 100644 index 9f3f52bd015a..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client_example_test.go +++ /dev/null @@ -1,117 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableSqlDatabaseList.json -func ExampleRestorableSQLDatabasesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableSQLDatabasesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", 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.RestorableSQLDatabasesListResult = armcosmos.RestorableSQLDatabasesListResult{ - // Value: []*armcosmos.RestorableSQLDatabaseGetResult{ - // { - // Name: to.Ptr("59c21367-b98b-4a8e-abb7-b6f46600decc"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlDatabases"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/36f09704-6be3-4f33-aa05-17b73e504c75/restorableSqlDatabases/59c21367-b98b-4a8e-abb7-b6f46600decc"), - // 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=="), - // ID: to.Ptr("Database1"), - // Colls: to.Ptr("colls/"), - // Self: to.Ptr("dbs/3fu-hg==/"), - // Users: to.Ptr("users/"), - // }, - // EventTimestamp: to.Ptr("2020-09-02T19:45:03Z"), - // OperationType: to.Ptr(armcosmos.OperationTypeCreate), - // OwnerID: to.Ptr("Database1"), - // OwnerResourceID: to.Ptr("3fu-hg=="), - // }, - // }, - // }, - // { - // Name: to.Ptr("8456cb17-cdb0-4c6a-8db8-d0ff3f886257"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlDatabases"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableSqlDatabases/8456cb17-cdb0-4c6a-8db8-d0ff3f886257"), - // 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=="), - // Ts: to.Ptr[float32](1599075903), - // ID: to.Ptr("Database1"), - // Colls: to.Ptr("colls/"), - // Self: to.Ptr("dbs/3fu-hg==/"), - // Users: to.Ptr("users/"), - // }, - // EventTimestamp: to.Ptr("2020-09-02T19:53:42Z"), - // OperationType: to.Ptr(armcosmos.OperationTypeDelete), - // OwnerID: to.Ptr("Database1"), - // OwnerResourceID: to.Ptr("3fu-hg=="), - // }, - // }, - // }, - // { - // Name: to.Ptr("2c07991b-9c7c-4e85-be68-b18c1f2ff326"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlDatabases"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableSqlDatabases/2c07991b-9c7c-4e85-be68-b18c1f2ff326"), - // 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=="), - // ID: to.Ptr("Database2"), - // Colls: to.Ptr("colls/"), - // Self: to.Ptr("dbs/0SziSg==/"), - // Users: to.Ptr("users/"), - // }, - // EventTimestamp: to.Ptr("2020-09-02T19:53:15Z"), - // OperationType: to.Ptr(armcosmos.OperationTypeCreate), - // OwnerID: to.Ptr("Database2"), - // OwnerResourceID: to.Ptr("0SziSg=="), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client.go index b8b8e5fd849e..accd889ac64c 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") if options != nil && options.RestoreLocation != nil { reqQP.Set("restoreLocation", *options.RestoreLocation) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client_example_test.go deleted file mode 100644 index 7650647b6fe2..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client_example_test.go +++ /dev/null @@ -1,74 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableSqlResourceList.json -func ExampleRestorableSQLResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableSQLResourcesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", &armcosmos.RestorableSQLResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"), - RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"), - }) - 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.RestorableSQLResourcesListResult = armcosmos.RestorableSQLResourcesListResult{ - // Value: []*armcosmos.RestorableSQLResourcesGetResult{ - // { - // Name: to.Ptr("Database1"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablesqlresources"), - // CollectionNames: []*string{ - // to.Ptr("Container1")}, - // DatabaseName: to.Ptr("Database1"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablesqlresources/Database1"), - // }, - // { - // Name: to.Ptr("Database2"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablesqlresources"), - // CollectionNames: []*string{ - // to.Ptr("Container1"), - // to.Ptr("Container2")}, - // DatabaseName: to.Ptr("Database2"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablesqlresources/Database2"), - // }, - // { - // Name: to.Ptr("Database3"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablesqlresources"), - // CollectionNames: []*string{ - // }, - // DatabaseName: to.Ptr("Database3"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablesqlresources/Database3"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client.go index b871d02d6e61..71412431c3c0 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - RestorableTableResourcesClientListOptions contains the optional parameters for the RestorableTableResourcesClient.NewListPager @@ -96,7 +96,7 @@ func (client *RestorableTableResourcesClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 deleted file mode 100644 index f3192b7ee38a..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client_example_test.go +++ /dev/null @@ -1,59 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableTableResourceList.json -func ExampleRestorableTableResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableTableResourcesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", &armcosmos.RestorableTableResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"), - RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"), - }) - 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.RestorableTableResourcesListResult = armcosmos.RestorableTableResourcesListResult{ - // Value: []*armcosmos.RestorableTableResourcesGetResult{ - // { - // Name: to.Ptr("table1"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablesqlresources"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorabletableresources/table1"), - // }, - // { - // Name: to.Ptr("table2"), - // Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablesqlresources"), - // ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorabletableresources/table2"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client.go index 3a0c724d35e4..8884a7e3e7ea 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - location - Cosmos DB region, with spaces between words and each word capitalized. // - instanceID - The instanceId GUID of a restorable database account. // - options - RestorableTablesClientListOptions contains the optional parameters for the RestorableTablesClient.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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") if options != nil && options.EndTime != nil { reqQP.Set("endTime", *options.EndTime) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client_example_test.go deleted file mode 100644 index 2890dcdb9198..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client_example_test.go +++ /dev/null @@ -1,79 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableTableList.json -func ExampleRestorableTablesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableTablesClient().NewListPager("WestUS", "98a570f2-63db-4117-91f0-366327b7b353", &armcosmos.RestorableTablesClientListOptions{StartTime: nil, - EndTime: 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.RestorableTablesListResult = armcosmos.RestorableTablesListResult{ - // Value: []*armcosmos.RestorableTableGetResult{ - // { - // 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("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 dc1d47cece21..3a26b60c3b94 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/service_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/service_client_example_test.go deleted file mode 100644 index f2c7a30035b1..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/service_client_example_test.go +++ /dev/null @@ -1,503 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBServicesList.json -func ExampleServiceClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceClient().NewListPager("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.ServiceResourceListResult = armcosmos.ServiceResourceListResult{ - // Value: []*armcosmos.ServiceResource{ - // { - // Name: to.Ptr("sqlDedicatedGateway"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/sqlDedicatedGateway"), - // Properties: &armcosmos.SQLDedicatedGatewayServiceResourceProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()), - // InstanceCount: to.Ptr[int32](1), - // InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - // ServiceType: to.Ptr(armcosmos.ServiceTypeSQLDedicatedGateway), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // Locations: []*armcosmos.SQLDedicatedGatewayRegionalServiceResource{ - // { - // Name: to.Ptr("sqlDedicatedGateway-westus2"), - // Location: to.Ptr("West US 2"), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"), - // }}, - // SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDataTransferServiceCreate.json -func ExampleServiceClient_BeginCreate_dataTransferServiceCreate() { - 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.NewServiceClient().BeginCreate(ctx, "rg1", "ddb1", "DataTransfer", armcosmos.ServiceResourceCreateUpdateParameters{ - Properties: &armcosmos.ServiceResourceCreateUpdateProperties{ - InstanceCount: to.Ptr[int32](1), - InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - ServiceType: to.Ptr(armcosmos.ServiceTypeDataTransfer), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.ServiceResource = armcosmos.ServiceResource{ - // Name: to.Ptr("DataTransfer"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/DataTransfer"), - // Properties: &armcosmos.DataTransferServiceResourceProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()), - // InstanceCount: to.Ptr[int32](1), - // InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - // ServiceType: to.Ptr(armcosmos.ServiceTypeDataTransfer), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // Locations: []*armcosmos.DataTransferRegionalServiceResource{ - // { - // Name: to.Ptr("DataTransfer-westus2"), - // Location: to.Ptr("West US 2"), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json -func ExampleServiceClient_BeginCreate_graphApiComputeServiceCreate() { - 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.NewServiceClient().BeginCreate(ctx, "rg1", "ddb1", "GraphAPICompute", armcosmos.ServiceResourceCreateUpdateParameters{ - Properties: &armcosmos.ServiceResourceCreateUpdateProperties{ - InstanceCount: to.Ptr[int32](1), - InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - ServiceType: to.Ptr(armcosmos.ServiceTypeGraphAPICompute), - }, - }, 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.ServiceResource = armcosmos.ServiceResource{ - // Name: to.Ptr("GraphAPICompute"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/GraphAPICompute"), - // Properties: &armcosmos.GraphAPIComputeServiceResourceProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()), - // InstanceCount: to.Ptr[int32](1), - // InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - // ServiceType: to.Ptr(armcosmos.ServiceTypeGraphAPICompute), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // GraphAPIComputeEndpoint: to.Ptr("https://graphAPICompute.gremlin.cosmos.windows-int.net/"), - // Locations: []*armcosmos.GraphAPIComputeRegionalServiceResource{ - // { - // Name: to.Ptr("GraphAPICompute-westus2"), - // Location: to.Ptr("West US 2"), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // GraphAPIComputeEndpoint: to.Ptr("https://graphAPICompute-westus.gremlin.cosmos.windows-int.net/"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json -func ExampleServiceClient_BeginCreate_materializedViewsBuilderServiceCreate() { - 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.NewServiceClient().BeginCreate(ctx, "rg1", "ddb1", "MaterializedViewsBuilder", armcosmos.ServiceResourceCreateUpdateParameters{ - Properties: &armcosmos.ServiceResourceCreateUpdateProperties{ - InstanceCount: to.Ptr[int32](1), - InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - ServiceType: to.Ptr(armcosmos.ServiceTypeMaterializedViewsBuilder), - }, - }, 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.ServiceResource = armcosmos.ServiceResource{ - // Name: to.Ptr("MaterializedViewsBuilder"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/MaterializedViewsBuilder"), - // Properties: &armcosmos.MaterializedViewsBuilderServiceResourceProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()), - // InstanceCount: to.Ptr[int32](1), - // InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - // ServiceType: to.Ptr(armcosmos.ServiceTypeMaterializedViewsBuilder), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // Locations: []*armcosmos.MaterializedViewsBuilderRegionalServiceResource{ - // { - // Name: to.Ptr("MaterializedViewsBuilder-westus2"), - // Location: to.Ptr("West US 2"), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceCreate.json -func ExampleServiceClient_BeginCreate_sqlDedicatedGatewayServiceCreate() { - 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.NewServiceClient().BeginCreate(ctx, "rg1", "ddb1", "SqlDedicatedGateway", armcosmos.ServiceResourceCreateUpdateParameters{ - Properties: &armcosmos.ServiceResourceCreateUpdateProperties{ - InstanceCount: to.Ptr[int32](1), - InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - ServiceType: to.Ptr(armcosmos.ServiceTypeSQLDedicatedGateway), - }, - }, 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.ServiceResource = armcosmos.ServiceResource{ - // Name: to.Ptr("SqlDedicatedGateway"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/SqlDedicatedGateway"), - // Properties: &armcosmos.SQLDedicatedGatewayServiceResourceProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()), - // InstanceCount: to.Ptr[int32](1), - // InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - // ServiceType: to.Ptr(armcosmos.ServiceTypeSQLDedicatedGateway), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // Locations: []*armcosmos.SQLDedicatedGatewayRegionalServiceResource{ - // { - // Name: to.Ptr("SqlDedicatedGateway-westus2"), - // Location: to.Ptr("West US 2"), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"), - // }}, - // SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDataTransferServiceGet.json -func ExampleServiceClient_Get_dataTransferServiceGet() { - 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.NewServiceClient().Get(ctx, "rg1", "ddb1", "DataTransfer", 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.ServiceResource = armcosmos.ServiceResource{ - // Name: to.Ptr("DataTransfer"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/DataTransfer"), - // Properties: &armcosmos.DataTransferServiceResourceProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()), - // InstanceCount: to.Ptr[int32](1), - // InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - // ServiceType: to.Ptr(armcosmos.ServiceTypeDataTransfer), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // Locations: []*armcosmos.DataTransferRegionalServiceResource{ - // { - // Name: to.Ptr("DataTransfer-westus2"), - // Location: to.Ptr("West US 2"), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json -func ExampleServiceClient_Get_graphApiComputeServiceGet() { - 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.NewServiceClient().Get(ctx, "rg1", "ddb1", "GraphAPICompute", 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.ServiceResource = armcosmos.ServiceResource{ - // Name: to.Ptr("GraphAPICompute"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/GraphAPICompute"), - // Properties: &armcosmos.GraphAPIComputeServiceResourceProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()), - // InstanceCount: to.Ptr[int32](1), - // InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - // ServiceType: to.Ptr(armcosmos.ServiceTypeGraphAPICompute), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // GraphAPIComputeEndpoint: to.Ptr("https://graphAPICompute.gremlin.cosmos.windows-int.net/"), - // Locations: []*armcosmos.GraphAPIComputeRegionalServiceResource{ - // { - // Name: to.Ptr("GraphAPICompute-westus2"), - // Location: to.Ptr("West US 2"), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // GraphAPIComputeEndpoint: to.Ptr("https://graphAPICompute-westus.gremlin.cosmos.windows-int.net/"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json -func ExampleServiceClient_Get_materializedViewsBuilderServiceGet() { - 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.NewServiceClient().Get(ctx, "rg1", "ddb1", "MaterializedViewsBuilder", 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.ServiceResource = armcosmos.ServiceResource{ - // Name: to.Ptr("MaterializedViewsBuilder"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/MaterializedViewsBuilder"), - // Properties: &armcosmos.MaterializedViewsBuilderServiceResourceProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()), - // InstanceCount: to.Ptr[int32](1), - // InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - // ServiceType: to.Ptr(armcosmos.ServiceTypeMaterializedViewsBuilder), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // Locations: []*armcosmos.MaterializedViewsBuilderRegionalServiceResource{ - // { - // Name: to.Ptr("MaterializedViewsBuilder-westus2"), - // Location: to.Ptr("West US 2"), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceGet.json -func ExampleServiceClient_Get_sqlDedicatedGatewayServiceGet() { - 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.NewServiceClient().Get(ctx, "rg1", "ddb1", "SqlDedicatedGateway", 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.ServiceResource = armcosmos.ServiceResource{ - // Name: to.Ptr("SqlDedicatedGateway"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/SqlDedicatedGateway"), - // Properties: &armcosmos.SQLDedicatedGatewayServiceResourceProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()), - // InstanceCount: to.Ptr[int32](1), - // InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - // ServiceType: to.Ptr(armcosmos.ServiceTypeSQLDedicatedGateway), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // Locations: []*armcosmos.SQLDedicatedGatewayRegionalServiceResource{ - // { - // Name: to.Ptr("SqlDedicatedGateway-westus2"), - // Location: to.Ptr("West US 2"), - // Status: to.Ptr(armcosmos.ServiceStatusRunning), - // SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"), - // }}, - // SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDataTransferServiceDelete.json -func ExampleServiceClient_BeginDelete_dataTransferServiceDelete() { - 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.NewServiceClient().BeginDelete(ctx, "rg1", "ddb1", "DataTransfer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json -func ExampleServiceClient_BeginDelete_graphApiComputeServiceDelete() { - 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.NewServiceClient().BeginDelete(ctx, "rg1", "ddb1", "GraphAPICompute", 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json -func ExampleServiceClient_BeginDelete_materializedViewsBuilderServiceDelete() { - 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.NewServiceClient().BeginDelete(ctx, "rg1", "ddb1", "MaterializedViewsBuilder", 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceDelete.json -func ExampleServiceClient_BeginDelete_sqlDedicatedGatewayServiceDelete() { - 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.NewServiceClient().BeginDelete(ctx, "rg1", "ddb1", "SqlDedicatedGateway", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client.go index c7a6ed018bcb..3ad66357ba37 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *SQLResourcesClient) createUpdateClientEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, createUpdateClientEncryptionKeyParameters ClientEncryptionKeyCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions) (*http.Response, error) { 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1422,7 +1422,7 @@ func (client *SQLResourcesClient) getClientEncryptionKeyCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1497,7 +1497,7 @@ func (client *SQLResourcesClient) getSQLContainerCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1572,7 +1572,7 @@ func (client *SQLResourcesClient) getSQLContainerThroughputCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1642,7 +1642,7 @@ func (client *SQLResourcesClient) getSQLDatabaseCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1713,7 +1713,7 @@ func (client *SQLResourcesClient) getSQLDatabaseThroughputCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -1933,7 +1933,7 @@ func (client *SQLResourcesClient) getSQLStoredProcedureCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2013,7 +2013,7 @@ func (client *SQLResourcesClient) getSQLTriggerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2093,7 +2093,7 @@ func (client *SQLResourcesClient) getSQLUserDefinedFunctionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2164,7 +2164,7 @@ func (client *SQLResourcesClient) listClientEncryptionKeysCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2182,7 +2182,7 @@ func (client *SQLResourcesClient) listClientEncryptionKeysHandleResponse(resp *h // BeginListSQLContainerPartitionMerge - Merges the partitions of a SQL Container // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2211,7 +2211,7 @@ func (client *SQLResourcesClient) BeginListSQLContainerPartitionMerge(ctx contex // ListSQLContainerPartitionMerge - Merges the partitions of a SQL Container // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *SQLResourcesClient) listSQLContainerPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginListSQLContainerPartitionMerge" @@ -2261,7 +2261,7 @@ func (client *SQLResourcesClient) listSQLContainerPartitionMergeCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, mergeParameters); err != nil { @@ -2272,7 +2272,7 @@ func (client *SQLResourcesClient) listSQLContainerPartitionMergeCreateRequest(ct // NewListSQLContainersPager - Lists the SQL container under an existing Azure Cosmos DB database account. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2326,7 +2326,7 @@ func (client *SQLResourcesClient) listSQLContainersCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2343,7 +2343,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 +2392,7 @@ func (client *SQLResourcesClient) listSQLDatabasesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2409,7 +2409,7 @@ func (client *SQLResourcesClient) listSQLDatabasesHandleResponse(resp *http.Resp // NewListSQLRoleAssignmentsPager - Retrieves the list of all Azure Cosmos DB SQL Role Assignments. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 +2458,7 @@ func (client *SQLResourcesClient) listSQLRoleAssignmentsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2475,7 +2475,7 @@ func (client *SQLResourcesClient) listSQLRoleAssignmentsHandleResponse(resp *htt // NewListSQLRoleDefinitionsPager - Retrieves the list of all Azure Cosmos DB SQL Role Definitions. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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 +2524,7 @@ func (client *SQLResourcesClient) listSQLRoleDefinitionsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2541,7 +2541,7 @@ func (client *SQLResourcesClient) listSQLRoleDefinitionsHandleResponse(resp *htt // NewListSQLStoredProceduresPager - Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2600,7 +2600,7 @@ func (client *SQLResourcesClient) listSQLStoredProceduresCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2617,7 +2617,7 @@ func (client *SQLResourcesClient) listSQLStoredProceduresHandleResponse(resp *ht // NewListSQLTriggersPager - Lists the SQL trigger under an existing Azure Cosmos DB database account. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2676,7 +2676,7 @@ func (client *SQLResourcesClient) listSQLTriggersCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2693,7 +2693,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2752,7 +2752,7 @@ func (client *SQLResourcesClient) listSQLUserDefinedFunctionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2770,7 +2770,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2797,7 +2797,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +2847,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToAutoscaleCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2856,7 +2856,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2883,7 +2883,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +2933,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToManualThroughputCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2942,7 +2942,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -2968,7 +2968,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +3014,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToAutoscaleCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -3023,7 +3023,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3049,7 +3049,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +3095,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToManualThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -3104,7 +3104,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3133,7 +3133,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +3183,7 @@ func (client *SQLResourcesClient) retrieveContinuousBackupInformationCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, location); err != nil { @@ -3195,7 +3195,7 @@ func (client *SQLResourcesClient) retrieveContinuousBackupInformationCreateReque // BeginSQLContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL container // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3224,7 +3224,7 @@ func (client *SQLResourcesClient) BeginSQLContainerRedistributeThroughput(ctx co // SQLContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL container // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *SQLResourcesClient) sQLContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginSQLContainerRedistributeThroughput" @@ -3274,7 +3274,7 @@ func (client *SQLResourcesClient) sqlContainerRedistributeThroughputCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, redistributeThroughputParameters); err != nil { @@ -3286,7 +3286,7 @@ func (client *SQLResourcesClient) sqlContainerRedistributeThroughputCreateReques // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3315,7 +3315,7 @@ func (client *SQLResourcesClient) BeginSQLContainerRetrieveThroughputDistributio // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *SQLResourcesClient) sQLContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (*http.Response, error) { var err error const operationName = "SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution" @@ -3365,7 +3365,7 @@ func (client *SQLResourcesClient) sqlContainerRetrieveThroughputDistributionCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, retrieveThroughputParameters); err != nil { @@ -3377,7 +3377,7 @@ func (client *SQLResourcesClient) sqlContainerRetrieveThroughputDistributionCrea // BeginSQLDatabasePartitionMerge - Merges the partitions of a SQL database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3405,7 +3405,7 @@ func (client *SQLResourcesClient) BeginSQLDatabasePartitionMerge(ctx context.Con // SQLDatabasePartitionMerge - Merges the partitions of a SQL database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -3451,7 +3451,7 @@ func (client *SQLResourcesClient) sqlDatabasePartitionMergeCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, mergeParameters); err != nil { @@ -3463,7 +3463,7 @@ func (client *SQLResourcesClient) sqlDatabasePartitionMergeCreateRequest(ctx con // BeginSQLDatabaseRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3491,7 +3491,7 @@ func (client *SQLResourcesClient) BeginSQLDatabaseRedistributeThroughput(ctx con // SQLDatabaseRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -3537,7 +3537,7 @@ func (client *SQLResourcesClient) sqlDatabaseRedistributeThroughputCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, redistributeThroughputParameters); err != nil { @@ -3549,7 +3549,7 @@ func (client *SQLResourcesClient) sqlDatabaseRedistributeThroughputCreateRequest // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3577,7 +3577,7 @@ func (client *SQLResourcesClient) BeginSQLDatabaseRetrieveThroughputDistribution // 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 2024-02-15-preview +// Generated from API version 2024-05-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" @@ -3623,7 +3623,7 @@ func (client *SQLResourcesClient) sqlDatabaseRetrieveThroughputDistributionCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, retrieveThroughputParameters); err != nil { @@ -3635,7 +3635,7 @@ func (client *SQLResourcesClient) sqlDatabaseRetrieveThroughputDistributionCreat // 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3663,7 +3663,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +3713,7 @@ func (client *SQLResourcesClient) updateSQLContainerThroughputCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateThroughputParameters); err != nil { @@ -3725,7 +3725,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - databaseName - Cosmos DB database name. @@ -3752,7 +3752,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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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 +3798,7 @@ func (client *SQLResourcesClient) updateSQLDatabaseThroughputCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 deleted file mode 100644 index 3e9d597bba99..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client_example_test.go +++ /dev/null @@ -1,2552 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseList.json -func ExampleSQLResourcesClient_NewListSQLDatabasesPager() { - 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().NewListSQLDatabasesPager("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.SQLDatabaseListResult = armcosmos.SQLDatabaseListResult{ - // Value: []*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"), - // Colls: to.Ptr("colls/"), - // Users: to.Ptr("users/"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseGet.json -func ExampleSQLResourcesClient_GetSQLDatabase() { - 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().GetSQLDatabase(ctx, "rg1", "ddb1", "databaseName", 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.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"), - // Colls: to.Ptr("colls/"), - // Users: to.Ptr("users/"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLDatabase_cosmosDbSqlDatabaseCreateUpdate() { - 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{ - ID: to.Ptr("databaseName"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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 }()), - RestoreWithTTLDisabled: to.Ptr(true), - }, - }, - }, - }, 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseDelete.json -func ExampleSQLResourcesClient_BeginDeleteSQLDatabase() { - 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().BeginDeleteSQLDatabase(ctx, "rg1", "ddb1", "databaseName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseThroughputGet.json -func ExampleSQLResourcesClient_GetSQLDatabaseThroughput() { - 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().GetSQLDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", 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/sqlDatabases/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json -func ExampleSQLResourcesClient_BeginUpdateSQLDatabaseThroughput() { - 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().BeginUpdateSQLDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/sqlDatabases/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json -func ExampleSQLResourcesClient_BeginMigrateSQLDatabaseToAutoscale() { - 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().BeginMigrateSQLDatabaseToAutoscale(ctx, "rg1", "ddb1", "databaseName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json -func ExampleSQLResourcesClient_BeginMigrateSQLDatabaseToManualThroughput() { - 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().BeginMigrateSQLDatabaseToManualThroughput(ctx, "rg1", "ddb1", "databaseName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerList.json -func ExampleSQLResourcesClient_NewListSQLContainersPager() { - 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().NewListSQLContainersPager("rgName", "ddb1", "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.SQLContainerListResult = armcosmos.SQLContainerListResult{ - // Value: []*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), - // }, - // 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), - // }, - // DefaultTTL: to.Ptr[int32](100), - // ID: to.Ptr("testctn"), - // 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")}, - // }}, - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("containerName1"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName1"), - // 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("PD5DALigDiw="), - // 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), - // }, - // ComputedProperties: []*armcosmos.ComputedProperty{ - // }, - // ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ - // ConflictResolutionPath: to.Ptr("/path"), - // Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), - // }, - // DefaultTTL: to.Ptr[int32](100), - // ID: to.Ptr("testctn1"), - // 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.PartitionKindMultiHash), - // Paths: []*string{ - // to.Ptr("/AccountNumber"), - // to.Ptr("/AccountLocation")}, - // Version: to.Ptr[int32](2), - // }, - // UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{ - // UniqueKeys: []*armcosmos.UniqueKey{ - // { - // Paths: []*string{ - // to.Ptr("/testPath")}, - // }}, - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("containerName2"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName2"), - // 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("PD5DALigDhw="), - // 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("testctn2"), - // 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("/_partitionKey")}, - // SystemKey: to.Ptr(true), - // Version: to.Ptr[int32](2), - // }, - // UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{ - // UniqueKeys: []*armcosmos.UniqueKey{ - // { - // Paths: []*string{ - // to.Ptr("/testPath")}, - // }}, - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerGet.json -func ExampleSQLResourcesClient_GetSQLContainer() { - 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().GetSQLContainer(ctx, "rgName", "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. - // 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{ - // Options: &armcosmos.SQLContainerGetPropertiesOptions{ - // Throughput: to.Ptr[int32](400), - // }, - // 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), - // }, - // 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), - // }, - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerCreateUpdate.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLContainer_cosmosDbSqlContainerCreateUpdate() { - 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", "containerName", armcosmos.SQLContainerCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.SQLContainerCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.SQLContainerResource{ - 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](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), - }, - 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")}, - }}, - }, - }, - }, - }, 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("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), - // }, - // 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), - // }, - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerRestore.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLContainer_cosmosDbSqlContainerRestore() { - 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", "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 }()), - RestoreWithTTLDisabled: to.Ptr(true), - }, - }, - }, - }, 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("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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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) - } - // 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/sqlDatabases/sqlContainers/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerThroughputUpdate.json -func ExampleSQLResourcesClient_BeginUpdateSQLContainerThroughput() { - 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().BeginUpdateSQLContainerThroughput(ctx, "rg1", "ddb1", "databaseName", "containerName", armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/sqlDatabases/sqlContainers/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json -func ExampleSQLResourcesClient_BeginMigrateSQLContainerToAutoscale() { - 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().BeginMigrateSQLContainerToAutoscale(ctx, "rg1", "ddb1", "databaseName", "containerName", 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json -func ExampleSQLResourcesClient_BeginMigrateSQLContainerToManualThroughput() { - 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().BeginMigrateSQLContainerToManualThroughput(ctx, "rg1", "ddb1", "databaseName", "containerName", 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json -func ExampleSQLResourcesClient_BeginSQLDatabaseRedistributeThroughput() { - 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().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) - } - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json -func ExampleSQLResourcesClient_BeginSQLContainerRetrieveThroughputDistribution() { - 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().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) - 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json -func ExampleSQLResourcesClient_BeginSQLContainerRedistributeThroughput() { - 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().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), - }, - }, - }, 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlStoredProcedureList.json -func ExampleSQLResourcesClient_NewListSQLStoredProceduresPager() { - 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().NewListSQLStoredProceduresPager("rgName", "ddb1", "databaseName", "containerName", 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.SQLStoredProcedureListResult = armcosmos.SQLStoredProcedureListResult{ - // Value: []*armcosmos.SQLStoredProcedureGetResults{ - // { - // Name: to.Ptr("testctn"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlStoredProcedures"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlStoredProcedures/storedProcedureName"), - // Properties: &armcosmos.SQLStoredProcedureGetProperties{ - // Resource: &armcosmos.SQLStoredProcedureGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // Body: to.Ptr("body"), - // ID: to.Ptr("testctn"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlStoredProcedureGet.json -func ExampleSQLResourcesClient_GetSQLStoredProcedure() { - 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().GetSQLStoredProcedure(ctx, "rgName", "ddb1", "databaseName", "containerName", "storedProcedureName", 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.SQLStoredProcedureGetResults = armcosmos.SQLStoredProcedureGetResults{ - // Name: to.Ptr("storedProcedureName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlStoredProcedures"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlStoredProcedures/storedProcedureName"), - // Properties: &armcosmos.SQLStoredProcedureGetProperties{ - // Resource: &armcosmos.SQLStoredProcedureGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // Body: to.Ptr("body"), - // ID: to.Ptr("storedProcedureName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLStoredProcedure() { - 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().BeginCreateUpdateSQLStoredProcedure(ctx, "rg1", "ddb1", "databaseName", "containerName", "storedProcedureName", armcosmos.SQLStoredProcedureCreateUpdateParameters{ - Properties: &armcosmos.SQLStoredProcedureCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.SQLStoredProcedureResource{ - Body: to.Ptr("body"), - ID: to.Ptr("storedProcedureName"), - }, - }, - }, 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.SQLStoredProcedureGetResults = armcosmos.SQLStoredProcedureGetResults{ - // Name: to.Ptr("storedProcedureName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlStoredProcedures"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlStoredProcedures/storedProcedureName"), - // Properties: &armcosmos.SQLStoredProcedureGetProperties{ - // Resource: &armcosmos.SQLStoredProcedureGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // Body: to.Ptr("body"), - // ID: to.Ptr("storedProcedureName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlStoredProcedureDelete.json -func ExampleSQLResourcesClient_BeginDeleteSQLStoredProcedure() { - 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().BeginDeleteSQLStoredProcedure(ctx, "rg1", "ddb1", "databaseName", "containerName", "storedProcedureName", 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlUserDefinedFunctionList.json -func ExampleSQLResourcesClient_NewListSQLUserDefinedFunctionsPager() { - 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().NewListSQLUserDefinedFunctionsPager("rgName", "ddb1", "databaseName", "containerName", 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.SQLUserDefinedFunctionListResult = armcosmos.SQLUserDefinedFunctionListResult{ - // Value: []*armcosmos.SQLUserDefinedFunctionGetResults{ - // { - // Name: to.Ptr("testctn"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlUserDefinedFunctions"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlUserDefinedFunctions/userDefinedFunctionName"), - // Properties: &armcosmos.SQLUserDefinedFunctionGetProperties{ - // Resource: &armcosmos.SQLUserDefinedFunctionGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // Body: to.Ptr("body"), - // ID: to.Ptr("testctn"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json -func ExampleSQLResourcesClient_GetSQLUserDefinedFunction() { - 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().GetSQLUserDefinedFunction(ctx, "rgName", "ddb1", "databaseName", "containerName", "userDefinedFunctionName", 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.SQLUserDefinedFunctionGetResults = armcosmos.SQLUserDefinedFunctionGetResults{ - // Name: to.Ptr("userDefinedFunctionName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlUserDefinedFunctions"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlUserDefinedFunctions/userDefinedFunctionName"), - // Properties: &armcosmos.SQLUserDefinedFunctionGetProperties{ - // Resource: &armcosmos.SQLUserDefinedFunctionGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // Body: to.Ptr("body"), - // ID: to.Ptr("userDefinedFunctionName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLUserDefinedFunction() { - 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().BeginCreateUpdateSQLUserDefinedFunction(ctx, "rg1", "ddb1", "databaseName", "containerName", "userDefinedFunctionName", armcosmos.SQLUserDefinedFunctionCreateUpdateParameters{ - Properties: &armcosmos.SQLUserDefinedFunctionCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.SQLUserDefinedFunctionResource{ - Body: to.Ptr("body"), - ID: to.Ptr("userDefinedFunctionName"), - }, - }, - }, 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.SQLUserDefinedFunctionGetResults = armcosmos.SQLUserDefinedFunctionGetResults{ - // Name: to.Ptr("userDefinedFunctionName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlUserDefinedFunctions"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlUserDefinedFunctions/userDefinedFunctionName"), - // Properties: &armcosmos.SQLUserDefinedFunctionGetProperties{ - // Resource: &armcosmos.SQLUserDefinedFunctionGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // Body: to.Ptr("body"), - // ID: to.Ptr("userDefinedFunctionName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json -func ExampleSQLResourcesClient_BeginDeleteSQLUserDefinedFunction() { - 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().BeginDeleteSQLUserDefinedFunction(ctx, "rg1", "ddb1", "databaseName", "containerName", "userDefinedFunctionName", 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlTriggerList.json -func ExampleSQLResourcesClient_NewListSQLTriggersPager() { - 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().NewListSQLTriggersPager("rgName", "ddb1", "databaseName", "containerName", 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.SQLTriggerListResult = armcosmos.SQLTriggerListResult{ - // Value: []*armcosmos.SQLTriggerGetResults{ - // { - // Name: to.Ptr("testctn"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlTriggers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlTriggers/triggerName"), - // Properties: &armcosmos.SQLTriggerGetProperties{ - // Resource: &armcosmos.SQLTriggerGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // Body: to.Ptr("body"), - // ID: to.Ptr("testctn"), - // TriggerOperation: to.Ptr(armcosmos.TriggerOperation("triggerOperation")), - // TriggerType: to.Ptr(armcosmos.TriggerType("triggerType")), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlTriggerGet.json -func ExampleSQLResourcesClient_GetSQLTrigger() { - 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().GetSQLTrigger(ctx, "rgName", "ddb1", "databaseName", "containerName", "triggerName", 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.SQLTriggerGetResults = armcosmos.SQLTriggerGetResults{ - // Name: to.Ptr("triggerName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlTriggers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlTriggers/triggerName"), - // Properties: &armcosmos.SQLTriggerGetProperties{ - // Resource: &armcosmos.SQLTriggerGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // Body: to.Ptr("body"), - // ID: to.Ptr("triggerName"), - // TriggerOperation: to.Ptr(armcosmos.TriggerOperation("triggerOperation")), - // TriggerType: to.Ptr(armcosmos.TriggerType("triggerType")), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlTriggerCreateUpdate.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLTrigger() { - 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().BeginCreateUpdateSQLTrigger(ctx, "rg1", "ddb1", "databaseName", "containerName", "triggerName", armcosmos.SQLTriggerCreateUpdateParameters{ - Properties: &armcosmos.SQLTriggerCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.SQLTriggerResource{ - Body: to.Ptr("body"), - ID: to.Ptr("triggerName"), - TriggerOperation: to.Ptr(armcosmos.TriggerOperation("triggerOperation")), - TriggerType: to.Ptr(armcosmos.TriggerType("triggerType")), - }, - }, - }, 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.SQLTriggerGetResults = armcosmos.SQLTriggerGetResults{ - // Name: to.Ptr("triggerName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlTriggers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlTriggers/triggerName"), - // Properties: &armcosmos.SQLTriggerGetProperties{ - // Resource: &armcosmos.SQLTriggerGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // Body: to.Ptr("body"), - // ID: to.Ptr("triggerName"), - // TriggerOperation: to.Ptr(armcosmos.TriggerOperation("triggerOperation")), - // TriggerType: to.Ptr(armcosmos.TriggerType("triggerType")), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlTriggerDelete.json -func ExampleSQLResourcesClient_BeginDeleteSQLTrigger() { - 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().BeginDeleteSQLTrigger(ctx, "rg1", "ddb1", "databaseName", "containerName", "triggerName", 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json -func ExampleSQLResourcesClient_GetSQLRoleDefinition() { - 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().GetSQLRoleDefinition(ctx, "myRoleDefinitionId", "myResourceGroupName", "myAccountName", 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.SQLRoleDefinitionGetResults = armcosmos.SQLRoleDefinitionGetResults{ - // Name: to.Ptr("myRoleDefinitionId"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"), - // Properties: &armcosmos.SQLRoleDefinitionResource{ - // Type: to.Ptr(armcosmos.RoleDefinitionTypeCustomRole), - // AssignableScopes: []*string{ - // to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales"), - // to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases")}, - // Permissions: []*armcosmos.Permission{ - // { - // DataActions: []*string{ - // to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create"), - // to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read")}, - // NotDataActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("myRoleName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLRoleDefinition() { - 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().BeginCreateUpdateSQLRoleDefinition(ctx, "myRoleDefinitionId", "myResourceGroupName", "myAccountName", armcosmos.SQLRoleDefinitionCreateUpdateParameters{ - Properties: &armcosmos.SQLRoleDefinitionResource{ - Type: to.Ptr(armcosmos.RoleDefinitionTypeCustomRole), - AssignableScopes: []*string{ - to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales"), - to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases")}, - Permissions: []*armcosmos.Permission{ - { - DataActions: []*string{ - to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create"), - to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read")}, - NotDataActions: []*string{}, - }}, - RoleName: to.Ptr("myRoleName"), - }, - }, 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.SQLRoleDefinitionGetResults = armcosmos.SQLRoleDefinitionGetResults{ - // Name: to.Ptr("myRoleDefinitionId"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"), - // Properties: &armcosmos.SQLRoleDefinitionResource{ - // Type: to.Ptr(armcosmos.RoleDefinitionTypeCustomRole), - // AssignableScopes: []*string{ - // to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales"), - // to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases")}, - // Permissions: []*armcosmos.Permission{ - // { - // DataActions: []*string{ - // to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create"), - // to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read")}, - // }}, - // RoleName: to.Ptr("myRoleName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleDefinitionDelete.json -func ExampleSQLResourcesClient_BeginDeleteSQLRoleDefinition() { - 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().BeginDeleteSQLRoleDefinition(ctx, "myRoleDefinitionId", "myResourceGroupName", "myAccountName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleDefinitionList.json -func ExampleSQLResourcesClient_NewListSQLRoleDefinitionsPager() { - 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().NewListSQLRoleDefinitionsPager("myResourceGroupName", "myAccountName", 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.SQLRoleDefinitionListResult = armcosmos.SQLRoleDefinitionListResult{ - // Value: []*armcosmos.SQLRoleDefinitionGetResults{ - // { - // Name: to.Ptr("myRoleDefinitionId"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"), - // Properties: &armcosmos.SQLRoleDefinitionResource{ - // Type: to.Ptr(armcosmos.RoleDefinitionTypeCustomRole), - // AssignableScopes: []*string{ - // to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales"), - // to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases")}, - // Permissions: []*armcosmos.Permission{ - // { - // DataActions: []*string{ - // to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create"), - // to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read")}, - // NotDataActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("myRoleName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json -func ExampleSQLResourcesClient_GetSQLRoleAssignment() { - 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().GetSQLRoleAssignment(ctx, "myRoleAssignmentId", "myResourceGroupName", "myAccountName", 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.SQLRoleAssignmentGetResults = armcosmos.SQLRoleAssignmentGetResults{ - // Name: to.Ptr("myRoleAssignmentId"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleAssignments/myRoleAssignmentId"), - // Properties: &armcosmos.SQLRoleAssignmentResource{ - // PrincipalID: to.Ptr("myPrincipalId"), - // RoleDefinitionID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"), - // Scope: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json -func ExampleSQLResourcesClient_BeginCreateUpdateSQLRoleAssignment() { - 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().BeginCreateUpdateSQLRoleAssignment(ctx, "myRoleAssignmentId", "myResourceGroupName", "myAccountName", armcosmos.SQLRoleAssignmentCreateUpdateParameters{ - Properties: &armcosmos.SQLRoleAssignmentResource{ - PrincipalID: to.Ptr("myPrincipalId"), - RoleDefinitionID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"), - Scope: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases"), - }, - }, 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.SQLRoleAssignmentGetResults = armcosmos.SQLRoleAssignmentGetResults{ - // Name: to.Ptr("myRoleAssignmentId"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleAssignments/myRoleAssignmentId"), - // Properties: &armcosmos.SQLRoleAssignmentResource{ - // PrincipalID: to.Ptr("myPrincipalId"), - // RoleDefinitionID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"), - // Scope: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleAssignmentDelete.json -func ExampleSQLResourcesClient_BeginDeleteSQLRoleAssignment() { - 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().BeginDeleteSQLRoleAssignment(ctx, "myRoleAssignmentId", "myResourceGroupName", "myAccountName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleAssignmentList.json -func ExampleSQLResourcesClient_NewListSQLRoleAssignmentsPager() { - 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().NewListSQLRoleAssignmentsPager("myResourceGroupName", "myAccountName", 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.SQLRoleAssignmentListResult = armcosmos.SQLRoleAssignmentListResult{ - // Value: []*armcosmos.SQLRoleAssignmentGetResults{ - // { - // Name: to.Ptr("myRoleAssignmentId"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments"), - // ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleAssignments/myRoleAssignmentId"), - // Properties: &armcosmos.SQLRoleAssignmentResource{ - // PrincipalID: to.Ptr("myPrincipalId"), - // RoleDefinitionID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"), - // Scope: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerBackupInformation.json -func ExampleSQLResourcesClient_BeginRetrieveContinuousBackupInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLResourcesClient().BeginRetrieveContinuousBackupInformation(ctx, "rgName", "ddb1", "databaseName", "containerName", armcosmos.ContinuousBackupRestoreLocation{ - Location: to.Ptr("North Europe"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.BackupInformation = armcosmos.BackupInformation{ - // ContinuousBackupInformation: &armcosmos.ContinuousBackupInformation{ - // LatestRestorableTimestamp: to.Ptr("2021-02-05T02:40:50Z"), - // }, - // } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/tableresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/tableresources_client.go index ca52c5687dbe..d82355cb874e 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -262,7 +262,7 @@ func (client *TableResourcesClient) getTableCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -333,7 +333,7 @@ func (client *TableResourcesClient) getTableThroughputCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - Cosmos DB database account name. // - tableName - Cosmos DB table name. @@ -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 2024-02-15-preview +// Generated from API version 2024-05-15-preview 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", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") 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 deleted file mode 100644 index 48eeae3259cb..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/tableresources_client_example_test.go +++ /dev/null @@ -1,357 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableList.json -func ExampleTableResourcesClient_NewListTablesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTableResourcesClient().NewListTablesPager("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.TableListResult = armcosmos.TableListResult{ - // Value: []*armcosmos.TableGetResults{ - // { - // Name: to.Ptr("tableName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/tables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/tables/tableName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.TableGetProperties{ - // Resource: &armcosmos.TableGetPropertiesResource{ - // ID: to.Ptr("tableName"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableGet.json -func ExampleTableResourcesClient_GetTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTableResourcesClient().GetTable(ctx, "rg1", "ddb1", "tableName", 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.TableGetResults = armcosmos.TableGetResults{ - // Name: to.Ptr("tableName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/tables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/tables/tableName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.TableGetProperties{ - // Resource: &armcosmos.TableGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // ID: to.Ptr("tableName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableCreateUpdate.json -func ExampleTableResourcesClient_BeginCreateUpdateTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTableResourcesClient().BeginCreateUpdateTable(ctx, "rg1", "ddb1", "tableName", armcosmos.TableCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.TableCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.TableResource{ - ID: to.Ptr("tableName"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.TableGetResults = armcosmos.TableGetResults{ - // Name: to.Ptr("tableName"), - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/tables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/tables/tableName"), - // Location: to.Ptr("West US"), - // Properties: &armcosmos.TableGetProperties{ - // Resource: &armcosmos.TableGetPropertiesResource{ - // ID: to.Ptr("tableName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableDelete.json -func ExampleTableResourcesClient_BeginDeleteTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTableResourcesClient().BeginDeleteTable(ctx, "rg1", "ddb1", "tableName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableThroughputGet.json -func ExampleTableResourcesClient_GetTableThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTableResourcesClient().GetTableThroughput(ctx, "rg1", "ddb1", "tableName", 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/tables/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/tables/tableName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableThroughputUpdate.json -func ExampleTableResourcesClient_BeginUpdateTableThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTableResourcesClient().BeginUpdateTableThroughput(ctx, "rg1", "ddb1", "tableName", armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/tables/throughputSettings"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/tables/tableName/throughputSettings/default"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armcosmos.ThroughputSettingsGetProperties{ - // Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableMigrateToAutoscale.json -func ExampleTableResourcesClient_BeginMigrateTableToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTableResourcesClient().BeginMigrateTableToAutoscale(ctx, "rg1", "ddb1", "tableName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableMigrateToManualThroughput.json -func ExampleTableResourcesClient_BeginMigrateTableToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTableResourcesClient().BeginMigrateTableToManualThroughput(ctx, "rg1", "ddb1", "tableName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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{ - // Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""), - // Rid: to.Ptr("PD5DALigDgw="), - // Ts: to.Ptr[float32](1459200611), - // 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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableBackupInformation.json -func ExampleTableResourcesClient_BeginRetrieveContinuousBackupInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcosmos.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTableResourcesClient().BeginRetrieveContinuousBackupInformation(ctx, "rgName", "ddb1", "tableName1", armcosmos.ContinuousBackupRestoreLocation{ - Location: to.Ptr("North Europe"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.BackupInformation = armcosmos.BackupInformation{ - // ContinuousBackupInformation: &armcosmos.ContinuousBackupInformation{ - // LatestRestorableTimestamp: to.Ptr("2021-02-05T02:40:50Z"), - // }, - // } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/throughputpool_client.go b/sdk/resourcemanager/cosmos/armcosmos/throughputpool_client.go index a4e13c94e5c8..c099aa3b4f56 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/throughputpool_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/throughputpool_client.go @@ -47,7 +47,7 @@ func NewThroughputPoolClient(subscriptionID string, credential azcore.TokenCrede // performing updates on an account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - throughputPoolName - Cosmos DB Throughput Pool name. // - body - The parameters to provide for the current ThroughputPool. @@ -75,7 +75,7 @@ func (client *ThroughputPoolClient) BeginCreateOrUpdate(ctx context.Context, res // updates on an account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *ThroughputPoolClient) createOrUpdate(ctx context.Context, resourceGroupName string, throughputPoolName string, body ThroughputPoolResource, options *ThroughputPoolClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ThroughputPoolClient.BeginCreateOrUpdate" @@ -117,7 +117,7 @@ func (client *ThroughputPoolClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -129,7 +129,7 @@ func (client *ThroughputPoolClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes an existing Azure Cosmos DB Throughput Pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - throughputPoolName - Cosmos DB Throughput Pool name. // - options - ThroughputPoolClientBeginDeleteOptions contains the optional parameters for the ThroughputPoolClient.BeginDelete @@ -154,7 +154,7 @@ func (client *ThroughputPoolClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes an existing Azure Cosmos DB Throughput Pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *ThroughputPoolClient) deleteOperation(ctx context.Context, resourceGroupName string, throughputPoolName string, options *ThroughputPoolClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ThroughputPoolClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *ThroughputPoolClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,7 @@ func (client *ThroughputPoolClient) deleteCreateRequest(ctx context.Context, res // Get - Retrieves the properties of an existing Azure Cosmos DB Throughput Pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - throughputPoolName - Cosmos DB Throughput Pool name. // - options - ThroughputPoolClientGetOptions contains the optional parameters for the ThroughputPoolClient.Get method. @@ -251,7 +251,7 @@ func (client *ThroughputPoolClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *ThroughputPoolClient) getHandleResponse(resp *http.Response) (Thro // BeginUpdate - Updates the properties of an existing Azure Cosmos DB Throughput Pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - throughputPoolName - Cosmos DB Throughput Pool name. // - options - ThroughputPoolClientBeginUpdateOptions contains the optional parameters for the ThroughputPoolClient.BeginUpdate @@ -295,7 +295,7 @@ func (client *ThroughputPoolClient) BeginUpdate(ctx context.Context, resourceGro // Update - Updates the properties of an existing Azure Cosmos DB Throughput Pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *ThroughputPoolClient) update(ctx context.Context, resourceGroupName string, throughputPoolName string, options *ThroughputPoolClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ThroughputPoolClient.BeginUpdate" @@ -337,7 +337,7 @@ func (client *ThroughputPoolClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/throughputpool_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/throughputpool_client_example_test.go deleted file mode 100644 index 4aca0a2b001f..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/throughputpool_client_example_test.go +++ /dev/null @@ -1,163 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json -func ExampleThroughputPoolClient_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.NewThroughputPoolClient().Get(ctx, "rgName", "tp1", 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.ThroughputPoolResource = armcosmos.ThroughputPoolResource{ - // Name: to.Ptr("tp1"), - // Type: to.Ptr("/Microsoft.DocumentDB/throughputPools"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1"), - // Location: to.Ptr("west us"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armcosmos.ThroughputPoolProperties{ - // MaxThroughput: to.Ptr[int32](10000), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json -func ExampleThroughputPoolClient_BeginCreateOrUpdate() { - 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.NewThroughputPoolClient().BeginCreateOrUpdate(ctx, "rg1", "tp1", armcosmos.ThroughputPoolResource{ - Location: to.Ptr("westus2"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputPoolProperties{ - MaxThroughput: to.Ptr[int32](10000), - }, - }, 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.ThroughputPoolResource = armcosmos.ThroughputPoolResource{ - // Name: to.Ptr("tp1"), - // Type: to.Ptr("/Microsoft.DocumentDB/throughputPools"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1"), - // Location: to.Ptr("westus2"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armcosmos.ThroughputPoolProperties{ - // MaxThroughput: to.Ptr[int32](10000), - // ProvisioningState: to.Ptr(armcosmos.StatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json -func ExampleThroughputPoolClient_BeginUpdate() { - 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.NewThroughputPoolClient().BeginUpdate(ctx, "rg1", "tp1", &armcosmos.ThroughputPoolClientBeginUpdateOptions{Body: &armcosmos.ThroughputPoolUpdate{ - Properties: &armcosmos.ThroughputPoolProperties{ - MaxThroughput: to.Ptr[int32](10000), - }, - }, - }) - 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.ThroughputPoolResource = armcosmos.ThroughputPoolResource{ - // Name: to.Ptr("tp1"), - // Type: to.Ptr("/Microsoft.DocumentDB/throughputPools"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1"), - // Location: to.Ptr("westus2"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armcosmos.ThroughputPoolProperties{ - // MaxThroughput: to.Ptr[int32](10000), - // ProvisioningState: to.Ptr(armcosmos.StatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json -func ExampleThroughputPoolClient_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.NewThroughputPoolClient().BeginDelete(ctx, "rgName", "tp1", 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/throughputpoolaccount_client.go b/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccount_client.go index 532420dd0d88..f975d0447904 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccount_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccount_client.go @@ -47,7 +47,7 @@ func NewThroughputPoolAccountClient(subscriptionID string, credential azcore.Tok // updates on an account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - throughputPoolName - Cosmos DB Throughput Pool name. // - throughputPoolAccountName - Cosmos DB global database account in a Throughput Pool @@ -76,7 +76,7 @@ func (client *ThroughputPoolAccountClient) BeginCreate(ctx context.Context, reso // updates on an account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *ThroughputPoolAccountClient) create(ctx context.Context, resourceGroupName string, throughputPoolName string, throughputPoolAccountName string, body ThroughputPoolAccountResource, options *ThroughputPoolAccountClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ThroughputPoolAccountClient.BeginCreate" @@ -122,7 +122,7 @@ func (client *ThroughputPoolAccountClient) createCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -134,7 +134,7 @@ func (client *ThroughputPoolAccountClient) createCreateRequest(ctx context.Conte // BeginDelete - Removes an existing Azure Cosmos DB database account from a throughput pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - throughputPoolName - Cosmos DB Throughput Pool name. // - throughputPoolAccountName - Cosmos DB global database account in a Throughput Pool @@ -160,7 +160,7 @@ func (client *ThroughputPoolAccountClient) BeginDelete(ctx context.Context, reso // Delete - Removes an existing Azure Cosmos DB database account from a throughput pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview func (client *ThroughputPoolAccountClient) deleteOperation(ctx context.Context, resourceGroupName string, throughputPoolName string, throughputPoolAccountName string, options *ThroughputPoolAccountClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ThroughputPoolAccountClient.BeginDelete" @@ -206,7 +206,7 @@ func (client *ThroughputPoolAccountClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,7 @@ func (client *ThroughputPoolAccountClient) deleteCreateRequest(ctx context.Conte // Get - Retrieves the properties of an existing Azure Cosmos DB Throughput Pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - throughputPoolName - Cosmos DB Throughput Pool name. // - throughputPoolAccountName - Cosmos DB global database account in a Throughput Pool @@ -267,7 +267,7 @@ func (client *ThroughputPoolAccountClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccount_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccount_client_example_test.go deleted file mode 100644 index 68f01dc87640..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccount_client_example_test.go +++ /dev/null @@ -1,107 +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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json -func ExampleThroughputPoolAccountClient_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.NewThroughputPoolAccountClient().Get(ctx, "rgName", "tp1", "db1", 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.ThroughputPoolAccountResource = armcosmos.ThroughputPoolAccountResource{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1/throughputPoolAccounts/db1"), - // Properties: &armcosmos.ThroughputPoolAccountProperties{ - // AccountInstanceID: to.Ptr("{instance-id}"), - // AccountLocation: to.Ptr("west us"), - // AccountResourceIdentifier: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/db1"), - // ProvisioningState: to.Ptr(armcosmos.StatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json -func ExampleThroughputPoolAccountClient_BeginCreate() { - 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.NewThroughputPoolAccountClient().BeginCreate(ctx, "rg1", "tp1", "db1", armcosmos.ThroughputPoolAccountResource{ - Properties: &armcosmos.ThroughputPoolAccountProperties{ - AccountLocation: to.Ptr("West US"), - AccountResourceIdentifier: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/"), - }, - }, 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.ThroughputPoolAccountResource = armcosmos.ThroughputPoolAccountResource{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1/throughputPoolAccounts/db1"), - // Properties: &armcosmos.ThroughputPoolAccountProperties{ - // AccountInstanceID: to.Ptr("{instance-id1}"), - // AccountLocation: to.Ptr("west us"), - // AccountResourceIdentifier: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/db1"), - // ProvisioningState: to.Ptr(armcosmos.StatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json -func ExampleThroughputPoolAccountClient_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.NewThroughputPoolAccountClient().BeginDelete(ctx, "rgName", "tp1", "db1", 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/throughputpoolaccounts_client.go b/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccounts_client.go index fef99de37bf4..604733f3df5b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccounts_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccounts_client.go @@ -45,7 +45,7 @@ func NewThroughputPoolAccountsClient(subscriptionID string, credential azcore.To // NewListPager - Lists all the Azure Cosmos DB accounts available under the subscription. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - throughputPoolName - Cosmos DB Throughput Pool name. // - options - ThroughputPoolAccountsClientListOptions contains the optional parameters for the ThroughputPoolAccountsClient.NewListPager @@ -93,7 +93,7 @@ func (client *ThroughputPoolAccountsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccounts_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccounts_client_example_test.go deleted file mode 100644 index e85602821520..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/throughputpoolaccounts_client_example_test.go +++ /dev/null @@ -1,62 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json -func ExampleThroughputPoolAccountsClient_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.NewThroughputPoolAccountsClient().NewListPager("rgName", "tp1", 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.ThroughputPoolAccountsListResult = armcosmos.ThroughputPoolAccountsListResult{ - // Value: []*armcosmos.ThroughputPoolAccountResource{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1/throughputPoolAccounts/db1"), - // Properties: &armcosmos.ThroughputPoolAccountProperties{ - // AccountInstanceID: to.Ptr("{instance-id1}"), - // AccountLocation: to.Ptr("west us"), - // AccountResourceIdentifier: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/db1"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1/throughputPoolAccounts/db2"), - // Properties: &armcosmos.ThroughputPoolAccountProperties{ - // AccountInstanceID: to.Ptr("{instance-id2}"), - // AccountLocation: to.Ptr("west us"), - // AccountResourceIdentifier: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/db2"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/throughputpools_client.go b/sdk/resourcemanager/cosmos/armcosmos/throughputpools_client.go index df1abf7a55d6..4c8f10b51f72 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/throughputpools_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/throughputpools_client.go @@ -45,7 +45,7 @@ func NewThroughputPoolsClient(subscriptionID string, credential azcore.TokenCred // NewListPager - Lists all the Azure Cosmos DB Throughput Pools available under the subscription. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - options - ThroughputPoolsClientListOptions contains the optional parameters for the ThroughputPoolsClient.NewListPager // method. func (client *ThroughputPoolsClient) NewListPager(options *ThroughputPoolsClientListOptions) *runtime.Pager[ThroughputPoolsClientListResponse] { @@ -83,7 +83,7 @@ func (client *ThroughputPoolsClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -100,7 +100,7 @@ func (client *ThroughputPoolsClient) listHandleResponse(resp *http.Response) (Th // NewListByResourceGroupPager - List all the ThroughputPools in a given resource group. // -// Generated from API version 2024-02-15-preview +// Generated from API version 2024-05-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ThroughputPoolsClientListByResourceGroupOptions contains the optional parameters for the ThroughputPoolsClient.NewListByResourceGroupPager // method. @@ -143,7 +143,7 @@ func (client *ThroughputPoolsClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-15-preview") + reqQP.Set("api-version", "2024-05-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/throughputpools_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/throughputpools_client_example_test.go deleted file mode 100644 index 8e1b2d1a7e1b..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/throughputpools_client_example_test.go +++ /dev/null @@ -1,74 +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/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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolList.json -func ExampleThroughputPoolsClient_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.NewThroughputPoolsClient().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.ThroughputPoolsListResult = armcosmos.ThroughputPoolsListResult{ - // Value: []*armcosmos.ThroughputPoolResource{ - // { - // Name: to.Ptr("tp1"), - // Type: to.Ptr("/Microsoft.DocumentDB/throughputPools"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1"), - // Location: to.Ptr("west us"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armcosmos.ThroughputPoolProperties{ - // MaxThroughput: to.Ptr[int32](10000), - // }, - // }, - // { - // Name: to.Ptr("tp2"), - // Type: to.Ptr("/Microsoft.DocumentDB/throughputPools"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp2"), - // Location: to.Ptr("west us"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armcosmos.ThroughputPoolProperties{ - // MaxThroughput: to.Ptr[int32](10000), - // }, - // }}, - // } - } -}