diff --git a/profiles/latest/cosmos-db/mgmt/documentdb/models.go b/profiles/latest/cosmos-db/mgmt/documentdb/models.go index 46fa7725536a..48d68af95eff 100644 --- a/profiles/latest/cosmos-db/mgmt/documentdb/models.go +++ b/profiles/latest/cosmos-db/mgmt/documentdb/models.go @@ -150,13 +150,7 @@ type CollectionRegionClient = original.CollectionRegionClient type Column = original.Column type ConflictResolutionPolicy = original.ConflictResolutionPolicy type ConsistencyPolicy = original.ConsistencyPolicy -type Container = original.Container -type ContainerCreateUpdateParameters = original.ContainerCreateUpdateParameters -type ContainerCreateUpdateProperties = original.ContainerCreateUpdateProperties -type ContainerListResult = original.ContainerListResult type ContainerPartitionKey = original.ContainerPartitionKey -type ContainerProperties = original.ContainerProperties -type ContainerResource = original.ContainerResource type DatabaseAccount = original.DatabaseAccount type DatabaseAccountConnectionString = original.DatabaseAccountConnectionString type DatabaseAccountCreateUpdateParameters = original.DatabaseAccountCreateUpdateParameters @@ -173,8 +167,8 @@ type DatabaseAccountsClient = original.DatabaseAccountsClient type DatabaseAccountsCreateOrUpdateFuture = original.DatabaseAccountsCreateOrUpdateFuture type DatabaseAccountsCreateUpdateCassandraKeyspaceFuture = original.DatabaseAccountsCreateUpdateCassandraKeyspaceFuture type DatabaseAccountsCreateUpdateCassandraTableFuture = original.DatabaseAccountsCreateUpdateCassandraTableFuture -type DatabaseAccountsCreateUpdateGremlinContainerFuture = original.DatabaseAccountsCreateUpdateGremlinContainerFuture type DatabaseAccountsCreateUpdateGremlinDatabaseFuture = original.DatabaseAccountsCreateUpdateGremlinDatabaseFuture +type DatabaseAccountsCreateUpdateGremlinGraphFuture = original.DatabaseAccountsCreateUpdateGremlinGraphFuture type DatabaseAccountsCreateUpdateMongoCollectionFuture = original.DatabaseAccountsCreateUpdateMongoCollectionFuture type DatabaseAccountsCreateUpdateMongoDatabaseFuture = original.DatabaseAccountsCreateUpdateMongoDatabaseFuture type DatabaseAccountsCreateUpdateSQLContainerFuture = original.DatabaseAccountsCreateUpdateSQLContainerFuture @@ -183,8 +177,8 @@ type DatabaseAccountsCreateUpdateTableFuture = original.DatabaseAccountsCreateUp type DatabaseAccountsDeleteCassandraKeyspaceFuture = original.DatabaseAccountsDeleteCassandraKeyspaceFuture type DatabaseAccountsDeleteCassandraTableFuture = original.DatabaseAccountsDeleteCassandraTableFuture type DatabaseAccountsDeleteFuture = original.DatabaseAccountsDeleteFuture -type DatabaseAccountsDeleteGremlinContainerFuture = original.DatabaseAccountsDeleteGremlinContainerFuture type DatabaseAccountsDeleteGremlinDatabaseFuture = original.DatabaseAccountsDeleteGremlinDatabaseFuture +type DatabaseAccountsDeleteGremlinGraphFuture = original.DatabaseAccountsDeleteGremlinGraphFuture type DatabaseAccountsDeleteMongoCollectionFuture = original.DatabaseAccountsDeleteMongoCollectionFuture type DatabaseAccountsDeleteMongoDatabaseFuture = original.DatabaseAccountsDeleteMongoDatabaseFuture type DatabaseAccountsDeleteSQLContainerFuture = original.DatabaseAccountsDeleteSQLContainerFuture @@ -208,6 +202,12 @@ type GremlinDatabaseCreateUpdateProperties = original.GremlinDatabaseCreateUpdat type GremlinDatabaseListResult = original.GremlinDatabaseListResult type GremlinDatabaseProperties = original.GremlinDatabaseProperties type GremlinDatabaseResource = original.GremlinDatabaseResource +type GremlinGraph = original.GremlinGraph +type GremlinGraphCreateUpdateParameters = original.GremlinGraphCreateUpdateParameters +type GremlinGraphCreateUpdateProperties = original.GremlinGraphCreateUpdateProperties +type GremlinGraphListResult = original.GremlinGraphListResult +type GremlinGraphProperties = original.GremlinGraphProperties +type GremlinGraphResource = original.GremlinGraphResource type IncludedPath = original.IncludedPath type Indexes = original.Indexes type IndexingPolicy = original.IndexingPolicy @@ -254,6 +254,12 @@ type PercentileSourceTargetClient = original.PercentileSourceTargetClient type PercentileTargetClient = original.PercentileTargetClient type RegionForOnlineOffline = original.RegionForOnlineOffline type Resource = original.Resource +type SQLContainer = original.SQLContainer +type SQLContainerCreateUpdateParameters = original.SQLContainerCreateUpdateParameters +type SQLContainerCreateUpdateProperties = original.SQLContainerCreateUpdateProperties +type SQLContainerListResult = original.SQLContainerListResult +type SQLContainerProperties = original.SQLContainerProperties +type SQLContainerResource = original.SQLContainerResource type SQLDatabase = original.SQLDatabase type SQLDatabaseCreateUpdateParameters = original.SQLDatabaseCreateUpdateParameters type SQLDatabaseCreateUpdateProperties = original.SQLDatabaseCreateUpdateProperties diff --git a/profiles/preview/cosmos-db/mgmt/documentdb/models.go b/profiles/preview/cosmos-db/mgmt/documentdb/models.go index 55423309f269..2e24fc4e609d 100644 --- a/profiles/preview/cosmos-db/mgmt/documentdb/models.go +++ b/profiles/preview/cosmos-db/mgmt/documentdb/models.go @@ -150,13 +150,7 @@ type CollectionRegionClient = original.CollectionRegionClient type Column = original.Column type ConflictResolutionPolicy = original.ConflictResolutionPolicy type ConsistencyPolicy = original.ConsistencyPolicy -type Container = original.Container -type ContainerCreateUpdateParameters = original.ContainerCreateUpdateParameters -type ContainerCreateUpdateProperties = original.ContainerCreateUpdateProperties -type ContainerListResult = original.ContainerListResult type ContainerPartitionKey = original.ContainerPartitionKey -type ContainerProperties = original.ContainerProperties -type ContainerResource = original.ContainerResource type DatabaseAccount = original.DatabaseAccount type DatabaseAccountConnectionString = original.DatabaseAccountConnectionString type DatabaseAccountCreateUpdateParameters = original.DatabaseAccountCreateUpdateParameters @@ -173,8 +167,8 @@ type DatabaseAccountsClient = original.DatabaseAccountsClient type DatabaseAccountsCreateOrUpdateFuture = original.DatabaseAccountsCreateOrUpdateFuture type DatabaseAccountsCreateUpdateCassandraKeyspaceFuture = original.DatabaseAccountsCreateUpdateCassandraKeyspaceFuture type DatabaseAccountsCreateUpdateCassandraTableFuture = original.DatabaseAccountsCreateUpdateCassandraTableFuture -type DatabaseAccountsCreateUpdateGremlinContainerFuture = original.DatabaseAccountsCreateUpdateGremlinContainerFuture type DatabaseAccountsCreateUpdateGremlinDatabaseFuture = original.DatabaseAccountsCreateUpdateGremlinDatabaseFuture +type DatabaseAccountsCreateUpdateGremlinGraphFuture = original.DatabaseAccountsCreateUpdateGremlinGraphFuture type DatabaseAccountsCreateUpdateMongoCollectionFuture = original.DatabaseAccountsCreateUpdateMongoCollectionFuture type DatabaseAccountsCreateUpdateMongoDatabaseFuture = original.DatabaseAccountsCreateUpdateMongoDatabaseFuture type DatabaseAccountsCreateUpdateSQLContainerFuture = original.DatabaseAccountsCreateUpdateSQLContainerFuture @@ -183,8 +177,8 @@ type DatabaseAccountsCreateUpdateTableFuture = original.DatabaseAccountsCreateUp type DatabaseAccountsDeleteCassandraKeyspaceFuture = original.DatabaseAccountsDeleteCassandraKeyspaceFuture type DatabaseAccountsDeleteCassandraTableFuture = original.DatabaseAccountsDeleteCassandraTableFuture type DatabaseAccountsDeleteFuture = original.DatabaseAccountsDeleteFuture -type DatabaseAccountsDeleteGremlinContainerFuture = original.DatabaseAccountsDeleteGremlinContainerFuture type DatabaseAccountsDeleteGremlinDatabaseFuture = original.DatabaseAccountsDeleteGremlinDatabaseFuture +type DatabaseAccountsDeleteGremlinGraphFuture = original.DatabaseAccountsDeleteGremlinGraphFuture type DatabaseAccountsDeleteMongoCollectionFuture = original.DatabaseAccountsDeleteMongoCollectionFuture type DatabaseAccountsDeleteMongoDatabaseFuture = original.DatabaseAccountsDeleteMongoDatabaseFuture type DatabaseAccountsDeleteSQLContainerFuture = original.DatabaseAccountsDeleteSQLContainerFuture @@ -208,6 +202,12 @@ type GremlinDatabaseCreateUpdateProperties = original.GremlinDatabaseCreateUpdat type GremlinDatabaseListResult = original.GremlinDatabaseListResult type GremlinDatabaseProperties = original.GremlinDatabaseProperties type GremlinDatabaseResource = original.GremlinDatabaseResource +type GremlinGraph = original.GremlinGraph +type GremlinGraphCreateUpdateParameters = original.GremlinGraphCreateUpdateParameters +type GremlinGraphCreateUpdateProperties = original.GremlinGraphCreateUpdateProperties +type GremlinGraphListResult = original.GremlinGraphListResult +type GremlinGraphProperties = original.GremlinGraphProperties +type GremlinGraphResource = original.GremlinGraphResource type IncludedPath = original.IncludedPath type Indexes = original.Indexes type IndexingPolicy = original.IndexingPolicy @@ -254,6 +254,12 @@ type PercentileSourceTargetClient = original.PercentileSourceTargetClient type PercentileTargetClient = original.PercentileTargetClient type RegionForOnlineOffline = original.RegionForOnlineOffline type Resource = original.Resource +type SQLContainer = original.SQLContainer +type SQLContainerCreateUpdateParameters = original.SQLContainerCreateUpdateParameters +type SQLContainerCreateUpdateProperties = original.SQLContainerCreateUpdateProperties +type SQLContainerListResult = original.SQLContainerListResult +type SQLContainerProperties = original.SQLContainerProperties +type SQLContainerResource = original.SQLContainerResource type SQLDatabase = original.SQLDatabase type SQLDatabaseCreateUpdateParameters = original.SQLDatabaseCreateUpdateParameters type SQLDatabaseCreateUpdateProperties = original.SQLDatabaseCreateUpdateProperties diff --git a/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go b/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go index 1a3527fd0432..0e92d3f0f60e 100644 --- a/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go +++ b/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go @@ -428,16 +428,15 @@ func (client DatabaseAccountsClient) CreateUpdateCassandraTableResponder(resp *h return } -// CreateUpdateGremlinContainer create or update an Azure Cosmos DB Gremlin container +// CreateUpdateGremlinDatabase create or update an Azure Cosmos DB Gremlin database // Parameters: // resourceGroupName - name of an Azure resource group. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. -// containerRid - cosmos DB container rid. -// createUpdateGremlinContainerParameters - the parameters to provide for the current Gremlin container. -func (client DatabaseAccountsClient) CreateUpdateGremlinContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string, createUpdateGremlinContainerParameters ContainerCreateUpdateParameters) (result DatabaseAccountsCreateUpdateGremlinContainerFuture, err error) { +// createUpdateGremlinDatabaseParameters - the parameters to provide for the current Gremlin database. +func (client DatabaseAccountsClient) CreateUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters) (result DatabaseAccountsCreateUpdateGremlinDatabaseFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.CreateUpdateGremlinContainer") + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.CreateUpdateGremlinDatabase") defer func() { sc := -1 if result.Response() != nil { @@ -454,35 +453,34 @@ func (client DatabaseAccountsClient) CreateUpdateGremlinContainer(ctx context.Co {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: createUpdateGremlinContainerParameters, - Constraints: []validation.Constraint{{Target: "createUpdateGremlinContainerParameters.ContainerCreateUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "createUpdateGremlinContainerParameters.ContainerCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "createUpdateGremlinContainerParameters.ContainerCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "createUpdateGremlinContainerParameters.ContainerCreateUpdateProperties.Options", Name: validation.Null, Rule: true, Chain: nil}, + {TargetValue: createUpdateGremlinDatabaseParameters, + Constraints: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Options", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewError("documentdb.DatabaseAccountsClient", "CreateUpdateGremlinContainer", err.Error()) + return result, validation.NewError("documentdb.DatabaseAccountsClient", "CreateUpdateGremlinDatabase", err.Error()) } - req, err := client.CreateUpdateGremlinContainerPreparer(ctx, resourceGroupName, accountName, databaseRid, containerRid, createUpdateGremlinContainerParameters) + req, err := client.CreateUpdateGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseRid, createUpdateGremlinDatabaseParameters) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateUpdateGremlinContainer", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateUpdateGremlinDatabase", nil, "Failure preparing request") return } - result, err = client.CreateUpdateGremlinContainerSender(req) + result, err = client.CreateUpdateGremlinDatabaseSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateUpdateGremlinContainer", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateUpdateGremlinDatabase", result.Response(), "Failure sending request") return } return } -// CreateUpdateGremlinContainerPreparer prepares the CreateUpdateGremlinContainer request. -func (client DatabaseAccountsClient) CreateUpdateGremlinContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string, createUpdateGremlinContainerParameters ContainerCreateUpdateParameters) (*http.Request, error) { +// CreateUpdateGremlinDatabasePreparer prepares the CreateUpdateGremlinDatabase request. +func (client DatabaseAccountsClient) CreateUpdateGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "containerRid": autorest.Encode("path", containerRid), "databaseRid": autorest.Encode("path", databaseRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -497,15 +495,15 @@ func (client DatabaseAccountsClient) CreateUpdateGremlinContainerPreparer(ctx co autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}/containers/{containerRid}", pathParameters), - autorest.WithJSON(createUpdateGremlinContainerParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}", pathParameters), + autorest.WithJSON(createUpdateGremlinDatabaseParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateUpdateGremlinContainerSender sends the CreateUpdateGremlinContainer request. The method will close the +// CreateUpdateGremlinDatabaseSender sends the CreateUpdateGremlinDatabase request. The method will close the // http.Response Body if it receives an error. -func (client DatabaseAccountsClient) CreateUpdateGremlinContainerSender(req *http.Request) (future DatabaseAccountsCreateUpdateGremlinContainerFuture, err error) { +func (client DatabaseAccountsClient) CreateUpdateGremlinDatabaseSender(req *http.Request) (future DatabaseAccountsCreateUpdateGremlinDatabaseFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) @@ -516,9 +514,9 @@ func (client DatabaseAccountsClient) CreateUpdateGremlinContainerSender(req *htt return } -// CreateUpdateGremlinContainerResponder handles the response to the CreateUpdateGremlinContainer request. The method always +// CreateUpdateGremlinDatabaseResponder handles the response to the CreateUpdateGremlinDatabase request. The method always // closes the http.Response Body. -func (client DatabaseAccountsClient) CreateUpdateGremlinContainerResponder(resp *http.Response) (result Container, err error) { +func (client DatabaseAccountsClient) CreateUpdateGremlinDatabaseResponder(resp *http.Response) (result GremlinDatabase, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -529,15 +527,16 @@ func (client DatabaseAccountsClient) CreateUpdateGremlinContainerResponder(resp return } -// CreateUpdateGremlinDatabase create or update an Azure Cosmos DB Gremlin database +// CreateUpdateGremlinGraph create or update an Azure Cosmos DB Gremlin graph // Parameters: // resourceGroupName - name of an Azure resource group. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. -// createUpdateGremlinDatabaseParameters - the parameters to provide for the current Gremlin database. -func (client DatabaseAccountsClient) CreateUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters) (result DatabaseAccountsCreateUpdateGremlinDatabaseFuture, err error) { +// graphRid - cosmos DB graph rid. +// createUpdateGremlinGraphParameters - the parameters to provide for the current Gremlin graph. +func (client DatabaseAccountsClient) CreateUpdateGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, graphRid string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters) (result DatabaseAccountsCreateUpdateGremlinGraphFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.CreateUpdateGremlinDatabase") + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.CreateUpdateGremlinGraph") defer func() { sc := -1 if result.Response() != nil { @@ -554,35 +553,36 @@ func (client DatabaseAccountsClient) CreateUpdateGremlinDatabase(ctx context.Con {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: createUpdateGremlinDatabaseParameters, - Constraints: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Options", Name: validation.Null, Rule: true, Chain: nil}, + {TargetValue: createUpdateGremlinGraphParameters, + Constraints: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Options", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewError("documentdb.DatabaseAccountsClient", "CreateUpdateGremlinDatabase", err.Error()) + return result, validation.NewError("documentdb.DatabaseAccountsClient", "CreateUpdateGremlinGraph", err.Error()) } - req, err := client.CreateUpdateGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseRid, createUpdateGremlinDatabaseParameters) + req, err := client.CreateUpdateGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseRid, graphRid, createUpdateGremlinGraphParameters) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateUpdateGremlinDatabase", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateUpdateGremlinGraph", nil, "Failure preparing request") return } - result, err = client.CreateUpdateGremlinDatabaseSender(req) + result, err = client.CreateUpdateGremlinGraphSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateUpdateGremlinDatabase", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateUpdateGremlinGraph", result.Response(), "Failure sending request") return } return } -// CreateUpdateGremlinDatabasePreparer prepares the CreateUpdateGremlinDatabase request. -func (client DatabaseAccountsClient) CreateUpdateGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters) (*http.Request, error) { +// CreateUpdateGremlinGraphPreparer prepares the CreateUpdateGremlinGraph request. +func (client DatabaseAccountsClient) CreateUpdateGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, graphRid string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "databaseRid": autorest.Encode("path", databaseRid), + "graphRid": autorest.Encode("path", graphRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -596,15 +596,15 @@ func (client DatabaseAccountsClient) CreateUpdateGremlinDatabasePreparer(ctx con autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}", pathParameters), - autorest.WithJSON(createUpdateGremlinDatabaseParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}/graphs/{graphRid}", pathParameters), + autorest.WithJSON(createUpdateGremlinGraphParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateUpdateGremlinDatabaseSender sends the CreateUpdateGremlinDatabase request. The method will close the +// CreateUpdateGremlinGraphSender sends the CreateUpdateGremlinGraph request. The method will close the // http.Response Body if it receives an error. -func (client DatabaseAccountsClient) CreateUpdateGremlinDatabaseSender(req *http.Request) (future DatabaseAccountsCreateUpdateGremlinDatabaseFuture, err error) { +func (client DatabaseAccountsClient) CreateUpdateGremlinGraphSender(req *http.Request) (future DatabaseAccountsCreateUpdateGremlinGraphFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) @@ -615,9 +615,9 @@ func (client DatabaseAccountsClient) CreateUpdateGremlinDatabaseSender(req *http return } -// CreateUpdateGremlinDatabaseResponder handles the response to the CreateUpdateGremlinDatabase request. The method always +// CreateUpdateGremlinGraphResponder handles the response to the CreateUpdateGremlinGraph request. The method always // closes the http.Response Body. -func (client DatabaseAccountsClient) CreateUpdateGremlinDatabaseResponder(resp *http.Response) (result GremlinDatabase, err error) { +func (client DatabaseAccountsClient) CreateUpdateGremlinGraphResponder(resp *http.Response) (result GremlinGraph, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -835,7 +835,7 @@ func (client DatabaseAccountsClient) CreateUpdateMongoDatabaseResponder(resp *ht // databaseRid - cosmos DB database rid. // containerRid - cosmos DB container rid. // createUpdateSQLContainerParameters - the parameters to provide for the current SQL container. -func (client DatabaseAccountsClient) CreateUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string, createUpdateSQLContainerParameters ContainerCreateUpdateParameters) (result DatabaseAccountsCreateUpdateSQLContainerFuture, err error) { +func (client DatabaseAccountsClient) CreateUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters) (result DatabaseAccountsCreateUpdateSQLContainerFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.CreateUpdateSQLContainer") defer func() { @@ -855,10 +855,10 @@ func (client DatabaseAccountsClient) CreateUpdateSQLContainer(ctx context.Contex Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, {TargetValue: createUpdateSQLContainerParameters, - Constraints: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.ContainerCreateUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.ContainerCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.ContainerCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "createUpdateSQLContainerParameters.ContainerCreateUpdateProperties.Options", Name: validation.Null, Rule: true, Chain: nil}, + Constraints: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Options", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("documentdb.DatabaseAccountsClient", "CreateUpdateSQLContainer", err.Error()) } @@ -879,7 +879,7 @@ func (client DatabaseAccountsClient) CreateUpdateSQLContainer(ctx context.Contex } // CreateUpdateSQLContainerPreparer prepares the CreateUpdateSQLContainer request. -func (client DatabaseAccountsClient) CreateUpdateSQLContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string, createUpdateSQLContainerParameters ContainerCreateUpdateParameters) (*http.Request, error) { +func (client DatabaseAccountsClient) CreateUpdateSQLContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "containerRid": autorest.Encode("path", containerRid), @@ -918,7 +918,7 @@ func (client DatabaseAccountsClient) CreateUpdateSQLContainerSender(req *http.Re // CreateUpdateSQLContainerResponder handles the response to the CreateUpdateSQLContainer request. The method always // closes the http.Response Body. -func (client DatabaseAccountsClient) CreateUpdateSQLContainerResponder(resp *http.Response) (result Container, err error) { +func (client DatabaseAccountsClient) CreateUpdateSQLContainerResponder(resp *http.Response) (result SQLContainer, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -1394,15 +1394,14 @@ func (client DatabaseAccountsClient) DeleteCassandraTableResponder(resp *http.Re return } -// DeleteGremlinContainer deletes an existing Azure Cosmos DB Gremlin container. +// DeleteGremlinDatabase deletes an existing Azure Cosmos DB Gremlin database. // Parameters: // resourceGroupName - name of an Azure resource group. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. -// containerRid - cosmos DB container rid. -func (client DatabaseAccountsClient) DeleteGremlinContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string) (result DatabaseAccountsDeleteGremlinContainerFuture, err error) { +func (client DatabaseAccountsClient) DeleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result DatabaseAccountsDeleteGremlinDatabaseFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.DeleteGremlinContainer") + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.DeleteGremlinDatabase") defer func() { sc := -1 if result.Response() != nil { @@ -1419,29 +1418,28 @@ func (client DatabaseAccountsClient) DeleteGremlinContainer(ctx context.Context, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewError("documentdb.DatabaseAccountsClient", "DeleteGremlinContainer", err.Error()) + return result, validation.NewError("documentdb.DatabaseAccountsClient", "DeleteGremlinDatabase", err.Error()) } - req, err := client.DeleteGremlinContainerPreparer(ctx, resourceGroupName, accountName, databaseRid, containerRid) + req, err := client.DeleteGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseRid) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "DeleteGremlinContainer", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "DeleteGremlinDatabase", nil, "Failure preparing request") return } - result, err = client.DeleteGremlinContainerSender(req) + result, err = client.DeleteGremlinDatabaseSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "DeleteGremlinContainer", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "DeleteGremlinDatabase", result.Response(), "Failure sending request") return } return } -// DeleteGremlinContainerPreparer prepares the DeleteGremlinContainer request. -func (client DatabaseAccountsClient) DeleteGremlinContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string) (*http.Request, error) { +// DeleteGremlinDatabasePreparer prepares the DeleteGremlinDatabase request. +func (client DatabaseAccountsClient) DeleteGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "containerRid": autorest.Encode("path", containerRid), "databaseRid": autorest.Encode("path", databaseRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -1455,14 +1453,14 @@ func (client DatabaseAccountsClient) DeleteGremlinContainerPreparer(ctx context. preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}/containers/{containerRid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteGremlinContainerSender sends the DeleteGremlinContainer request. The method will close the +// DeleteGremlinDatabaseSender sends the DeleteGremlinDatabase request. The method will close the // http.Response Body if it receives an error. -func (client DatabaseAccountsClient) DeleteGremlinContainerSender(req *http.Request) (future DatabaseAccountsDeleteGremlinContainerFuture, err error) { +func (client DatabaseAccountsClient) DeleteGremlinDatabaseSender(req *http.Request) (future DatabaseAccountsDeleteGremlinDatabaseFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) @@ -1473,9 +1471,9 @@ func (client DatabaseAccountsClient) DeleteGremlinContainerSender(req *http.Requ return } -// DeleteGremlinContainerResponder handles the response to the DeleteGremlinContainer request. The method always +// DeleteGremlinDatabaseResponder handles the response to the DeleteGremlinDatabase request. The method always // closes the http.Response Body. -func (client DatabaseAccountsClient) DeleteGremlinContainerResponder(resp *http.Response) (result autorest.Response, err error) { +func (client DatabaseAccountsClient) DeleteGremlinDatabaseResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -1485,14 +1483,15 @@ func (client DatabaseAccountsClient) DeleteGremlinContainerResponder(resp *http. return } -// DeleteGremlinDatabase deletes an existing Azure Cosmos DB Gremlin database. +// DeleteGremlinGraph deletes an existing Azure Cosmos DB Gremlin graph. // Parameters: // resourceGroupName - name of an Azure resource group. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. -func (client DatabaseAccountsClient) DeleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result DatabaseAccountsDeleteGremlinDatabaseFuture, err error) { +// graphRid - cosmos DB graph rid. +func (client DatabaseAccountsClient) DeleteGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, graphRid string) (result DatabaseAccountsDeleteGremlinGraphFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.DeleteGremlinDatabase") + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.DeleteGremlinGraph") defer func() { sc := -1 if result.Response() != nil { @@ -1509,29 +1508,30 @@ func (client DatabaseAccountsClient) DeleteGremlinDatabase(ctx context.Context, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewError("documentdb.DatabaseAccountsClient", "DeleteGremlinDatabase", err.Error()) + return result, validation.NewError("documentdb.DatabaseAccountsClient", "DeleteGremlinGraph", err.Error()) } - req, err := client.DeleteGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseRid) + req, err := client.DeleteGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseRid, graphRid) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "DeleteGremlinDatabase", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "DeleteGremlinGraph", nil, "Failure preparing request") return } - result, err = client.DeleteGremlinDatabaseSender(req) + result, err = client.DeleteGremlinGraphSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "DeleteGremlinDatabase", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "DeleteGremlinGraph", result.Response(), "Failure sending request") return } return } -// DeleteGremlinDatabasePreparer prepares the DeleteGremlinDatabase request. -func (client DatabaseAccountsClient) DeleteGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (*http.Request, error) { +// DeleteGremlinGraphPreparer prepares the DeleteGremlinGraph request. +func (client DatabaseAccountsClient) DeleteGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, graphRid string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "databaseRid": autorest.Encode("path", databaseRid), + "graphRid": autorest.Encode("path", graphRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -1544,14 +1544,14 @@ func (client DatabaseAccountsClient) DeleteGremlinDatabasePreparer(ctx context.C preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}/graphs/{graphRid}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteGremlinDatabaseSender sends the DeleteGremlinDatabase request. The method will close the +// DeleteGremlinGraphSender sends the DeleteGremlinGraph request. The method will close the // http.Response Body if it receives an error. -func (client DatabaseAccountsClient) DeleteGremlinDatabaseSender(req *http.Request) (future DatabaseAccountsDeleteGremlinDatabaseFuture, err error) { +func (client DatabaseAccountsClient) DeleteGremlinGraphSender(req *http.Request) (future DatabaseAccountsDeleteGremlinGraphFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) @@ -1562,9 +1562,9 @@ func (client DatabaseAccountsClient) DeleteGremlinDatabaseSender(req *http.Reque return } -// DeleteGremlinDatabaseResponder handles the response to the DeleteGremlinDatabase request. The method always +// DeleteGremlinGraphResponder handles the response to the DeleteGremlinGraph request. The method always // closes the http.Response Body. -func (client DatabaseAccountsClient) DeleteGremlinDatabaseResponder(resp *http.Response) (result autorest.Response, err error) { +func (client DatabaseAccountsClient) DeleteGremlinGraphResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -2388,15 +2388,15 @@ func (client DatabaseAccountsClient) GetCassandraTableResponder(resp *http.Respo return } -// GetGremlinContainer gets the Gremlin container under an existing Azure Cosmos DB database account. +// GetGremlinDatabase gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided +// id. // Parameters: // resourceGroupName - name of an Azure resource group. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. -// containerRid - cosmos DB container rid. -func (client DatabaseAccountsClient) GetGremlinContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string) (result Container, err error) { +func (client DatabaseAccountsClient) GetGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result GremlinDatabase, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.GetGremlinContainer") + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.GetGremlinDatabase") defer func() { sc := -1 if result.Response.Response != nil { @@ -2413,35 +2413,34 @@ func (client DatabaseAccountsClient) GetGremlinContainer(ctx context.Context, re {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewError("documentdb.DatabaseAccountsClient", "GetGremlinContainer", err.Error()) + return result, validation.NewError("documentdb.DatabaseAccountsClient", "GetGremlinDatabase", err.Error()) } - req, err := client.GetGremlinContainerPreparer(ctx, resourceGroupName, accountName, databaseRid, containerRid) + req, err := client.GetGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseRid) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinContainer", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinDatabase", nil, "Failure preparing request") return } - resp, err := client.GetGremlinContainerSender(req) + resp, err := client.GetGremlinDatabaseSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinContainer", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinDatabase", resp, "Failure sending request") return } - result, err = client.GetGremlinContainerResponder(resp) + result, err = client.GetGremlinDatabaseResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinContainer", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinDatabase", resp, "Failure responding to request") } return } -// GetGremlinContainerPreparer prepares the GetGremlinContainer request. -func (client DatabaseAccountsClient) GetGremlinContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string) (*http.Request, error) { +// GetGremlinDatabasePreparer prepares the GetGremlinDatabase request. +func (client DatabaseAccountsClient) GetGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "containerRid": autorest.Encode("path", containerRid), "databaseRid": autorest.Encode("path", databaseRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -2455,21 +2454,21 @@ func (client DatabaseAccountsClient) GetGremlinContainerPreparer(ctx context.Con preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}/containers/{containerRid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetGremlinContainerSender sends the GetGremlinContainer request. The method will close the +// GetGremlinDatabaseSender sends the GetGremlinDatabase request. The method will close the // http.Response Body if it receives an error. -func (client DatabaseAccountsClient) GetGremlinContainerSender(req *http.Request) (*http.Response, error) { +func (client DatabaseAccountsClient) GetGremlinDatabaseSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } -// GetGremlinContainerResponder handles the response to the GetGremlinContainer request. The method always +// GetGremlinDatabaseResponder handles the response to the GetGremlinDatabase request. The method always // closes the http.Response Body. -func (client DatabaseAccountsClient) GetGremlinContainerResponder(resp *http.Response) (result Container, err error) { +func (client DatabaseAccountsClient) GetGremlinDatabaseResponder(resp *http.Response) (result GremlinDatabase, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -2480,15 +2479,15 @@ func (client DatabaseAccountsClient) GetGremlinContainerResponder(resp *http.Res return } -// GetGremlinDatabase gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided -// id. +// GetGremlinGraph gets the Gremlin graph under an existing Azure Cosmos DB database account. // Parameters: // resourceGroupName - name of an Azure resource group. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. -func (client DatabaseAccountsClient) GetGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result GremlinDatabase, err error) { +// graphRid - cosmos DB graph rid. +func (client DatabaseAccountsClient) GetGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, graphRid string) (result GremlinGraph, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.GetGremlinDatabase") + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.GetGremlinGraph") defer func() { sc := -1 if result.Response.Response != nil { @@ -2505,35 +2504,36 @@ func (client DatabaseAccountsClient) GetGremlinDatabase(ctx context.Context, res {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewError("documentdb.DatabaseAccountsClient", "GetGremlinDatabase", err.Error()) + return result, validation.NewError("documentdb.DatabaseAccountsClient", "GetGremlinGraph", err.Error()) } - req, err := client.GetGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseRid) + req, err := client.GetGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseRid, graphRid) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinDatabase", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinGraph", nil, "Failure preparing request") return } - resp, err := client.GetGremlinDatabaseSender(req) + resp, err := client.GetGremlinGraphSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinDatabase", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinGraph", resp, "Failure sending request") return } - result, err = client.GetGremlinDatabaseResponder(resp) + result, err = client.GetGremlinGraphResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinDatabase", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetGremlinGraph", resp, "Failure responding to request") } return } -// GetGremlinDatabasePreparer prepares the GetGremlinDatabase request. -func (client DatabaseAccountsClient) GetGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (*http.Request, error) { +// GetGremlinGraphPreparer prepares the GetGremlinGraph request. +func (client DatabaseAccountsClient) GetGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, graphRid string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "databaseRid": autorest.Encode("path", databaseRid), + "graphRid": autorest.Encode("path", graphRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -2546,21 +2546,21 @@ func (client DatabaseAccountsClient) GetGremlinDatabasePreparer(ctx context.Cont preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}/graphs/{graphRid}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetGremlinDatabaseSender sends the GetGremlinDatabase request. The method will close the +// GetGremlinGraphSender sends the GetGremlinGraph request. The method will close the // http.Response Body if it receives an error. -func (client DatabaseAccountsClient) GetGremlinDatabaseSender(req *http.Request) (*http.Response, error) { +func (client DatabaseAccountsClient) GetGremlinGraphSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } -// GetGremlinDatabaseResponder handles the response to the GetGremlinDatabase request. The method always +// GetGremlinGraphResponder handles the response to the GetGremlinGraph request. The method always // closes the http.Response Body. -func (client DatabaseAccountsClient) GetGremlinDatabaseResponder(resp *http.Response) (result GremlinDatabase, err error) { +func (client DatabaseAccountsClient) GetGremlinGraphResponder(resp *http.Response) (result GremlinGraph, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -2847,7 +2847,7 @@ func (client DatabaseAccountsClient) GetReadOnlyKeysResponder(resp *http.Respons // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. // containerRid - cosmos DB container rid. -func (client DatabaseAccountsClient) GetSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string) (result Container, err error) { +func (client DatabaseAccountsClient) GetSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string) (result SQLContainer, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.GetSQLContainer") defer func() { @@ -2922,7 +2922,7 @@ func (client DatabaseAccountsClient) GetSQLContainerSender(req *http.Request) (* // GetSQLContainerResponder handles the response to the GetSQLContainer request. The method always // closes the http.Response Body. -func (client DatabaseAccountsClient) GetSQLContainerResponder(resp *http.Response) (result Container, err error) { +func (client DatabaseAccountsClient) GetSQLContainerResponder(resp *http.Response) (result SQLContainer, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -3534,14 +3534,13 @@ func (client DatabaseAccountsClient) ListConnectionStringsResponder(resp *http.R return } -// ListGremlinContainers lists the Gremlin container under an existing Azure Cosmos DB database account. +// ListGremlinDatabases lists the Gremlin databases under an existing Azure Cosmos DB database account. // Parameters: // resourceGroupName - name of an Azure resource group. // accountName - cosmos DB database account name. -// databaseRid - cosmos DB database rid. -func (client DatabaseAccountsClient) ListGremlinContainers(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result ContainerListResult, err error) { +func (client DatabaseAccountsClient) ListGremlinDatabases(ctx context.Context, resourceGroupName string, accountName string) (result GremlinDatabaseListResult, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListGremlinContainers") + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListGremlinDatabases") defer func() { sc := -1 if result.Response.Response != nil { @@ -3558,35 +3557,34 @@ func (client DatabaseAccountsClient) ListGremlinContainers(ctx context.Context, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListGremlinContainers", err.Error()) + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListGremlinDatabases", err.Error()) } - req, err := client.ListGremlinContainersPreparer(ctx, resourceGroupName, accountName, databaseRid) + req, err := client.ListGremlinDatabasesPreparer(ctx, resourceGroupName, accountName) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinContainers", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinDatabases", nil, "Failure preparing request") return } - resp, err := client.ListGremlinContainersSender(req) + resp, err := client.ListGremlinDatabasesSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinContainers", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinDatabases", resp, "Failure sending request") return } - result, err = client.ListGremlinContainersResponder(resp) + result, err = client.ListGremlinDatabasesResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinContainers", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinDatabases", resp, "Failure responding to request") } return } -// ListGremlinContainersPreparer prepares the ListGremlinContainers request. -func (client DatabaseAccountsClient) ListGremlinContainersPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (*http.Request, error) { +// ListGremlinDatabasesPreparer prepares the ListGremlinDatabases request. +func (client DatabaseAccountsClient) ListGremlinDatabasesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "databaseRid": autorest.Encode("path", databaseRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -3599,21 +3597,21 @@ func (client DatabaseAccountsClient) ListGremlinContainersPreparer(ctx context.C preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}/containers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListGremlinContainersSender sends the ListGremlinContainers request. The method will close the +// ListGremlinDatabasesSender sends the ListGremlinDatabases request. The method will close the // http.Response Body if it receives an error. -func (client DatabaseAccountsClient) ListGremlinContainersSender(req *http.Request) (*http.Response, error) { +func (client DatabaseAccountsClient) ListGremlinDatabasesSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } -// ListGremlinContainersResponder handles the response to the ListGremlinContainers request. The method always +// ListGremlinDatabasesResponder handles the response to the ListGremlinDatabases request. The method always // closes the http.Response Body. -func (client DatabaseAccountsClient) ListGremlinContainersResponder(resp *http.Response) (result ContainerListResult, err error) { +func (client DatabaseAccountsClient) ListGremlinDatabasesResponder(resp *http.Response) (result GremlinDatabaseListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -3624,13 +3622,14 @@ func (client DatabaseAccountsClient) ListGremlinContainersResponder(resp *http.R return } -// ListGremlinDatabases lists the Gremlin databases under an existing Azure Cosmos DB database account. +// ListGremlinGraphs lists the Gremlin graph under an existing Azure Cosmos DB database account. // Parameters: // resourceGroupName - name of an Azure resource group. // accountName - cosmos DB database account name. -func (client DatabaseAccountsClient) ListGremlinDatabases(ctx context.Context, resourceGroupName string, accountName string) (result GremlinDatabaseListResult, err error) { +// databaseRid - cosmos DB database rid. +func (client DatabaseAccountsClient) ListGremlinGraphs(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result GremlinGraphListResult, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListGremlinDatabases") + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListGremlinGraphs") defer func() { sc := -1 if result.Response.Response != nil { @@ -3647,34 +3646,35 @@ func (client DatabaseAccountsClient) ListGremlinDatabases(ctx context.Context, r {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListGremlinDatabases", err.Error()) + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListGremlinGraphs", err.Error()) } - req, err := client.ListGremlinDatabasesPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListGremlinGraphsPreparer(ctx, resourceGroupName, accountName, databaseRid) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinDatabases", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinGraphs", nil, "Failure preparing request") return } - resp, err := client.ListGremlinDatabasesSender(req) + resp, err := client.ListGremlinGraphsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinDatabases", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinGraphs", resp, "Failure sending request") return } - result, err = client.ListGremlinDatabasesResponder(resp) + result, err = client.ListGremlinGraphsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinDatabases", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListGremlinGraphs", resp, "Failure responding to request") } return } -// ListGremlinDatabasesPreparer prepares the ListGremlinDatabases request. -func (client DatabaseAccountsClient) ListGremlinDatabasesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +// ListGremlinGraphsPreparer prepares the ListGremlinGraphs request. +func (client DatabaseAccountsClient) ListGremlinGraphsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), + "databaseRid": autorest.Encode("path", databaseRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -3687,21 +3687,21 @@ func (client DatabaseAccountsClient) ListGremlinDatabasesPreparer(ctx context.Co preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}/graphs", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListGremlinDatabasesSender sends the ListGremlinDatabases request. The method will close the +// ListGremlinGraphsSender sends the ListGremlinGraphs request. The method will close the // http.Response Body if it receives an error. -func (client DatabaseAccountsClient) ListGremlinDatabasesSender(req *http.Request) (*http.Response, error) { +func (client DatabaseAccountsClient) ListGremlinGraphsSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } -// ListGremlinDatabasesResponder handles the response to the ListGremlinDatabases request. The method always +// ListGremlinGraphsResponder handles the response to the ListGremlinGraphs request. The method always // closes the http.Response Body. -func (client DatabaseAccountsClient) ListGremlinDatabasesResponder(resp *http.Response) (result GremlinDatabaseListResult, err error) { +func (client DatabaseAccountsClient) ListGremlinGraphsResponder(resp *http.Response) (result GremlinGraphListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -4251,7 +4251,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeysResponder(resp *http.Respon // resourceGroupName - name of an Azure resource group. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. -func (client DatabaseAccountsClient) ListSQLContainers(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result ContainerListResult, err error) { +func (client DatabaseAccountsClient) ListSQLContainers(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result SQLContainerListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListSQLContainers") defer func() { @@ -4325,7 +4325,7 @@ func (client DatabaseAccountsClient) ListSQLContainersSender(req *http.Request) // ListSQLContainersResponder handles the response to the ListSQLContainers request. The method always // closes the http.Response Body. -func (client DatabaseAccountsClient) ListSQLContainersResponder(resp *http.Response) (result ContainerListResult, err error) { +func (client DatabaseAccountsClient) ListSQLContainersResponder(resp *http.Response) (result SQLContainerListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/cosmos-db/mgmt/2015-04-08/documentdb/documentdbapi/interfaces.go b/services/cosmos-db/mgmt/2015-04-08/documentdb/documentdbapi/interfaces.go index 84e17828fc94..95e9db5d082d 100644 --- a/services/cosmos-db/mgmt/2015-04-08/documentdb/documentdbapi/interfaces.go +++ b/services/cosmos-db/mgmt/2015-04-08/documentdb/documentdbapi/interfaces.go @@ -29,18 +29,18 @@ type DatabaseAccountsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, createUpdateParameters documentdb.DatabaseAccountCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateOrUpdateFuture, err error) CreateUpdateCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceRid string, createUpdateCassandraKeyspaceParameters documentdb.CassandraKeyspaceCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateUpdateCassandraKeyspaceFuture, err error) CreateUpdateCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceRid string, tableRid string, createUpdateCassandraTableParameters documentdb.CassandraTableCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateUpdateCassandraTableFuture, err error) - CreateUpdateGremlinContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string, createUpdateGremlinContainerParameters documentdb.ContainerCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateUpdateGremlinContainerFuture, err error) CreateUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, createUpdateGremlinDatabaseParameters documentdb.GremlinDatabaseCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateUpdateGremlinDatabaseFuture, err error) + CreateUpdateGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, graphRid string, createUpdateGremlinGraphParameters documentdb.GremlinGraphCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateUpdateGremlinGraphFuture, err error) CreateUpdateMongoCollection(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, createUpdateMongoCollectionParameters documentdb.MongoCollectionCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateUpdateMongoCollectionFuture, err error) CreateUpdateMongoDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, createUpdateMongoDatabaseParameters documentdb.MongoDatabaseCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateUpdateMongoDatabaseFuture, err error) - CreateUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string, createUpdateSQLContainerParameters documentdb.ContainerCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateUpdateSQLContainerFuture, err error) + CreateUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string, createUpdateSQLContainerParameters documentdb.SQLContainerCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateUpdateSQLContainerFuture, err error) CreateUpdateSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, createUpdateSQLDatabaseParameters documentdb.SQLDatabaseCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateUpdateSQLDatabaseFuture, err error) CreateUpdateTable(ctx context.Context, resourceGroupName string, accountName string, tableRid string, createUpdateTableParameters documentdb.TableCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateUpdateTableFuture, err error) Delete(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountsDeleteFuture, err error) DeleteCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceRid string) (result documentdb.DatabaseAccountsDeleteCassandraKeyspaceFuture, err error) DeleteCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceRid string, tableRid string) (result documentdb.DatabaseAccountsDeleteCassandraTableFuture, err error) - DeleteGremlinContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string) (result documentdb.DatabaseAccountsDeleteGremlinContainerFuture, err error) DeleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.DatabaseAccountsDeleteGremlinDatabaseFuture, err error) + DeleteGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, graphRid string) (result documentdb.DatabaseAccountsDeleteGremlinGraphFuture, err error) DeleteMongoCollection(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string) (result documentdb.DatabaseAccountsDeleteMongoCollectionFuture, err error) DeleteMongoDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.DatabaseAccountsDeleteMongoDatabaseFuture, err error) DeleteSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string) (result documentdb.DatabaseAccountsDeleteSQLContainerFuture, err error) @@ -50,12 +50,12 @@ type DatabaseAccountsClientAPI interface { Get(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccount, err error) GetCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceRid string) (result documentdb.CassandraKeyspace, err error) GetCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceRid string, tableRid string) (result documentdb.CassandraTable, err error) - GetGremlinContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string) (result documentdb.Container, err error) GetGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.GremlinDatabase, err error) + GetGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, graphRid string) (result documentdb.GremlinGraph, err error) GetMongoCollection(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string) (result documentdb.MongoCollection, err error) GetMongoDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.MongoDatabase, err error) GetReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListReadOnlyKeysResult, err error) - GetSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string) (result documentdb.Container, err error) + GetSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, containerRid string) (result documentdb.SQLContainer, err error) GetSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.SQLDatabase, err error) GetTable(ctx context.Context, resourceGroupName string, accountName string, tableRid string) (result documentdb.Table, err error) List(ctx context.Context) (result documentdb.DatabaseAccountsListResult, err error) @@ -63,15 +63,15 @@ type DatabaseAccountsClientAPI interface { ListCassandraKeyspaces(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.CassandraKeyspaceListResult, err error) ListCassandraTables(ctx context.Context, resourceGroupName string, accountName string, keyspaceRid string) (result documentdb.CassandraTableListResult, err error) ListConnectionStrings(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListConnectionStringsResult, err error) - ListGremlinContainers(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.ContainerListResult, err error) ListGremlinDatabases(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.GremlinDatabaseListResult, err error) + ListGremlinGraphs(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.GremlinGraphListResult, err error) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListKeysResult, err error) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.MetricDefinitionsListResult, err error) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, filter string) (result documentdb.MetricListResult, err error) ListMongoCollections(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.MongoCollectionListResult, err error) ListMongoDatabases(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.MongoDatabaseListResult, err error) ListReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListReadOnlyKeysResult, err error) - ListSQLContainers(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.ContainerListResult, err error) + ListSQLContainers(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.SQLContainerListResult, err error) ListSQLDatabases(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.SQLDatabaseListResult, err error) ListTables(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.TableListResult, err error) ListUsages(ctx context.Context, resourceGroupName string, accountName string, filter string) (result documentdb.UsagesResult, err error) diff --git a/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go b/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go index c66343399c3a..2eb4603f6096 100644 --- a/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go +++ b/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go @@ -247,11 +247,11 @@ type CassandraKeyspace struct { autorest.Response `json:"-"` // CassandraKeyspaceProperties - The properties of an Azure Cosmos DB Cassandra keyspace *CassandraKeyspaceProperties `json:"properties,omitempty"` - // ID - The unique resource identifier of the database account. + // ID - READ-ONLY; The unique resource identifier of the database account. ID *string `json:"id,omitempty"` - // Name - The name of the database account. + // Name - READ-ONLY; The name of the database account. Name *string `json:"name,omitempty"` - // Type - The type of Azure resource. + // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -264,15 +264,6 @@ func (ck CassandraKeyspace) MarshalJSON() ([]byte, error) { if ck.CassandraKeyspaceProperties != nil { objectMap["properties"] = ck.CassandraKeyspaceProperties } - if ck.ID != nil { - objectMap["id"] = ck.ID - } - if ck.Name != nil { - objectMap["name"] = ck.Name - } - if ck.Type != nil { - objectMap["type"] = ck.Type - } if ck.Location != nil { objectMap["location"] = ck.Location } @@ -415,7 +406,7 @@ func (ckcup CassandraKeyspaceCreateUpdateProperties) MarshalJSON() ([]byte, erro // properties. type CassandraKeyspaceListResult struct { autorest.Response `json:"-"` - // Value - List of Cassandra keyspaces and their properties. + // Value - READ-ONLY; List of Cassandra keyspaces and their properties. Value *[]CassandraKeyspace `json:"value,omitempty"` } @@ -452,11 +443,11 @@ type CassandraTable struct { autorest.Response `json:"-"` // CassandraTableProperties - The properties of an Azure Cosmos DB Cassandra table *CassandraTableProperties `json:"properties,omitempty"` - // ID - The unique resource identifier of the database account. + // ID - READ-ONLY; The unique resource identifier of the database account. ID *string `json:"id,omitempty"` - // Name - The name of the database account. + // Name - READ-ONLY; The name of the database account. Name *string `json:"name,omitempty"` - // Type - The type of Azure resource. + // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -469,15 +460,6 @@ func (ct CassandraTable) MarshalJSON() ([]byte, error) { if ct.CassandraTableProperties != nil { objectMap["properties"] = ct.CassandraTableProperties } - if ct.ID != nil { - objectMap["id"] = ct.ID - } - if ct.Name != nil { - objectMap["name"] = ct.Name - } - if ct.Type != nil { - objectMap["type"] = ct.Type - } if ct.Location != nil { objectMap["location"] = ct.Location } @@ -619,7 +601,7 @@ func (ctcup CassandraTableCreateUpdateProperties) MarshalJSON() ([]byte, error) // properties. type CassandraTableListResult struct { autorest.Response `json:"-"` - // Value - List of Cassandra tables and their properties. + // Value - READ-ONLY; List of Cassandra tables and their properties. Value *[]CassandraTable `json:"value,omitempty"` } @@ -679,181 +661,6 @@ type ConsistencyPolicy struct { MaxIntervalInSeconds *int32 `json:"maxIntervalInSeconds,omitempty"` } -// Container an Azure Cosmos DB container. -type Container struct { - autorest.Response `json:"-"` - // ContainerProperties - The properties of an Azure Cosmos DB container - *ContainerProperties `json:"properties,omitempty"` - // ID - The unique resource identifier of the database account. - ID *string `json:"id,omitempty"` - // Name - The name of the database account. - Name *string `json:"name,omitempty"` - // Type - The type of Azure resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Container. -func (c Container) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ContainerProperties != nil { - objectMap["properties"] = c.ContainerProperties - } - if c.ID != nil { - objectMap["id"] = c.ID - } - if c.Name != nil { - objectMap["name"] = c.Name - } - if c.Type != nil { - objectMap["type"] = c.Type - } - if c.Location != nil { - objectMap["location"] = c.Location - } - if c.Tags != nil { - objectMap["tags"] = c.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Container struct. -func (c *Container) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var containerProperties ContainerProperties - err = json.Unmarshal(*v, &containerProperties) - if err != nil { - return err - } - c.ContainerProperties = &containerProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - c.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - c.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - c.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - c.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - c.Tags = tags - } - } - } - - return nil -} - -// ContainerCreateUpdateParameters parameters to create and update Cosmos DB container. -type ContainerCreateUpdateParameters struct { - // ContainerCreateUpdateProperties - Properties to create and update Azure Cosmos DB container. - *ContainerCreateUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerCreateUpdateParameters. -func (ccup ContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccup.ContainerCreateUpdateProperties != nil { - objectMap["properties"] = ccup.ContainerCreateUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ContainerCreateUpdateParameters struct. -func (ccup *ContainerCreateUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var containerCreateUpdateProperties ContainerCreateUpdateProperties - err = json.Unmarshal(*v, &containerCreateUpdateProperties) - if err != nil { - return err - } - ccup.ContainerCreateUpdateProperties = &containerCreateUpdateProperties - } - } - } - - return nil -} - -// ContainerCreateUpdateProperties properties to create and update Azure Cosmos DB container. -type ContainerCreateUpdateProperties struct { - // Resource - The standard JSON format of a container - Resource *ContainerResource `json:"resource,omitempty"` - // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - Options map[string]*string `json:"options"` -} - -// MarshalJSON is the custom marshaler for ContainerCreateUpdateProperties. -func (ccup ContainerCreateUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccup.Resource != nil { - objectMap["resource"] = ccup.Resource - } - if ccup.Options != nil { - objectMap["options"] = ccup.Options - } - return json.Marshal(objectMap) -} - -// ContainerListResult the List operation response, that contains the containers and their properties. -type ContainerListResult struct { - autorest.Response `json:"-"` - // Value - List of containers and their properties. - Value *[]Container `json:"value,omitempty"` -} - // ContainerPartitionKey the configuration of the partition key to be used for partitioning data into // multiple partitions type ContainerPartitionKey struct { @@ -863,55 +670,17 @@ type ContainerPartitionKey struct { Kind PartitionKind `json:"kind,omitempty"` } -// ContainerProperties the properties of an Azure Cosmos DB container -type ContainerProperties struct { - // ID - Name of the Cosmos DB container - ID *string `json:"id,omitempty"` - // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container - IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` - // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions - PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` - // DefaultTTL - Default time to live - DefaultTTL *int32 `json:"defaultTtl,omitempty"` - // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. - UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` - // ConflictResolutionPolicy - The conflict resolution policy for the container. - ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` - // Rid - A system generated property. A unique identifier. - Rid *string `json:"_rid,omitempty"` - // Ts - A system generated property that denotes the last updated timestamp of the resource. - Ts interface{} `json:"_ts,omitempty"` - // Etag - A system generated property representing the resource etag required for optimistic concurrency control. - Etag *string `json:"_etag,omitempty"` -} - -// ContainerResource cosmos DB container resource object -type ContainerResource struct { - // ID - Name of the Cosmos DB container - ID *string `json:"id,omitempty"` - // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container - IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` - // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions - PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` - // DefaultTTL - Default time to live - DefaultTTL *int32 `json:"defaultTtl,omitempty"` - // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. - UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` - // ConflictResolutionPolicy - The conflict resolution policy for the container. - ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` -} - // DatabaseAccount an Azure Cosmos DB database account. type DatabaseAccount struct { autorest.Response `json:"-"` // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' Kind DatabaseAccountKind `json:"kind,omitempty"` *DatabaseAccountProperties `json:"properties,omitempty"` - // ID - The unique resource identifier of the database account. + // ID - READ-ONLY; The unique resource identifier of the database account. ID *string `json:"id,omitempty"` - // Name - The name of the database account. + // Name - READ-ONLY; The name of the database account. Name *string `json:"name,omitempty"` - // Type - The type of Azure resource. + // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -927,15 +696,6 @@ func (da DatabaseAccount) MarshalJSON() ([]byte, error) { if da.DatabaseAccountProperties != nil { objectMap["properties"] = da.DatabaseAccountProperties } - if da.ID != nil { - objectMap["id"] = da.ID - } - if da.Name != nil { - objectMap["name"] = da.Name - } - if da.Type != nil { - objectMap["type"] = da.Type - } if da.Location != nil { objectMap["location"] = da.Location } @@ -1025,9 +785,9 @@ func (da *DatabaseAccount) UnmarshalJSON(body []byte) error { // DatabaseAccountConnectionString connection string for the Cosmos DB account type DatabaseAccountConnectionString struct { - // ConnectionString - Value of the connection string + // ConnectionString - READ-ONLY; Value of the connection string ConnectionString *string `json:"connectionString,omitempty"` - // Description - Description of the connection string + // Description - READ-ONLY; Description of the connection string Description *string `json:"description,omitempty"` } @@ -1036,11 +796,11 @@ type DatabaseAccountCreateUpdateParameters struct { // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' Kind DatabaseAccountKind `json:"kind,omitempty"` *DatabaseAccountCreateUpdateProperties `json:"properties,omitempty"` - // ID - The unique resource identifier of the database account. + // ID - READ-ONLY; The unique resource identifier of the database account. ID *string `json:"id,omitempty"` - // Name - The name of the database account. + // Name - READ-ONLY; The name of the database account. Name *string `json:"name,omitempty"` - // Type - The type of Azure resource. + // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -1056,15 +816,6 @@ func (dacup DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) if dacup.DatabaseAccountCreateUpdateProperties != nil { objectMap["properties"] = dacup.DatabaseAccountCreateUpdateProperties } - if dacup.ID != nil { - objectMap["id"] = dacup.ID - } - if dacup.Name != nil { - objectMap["name"] = dacup.Name - } - if dacup.Type != nil { - objectMap["type"] = dacup.Type - } if dacup.Location != nil { objectMap["location"] = dacup.Location } @@ -1184,9 +935,9 @@ type DatabaseAccountListConnectionStringsResult struct { // DatabaseAccountListKeysResult the access keys for the given database account. type DatabaseAccountListKeysResult struct { autorest.Response `json:"-"` - // PrimaryMasterKey - Base 64 encoded value of the primary read-write key. + // PrimaryMasterKey - READ-ONLY; Base 64 encoded value of the primary read-write key. PrimaryMasterKey *string `json:"primaryMasterKey,omitempty"` - // SecondaryMasterKey - Base 64 encoded value of the secondary read-write key. + // SecondaryMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-write key. SecondaryMasterKey *string `json:"secondaryMasterKey,omitempty"` *DatabaseAccountListReadOnlyKeysResult `json:"properties,omitempty"` } @@ -1194,12 +945,6 @@ type DatabaseAccountListKeysResult struct { // MarshalJSON is the custom marshaler for DatabaseAccountListKeysResult. func (dalkr DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dalkr.PrimaryMasterKey != nil { - objectMap["primaryMasterKey"] = dalkr.PrimaryMasterKey - } - if dalkr.SecondaryMasterKey != nil { - objectMap["secondaryMasterKey"] = dalkr.SecondaryMasterKey - } if dalkr.DatabaseAccountListReadOnlyKeysResult != nil { objectMap["properties"] = dalkr.DatabaseAccountListReadOnlyKeysResult } @@ -1251,9 +996,9 @@ func (dalkr *DatabaseAccountListKeysResult) UnmarshalJSON(body []byte) error { // DatabaseAccountListReadOnlyKeysResult the read-only access keys for the given database account. type DatabaseAccountListReadOnlyKeysResult struct { autorest.Response `json:"-"` - // PrimaryReadonlyMasterKey - Base 64 encoded value of the primary read-only key. + // PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key. PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` - // SecondaryReadonlyMasterKey - Base 64 encoded value of the secondary read-only key. + // SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key. SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` } @@ -1317,9 +1062,9 @@ type DatabaseAccountPatchProperties struct { // DatabaseAccountProperties properties for the database account. type DatabaseAccountProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` - // DocumentEndpoint - The connection endpoint for the Cosmos DB database account. + // DocumentEndpoint - READ-ONLY; The connection endpoint for the Cosmos DB database account. DocumentEndpoint *string `json:"documentEndpoint,omitempty"` - // DatabaseAccountOfferType - The offer type for the Cosmos DB database account. Default value: Standard. Possible values include: 'Standard' + // DatabaseAccountOfferType - READ-ONLY; The offer type for the Cosmos DB database account. Default value: Standard. Possible values include: 'Standard' DatabaseAccountOfferType DatabaseAccountOfferType `json:"databaseAccountOfferType,omitempty"` // IPRangeFilter - Cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. IPRangeFilter *string `json:"ipRangeFilter,omitempty"` @@ -1331,11 +1076,11 @@ type DatabaseAccountProperties struct { ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` // Capabilities - List of Cosmos DB capabilities for the account Capabilities *[]Capability `json:"capabilities,omitempty"` - // WriteLocations - An array that contains the write location for the Cosmos DB account. + // WriteLocations - READ-ONLY; An array that contains the write location for the Cosmos DB account. WriteLocations *[]Location `json:"writeLocations,omitempty"` - // ReadLocations - An array that contains of the read locations enabled for the Cosmos DB account. + // ReadLocations - READ-ONLY; An array that contains of the read locations enabled for the Cosmos DB account. ReadLocations *[]Location `json:"readLocations,omitempty"` - // FailoverPolicies - An array that contains the regions ordered by their failover priorities. + // FailoverPolicies - READ-ONLY; An array that contains the regions ordered by their failover priorities. FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"` // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` @@ -1359,7 +1104,7 @@ type DatabaseAccountsCreateOrUpdateFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsCreateOrUpdateFuture) Result(client DatabaseAccountsClient) (da DatabaseAccount, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return @@ -1388,7 +1133,7 @@ type DatabaseAccountsCreateUpdateCassandraKeyspaceFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsCreateUpdateCassandraKeyspaceFuture) Result(client DatabaseAccountsClient) (ck CassandraKeyspace, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure") return @@ -1417,7 +1162,7 @@ type DatabaseAccountsCreateUpdateCassandraTableFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsCreateUpdateCassandraTableFuture) Result(client DatabaseAccountsClient) (ct CassandraTable, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateCassandraTableFuture", "Result", future.Response(), "Polling failure") return @@ -1436,59 +1181,59 @@ func (future *DatabaseAccountsCreateUpdateCassandraTableFuture) Result(client Da return } -// DatabaseAccountsCreateUpdateGremlinContainerFuture an abstraction for monitoring and retrieving the +// DatabaseAccountsCreateUpdateGremlinDatabaseFuture an abstraction for monitoring and retrieving the // results of a long-running operation. -type DatabaseAccountsCreateUpdateGremlinContainerFuture struct { +type DatabaseAccountsCreateUpdateGremlinDatabaseFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *DatabaseAccountsCreateUpdateGremlinContainerFuture) Result(client DatabaseAccountsClient) (c Container, err error) { +func (future *DatabaseAccountsCreateUpdateGremlinDatabaseFuture) Result(client DatabaseAccountsClient) (gd GremlinDatabase, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateGremlinContainerFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateUpdateGremlinContainerFuture") + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateUpdateGremlinDatabaseFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { - c, err = client.CreateUpdateGremlinContainerResponder(c.Response.Response) + if gd.Response.Response, err = future.GetResult(sender); err == nil && gd.Response.Response.StatusCode != http.StatusNoContent { + gd, err = client.CreateUpdateGremlinDatabaseResponder(gd.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateGremlinContainerFuture", "Result", c.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateGremlinDatabaseFuture", "Result", gd.Response.Response, "Failure responding to request") } } return } -// DatabaseAccountsCreateUpdateGremlinDatabaseFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type DatabaseAccountsCreateUpdateGremlinDatabaseFuture struct { +// DatabaseAccountsCreateUpdateGremlinGraphFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type DatabaseAccountsCreateUpdateGremlinGraphFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *DatabaseAccountsCreateUpdateGremlinDatabaseFuture) Result(client DatabaseAccountsClient) (gd GremlinDatabase, err error) { +func (future *DatabaseAccountsCreateUpdateGremlinGraphFuture) Result(client DatabaseAccountsClient) (gg GremlinGraph, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateGremlinGraphFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateUpdateGremlinDatabaseFuture") + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateUpdateGremlinGraphFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gd.Response.Response, err = future.GetResult(sender); err == nil && gd.Response.Response.StatusCode != http.StatusNoContent { - gd, err = client.CreateUpdateGremlinDatabaseResponder(gd.Response.Response) + if gg.Response.Response, err = future.GetResult(sender); err == nil && gg.Response.Response.StatusCode != http.StatusNoContent { + gg, err = client.CreateUpdateGremlinGraphResponder(gg.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateGremlinDatabaseFuture", "Result", gd.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateGremlinGraphFuture", "Result", gg.Response.Response, "Failure responding to request") } } return @@ -1504,7 +1249,7 @@ type DatabaseAccountsCreateUpdateMongoCollectionFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsCreateUpdateMongoCollectionFuture) Result(client DatabaseAccountsClient) (mc MongoCollection, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateMongoCollectionFuture", "Result", future.Response(), "Polling failure") return @@ -1533,7 +1278,7 @@ type DatabaseAccountsCreateUpdateMongoDatabaseFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsCreateUpdateMongoDatabaseFuture) Result(client DatabaseAccountsClient) (md MongoDatabase, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateMongoDatabaseFuture", "Result", future.Response(), "Polling failure") return @@ -1560,9 +1305,9 @@ type DatabaseAccountsCreateUpdateSQLContainerFuture struct { // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *DatabaseAccountsCreateUpdateSQLContainerFuture) Result(client DatabaseAccountsClient) (c Container, err error) { +func (future *DatabaseAccountsCreateUpdateSQLContainerFuture) Result(client DatabaseAccountsClient) (sc SQLContainer, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateSQLContainerFuture", "Result", future.Response(), "Polling failure") return @@ -1572,10 +1317,10 @@ func (future *DatabaseAccountsCreateUpdateSQLContainerFuture) Result(client Data return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { - c, err = client.CreateUpdateSQLContainerResponder(c.Response.Response) + if sc.Response.Response, err = future.GetResult(sender); err == nil && sc.Response.Response.StatusCode != http.StatusNoContent { + sc, err = client.CreateUpdateSQLContainerResponder(sc.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateSQLContainerFuture", "Result", c.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateSQLContainerFuture", "Result", sc.Response.Response, "Failure responding to request") } } return @@ -1591,7 +1336,7 @@ type DatabaseAccountsCreateUpdateSQLDatabaseFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsCreateUpdateSQLDatabaseFuture) Result(client DatabaseAccountsClient) (sd SQLDatabase, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateSQLDatabaseFuture", "Result", future.Response(), "Polling failure") return @@ -1620,7 +1365,7 @@ type DatabaseAccountsCreateUpdateTableFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsCreateUpdateTableFuture) Result(client DatabaseAccountsClient) (t Table, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateUpdateTableFuture", "Result", future.Response(), "Polling failure") return @@ -1649,7 +1394,7 @@ type DatabaseAccountsDeleteCassandraKeyspaceFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsDeleteCassandraKeyspaceFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure") return @@ -1672,7 +1417,7 @@ type DatabaseAccountsDeleteCassandraTableFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsDeleteCassandraTableFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteCassandraTableFuture", "Result", future.Response(), "Polling failure") return @@ -1695,7 +1440,7 @@ type DatabaseAccountsDeleteFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsDeleteFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", future.Response(), "Polling failure") return @@ -1708,46 +1453,46 @@ func (future *DatabaseAccountsDeleteFuture) Result(client DatabaseAccountsClient return } -// DatabaseAccountsDeleteGremlinContainerFuture an abstraction for monitoring and retrieving the results of +// DatabaseAccountsDeleteGremlinDatabaseFuture an abstraction for monitoring and retrieving the results of // a long-running operation. -type DatabaseAccountsDeleteGremlinContainerFuture struct { +type DatabaseAccountsDeleteGremlinDatabaseFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *DatabaseAccountsDeleteGremlinContainerFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { +func (future *DatabaseAccountsDeleteGremlinDatabaseFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteGremlinContainerFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteGremlinContainerFuture") + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteGremlinDatabaseFuture") return } ar.Response = future.Response() return } -// DatabaseAccountsDeleteGremlinDatabaseFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type DatabaseAccountsDeleteGremlinDatabaseFuture struct { +// DatabaseAccountsDeleteGremlinGraphFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabaseAccountsDeleteGremlinGraphFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *DatabaseAccountsDeleteGremlinDatabaseFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { +func (future *DatabaseAccountsDeleteGremlinGraphFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteGremlinGraphFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteGremlinDatabaseFuture") + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteGremlinGraphFuture") return } ar.Response = future.Response() @@ -1764,7 +1509,7 @@ type DatabaseAccountsDeleteMongoCollectionFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsDeleteMongoCollectionFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteMongoCollectionFuture", "Result", future.Response(), "Polling failure") return @@ -1787,7 +1532,7 @@ type DatabaseAccountsDeleteMongoDatabaseFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsDeleteMongoDatabaseFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteMongoDatabaseFuture", "Result", future.Response(), "Polling failure") return @@ -1810,7 +1555,7 @@ type DatabaseAccountsDeleteSQLContainerFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsDeleteSQLContainerFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteSQLContainerFuture", "Result", future.Response(), "Polling failure") return @@ -1833,7 +1578,7 @@ type DatabaseAccountsDeleteSQLDatabaseFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsDeleteSQLDatabaseFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteSQLDatabaseFuture", "Result", future.Response(), "Polling failure") return @@ -1856,7 +1601,7 @@ type DatabaseAccountsDeleteTableFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsDeleteTableFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteTableFuture", "Result", future.Response(), "Polling failure") return @@ -1879,7 +1624,7 @@ type DatabaseAccountsFailoverPriorityChangeFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsFailoverPriorityChangeFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", future.Response(), "Polling failure") return @@ -1896,7 +1641,7 @@ func (future *DatabaseAccountsFailoverPriorityChangeFuture) Result(client Databa // properties. type DatabaseAccountsListResult struct { autorest.Response `json:"-"` - // Value - List of database account and their properties. + // Value - READ-ONLY; List of database account and their properties. Value *[]DatabaseAccount `json:"value,omitempty"` } @@ -1910,7 +1655,7 @@ type DatabaseAccountsOfflineRegionFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsOfflineRegionFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOfflineRegionFuture", "Result", future.Response(), "Polling failure") return @@ -1933,7 +1678,7 @@ type DatabaseAccountsOnlineRegionFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsOnlineRegionFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOnlineRegionFuture", "Result", future.Response(), "Polling failure") return @@ -1956,7 +1701,7 @@ type DatabaseAccountsPatchFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsPatchFuture) Result(client DatabaseAccountsClient) (da DatabaseAccount, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsPatchFuture", "Result", future.Response(), "Polling failure") return @@ -1985,7 +1730,7 @@ type DatabaseAccountsRegenerateKeyFuture struct { // If the operation has not completed it will return an error. func (future *DatabaseAccountsRegenerateKeyFuture) Result(client DatabaseAccountsClient) (ar autorest.Response, err error) { var done bool - done, err = future.Done(client) + done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", future.Response(), "Polling failure") return @@ -2031,7 +1776,7 @@ type FailoverPolicies struct { // FailoverPolicy the failover policy for a given region of a database account. type FailoverPolicy struct { - // ID - The unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>. + // ID - READ-ONLY; The unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>. ID *string `json:"id,omitempty"` // LocationName - The name of the region in which the database account exists. LocationName *string `json:"locationName,omitempty"` @@ -2044,11 +1789,11 @@ type GremlinDatabase struct { autorest.Response `json:"-"` // GremlinDatabaseProperties - The properties of an Azure Cosmos DB SQL database *GremlinDatabaseProperties `json:"properties,omitempty"` - // ID - The unique resource identifier of the database account. + // ID - READ-ONLY; The unique resource identifier of the database account. ID *string `json:"id,omitempty"` - // Name - The name of the database account. + // Name - READ-ONLY; The name of the database account. Name *string `json:"name,omitempty"` - // Type - The type of Azure resource. + // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -2061,15 +1806,6 @@ func (gd GremlinDatabase) MarshalJSON() ([]byte, error) { if gd.GremlinDatabaseProperties != nil { objectMap["properties"] = gd.GremlinDatabaseProperties } - if gd.ID != nil { - objectMap["id"] = gd.ID - } - if gd.Name != nil { - objectMap["name"] = gd.Name - } - if gd.Type != nil { - objectMap["type"] = gd.Type - } if gd.Location != nil { objectMap["location"] = gd.Location } @@ -2211,7 +1947,7 @@ func (gdcup GremlinDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) // properties. type GremlinDatabaseListResult struct { autorest.Response `json:"-"` - // Value - List of Gremlin databases and their properties. + // Value - READ-ONLY; List of Gremlin databases and their properties. Value *[]GremlinDatabase `json:"value,omitempty"` } @@ -2233,6 +1969,210 @@ type GremlinDatabaseResource struct { ID *string `json:"id,omitempty"` } +// GremlinGraph an Azure Cosmos DB Gremlin graph. +type GremlinGraph struct { + autorest.Response `json:"-"` + // GremlinGraphProperties - The properties of an Azure Cosmos DB Gremlin graph + *GremlinGraphProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GremlinGraph. +func (gg GremlinGraph) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gg.GremlinGraphProperties != nil { + objectMap["properties"] = gg.GremlinGraphProperties + } + if gg.Location != nil { + objectMap["location"] = gg.Location + } + if gg.Tags != nil { + objectMap["tags"] = gg.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GremlinGraph struct. +func (gg *GremlinGraph) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var gremlinGraphProperties GremlinGraphProperties + err = json.Unmarshal(*v, &gremlinGraphProperties) + if err != nil { + return err + } + gg.GremlinGraphProperties = &gremlinGraphProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + gg.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gg.Tags = tags + } + } + } + + return nil +} + +// GremlinGraphCreateUpdateParameters parameters to create and update Cosmos DB Gremlin graph. +type GremlinGraphCreateUpdateParameters struct { + // GremlinGraphCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin graph. + *GremlinGraphCreateUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinGraphCreateUpdateParameters. +func (ggcup GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ggcup.GremlinGraphCreateUpdateProperties != nil { + objectMap["properties"] = ggcup.GremlinGraphCreateUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GremlinGraphCreateUpdateParameters struct. +func (ggcup *GremlinGraphCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var gremlinGraphCreateUpdateProperties GremlinGraphCreateUpdateProperties + err = json.Unmarshal(*v, &gremlinGraphCreateUpdateProperties) + if err != nil { + return err + } + ggcup.GremlinGraphCreateUpdateProperties = &gremlinGraphCreateUpdateProperties + } + } + } + + return nil +} + +// GremlinGraphCreateUpdateProperties properties to create and update Azure Cosmos DB Gremlin graph. +type GremlinGraphCreateUpdateProperties struct { + // Resource - The standard JSON format of a Gremlin graph + Resource *GremlinGraphResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options map[string]*string `json:"options"` +} + +// MarshalJSON is the custom marshaler for GremlinGraphCreateUpdateProperties. +func (ggcup GremlinGraphCreateUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ggcup.Resource != nil { + objectMap["resource"] = ggcup.Resource + } + if ggcup.Options != nil { + objectMap["options"] = ggcup.Options + } + return json.Marshal(objectMap) +} + +// GremlinGraphListResult the List operation response, that contains the graphs and their properties. +type GremlinGraphListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of graphs and their properties. + Value *[]GremlinGraph `json:"value,omitempty"` +} + +// GremlinGraphProperties the properties of an Azure Cosmos DB Gremlin graph +type GremlinGraphProperties struct { + // ID - Name of the Cosmos DB Gremlin graph + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the graph. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + // Rid - A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - A system generated property that denotes the last updated timestamp of the resource. + Ts interface{} `json:"_ts,omitempty"` + // Etag - A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// GremlinGraphResource cosmos DB Gremlin graph resource object +type GremlinGraphResource struct { + // ID - Name of the Cosmos DB Gremlin graph + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the graph. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` +} + // IncludedPath the paths that are included in indexing type IncludedPath struct { // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) @@ -2265,11 +2205,11 @@ type IndexingPolicy struct { // Location a region in which the Azure Cosmos DB database account is deployed. type Location struct { - // ID - The unique identifier of the region within the database account. Example: <accountName>-<locationName>. + // ID - READ-ONLY; The unique identifier of the region within the database account. Example: <accountName>-<locationName>. ID *string `json:"id,omitempty"` // LocationName - The name of the region. LocationName *string `json:"locationName,omitempty"` - // DocumentEndpoint - The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/ + // DocumentEndpoint - READ-ONLY; The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/ DocumentEndpoint *string `json:"documentEndpoint,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` // FailoverPriority - The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. @@ -2278,77 +2218,77 @@ type Location struct { // Metric metric data type Metric struct { - // StartTime - The start time for the metric (ISO-8601 format). + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time for the metric (ISO-8601 format). + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). EndTime *date.Time `json:"endTime,omitempty"` - // TimeGrain - The time grain to be used to summarize the metric values. + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. TimeGrain *string `json:"timeGrain,omitempty"` // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' Unit UnitType `json:"unit,omitempty"` - // Name - The name information for the metric. + // Name - READ-ONLY; The name information for the metric. Name *MetricName `json:"name,omitempty"` - // MetricValues - The metric values for the specified time window and timestep. + // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. MetricValues *[]MetricValue `json:"metricValues,omitempty"` } // MetricAvailability the availability of the metric. type MetricAvailability struct { - // TimeGrain - The time grain to be used to summarize the metric values. + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. TimeGrain *string `json:"timeGrain,omitempty"` - // Retention - The retention for the metric values. + // Retention - READ-ONLY; The retention for the metric values. Retention *string `json:"retention,omitempty"` } // MetricDefinition the definition of a metric. type MetricDefinition struct { - // MetricAvailabilities - The list of metric availabilities for the account. + // MetricAvailabilities - READ-ONLY; The list of metric availabilities for the account. MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` - // PrimaryAggregationType - The primary aggregation type of the metric. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeTotal', 'PrimaryAggregationTypeMinimimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeLast' + // PrimaryAggregationType - READ-ONLY; The primary aggregation type of the metric. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeTotal', 'PrimaryAggregationTypeMinimimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeLast' PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"` // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' Unit UnitType `json:"unit,omitempty"` - // ResourceURI - The resource uri of the database. + // ResourceURI - READ-ONLY; The resource uri of the database. ResourceURI *string `json:"resourceUri,omitempty"` - // Name - The name information for the metric. + // Name - READ-ONLY; The name information for the metric. Name *MetricName `json:"name,omitempty"` } // MetricDefinitionsListResult the response to a list metric definitions request. type MetricDefinitionsListResult struct { autorest.Response `json:"-"` - // Value - The list of metric definitions for the account. + // Value - READ-ONLY; The list of metric definitions for the account. Value *[]MetricDefinition `json:"value,omitempty"` } // MetricListResult the response to a list metrics request. type MetricListResult struct { autorest.Response `json:"-"` - // Value - The list of metrics for the account. + // Value - READ-ONLY; The list of metrics for the account. Value *[]Metric `json:"value,omitempty"` } // MetricName a metric name. type MetricName struct { - // Value - The name of the metric. + // Value - READ-ONLY; The name of the metric. Value *string `json:"value,omitempty"` - // LocalizedValue - The friendly name of the metric. + // LocalizedValue - READ-ONLY; The friendly name of the metric. LocalizedValue *string `json:"localizedValue,omitempty"` } // MetricValue represents metrics values. type MetricValue struct { - // Count - The number of values for the metric. + // Count - READ-ONLY; The number of values for the metric. Count *float64 `json:"_count,omitempty"` - // Average - The average value of the metric. + // Average - READ-ONLY; The average value of the metric. Average *float64 `json:"average,omitempty"` - // Maximum - The max value of the metric. + // Maximum - READ-ONLY; The max value of the metric. Maximum *float64 `json:"maximum,omitempty"` - // Minimum - The min value of the metric. + // Minimum - READ-ONLY; The min value of the metric. Minimum *float64 `json:"minimum,omitempty"` - // Timestamp - The metric timestamp (ISO-8601 format). + // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). Timestamp *date.Time `json:"timestamp,omitempty"` - // Total - The total value of the metric. + // Total - READ-ONLY; The total value of the metric. Total *float64 `json:"total,omitempty"` } @@ -2357,11 +2297,11 @@ type MongoCollection struct { autorest.Response `json:"-"` // MongoCollectionProperties - The properties of an Azure Cosmos DB Mongo collection *MongoCollectionProperties `json:"properties,omitempty"` - // ID - The unique resource identifier of the database account. + // ID - READ-ONLY; The unique resource identifier of the database account. ID *string `json:"id,omitempty"` - // Name - The name of the database account. + // Name - READ-ONLY; The name of the database account. Name *string `json:"name,omitempty"` - // Type - The type of Azure resource. + // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -2374,15 +2314,6 @@ func (mc MongoCollection) MarshalJSON() ([]byte, error) { if mc.MongoCollectionProperties != nil { objectMap["properties"] = mc.MongoCollectionProperties } - if mc.ID != nil { - objectMap["id"] = mc.ID - } - if mc.Name != nil { - objectMap["name"] = mc.Name - } - if mc.Type != nil { - objectMap["type"] = mc.Type - } if mc.Location != nil { objectMap["location"] = mc.Location } @@ -2524,7 +2455,7 @@ func (mccup MongoCollectionCreateUpdateProperties) MarshalJSON() ([]byte, error) // properties. type MongoCollectionListResult struct { autorest.Response `json:"-"` - // Value - List of Mongo collections and their properties. + // Value - READ-ONLY; List of Mongo collections and their properties. Value *[]MongoCollection `json:"value,omitempty"` } @@ -2583,11 +2514,11 @@ type MongoDatabase struct { autorest.Response `json:"-"` // MongoDatabaseProperties - The properties of an Azure Cosmos DB Mongo database *MongoDatabaseProperties `json:"properties,omitempty"` - // ID - The unique resource identifier of the database account. + // ID - READ-ONLY; The unique resource identifier of the database account. ID *string `json:"id,omitempty"` - // Name - The name of the database account. + // Name - READ-ONLY; The name of the database account. Name *string `json:"name,omitempty"` - // Type - The type of Azure resource. + // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -2600,15 +2531,6 @@ func (md MongoDatabase) MarshalJSON() ([]byte, error) { if md.MongoDatabaseProperties != nil { objectMap["properties"] = md.MongoDatabaseProperties } - if md.ID != nil { - objectMap["id"] = md.ID - } - if md.Name != nil { - objectMap["name"] = md.Name - } - if md.Type != nil { - objectMap["type"] = md.Type - } if md.Location != nil { objectMap["location"] = md.Location } @@ -2750,7 +2672,7 @@ func (mdcup MongoDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) { // properties. type MongoDatabaseListResult struct { autorest.Response `json:"-"` - // Value - List of Mongo databases and their properties. + // Value - READ-ONLY; List of Mongo databases and their properties. Value *[]MongoDatabase `json:"value,omitempty"` } @@ -2957,106 +2879,106 @@ func NewOperationListResultPage(getNextPage func(context.Context, OperationListR // PartitionMetric the metric values for a single partition. type PartitionMetric struct { - // PartitionID - The partition id (GUID identifier) of the metric values. + // PartitionID - READ-ONLY; The partition id (GUID identifier) of the metric values. PartitionID *string `json:"partitionId,omitempty"` - // PartitionKeyRangeID - The partition key range id (integer identifier) of the metric values. + // PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the metric values. PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` - // StartTime - The start time for the metric (ISO-8601 format). + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time for the metric (ISO-8601 format). + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). EndTime *date.Time `json:"endTime,omitempty"` - // TimeGrain - The time grain to be used to summarize the metric values. + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. TimeGrain *string `json:"timeGrain,omitempty"` // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' Unit UnitType `json:"unit,omitempty"` - // Name - The name information for the metric. + // Name - READ-ONLY; The name information for the metric. Name *MetricName `json:"name,omitempty"` - // MetricValues - The metric values for the specified time window and timestep. + // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. MetricValues *[]MetricValue `json:"metricValues,omitempty"` } // PartitionMetricListResult the response to a list partition metrics request. type PartitionMetricListResult struct { autorest.Response `json:"-"` - // Value - The list of partition-level metrics for the account. + // Value - READ-ONLY; The list of partition-level metrics for the account. Value *[]PartitionMetric `json:"value,omitempty"` } // PartitionUsage the partition level usage data for a usage request. type PartitionUsage struct { - // PartitionID - The partition id (GUID identifier) of the usages. + // PartitionID - READ-ONLY; The partition id (GUID identifier) of the usages. PartitionID *string `json:"partitionId,omitempty"` - // PartitionKeyRangeID - The partition key range id (integer identifier) of the usages. + // PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the usages. PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' Unit UnitType `json:"unit,omitempty"` - // Name - The name information for the metric. + // Name - READ-ONLY; The name information for the metric. Name *MetricName `json:"name,omitempty"` - // QuotaPeriod - The quota period used to summarize the usage values. + // QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values. QuotaPeriod *string `json:"quotaPeriod,omitempty"` - // Limit - Maximum value for this metric + // Limit - READ-ONLY; Maximum value for this metric Limit *int32 `json:"limit,omitempty"` - // CurrentValue - Current value for this metric + // CurrentValue - READ-ONLY; Current value for this metric CurrentValue *int32 `json:"currentValue,omitempty"` } // PartitionUsagesResult the response to a list partition level usage request. type PartitionUsagesResult struct { autorest.Response `json:"-"` - // Value - The list of partition-level usages for the database. A usage is a point in time metric + // Value - READ-ONLY; The list of partition-level usages for the database. A usage is a point in time metric Value *[]PartitionUsage `json:"value,omitempty"` } // PercentileMetric percentile Metric data type PercentileMetric struct { - // StartTime - The start time for the metric (ISO-8601 format). + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time for the metric (ISO-8601 format). + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). EndTime *date.Time `json:"endTime,omitempty"` - // TimeGrain - The time grain to be used to summarize the metric values. + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. TimeGrain *string `json:"timeGrain,omitempty"` // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' Unit UnitType `json:"unit,omitempty"` - // Name - The name information for the metric. + // Name - READ-ONLY; The name information for the metric. Name *MetricName `json:"name,omitempty"` - // MetricValues - The percentile metric values for the specified time window and timestep. + // MetricValues - READ-ONLY; The percentile metric values for the specified time window and timestep. MetricValues *[]PercentileMetricValue `json:"metricValues,omitempty"` } // PercentileMetricListResult the response to a list percentile metrics request. type PercentileMetricListResult struct { autorest.Response `json:"-"` - // Value - The list of percentile metrics for the account. + // Value - READ-ONLY; The list of percentile metrics for the account. Value *[]PercentileMetric `json:"value,omitempty"` } // PercentileMetricValue represents percentile metrics values. type PercentileMetricValue struct { - // P10 - The 10th percentile value for the metric. + // P10 - READ-ONLY; The 10th percentile value for the metric. P10 *float64 `json:"P10,omitempty"` - // P25 - The 25th percentile value for the metric. + // P25 - READ-ONLY; The 25th percentile value for the metric. P25 *float64 `json:"P25,omitempty"` - // P50 - The 50th percentile value for the metric. + // P50 - READ-ONLY; The 50th percentile value for the metric. P50 *float64 `json:"P50,omitempty"` - // P75 - The 75th percentile value for the metric. + // P75 - READ-ONLY; The 75th percentile value for the metric. P75 *float64 `json:"P75,omitempty"` - // P90 - The 90th percentile value for the metric. + // P90 - READ-ONLY; The 90th percentile value for the metric. P90 *float64 `json:"P90,omitempty"` - // P95 - The 95th percentile value for the metric. + // P95 - READ-ONLY; The 95th percentile value for the metric. P95 *float64 `json:"P95,omitempty"` - // P99 - The 99th percentile value for the metric. + // P99 - READ-ONLY; The 99th percentile value for the metric. P99 *float64 `json:"P99,omitempty"` - // Count - The number of values for the metric. + // Count - READ-ONLY; The number of values for the metric. Count *float64 `json:"_count,omitempty"` - // Average - The average value of the metric. + // Average - READ-ONLY; The average value of the metric. Average *float64 `json:"average,omitempty"` - // Maximum - The max value of the metric. + // Maximum - READ-ONLY; The max value of the metric. Maximum *float64 `json:"maximum,omitempty"` - // Minimum - The min value of the metric. + // Minimum - READ-ONLY; The min value of the metric. Minimum *float64 `json:"minimum,omitempty"` - // Timestamp - The metric timestamp (ISO-8601 format). + // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). Timestamp *date.Time `json:"timestamp,omitempty"` - // Total - The total value of the metric. + // Total - READ-ONLY; The total value of the metric. Total *float64 `json:"total,omitempty"` } @@ -3068,11 +2990,11 @@ type RegionForOnlineOffline struct { // Resource the core properties of ARM resources. type Resource struct { - // ID - The unique resource identifier of the database account. + // ID - READ-ONLY; The unique resource identifier of the database account. ID *string `json:"id,omitempty"` - // Name - The name of the database account. + // Name - READ-ONLY; The name of the database account. Name *string `json:"name,omitempty"` - // Type - The type of Azure resource. + // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -3082,15 +3004,6 @@ type Resource struct { // MarshalJSON is the custom marshaler for Resource. func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if r.ID != nil { - objectMap["id"] = r.ID - } - if r.Name != nil { - objectMap["name"] = r.Name - } - if r.Type != nil { - objectMap["type"] = r.Type - } if r.Location != nil { objectMap["location"] = r.Location } @@ -3100,16 +3013,220 @@ func (r Resource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// SQLContainer an Azure Cosmos DB container. +type SQLContainer struct { + autorest.Response `json:"-"` + // SQLContainerProperties - The properties of an Azure Cosmos DB container + *SQLContainerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLContainer. +func (sc SQLContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.SQLContainerProperties != nil { + objectMap["properties"] = sc.SQLContainerProperties + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } + if sc.Tags != nil { + objectMap["tags"] = sc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLContainer struct. +func (sc *SQLContainer) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLContainerProperties SQLContainerProperties + err = json.Unmarshal(*v, &SQLContainerProperties) + if err != nil { + return err + } + sc.SQLContainerProperties = &SQLContainerProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sc.Tags = tags + } + } + } + + return nil +} + +// SQLContainerCreateUpdateParameters parameters to create and update Cosmos DB container. +type SQLContainerCreateUpdateParameters struct { + // SQLContainerCreateUpdateProperties - Properties to create and update Azure Cosmos DB container. + *SQLContainerCreateUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLContainerCreateUpdateParameters. +func (sccup SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sccup.SQLContainerCreateUpdateProperties != nil { + objectMap["properties"] = sccup.SQLContainerCreateUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLContainerCreateUpdateParameters struct. +func (sccup *SQLContainerCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLContainerCreateUpdateProperties SQLContainerCreateUpdateProperties + err = json.Unmarshal(*v, &SQLContainerCreateUpdateProperties) + if err != nil { + return err + } + sccup.SQLContainerCreateUpdateProperties = &SQLContainerCreateUpdateProperties + } + } + } + + return nil +} + +// SQLContainerCreateUpdateProperties properties to create and update Azure Cosmos DB container. +type SQLContainerCreateUpdateProperties struct { + // Resource - The standard JSON format of a container + Resource *SQLContainerResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options map[string]*string `json:"options"` +} + +// MarshalJSON is the custom marshaler for SQLContainerCreateUpdateProperties. +func (sccup SQLContainerCreateUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sccup.Resource != nil { + objectMap["resource"] = sccup.Resource + } + if sccup.Options != nil { + objectMap["options"] = sccup.Options + } + return json.Marshal(objectMap) +} + +// SQLContainerListResult the List operation response, that contains the containers and their properties. +type SQLContainerListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of containers and their properties. + Value *[]SQLContainer `json:"value,omitempty"` +} + +// SQLContainerProperties the properties of an Azure Cosmos DB container +type SQLContainerProperties struct { + // ID - Name of the Cosmos DB SQL container + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the container. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + // Rid - A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - A system generated property that denotes the last updated timestamp of the resource. + Ts interface{} `json:"_ts,omitempty"` + // Etag - A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// SQLContainerResource cosmos DB SQL container resource object +type SQLContainerResource struct { + // ID - Name of the Cosmos DB SQL container + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the container. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` +} + // SQLDatabase an Azure Cosmos DB SQL database. type SQLDatabase struct { autorest.Response `json:"-"` // SQLDatabaseProperties - The properties of an Azure Cosmos DB SQL database *SQLDatabaseProperties `json:"properties,omitempty"` - // ID - The unique resource identifier of the database account. + // ID - READ-ONLY; The unique resource identifier of the database account. ID *string `json:"id,omitempty"` - // Name - The name of the database account. + // Name - READ-ONLY; The name of the database account. Name *string `json:"name,omitempty"` - // Type - The type of Azure resource. + // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -3122,15 +3239,6 @@ func (sd SQLDatabase) MarshalJSON() ([]byte, error) { if sd.SQLDatabaseProperties != nil { objectMap["properties"] = sd.SQLDatabaseProperties } - if sd.ID != nil { - objectMap["id"] = sd.ID - } - if sd.Name != nil { - objectMap["name"] = sd.Name - } - if sd.Type != nil { - objectMap["type"] = sd.Type - } if sd.Location != nil { objectMap["location"] = sd.Location } @@ -3271,7 +3379,7 @@ func (sdcup SQLDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) { // SQLDatabaseListResult the List operation response, that contains the SQL databases and their properties. type SQLDatabaseListResult struct { autorest.Response `json:"-"` - // Value - List of SQL databases and their properties. + // Value - READ-ONLY; List of SQL databases and their properties. Value *[]SQLDatabase `json:"value,omitempty"` } @@ -3302,11 +3410,11 @@ type Table struct { autorest.Response `json:"-"` // TableProperties - The properties of an Azure Cosmos DB Table *TableProperties `json:"properties,omitempty"` - // ID - The unique resource identifier of the database account. + // ID - READ-ONLY; The unique resource identifier of the database account. ID *string `json:"id,omitempty"` - // Name - The name of the database account. + // Name - READ-ONLY; The name of the database account. Name *string `json:"name,omitempty"` - // Type - The type of Azure resource. + // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -3319,15 +3427,6 @@ func (t Table) MarshalJSON() ([]byte, error) { if t.TableProperties != nil { objectMap["properties"] = t.TableProperties } - if t.ID != nil { - objectMap["id"] = t.ID - } - if t.Name != nil { - objectMap["name"] = t.Name - } - if t.Type != nil { - objectMap["type"] = t.Type - } if t.Location != nil { objectMap["location"] = t.Location } @@ -3468,7 +3567,7 @@ func (tcup TableCreateUpdateProperties) MarshalJSON() ([]byte, error) { // TableListResult the List operation response, that contains the Table and their properties. type TableListResult struct { autorest.Response `json:"-"` - // Value - List of Table and their properties. + // Value - READ-ONLY; List of Table and their properties. Value *[]Table `json:"value,omitempty"` } @@ -3502,20 +3601,20 @@ type UniqueKeyPolicy struct { type Usage struct { // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' Unit UnitType `json:"unit,omitempty"` - // Name - The name information for the metric. + // Name - READ-ONLY; The name information for the metric. Name *MetricName `json:"name,omitempty"` - // QuotaPeriod - The quota period used to summarize the usage values. + // QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values. QuotaPeriod *string `json:"quotaPeriod,omitempty"` - // Limit - Maximum value for this metric + // Limit - READ-ONLY; Maximum value for this metric Limit *int32 `json:"limit,omitempty"` - // CurrentValue - Current value for this metric + // CurrentValue - READ-ONLY; Current value for this metric CurrentValue *int32 `json:"currentValue,omitempty"` } // UsagesResult the response to a list usage request. type UsagesResult struct { autorest.Response `json:"-"` - // Value - The list of usages for the database. A usage is a point in time metric + // Value - READ-ONLY; The list of usages for the database. A usage is a point in time metric Value *[]Usage `json:"value,omitempty"` }