...

Source file src/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2019-08-01/documentdb/gremlinresources.go

Documentation: github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2019-08-01/documentdb

     1  package documentdb
     2  
     3  // Copyright (c) Microsoft Corporation. All rights reserved.
     4  // Licensed under the MIT License. See License.txt in the project root for license information.
     5  //
     6  // Code generated by Microsoft (R) AutoRest Code Generator.
     7  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
     8  
     9  import (
    10  	"context"
    11  	"github.com/Azure/go-autorest/autorest"
    12  	"github.com/Azure/go-autorest/autorest/azure"
    13  	"github.com/Azure/go-autorest/autorest/validation"
    14  	"github.com/Azure/go-autorest/tracing"
    15  	"net/http"
    16  )
    17  
    18  // GremlinResourcesClient is the azure Cosmos DB Database Service Resource Provider REST API
    19  type GremlinResourcesClient struct {
    20  	BaseClient
    21  }
    22  
    23  // NewGremlinResourcesClient creates an instance of the GremlinResourcesClient client.
    24  func NewGremlinResourcesClient(subscriptionID string) GremlinResourcesClient {
    25  	return NewGremlinResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID)
    26  }
    27  
    28  // NewGremlinResourcesClientWithBaseURI creates an instance of the GremlinResourcesClient client using a custom
    29  // endpoint.  Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
    30  // stack).
    31  func NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string) GremlinResourcesClient {
    32  	return GremlinResourcesClient{NewWithBaseURI(baseURI, subscriptionID)}
    33  }
    34  
    35  // CreateUpdateGremlinDatabase create or update an Azure Cosmos DB Gremlin database
    36  // Parameters:
    37  // resourceGroupName - name of an Azure resource group.
    38  // accountName - cosmos DB database account name.
    39  // databaseName - cosmos DB database name.
    40  // createUpdateGremlinDatabaseParameters - the parameters to provide for the current Gremlin database.
    41  func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters) (result GremlinResourcesCreateUpdateGremlinDatabaseFuture, err error) {
    42  	if tracing.IsEnabled() {
    43  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.CreateUpdateGremlinDatabase")
    44  		defer func() {
    45  			sc := -1
    46  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
    47  				sc = result.FutureAPI.Response().StatusCode
    48  			}
    49  			tracing.EndSpan(ctx, sc, err)
    50  		}()
    51  	}
    52  	if err := validation.Validate([]validation.Validation{
    53  		{TargetValue: client.SubscriptionID,
    54  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
    55  		{TargetValue: resourceGroupName,
    56  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
    57  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
    58  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
    59  		{TargetValue: accountName,
    60  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
    61  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
    62  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
    63  		{TargetValue: createUpdateGremlinDatabaseParameters,
    64  			Constraints: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties", Name: validation.Null, Rule: true,
    65  				Chain: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Resource", Name: validation.Null, Rule: true,
    66  					Chain: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}},
    67  					{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Options", Name: validation.Null, Rule: true, Chain: nil},
    68  				}}}}}); err != nil {
    69  		return result, validation.NewError("documentdb.GremlinResourcesClient", "CreateUpdateGremlinDatabase", err.Error())
    70  	}
    71  
    72  	req, err := client.CreateUpdateGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters)
    73  	if err != nil {
    74  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinDatabase", nil, "Failure preparing request")
    75  		return
    76  	}
    77  
    78  	result, err = client.CreateUpdateGremlinDatabaseSender(req)
    79  	if err != nil {
    80  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinDatabase", result.Response(), "Failure sending request")
    81  		return
    82  	}
    83  
    84  	return
    85  }
    86  
    87  // CreateUpdateGremlinDatabasePreparer prepares the CreateUpdateGremlinDatabase request.
    88  func (client GremlinResourcesClient) CreateUpdateGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters) (*http.Request, error) {
    89  	pathParameters := map[string]interface{}{
    90  		"accountName":       autorest.Encode("path", accountName),
    91  		"databaseName":      autorest.Encode("path", databaseName),
    92  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
    93  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
    94  	}
    95  
    96  	const APIVersion = "2019-08-01"
    97  	queryParameters := map[string]interface{}{
    98  		"api-version": APIVersion,
    99  	}
   100  
   101  	preparer := autorest.CreatePreparer(
   102  		autorest.AsContentType("application/json; charset=utf-8"),
   103  		autorest.AsPut(),
   104  		autorest.WithBaseURL(client.BaseURI),
   105  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", pathParameters),
   106  		autorest.WithJSON(createUpdateGremlinDatabaseParameters),
   107  		autorest.WithQueryParameters(queryParameters))
   108  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   109  }
   110  
   111  // CreateUpdateGremlinDatabaseSender sends the CreateUpdateGremlinDatabase request. The method will close the
   112  // http.Response Body if it receives an error.
   113  func (client GremlinResourcesClient) CreateUpdateGremlinDatabaseSender(req *http.Request) (future GremlinResourcesCreateUpdateGremlinDatabaseFuture, err error) {
   114  	var resp *http.Response
   115  	future.FutureAPI = &azure.Future{}
   116  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   117  	if err != nil {
   118  		return
   119  	}
   120  	var azf azure.Future
   121  	azf, err = azure.NewFutureFromResponse(resp)
   122  	future.FutureAPI = &azf
   123  	future.Result = future.result
   124  	return
   125  }
   126  
   127  // CreateUpdateGremlinDatabaseResponder handles the response to the CreateUpdateGremlinDatabase request. The method always
   128  // closes the http.Response Body.
   129  func (client GremlinResourcesClient) CreateUpdateGremlinDatabaseResponder(resp *http.Response) (result GremlinDatabaseGetResults, err error) {
   130  	err = autorest.Respond(
   131  		resp,
   132  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   133  		autorest.ByUnmarshallingJSON(&result),
   134  		autorest.ByClosing())
   135  	result.Response = autorest.Response{Response: resp}
   136  	return
   137  }
   138  
   139  // CreateUpdateGremlinGraph create or update an Azure Cosmos DB Gremlin graph
   140  // Parameters:
   141  // resourceGroupName - name of an Azure resource group.
   142  // accountName - cosmos DB database account name.
   143  // databaseName - cosmos DB database name.
   144  // graphName - cosmos DB graph name.
   145  // createUpdateGremlinGraphParameters - the parameters to provide for the current Gremlin graph.
   146  func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters) (result GremlinResourcesCreateUpdateGremlinGraphFuture, err error) {
   147  	if tracing.IsEnabled() {
   148  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.CreateUpdateGremlinGraph")
   149  		defer func() {
   150  			sc := -1
   151  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   152  				sc = result.FutureAPI.Response().StatusCode
   153  			}
   154  			tracing.EndSpan(ctx, sc, err)
   155  		}()
   156  	}
   157  	if err := validation.Validate([]validation.Validation{
   158  		{TargetValue: client.SubscriptionID,
   159  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   160  		{TargetValue: resourceGroupName,
   161  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   162  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   163  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   164  		{TargetValue: accountName,
   165  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   166  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   167  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
   168  		{TargetValue: createUpdateGremlinGraphParameters,
   169  			Constraints: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties", Name: validation.Null, Rule: true,
   170  				Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource", Name: validation.Null, Rule: true,
   171  					Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil},
   172  						{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey", Name: validation.Null, Rule: false,
   173  							Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.Null, Rule: false,
   174  								Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMaximum, Rule: int64(2), Chain: nil},
   175  									{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
   176  								}},
   177  							}},
   178  					}},
   179  					{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Options", Name: validation.Null, Rule: true, Chain: nil},
   180  				}}}}}); err != nil {
   181  		return result, validation.NewError("documentdb.GremlinResourcesClient", "CreateUpdateGremlinGraph", err.Error())
   182  	}
   183  
   184  	req, err := client.CreateUpdateGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters)
   185  	if err != nil {
   186  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinGraph", nil, "Failure preparing request")
   187  		return
   188  	}
   189  
   190  	result, err = client.CreateUpdateGremlinGraphSender(req)
   191  	if err != nil {
   192  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinGraph", result.Response(), "Failure sending request")
   193  		return
   194  	}
   195  
   196  	return
   197  }
   198  
   199  // CreateUpdateGremlinGraphPreparer prepares the CreateUpdateGremlinGraph request.
   200  func (client GremlinResourcesClient) CreateUpdateGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters) (*http.Request, error) {
   201  	pathParameters := map[string]interface{}{
   202  		"accountName":       autorest.Encode("path", accountName),
   203  		"databaseName":      autorest.Encode("path", databaseName),
   204  		"graphName":         autorest.Encode("path", graphName),
   205  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   206  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   207  	}
   208  
   209  	const APIVersion = "2019-08-01"
   210  	queryParameters := map[string]interface{}{
   211  		"api-version": APIVersion,
   212  	}
   213  
   214  	preparer := autorest.CreatePreparer(
   215  		autorest.AsContentType("application/json; charset=utf-8"),
   216  		autorest.AsPut(),
   217  		autorest.WithBaseURL(client.BaseURI),
   218  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", pathParameters),
   219  		autorest.WithJSON(createUpdateGremlinGraphParameters),
   220  		autorest.WithQueryParameters(queryParameters))
   221  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   222  }
   223  
   224  // CreateUpdateGremlinGraphSender sends the CreateUpdateGremlinGraph request. The method will close the
   225  // http.Response Body if it receives an error.
   226  func (client GremlinResourcesClient) CreateUpdateGremlinGraphSender(req *http.Request) (future GremlinResourcesCreateUpdateGremlinGraphFuture, err error) {
   227  	var resp *http.Response
   228  	future.FutureAPI = &azure.Future{}
   229  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   230  	if err != nil {
   231  		return
   232  	}
   233  	var azf azure.Future
   234  	azf, err = azure.NewFutureFromResponse(resp)
   235  	future.FutureAPI = &azf
   236  	future.Result = future.result
   237  	return
   238  }
   239  
   240  // CreateUpdateGremlinGraphResponder handles the response to the CreateUpdateGremlinGraph request. The method always
   241  // closes the http.Response Body.
   242  func (client GremlinResourcesClient) CreateUpdateGremlinGraphResponder(resp *http.Response) (result GremlinGraphGetResults, err error) {
   243  	err = autorest.Respond(
   244  		resp,
   245  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   246  		autorest.ByUnmarshallingJSON(&result),
   247  		autorest.ByClosing())
   248  	result.Response = autorest.Response{Response: resp}
   249  	return
   250  }
   251  
   252  // DeleteGremlinDatabase deletes an existing Azure Cosmos DB Gremlin database.
   253  // Parameters:
   254  // resourceGroupName - name of an Azure resource group.
   255  // accountName - cosmos DB database account name.
   256  // databaseName - cosmos DB database name.
   257  func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinResourcesDeleteGremlinDatabaseFuture, err error) {
   258  	if tracing.IsEnabled() {
   259  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.DeleteGremlinDatabase")
   260  		defer func() {
   261  			sc := -1
   262  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   263  				sc = result.FutureAPI.Response().StatusCode
   264  			}
   265  			tracing.EndSpan(ctx, sc, err)
   266  		}()
   267  	}
   268  	if err := validation.Validate([]validation.Validation{
   269  		{TargetValue: client.SubscriptionID,
   270  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   271  		{TargetValue: resourceGroupName,
   272  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   273  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   274  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   275  		{TargetValue: accountName,
   276  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   277  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   278  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   279  		return result, validation.NewError("documentdb.GremlinResourcesClient", "DeleteGremlinDatabase", err.Error())
   280  	}
   281  
   282  	req, err := client.DeleteGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseName)
   283  	if err != nil {
   284  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinDatabase", nil, "Failure preparing request")
   285  		return
   286  	}
   287  
   288  	result, err = client.DeleteGremlinDatabaseSender(req)
   289  	if err != nil {
   290  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinDatabase", result.Response(), "Failure sending request")
   291  		return
   292  	}
   293  
   294  	return
   295  }
   296  
   297  // DeleteGremlinDatabasePreparer prepares the DeleteGremlinDatabase request.
   298  func (client GremlinResourcesClient) DeleteGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) {
   299  	pathParameters := map[string]interface{}{
   300  		"accountName":       autorest.Encode("path", accountName),
   301  		"databaseName":      autorest.Encode("path", databaseName),
   302  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   303  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   304  	}
   305  
   306  	const APIVersion = "2019-08-01"
   307  	queryParameters := map[string]interface{}{
   308  		"api-version": APIVersion,
   309  	}
   310  
   311  	preparer := autorest.CreatePreparer(
   312  		autorest.AsDelete(),
   313  		autorest.WithBaseURL(client.BaseURI),
   314  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", pathParameters),
   315  		autorest.WithQueryParameters(queryParameters))
   316  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   317  }
   318  
   319  // DeleteGremlinDatabaseSender sends the DeleteGremlinDatabase request. The method will close the
   320  // http.Response Body if it receives an error.
   321  func (client GremlinResourcesClient) DeleteGremlinDatabaseSender(req *http.Request) (future GremlinResourcesDeleteGremlinDatabaseFuture, err error) {
   322  	var resp *http.Response
   323  	future.FutureAPI = &azure.Future{}
   324  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   325  	if err != nil {
   326  		return
   327  	}
   328  	var azf azure.Future
   329  	azf, err = azure.NewFutureFromResponse(resp)
   330  	future.FutureAPI = &azf
   331  	future.Result = future.result
   332  	return
   333  }
   334  
   335  // DeleteGremlinDatabaseResponder handles the response to the DeleteGremlinDatabase request. The method always
   336  // closes the http.Response Body.
   337  func (client GremlinResourcesClient) DeleteGremlinDatabaseResponder(resp *http.Response) (result autorest.Response, err error) {
   338  	err = autorest.Respond(
   339  		resp,
   340  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   341  		autorest.ByClosing())
   342  	result.Response = resp
   343  	return
   344  }
   345  
   346  // DeleteGremlinGraph deletes an existing Azure Cosmos DB Gremlin graph.
   347  // Parameters:
   348  // resourceGroupName - name of an Azure resource group.
   349  // accountName - cosmos DB database account name.
   350  // databaseName - cosmos DB database name.
   351  // graphName - cosmos DB graph name.
   352  func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result GremlinResourcesDeleteGremlinGraphFuture, err error) {
   353  	if tracing.IsEnabled() {
   354  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.DeleteGremlinGraph")
   355  		defer func() {
   356  			sc := -1
   357  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   358  				sc = result.FutureAPI.Response().StatusCode
   359  			}
   360  			tracing.EndSpan(ctx, sc, err)
   361  		}()
   362  	}
   363  	if err := validation.Validate([]validation.Validation{
   364  		{TargetValue: client.SubscriptionID,
   365  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   366  		{TargetValue: resourceGroupName,
   367  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   368  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   369  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   370  		{TargetValue: accountName,
   371  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   372  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   373  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   374  		return result, validation.NewError("documentdb.GremlinResourcesClient", "DeleteGremlinGraph", err.Error())
   375  	}
   376  
   377  	req, err := client.DeleteGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseName, graphName)
   378  	if err != nil {
   379  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinGraph", nil, "Failure preparing request")
   380  		return
   381  	}
   382  
   383  	result, err = client.DeleteGremlinGraphSender(req)
   384  	if err != nil {
   385  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinGraph", result.Response(), "Failure sending request")
   386  		return
   387  	}
   388  
   389  	return
   390  }
   391  
   392  // DeleteGremlinGraphPreparer prepares the DeleteGremlinGraph request.
   393  func (client GremlinResourcesClient) DeleteGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) {
   394  	pathParameters := map[string]interface{}{
   395  		"accountName":       autorest.Encode("path", accountName),
   396  		"databaseName":      autorest.Encode("path", databaseName),
   397  		"graphName":         autorest.Encode("path", graphName),
   398  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   399  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   400  	}
   401  
   402  	const APIVersion = "2019-08-01"
   403  	queryParameters := map[string]interface{}{
   404  		"api-version": APIVersion,
   405  	}
   406  
   407  	preparer := autorest.CreatePreparer(
   408  		autorest.AsDelete(),
   409  		autorest.WithBaseURL(client.BaseURI),
   410  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", pathParameters),
   411  		autorest.WithQueryParameters(queryParameters))
   412  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   413  }
   414  
   415  // DeleteGremlinGraphSender sends the DeleteGremlinGraph request. The method will close the
   416  // http.Response Body if it receives an error.
   417  func (client GremlinResourcesClient) DeleteGremlinGraphSender(req *http.Request) (future GremlinResourcesDeleteGremlinGraphFuture, err error) {
   418  	var resp *http.Response
   419  	future.FutureAPI = &azure.Future{}
   420  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   421  	if err != nil {
   422  		return
   423  	}
   424  	var azf azure.Future
   425  	azf, err = azure.NewFutureFromResponse(resp)
   426  	future.FutureAPI = &azf
   427  	future.Result = future.result
   428  	return
   429  }
   430  
   431  // DeleteGremlinGraphResponder handles the response to the DeleteGremlinGraph request. The method always
   432  // closes the http.Response Body.
   433  func (client GremlinResourcesClient) DeleteGremlinGraphResponder(resp *http.Response) (result autorest.Response, err error) {
   434  	err = autorest.Respond(
   435  		resp,
   436  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   437  		autorest.ByClosing())
   438  	result.Response = resp
   439  	return
   440  }
   441  
   442  // GetGremlinDatabase gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided
   443  // name.
   444  // Parameters:
   445  // resourceGroupName - name of an Azure resource group.
   446  // accountName - cosmos DB database account name.
   447  // databaseName - cosmos DB database name.
   448  func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinDatabaseGetResults, err error) {
   449  	if tracing.IsEnabled() {
   450  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinDatabase")
   451  		defer func() {
   452  			sc := -1
   453  			if result.Response.Response != nil {
   454  				sc = result.Response.Response.StatusCode
   455  			}
   456  			tracing.EndSpan(ctx, sc, err)
   457  		}()
   458  	}
   459  	if err := validation.Validate([]validation.Validation{
   460  		{TargetValue: client.SubscriptionID,
   461  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   462  		{TargetValue: resourceGroupName,
   463  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   464  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   465  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   466  		{TargetValue: accountName,
   467  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   468  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   469  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   470  		return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinDatabase", err.Error())
   471  	}
   472  
   473  	req, err := client.GetGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseName)
   474  	if err != nil {
   475  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabase", nil, "Failure preparing request")
   476  		return
   477  	}
   478  
   479  	resp, err := client.GetGremlinDatabaseSender(req)
   480  	if err != nil {
   481  		result.Response = autorest.Response{Response: resp}
   482  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabase", resp, "Failure sending request")
   483  		return
   484  	}
   485  
   486  	result, err = client.GetGremlinDatabaseResponder(resp)
   487  	if err != nil {
   488  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabase", resp, "Failure responding to request")
   489  		return
   490  	}
   491  
   492  	return
   493  }
   494  
   495  // GetGremlinDatabasePreparer prepares the GetGremlinDatabase request.
   496  func (client GremlinResourcesClient) GetGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) {
   497  	pathParameters := map[string]interface{}{
   498  		"accountName":       autorest.Encode("path", accountName),
   499  		"databaseName":      autorest.Encode("path", databaseName),
   500  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   501  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   502  	}
   503  
   504  	const APIVersion = "2019-08-01"
   505  	queryParameters := map[string]interface{}{
   506  		"api-version": APIVersion,
   507  	}
   508  
   509  	preparer := autorest.CreatePreparer(
   510  		autorest.AsGet(),
   511  		autorest.WithBaseURL(client.BaseURI),
   512  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", pathParameters),
   513  		autorest.WithQueryParameters(queryParameters))
   514  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   515  }
   516  
   517  // GetGremlinDatabaseSender sends the GetGremlinDatabase request. The method will close the
   518  // http.Response Body if it receives an error.
   519  func (client GremlinResourcesClient) GetGremlinDatabaseSender(req *http.Request) (*http.Response, error) {
   520  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   521  }
   522  
   523  // GetGremlinDatabaseResponder handles the response to the GetGremlinDatabase request. The method always
   524  // closes the http.Response Body.
   525  func (client GremlinResourcesClient) GetGremlinDatabaseResponder(resp *http.Response) (result GremlinDatabaseGetResults, err error) {
   526  	err = autorest.Respond(
   527  		resp,
   528  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   529  		autorest.ByUnmarshallingJSON(&result),
   530  		autorest.ByClosing())
   531  	result.Response = autorest.Response{Response: resp}
   532  	return
   533  }
   534  
   535  // GetGremlinDatabaseThroughput gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB
   536  // database account with the provided name.
   537  // Parameters:
   538  // resourceGroupName - name of an Azure resource group.
   539  // accountName - cosmos DB database account name.
   540  // databaseName - cosmos DB database name.
   541  func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result ThroughputSettingsGetResults, err error) {
   542  	if tracing.IsEnabled() {
   543  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinDatabaseThroughput")
   544  		defer func() {
   545  			sc := -1
   546  			if result.Response.Response != nil {
   547  				sc = result.Response.Response.StatusCode
   548  			}
   549  			tracing.EndSpan(ctx, sc, err)
   550  		}()
   551  	}
   552  	if err := validation.Validate([]validation.Validation{
   553  		{TargetValue: client.SubscriptionID,
   554  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   555  		{TargetValue: resourceGroupName,
   556  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   557  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   558  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   559  		{TargetValue: accountName,
   560  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   561  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   562  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   563  		return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", err.Error())
   564  	}
   565  
   566  	req, err := client.GetGremlinDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName)
   567  	if err != nil {
   568  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", nil, "Failure preparing request")
   569  		return
   570  	}
   571  
   572  	resp, err := client.GetGremlinDatabaseThroughputSender(req)
   573  	if err != nil {
   574  		result.Response = autorest.Response{Response: resp}
   575  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", resp, "Failure sending request")
   576  		return
   577  	}
   578  
   579  	result, err = client.GetGremlinDatabaseThroughputResponder(resp)
   580  	if err != nil {
   581  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", resp, "Failure responding to request")
   582  		return
   583  	}
   584  
   585  	return
   586  }
   587  
   588  // GetGremlinDatabaseThroughputPreparer prepares the GetGremlinDatabaseThroughput request.
   589  func (client GremlinResourcesClient) GetGremlinDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) {
   590  	pathParameters := map[string]interface{}{
   591  		"accountName":       autorest.Encode("path", accountName),
   592  		"databaseName":      autorest.Encode("path", databaseName),
   593  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   594  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   595  	}
   596  
   597  	const APIVersion = "2019-08-01"
   598  	queryParameters := map[string]interface{}{
   599  		"api-version": APIVersion,
   600  	}
   601  
   602  	preparer := autorest.CreatePreparer(
   603  		autorest.AsGet(),
   604  		autorest.WithBaseURL(client.BaseURI),
   605  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default", pathParameters),
   606  		autorest.WithQueryParameters(queryParameters))
   607  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   608  }
   609  
   610  // GetGremlinDatabaseThroughputSender sends the GetGremlinDatabaseThroughput request. The method will close the
   611  // http.Response Body if it receives an error.
   612  func (client GremlinResourcesClient) GetGremlinDatabaseThroughputSender(req *http.Request) (*http.Response, error) {
   613  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   614  }
   615  
   616  // GetGremlinDatabaseThroughputResponder handles the response to the GetGremlinDatabaseThroughput request. The method always
   617  // closes the http.Response Body.
   618  func (client GremlinResourcesClient) GetGremlinDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
   619  	err = autorest.Respond(
   620  		resp,
   621  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   622  		autorest.ByUnmarshallingJSON(&result),
   623  		autorest.ByClosing())
   624  	result.Response = autorest.Response{Response: resp}
   625  	return
   626  }
   627  
   628  // GetGremlinGraph gets the Gremlin graph under an existing Azure Cosmos DB database account.
   629  // Parameters:
   630  // resourceGroupName - name of an Azure resource group.
   631  // accountName - cosmos DB database account name.
   632  // databaseName - cosmos DB database name.
   633  // graphName - cosmos DB graph name.
   634  func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result GremlinGraphGetResults, err error) {
   635  	if tracing.IsEnabled() {
   636  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinGraph")
   637  		defer func() {
   638  			sc := -1
   639  			if result.Response.Response != nil {
   640  				sc = result.Response.Response.StatusCode
   641  			}
   642  			tracing.EndSpan(ctx, sc, err)
   643  		}()
   644  	}
   645  	if err := validation.Validate([]validation.Validation{
   646  		{TargetValue: client.SubscriptionID,
   647  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   648  		{TargetValue: resourceGroupName,
   649  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   650  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   651  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   652  		{TargetValue: accountName,
   653  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   654  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   655  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   656  		return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinGraph", err.Error())
   657  	}
   658  
   659  	req, err := client.GetGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseName, graphName)
   660  	if err != nil {
   661  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraph", nil, "Failure preparing request")
   662  		return
   663  	}
   664  
   665  	resp, err := client.GetGremlinGraphSender(req)
   666  	if err != nil {
   667  		result.Response = autorest.Response{Response: resp}
   668  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraph", resp, "Failure sending request")
   669  		return
   670  	}
   671  
   672  	result, err = client.GetGremlinGraphResponder(resp)
   673  	if err != nil {
   674  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraph", resp, "Failure responding to request")
   675  		return
   676  	}
   677  
   678  	return
   679  }
   680  
   681  // GetGremlinGraphPreparer prepares the GetGremlinGraph request.
   682  func (client GremlinResourcesClient) GetGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) {
   683  	pathParameters := map[string]interface{}{
   684  		"accountName":       autorest.Encode("path", accountName),
   685  		"databaseName":      autorest.Encode("path", databaseName),
   686  		"graphName":         autorest.Encode("path", graphName),
   687  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   688  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   689  	}
   690  
   691  	const APIVersion = "2019-08-01"
   692  	queryParameters := map[string]interface{}{
   693  		"api-version": APIVersion,
   694  	}
   695  
   696  	preparer := autorest.CreatePreparer(
   697  		autorest.AsGet(),
   698  		autorest.WithBaseURL(client.BaseURI),
   699  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", pathParameters),
   700  		autorest.WithQueryParameters(queryParameters))
   701  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   702  }
   703  
   704  // GetGremlinGraphSender sends the GetGremlinGraph request. The method will close the
   705  // http.Response Body if it receives an error.
   706  func (client GremlinResourcesClient) GetGremlinGraphSender(req *http.Request) (*http.Response, error) {
   707  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   708  }
   709  
   710  // GetGremlinGraphResponder handles the response to the GetGremlinGraph request. The method always
   711  // closes the http.Response Body.
   712  func (client GremlinResourcesClient) GetGremlinGraphResponder(resp *http.Response) (result GremlinGraphGetResults, err error) {
   713  	err = autorest.Respond(
   714  		resp,
   715  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   716  		autorest.ByUnmarshallingJSON(&result),
   717  		autorest.ByClosing())
   718  	result.Response = autorest.Response{Response: resp}
   719  	return
   720  }
   721  
   722  // GetGremlinGraphThroughput gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with
   723  // the provided name.
   724  // Parameters:
   725  // resourceGroupName - name of an Azure resource group.
   726  // accountName - cosmos DB database account name.
   727  // databaseName - cosmos DB database name.
   728  // graphName - cosmos DB graph name.
   729  func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result ThroughputSettingsGetResults, err error) {
   730  	if tracing.IsEnabled() {
   731  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinGraphThroughput")
   732  		defer func() {
   733  			sc := -1
   734  			if result.Response.Response != nil {
   735  				sc = result.Response.Response.StatusCode
   736  			}
   737  			tracing.EndSpan(ctx, sc, err)
   738  		}()
   739  	}
   740  	if err := validation.Validate([]validation.Validation{
   741  		{TargetValue: client.SubscriptionID,
   742  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   743  		{TargetValue: resourceGroupName,
   744  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   745  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   746  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   747  		{TargetValue: accountName,
   748  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   749  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   750  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   751  		return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", err.Error())
   752  	}
   753  
   754  	req, err := client.GetGremlinGraphThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, graphName)
   755  	if err != nil {
   756  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", nil, "Failure preparing request")
   757  		return
   758  	}
   759  
   760  	resp, err := client.GetGremlinGraphThroughputSender(req)
   761  	if err != nil {
   762  		result.Response = autorest.Response{Response: resp}
   763  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", resp, "Failure sending request")
   764  		return
   765  	}
   766  
   767  	result, err = client.GetGremlinGraphThroughputResponder(resp)
   768  	if err != nil {
   769  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", resp, "Failure responding to request")
   770  		return
   771  	}
   772  
   773  	return
   774  }
   775  
   776  // GetGremlinGraphThroughputPreparer prepares the GetGremlinGraphThroughput request.
   777  func (client GremlinResourcesClient) GetGremlinGraphThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) {
   778  	pathParameters := map[string]interface{}{
   779  		"accountName":       autorest.Encode("path", accountName),
   780  		"databaseName":      autorest.Encode("path", databaseName),
   781  		"graphName":         autorest.Encode("path", graphName),
   782  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   783  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   784  	}
   785  
   786  	const APIVersion = "2019-08-01"
   787  	queryParameters := map[string]interface{}{
   788  		"api-version": APIVersion,
   789  	}
   790  
   791  	preparer := autorest.CreatePreparer(
   792  		autorest.AsGet(),
   793  		autorest.WithBaseURL(client.BaseURI),
   794  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default", pathParameters),
   795  		autorest.WithQueryParameters(queryParameters))
   796  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   797  }
   798  
   799  // GetGremlinGraphThroughputSender sends the GetGremlinGraphThroughput request. The method will close the
   800  // http.Response Body if it receives an error.
   801  func (client GremlinResourcesClient) GetGremlinGraphThroughputSender(req *http.Request) (*http.Response, error) {
   802  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   803  }
   804  
   805  // GetGremlinGraphThroughputResponder handles the response to the GetGremlinGraphThroughput request. The method always
   806  // closes the http.Response Body.
   807  func (client GremlinResourcesClient) GetGremlinGraphThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
   808  	err = autorest.Respond(
   809  		resp,
   810  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   811  		autorest.ByUnmarshallingJSON(&result),
   812  		autorest.ByClosing())
   813  	result.Response = autorest.Response{Response: resp}
   814  	return
   815  }
   816  
   817  // ListGremlinDatabases lists the Gremlin databases under an existing Azure Cosmos DB database account.
   818  // Parameters:
   819  // resourceGroupName - name of an Azure resource group.
   820  // accountName - cosmos DB database account name.
   821  func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, resourceGroupName string, accountName string) (result GremlinDatabaseListResult, err error) {
   822  	if tracing.IsEnabled() {
   823  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.ListGremlinDatabases")
   824  		defer func() {
   825  			sc := -1
   826  			if result.Response.Response != nil {
   827  				sc = result.Response.Response.StatusCode
   828  			}
   829  			tracing.EndSpan(ctx, sc, err)
   830  		}()
   831  	}
   832  	if err := validation.Validate([]validation.Validation{
   833  		{TargetValue: client.SubscriptionID,
   834  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   835  		{TargetValue: resourceGroupName,
   836  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   837  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   838  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   839  		{TargetValue: accountName,
   840  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   841  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   842  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   843  		return result, validation.NewError("documentdb.GremlinResourcesClient", "ListGremlinDatabases", err.Error())
   844  	}
   845  
   846  	req, err := client.ListGremlinDatabasesPreparer(ctx, resourceGroupName, accountName)
   847  	if err != nil {
   848  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinDatabases", nil, "Failure preparing request")
   849  		return
   850  	}
   851  
   852  	resp, err := client.ListGremlinDatabasesSender(req)
   853  	if err != nil {
   854  		result.Response = autorest.Response{Response: resp}
   855  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinDatabases", resp, "Failure sending request")
   856  		return
   857  	}
   858  
   859  	result, err = client.ListGremlinDatabasesResponder(resp)
   860  	if err != nil {
   861  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinDatabases", resp, "Failure responding to request")
   862  		return
   863  	}
   864  
   865  	return
   866  }
   867  
   868  // ListGremlinDatabasesPreparer prepares the ListGremlinDatabases request.
   869  func (client GremlinResourcesClient) ListGremlinDatabasesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
   870  	pathParameters := map[string]interface{}{
   871  		"accountName":       autorest.Encode("path", accountName),
   872  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   873  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   874  	}
   875  
   876  	const APIVersion = "2019-08-01"
   877  	queryParameters := map[string]interface{}{
   878  		"api-version": APIVersion,
   879  	}
   880  
   881  	preparer := autorest.CreatePreparer(
   882  		autorest.AsGet(),
   883  		autorest.WithBaseURL(client.BaseURI),
   884  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases", pathParameters),
   885  		autorest.WithQueryParameters(queryParameters))
   886  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   887  }
   888  
   889  // ListGremlinDatabasesSender sends the ListGremlinDatabases request. The method will close the
   890  // http.Response Body if it receives an error.
   891  func (client GremlinResourcesClient) ListGremlinDatabasesSender(req *http.Request) (*http.Response, error) {
   892  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   893  }
   894  
   895  // ListGremlinDatabasesResponder handles the response to the ListGremlinDatabases request. The method always
   896  // closes the http.Response Body.
   897  func (client GremlinResourcesClient) ListGremlinDatabasesResponder(resp *http.Response) (result GremlinDatabaseListResult, err error) {
   898  	err = autorest.Respond(
   899  		resp,
   900  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   901  		autorest.ByUnmarshallingJSON(&result),
   902  		autorest.ByClosing())
   903  	result.Response = autorest.Response{Response: resp}
   904  	return
   905  }
   906  
   907  // ListGremlinGraphs lists the Gremlin graph under an existing Azure Cosmos DB database account.
   908  // Parameters:
   909  // resourceGroupName - name of an Azure resource group.
   910  // accountName - cosmos DB database account name.
   911  // databaseName - cosmos DB database name.
   912  func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinGraphListResult, err error) {
   913  	if tracing.IsEnabled() {
   914  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.ListGremlinGraphs")
   915  		defer func() {
   916  			sc := -1
   917  			if result.Response.Response != nil {
   918  				sc = result.Response.Response.StatusCode
   919  			}
   920  			tracing.EndSpan(ctx, sc, err)
   921  		}()
   922  	}
   923  	if err := validation.Validate([]validation.Validation{
   924  		{TargetValue: client.SubscriptionID,
   925  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   926  		{TargetValue: resourceGroupName,
   927  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   928  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   929  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   930  		{TargetValue: accountName,
   931  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   932  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   933  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   934  		return result, validation.NewError("documentdb.GremlinResourcesClient", "ListGremlinGraphs", err.Error())
   935  	}
   936  
   937  	req, err := client.ListGremlinGraphsPreparer(ctx, resourceGroupName, accountName, databaseName)
   938  	if err != nil {
   939  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinGraphs", nil, "Failure preparing request")
   940  		return
   941  	}
   942  
   943  	resp, err := client.ListGremlinGraphsSender(req)
   944  	if err != nil {
   945  		result.Response = autorest.Response{Response: resp}
   946  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinGraphs", resp, "Failure sending request")
   947  		return
   948  	}
   949  
   950  	result, err = client.ListGremlinGraphsResponder(resp)
   951  	if err != nil {
   952  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinGraphs", resp, "Failure responding to request")
   953  		return
   954  	}
   955  
   956  	return
   957  }
   958  
   959  // ListGremlinGraphsPreparer prepares the ListGremlinGraphs request.
   960  func (client GremlinResourcesClient) ListGremlinGraphsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) {
   961  	pathParameters := map[string]interface{}{
   962  		"accountName":       autorest.Encode("path", accountName),
   963  		"databaseName":      autorest.Encode("path", databaseName),
   964  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   965  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   966  	}
   967  
   968  	const APIVersion = "2019-08-01"
   969  	queryParameters := map[string]interface{}{
   970  		"api-version": APIVersion,
   971  	}
   972  
   973  	preparer := autorest.CreatePreparer(
   974  		autorest.AsGet(),
   975  		autorest.WithBaseURL(client.BaseURI),
   976  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs", pathParameters),
   977  		autorest.WithQueryParameters(queryParameters))
   978  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   979  }
   980  
   981  // ListGremlinGraphsSender sends the ListGremlinGraphs request. The method will close the
   982  // http.Response Body if it receives an error.
   983  func (client GremlinResourcesClient) ListGremlinGraphsSender(req *http.Request) (*http.Response, error) {
   984  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   985  }
   986  
   987  // ListGremlinGraphsResponder handles the response to the ListGremlinGraphs request. The method always
   988  // closes the http.Response Body.
   989  func (client GremlinResourcesClient) ListGremlinGraphsResponder(resp *http.Response) (result GremlinGraphListResult, err error) {
   990  	err = autorest.Respond(
   991  		resp,
   992  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   993  		autorest.ByUnmarshallingJSON(&result),
   994  		autorest.ByClosing())
   995  	result.Response = autorest.Response{Response: resp}
   996  	return
   997  }
   998  
   999  // UpdateGremlinDatabaseThroughput update RUs per second of an Azure Cosmos DB Gremlin database
  1000  // Parameters:
  1001  // resourceGroupName - name of an Azure resource group.
  1002  // accountName - cosmos DB database account name.
  1003  // databaseName - cosmos DB database name.
  1004  // updateThroughputParameters - the RUs per second of the parameters to provide for the current Gremlin
  1005  // database.
  1006  func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result GremlinResourcesUpdateGremlinDatabaseThroughputFuture, err error) {
  1007  	if tracing.IsEnabled() {
  1008  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.UpdateGremlinDatabaseThroughput")
  1009  		defer func() {
  1010  			sc := -1
  1011  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  1012  				sc = result.FutureAPI.Response().StatusCode
  1013  			}
  1014  			tracing.EndSpan(ctx, sc, err)
  1015  		}()
  1016  	}
  1017  	if err := validation.Validate([]validation.Validation{
  1018  		{TargetValue: client.SubscriptionID,
  1019  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1020  		{TargetValue: resourceGroupName,
  1021  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1022  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1023  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1024  		{TargetValue: accountName,
  1025  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1026  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1027  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
  1028  		{TargetValue: updateThroughputParameters,
  1029  			Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true,
  1030  				Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true,
  1031  					Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.Throughput", Name: validation.Null, Rule: true, Chain: nil}}},
  1032  				}}}}}); err != nil {
  1033  		return result, validation.NewError("documentdb.GremlinResourcesClient", "UpdateGremlinDatabaseThroughput", err.Error())
  1034  	}
  1035  
  1036  	req, err := client.UpdateGremlinDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters)
  1037  	if err != nil {
  1038  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinDatabaseThroughput", nil, "Failure preparing request")
  1039  		return
  1040  	}
  1041  
  1042  	result, err = client.UpdateGremlinDatabaseThroughputSender(req)
  1043  	if err != nil {
  1044  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinDatabaseThroughput", result.Response(), "Failure sending request")
  1045  		return
  1046  	}
  1047  
  1048  	return
  1049  }
  1050  
  1051  // UpdateGremlinDatabaseThroughputPreparer prepares the UpdateGremlinDatabaseThroughput request.
  1052  func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) {
  1053  	pathParameters := map[string]interface{}{
  1054  		"accountName":       autorest.Encode("path", accountName),
  1055  		"databaseName":      autorest.Encode("path", databaseName),
  1056  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1057  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1058  	}
  1059  
  1060  	const APIVersion = "2019-08-01"
  1061  	queryParameters := map[string]interface{}{
  1062  		"api-version": APIVersion,
  1063  	}
  1064  
  1065  	preparer := autorest.CreatePreparer(
  1066  		autorest.AsContentType("application/json; charset=utf-8"),
  1067  		autorest.AsPut(),
  1068  		autorest.WithBaseURL(client.BaseURI),
  1069  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default", pathParameters),
  1070  		autorest.WithJSON(updateThroughputParameters),
  1071  		autorest.WithQueryParameters(queryParameters))
  1072  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1073  }
  1074  
  1075  // UpdateGremlinDatabaseThroughputSender sends the UpdateGremlinDatabaseThroughput request. The method will close the
  1076  // http.Response Body if it receives an error.
  1077  func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughputSender(req *http.Request) (future GremlinResourcesUpdateGremlinDatabaseThroughputFuture, err error) {
  1078  	var resp *http.Response
  1079  	future.FutureAPI = &azure.Future{}
  1080  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1081  	if err != nil {
  1082  		return
  1083  	}
  1084  	var azf azure.Future
  1085  	azf, err = azure.NewFutureFromResponse(resp)
  1086  	future.FutureAPI = &azf
  1087  	future.Result = future.result
  1088  	return
  1089  }
  1090  
  1091  // UpdateGremlinDatabaseThroughputResponder handles the response to the UpdateGremlinDatabaseThroughput request. The method always
  1092  // closes the http.Response Body.
  1093  func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  1094  	err = autorest.Respond(
  1095  		resp,
  1096  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  1097  		autorest.ByUnmarshallingJSON(&result),
  1098  		autorest.ByClosing())
  1099  	result.Response = autorest.Response{Response: resp}
  1100  	return
  1101  }
  1102  
  1103  // UpdateGremlinGraphThroughput update RUs per second of an Azure Cosmos DB Gremlin graph
  1104  // Parameters:
  1105  // resourceGroupName - name of an Azure resource group.
  1106  // accountName - cosmos DB database account name.
  1107  // databaseName - cosmos DB database name.
  1108  // graphName - cosmos DB graph name.
  1109  // updateThroughputParameters - the RUs per second of the parameters to provide for the current Gremlin graph.
  1110  func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result GremlinResourcesUpdateGremlinGraphThroughputFuture, err error) {
  1111  	if tracing.IsEnabled() {
  1112  		ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.UpdateGremlinGraphThroughput")
  1113  		defer func() {
  1114  			sc := -1
  1115  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  1116  				sc = result.FutureAPI.Response().StatusCode
  1117  			}
  1118  			tracing.EndSpan(ctx, sc, err)
  1119  		}()
  1120  	}
  1121  	if err := validation.Validate([]validation.Validation{
  1122  		{TargetValue: client.SubscriptionID,
  1123  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1124  		{TargetValue: resourceGroupName,
  1125  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1126  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1127  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1128  		{TargetValue: accountName,
  1129  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1130  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1131  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
  1132  		{TargetValue: updateThroughputParameters,
  1133  			Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true,
  1134  				Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true,
  1135  					Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.Throughput", Name: validation.Null, Rule: true, Chain: nil}}},
  1136  				}}}}}); err != nil {
  1137  		return result, validation.NewError("documentdb.GremlinResourcesClient", "UpdateGremlinGraphThroughput", err.Error())
  1138  	}
  1139  
  1140  	req, err := client.UpdateGremlinGraphThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters)
  1141  	if err != nil {
  1142  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinGraphThroughput", nil, "Failure preparing request")
  1143  		return
  1144  	}
  1145  
  1146  	result, err = client.UpdateGremlinGraphThroughputSender(req)
  1147  	if err != nil {
  1148  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinGraphThroughput", result.Response(), "Failure sending request")
  1149  		return
  1150  	}
  1151  
  1152  	return
  1153  }
  1154  
  1155  // UpdateGremlinGraphThroughputPreparer prepares the UpdateGremlinGraphThroughput request.
  1156  func (client GremlinResourcesClient) UpdateGremlinGraphThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) {
  1157  	pathParameters := map[string]interface{}{
  1158  		"accountName":       autorest.Encode("path", accountName),
  1159  		"databaseName":      autorest.Encode("path", databaseName),
  1160  		"graphName":         autorest.Encode("path", graphName),
  1161  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1162  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1163  	}
  1164  
  1165  	const APIVersion = "2019-08-01"
  1166  	queryParameters := map[string]interface{}{
  1167  		"api-version": APIVersion,
  1168  	}
  1169  
  1170  	preparer := autorest.CreatePreparer(
  1171  		autorest.AsContentType("application/json; charset=utf-8"),
  1172  		autorest.AsPut(),
  1173  		autorest.WithBaseURL(client.BaseURI),
  1174  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default", pathParameters),
  1175  		autorest.WithJSON(updateThroughputParameters),
  1176  		autorest.WithQueryParameters(queryParameters))
  1177  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1178  }
  1179  
  1180  // UpdateGremlinGraphThroughputSender sends the UpdateGremlinGraphThroughput request. The method will close the
  1181  // http.Response Body if it receives an error.
  1182  func (client GremlinResourcesClient) UpdateGremlinGraphThroughputSender(req *http.Request) (future GremlinResourcesUpdateGremlinGraphThroughputFuture, err error) {
  1183  	var resp *http.Response
  1184  	future.FutureAPI = &azure.Future{}
  1185  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1186  	if err != nil {
  1187  		return
  1188  	}
  1189  	var azf azure.Future
  1190  	azf, err = azure.NewFutureFromResponse(resp)
  1191  	future.FutureAPI = &azf
  1192  	future.Result = future.result
  1193  	return
  1194  }
  1195  
  1196  // UpdateGremlinGraphThroughputResponder handles the response to the UpdateGremlinGraphThroughput request. The method always
  1197  // closes the http.Response Body.
  1198  func (client GremlinResourcesClient) UpdateGremlinGraphThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  1199  	err = autorest.Respond(
  1200  		resp,
  1201  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  1202  		autorest.ByUnmarshallingJSON(&result),
  1203  		autorest.ByClosing())
  1204  	result.Response = autorest.Response{Response: resp}
  1205  	return
  1206  }
  1207  

View as plain text