...

Source file src/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-03-15/documentdb/sqlresources.go

Documentation: github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-03-15/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  // SQLResourcesClient is the azure Cosmos DB Database Service Resource Provider REST API
    19  type SQLResourcesClient struct {
    20  	BaseClient
    21  }
    22  
    23  // NewSQLResourcesClient creates an instance of the SQLResourcesClient client.
    24  func NewSQLResourcesClient(subscriptionID string) SQLResourcesClient {
    25  	return NewSQLResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID)
    26  }
    27  
    28  // NewSQLResourcesClientWithBaseURI creates an instance of the SQLResourcesClient client using a custom endpoint.  Use
    29  // this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
    30  func NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string) SQLResourcesClient {
    31  	return SQLResourcesClient{NewWithBaseURI(baseURI, subscriptionID)}
    32  }
    33  
    34  // CreateUpdateSQLContainer create or update an Azure Cosmos DB SQL container
    35  // Parameters:
    36  // resourceGroupName - the name of the resource group. The name is case insensitive.
    37  // accountName - cosmos DB database account name.
    38  // databaseName - cosmos DB database name.
    39  // containerName - cosmos DB container name.
    40  // createUpdateSQLContainerParameters - the parameters to provide for the current SQL container.
    41  func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLContainerFuture, err error) {
    42  	if tracing.IsEnabled() {
    43  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLContainer")
    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: createUpdateSQLContainerParameters,
    64  			Constraints: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties", Name: validation.Null, Rule: true,
    65  				Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource", Name: validation.Null, Rule: true,
    66  					Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil},
    67  						{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey", Name: validation.Null, Rule: false,
    68  							Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.Null, Rule: false,
    69  								Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMaximum, Rule: int64(2), Chain: nil},
    70  									{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
    71  								}},
    72  							}},
    73  					}},
    74  				}}}}}); err != nil {
    75  		return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLContainer", err.Error())
    76  	}
    77  
    78  	req, err := client.CreateUpdateSQLContainerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, createUpdateSQLContainerParameters)
    79  	if err != nil {
    80  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLContainer", nil, "Failure preparing request")
    81  		return
    82  	}
    83  
    84  	result, err = client.CreateUpdateSQLContainerSender(req)
    85  	if err != nil {
    86  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLContainer", result.Response(), "Failure sending request")
    87  		return
    88  	}
    89  
    90  	return
    91  }
    92  
    93  // CreateUpdateSQLContainerPreparer prepares the CreateUpdateSQLContainer request.
    94  func (client SQLResourcesClient) CreateUpdateSQLContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters) (*http.Request, error) {
    95  	pathParameters := map[string]interface{}{
    96  		"accountName":       autorest.Encode("path", accountName),
    97  		"containerName":     autorest.Encode("path", containerName),
    98  		"databaseName":      autorest.Encode("path", databaseName),
    99  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   100  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   101  	}
   102  
   103  	const APIVersion = "2021-03-15"
   104  	queryParameters := map[string]interface{}{
   105  		"api-version": APIVersion,
   106  	}
   107  
   108  	preparer := autorest.CreatePreparer(
   109  		autorest.AsContentType("application/json; charset=utf-8"),
   110  		autorest.AsPut(),
   111  		autorest.WithBaseURL(client.BaseURI),
   112  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", pathParameters),
   113  		autorest.WithJSON(createUpdateSQLContainerParameters),
   114  		autorest.WithQueryParameters(queryParameters))
   115  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   116  }
   117  
   118  // CreateUpdateSQLContainerSender sends the CreateUpdateSQLContainer request. The method will close the
   119  // http.Response Body if it receives an error.
   120  func (client SQLResourcesClient) CreateUpdateSQLContainerSender(req *http.Request) (future SQLResourcesCreateUpdateSQLContainerFuture, err error) {
   121  	var resp *http.Response
   122  	future.FutureAPI = &azure.Future{}
   123  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   124  	if err != nil {
   125  		return
   126  	}
   127  	var azf azure.Future
   128  	azf, err = azure.NewFutureFromResponse(resp)
   129  	future.FutureAPI = &azf
   130  	future.Result = future.result
   131  	return
   132  }
   133  
   134  // CreateUpdateSQLContainerResponder handles the response to the CreateUpdateSQLContainer request. The method always
   135  // closes the http.Response Body.
   136  func (client SQLResourcesClient) CreateUpdateSQLContainerResponder(resp *http.Response) (result SQLContainerGetResults, err error) {
   137  	err = autorest.Respond(
   138  		resp,
   139  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   140  		autorest.ByUnmarshallingJSON(&result),
   141  		autorest.ByClosing())
   142  	result.Response = autorest.Response{Response: resp}
   143  	return
   144  }
   145  
   146  // CreateUpdateSQLDatabase create or update an Azure Cosmos DB SQL database
   147  // Parameters:
   148  // resourceGroupName - the name of the resource group. The name is case insensitive.
   149  // accountName - cosmos DB database account name.
   150  // databaseName - cosmos DB database name.
   151  // createUpdateSQLDatabaseParameters - the parameters to provide for the current SQL database.
   152  func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters SQLDatabaseCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLDatabaseFuture, err error) {
   153  	if tracing.IsEnabled() {
   154  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLDatabase")
   155  		defer func() {
   156  			sc := -1
   157  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   158  				sc = result.FutureAPI.Response().StatusCode
   159  			}
   160  			tracing.EndSpan(ctx, sc, err)
   161  		}()
   162  	}
   163  	if err := validation.Validate([]validation.Validation{
   164  		{TargetValue: client.SubscriptionID,
   165  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   166  		{TargetValue: resourceGroupName,
   167  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   168  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   169  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   170  		{TargetValue: accountName,
   171  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   172  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   173  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
   174  		{TargetValue: createUpdateSQLDatabaseParameters,
   175  			Constraints: []validation.Constraint{{Target: "createUpdateSQLDatabaseParameters.SQLDatabaseCreateUpdateProperties", Name: validation.Null, Rule: true,
   176  				Chain: []validation.Constraint{{Target: "createUpdateSQLDatabaseParameters.SQLDatabaseCreateUpdateProperties.Resource", Name: validation.Null, Rule: true,
   177  					Chain: []validation.Constraint{{Target: "createUpdateSQLDatabaseParameters.SQLDatabaseCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}},
   178  				}}}}}); err != nil {
   179  		return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLDatabase", err.Error())
   180  	}
   181  
   182  	req, err := client.CreateUpdateSQLDatabasePreparer(ctx, resourceGroupName, accountName, databaseName, createUpdateSQLDatabaseParameters)
   183  	if err != nil {
   184  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLDatabase", nil, "Failure preparing request")
   185  		return
   186  	}
   187  
   188  	result, err = client.CreateUpdateSQLDatabaseSender(req)
   189  	if err != nil {
   190  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLDatabase", result.Response(), "Failure sending request")
   191  		return
   192  	}
   193  
   194  	return
   195  }
   196  
   197  // CreateUpdateSQLDatabasePreparer prepares the CreateUpdateSQLDatabase request.
   198  func (client SQLResourcesClient) CreateUpdateSQLDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters SQLDatabaseCreateUpdateParameters) (*http.Request, error) {
   199  	pathParameters := map[string]interface{}{
   200  		"accountName":       autorest.Encode("path", accountName),
   201  		"databaseName":      autorest.Encode("path", databaseName),
   202  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   203  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   204  	}
   205  
   206  	const APIVersion = "2021-03-15"
   207  	queryParameters := map[string]interface{}{
   208  		"api-version": APIVersion,
   209  	}
   210  
   211  	preparer := autorest.CreatePreparer(
   212  		autorest.AsContentType("application/json; charset=utf-8"),
   213  		autorest.AsPut(),
   214  		autorest.WithBaseURL(client.BaseURI),
   215  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", pathParameters),
   216  		autorest.WithJSON(createUpdateSQLDatabaseParameters),
   217  		autorest.WithQueryParameters(queryParameters))
   218  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   219  }
   220  
   221  // CreateUpdateSQLDatabaseSender sends the CreateUpdateSQLDatabase request. The method will close the
   222  // http.Response Body if it receives an error.
   223  func (client SQLResourcesClient) CreateUpdateSQLDatabaseSender(req *http.Request) (future SQLResourcesCreateUpdateSQLDatabaseFuture, err error) {
   224  	var resp *http.Response
   225  	future.FutureAPI = &azure.Future{}
   226  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   227  	if err != nil {
   228  		return
   229  	}
   230  	var azf azure.Future
   231  	azf, err = azure.NewFutureFromResponse(resp)
   232  	future.FutureAPI = &azf
   233  	future.Result = future.result
   234  	return
   235  }
   236  
   237  // CreateUpdateSQLDatabaseResponder handles the response to the CreateUpdateSQLDatabase request. The method always
   238  // closes the http.Response Body.
   239  func (client SQLResourcesClient) CreateUpdateSQLDatabaseResponder(resp *http.Response) (result SQLDatabaseGetResults, err error) {
   240  	err = autorest.Respond(
   241  		resp,
   242  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   243  		autorest.ByUnmarshallingJSON(&result),
   244  		autorest.ByClosing())
   245  	result.Response = autorest.Response{Response: resp}
   246  	return
   247  }
   248  
   249  // CreateUpdateSQLStoredProcedure create or update an Azure Cosmos DB SQL storedProcedure
   250  // Parameters:
   251  // resourceGroupName - the name of the resource group. The name is case insensitive.
   252  // accountName - cosmos DB database account name.
   253  // databaseName - cosmos DB database name.
   254  // containerName - cosmos DB container name.
   255  // storedProcedureName - cosmos DB storedProcedure name.
   256  // createUpdateSQLStoredProcedureParameters - the parameters to provide for the current SQL storedProcedure.
   257  func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, createUpdateSQLStoredProcedureParameters SQLStoredProcedureCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLStoredProcedureFuture, err error) {
   258  	if tracing.IsEnabled() {
   259  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLStoredProcedure")
   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}}},
   279  		{TargetValue: createUpdateSQLStoredProcedureParameters,
   280  			Constraints: []validation.Constraint{{Target: "createUpdateSQLStoredProcedureParameters.SQLStoredProcedureCreateUpdateProperties", Name: validation.Null, Rule: true,
   281  				Chain: []validation.Constraint{{Target: "createUpdateSQLStoredProcedureParameters.SQLStoredProcedureCreateUpdateProperties.Resource", Name: validation.Null, Rule: true,
   282  					Chain: []validation.Constraint{{Target: "createUpdateSQLStoredProcedureParameters.SQLStoredProcedureCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}},
   283  				}}}}}); err != nil {
   284  		return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLStoredProcedure", err.Error())
   285  	}
   286  
   287  	req, err := client.CreateUpdateSQLStoredProcedurePreparer(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSQLStoredProcedureParameters)
   288  	if err != nil {
   289  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLStoredProcedure", nil, "Failure preparing request")
   290  		return
   291  	}
   292  
   293  	result, err = client.CreateUpdateSQLStoredProcedureSender(req)
   294  	if err != nil {
   295  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLStoredProcedure", result.Response(), "Failure sending request")
   296  		return
   297  	}
   298  
   299  	return
   300  }
   301  
   302  // CreateUpdateSQLStoredProcedurePreparer prepares the CreateUpdateSQLStoredProcedure request.
   303  func (client SQLResourcesClient) CreateUpdateSQLStoredProcedurePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, createUpdateSQLStoredProcedureParameters SQLStoredProcedureCreateUpdateParameters) (*http.Request, error) {
   304  	pathParameters := map[string]interface{}{
   305  		"accountName":         autorest.Encode("path", accountName),
   306  		"containerName":       autorest.Encode("path", containerName),
   307  		"databaseName":        autorest.Encode("path", databaseName),
   308  		"resourceGroupName":   autorest.Encode("path", resourceGroupName),
   309  		"storedProcedureName": autorest.Encode("path", storedProcedureName),
   310  		"subscriptionId":      autorest.Encode("path", client.SubscriptionID),
   311  	}
   312  
   313  	const APIVersion = "2021-03-15"
   314  	queryParameters := map[string]interface{}{
   315  		"api-version": APIVersion,
   316  	}
   317  
   318  	preparer := autorest.CreatePreparer(
   319  		autorest.AsContentType("application/json; charset=utf-8"),
   320  		autorest.AsPut(),
   321  		autorest.WithBaseURL(client.BaseURI),
   322  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", pathParameters),
   323  		autorest.WithJSON(createUpdateSQLStoredProcedureParameters),
   324  		autorest.WithQueryParameters(queryParameters))
   325  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   326  }
   327  
   328  // CreateUpdateSQLStoredProcedureSender sends the CreateUpdateSQLStoredProcedure request. The method will close the
   329  // http.Response Body if it receives an error.
   330  func (client SQLResourcesClient) CreateUpdateSQLStoredProcedureSender(req *http.Request) (future SQLResourcesCreateUpdateSQLStoredProcedureFuture, err error) {
   331  	var resp *http.Response
   332  	future.FutureAPI = &azure.Future{}
   333  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   334  	if err != nil {
   335  		return
   336  	}
   337  	var azf azure.Future
   338  	azf, err = azure.NewFutureFromResponse(resp)
   339  	future.FutureAPI = &azf
   340  	future.Result = future.result
   341  	return
   342  }
   343  
   344  // CreateUpdateSQLStoredProcedureResponder handles the response to the CreateUpdateSQLStoredProcedure request. The method always
   345  // closes the http.Response Body.
   346  func (client SQLResourcesClient) CreateUpdateSQLStoredProcedureResponder(resp *http.Response) (result SQLStoredProcedureGetResults, err error) {
   347  	err = autorest.Respond(
   348  		resp,
   349  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   350  		autorest.ByUnmarshallingJSON(&result),
   351  		autorest.ByClosing())
   352  	result.Response = autorest.Response{Response: resp}
   353  	return
   354  }
   355  
   356  // CreateUpdateSQLTrigger create or update an Azure Cosmos DB SQL trigger
   357  // Parameters:
   358  // resourceGroupName - the name of the resource group. The name is case insensitive.
   359  // accountName - cosmos DB database account name.
   360  // databaseName - cosmos DB database name.
   361  // containerName - cosmos DB container name.
   362  // triggerName - cosmos DB trigger name.
   363  // createUpdateSQLTriggerParameters - the parameters to provide for the current SQL trigger.
   364  func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, createUpdateSQLTriggerParameters SQLTriggerCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLTriggerFuture, err error) {
   365  	if tracing.IsEnabled() {
   366  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLTrigger")
   367  		defer func() {
   368  			sc := -1
   369  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   370  				sc = result.FutureAPI.Response().StatusCode
   371  			}
   372  			tracing.EndSpan(ctx, sc, err)
   373  		}()
   374  	}
   375  	if err := validation.Validate([]validation.Validation{
   376  		{TargetValue: client.SubscriptionID,
   377  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   378  		{TargetValue: resourceGroupName,
   379  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   380  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   381  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   382  		{TargetValue: accountName,
   383  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   384  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   385  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
   386  		{TargetValue: createUpdateSQLTriggerParameters,
   387  			Constraints: []validation.Constraint{{Target: "createUpdateSQLTriggerParameters.SQLTriggerCreateUpdateProperties", Name: validation.Null, Rule: true,
   388  				Chain: []validation.Constraint{{Target: "createUpdateSQLTriggerParameters.SQLTriggerCreateUpdateProperties.Resource", Name: validation.Null, Rule: true,
   389  					Chain: []validation.Constraint{{Target: "createUpdateSQLTriggerParameters.SQLTriggerCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}},
   390  				}}}}}); err != nil {
   391  		return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLTrigger", err.Error())
   392  	}
   393  
   394  	req, err := client.CreateUpdateSQLTriggerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSQLTriggerParameters)
   395  	if err != nil {
   396  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLTrigger", nil, "Failure preparing request")
   397  		return
   398  	}
   399  
   400  	result, err = client.CreateUpdateSQLTriggerSender(req)
   401  	if err != nil {
   402  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLTrigger", result.Response(), "Failure sending request")
   403  		return
   404  	}
   405  
   406  	return
   407  }
   408  
   409  // CreateUpdateSQLTriggerPreparer prepares the CreateUpdateSQLTrigger request.
   410  func (client SQLResourcesClient) CreateUpdateSQLTriggerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, createUpdateSQLTriggerParameters SQLTriggerCreateUpdateParameters) (*http.Request, error) {
   411  	pathParameters := map[string]interface{}{
   412  		"accountName":       autorest.Encode("path", accountName),
   413  		"containerName":     autorest.Encode("path", containerName),
   414  		"databaseName":      autorest.Encode("path", databaseName),
   415  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   416  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   417  		"triggerName":       autorest.Encode("path", triggerName),
   418  	}
   419  
   420  	const APIVersion = "2021-03-15"
   421  	queryParameters := map[string]interface{}{
   422  		"api-version": APIVersion,
   423  	}
   424  
   425  	preparer := autorest.CreatePreparer(
   426  		autorest.AsContentType("application/json; charset=utf-8"),
   427  		autorest.AsPut(),
   428  		autorest.WithBaseURL(client.BaseURI),
   429  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", pathParameters),
   430  		autorest.WithJSON(createUpdateSQLTriggerParameters),
   431  		autorest.WithQueryParameters(queryParameters))
   432  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   433  }
   434  
   435  // CreateUpdateSQLTriggerSender sends the CreateUpdateSQLTrigger request. The method will close the
   436  // http.Response Body if it receives an error.
   437  func (client SQLResourcesClient) CreateUpdateSQLTriggerSender(req *http.Request) (future SQLResourcesCreateUpdateSQLTriggerFuture, err error) {
   438  	var resp *http.Response
   439  	future.FutureAPI = &azure.Future{}
   440  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   441  	if err != nil {
   442  		return
   443  	}
   444  	var azf azure.Future
   445  	azf, err = azure.NewFutureFromResponse(resp)
   446  	future.FutureAPI = &azf
   447  	future.Result = future.result
   448  	return
   449  }
   450  
   451  // CreateUpdateSQLTriggerResponder handles the response to the CreateUpdateSQLTrigger request. The method always
   452  // closes the http.Response Body.
   453  func (client SQLResourcesClient) CreateUpdateSQLTriggerResponder(resp *http.Response) (result SQLTriggerGetResults, err error) {
   454  	err = autorest.Respond(
   455  		resp,
   456  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   457  		autorest.ByUnmarshallingJSON(&result),
   458  		autorest.ByClosing())
   459  	result.Response = autorest.Response{Response: resp}
   460  	return
   461  }
   462  
   463  // CreateUpdateSQLUserDefinedFunction create or update an Azure Cosmos DB SQL userDefinedFunction
   464  // Parameters:
   465  // resourceGroupName - the name of the resource group. The name is case insensitive.
   466  // accountName - cosmos DB database account name.
   467  // databaseName - cosmos DB database name.
   468  // containerName - cosmos DB container name.
   469  // userDefinedFunctionName - cosmos DB userDefinedFunction name.
   470  // createUpdateSQLUserDefinedFunctionParameters - the parameters to provide for the current SQL
   471  // userDefinedFunction.
   472  func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, createUpdateSQLUserDefinedFunctionParameters SQLUserDefinedFunctionCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture, err error) {
   473  	if tracing.IsEnabled() {
   474  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLUserDefinedFunction")
   475  		defer func() {
   476  			sc := -1
   477  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   478  				sc = result.FutureAPI.Response().StatusCode
   479  			}
   480  			tracing.EndSpan(ctx, sc, err)
   481  		}()
   482  	}
   483  	if err := validation.Validate([]validation.Validation{
   484  		{TargetValue: client.SubscriptionID,
   485  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   486  		{TargetValue: resourceGroupName,
   487  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   488  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   489  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   490  		{TargetValue: accountName,
   491  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   492  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   493  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
   494  		{TargetValue: createUpdateSQLUserDefinedFunctionParameters,
   495  			Constraints: []validation.Constraint{{Target: "createUpdateSQLUserDefinedFunctionParameters.SQLUserDefinedFunctionCreateUpdateProperties", Name: validation.Null, Rule: true,
   496  				Chain: []validation.Constraint{{Target: "createUpdateSQLUserDefinedFunctionParameters.SQLUserDefinedFunctionCreateUpdateProperties.Resource", Name: validation.Null, Rule: true,
   497  					Chain: []validation.Constraint{{Target: "createUpdateSQLUserDefinedFunctionParameters.SQLUserDefinedFunctionCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}},
   498  				}}}}}); err != nil {
   499  		return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLUserDefinedFunction", err.Error())
   500  	}
   501  
   502  	req, err := client.CreateUpdateSQLUserDefinedFunctionPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSQLUserDefinedFunctionParameters)
   503  	if err != nil {
   504  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLUserDefinedFunction", nil, "Failure preparing request")
   505  		return
   506  	}
   507  
   508  	result, err = client.CreateUpdateSQLUserDefinedFunctionSender(req)
   509  	if err != nil {
   510  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLUserDefinedFunction", result.Response(), "Failure sending request")
   511  		return
   512  	}
   513  
   514  	return
   515  }
   516  
   517  // CreateUpdateSQLUserDefinedFunctionPreparer prepares the CreateUpdateSQLUserDefinedFunction request.
   518  func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunctionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, createUpdateSQLUserDefinedFunctionParameters SQLUserDefinedFunctionCreateUpdateParameters) (*http.Request, error) {
   519  	pathParameters := map[string]interface{}{
   520  		"accountName":             autorest.Encode("path", accountName),
   521  		"containerName":           autorest.Encode("path", containerName),
   522  		"databaseName":            autorest.Encode("path", databaseName),
   523  		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
   524  		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
   525  		"userDefinedFunctionName": autorest.Encode("path", userDefinedFunctionName),
   526  	}
   527  
   528  	const APIVersion = "2021-03-15"
   529  	queryParameters := map[string]interface{}{
   530  		"api-version": APIVersion,
   531  	}
   532  
   533  	preparer := autorest.CreatePreparer(
   534  		autorest.AsContentType("application/json; charset=utf-8"),
   535  		autorest.AsPut(),
   536  		autorest.WithBaseURL(client.BaseURI),
   537  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", pathParameters),
   538  		autorest.WithJSON(createUpdateSQLUserDefinedFunctionParameters),
   539  		autorest.WithQueryParameters(queryParameters))
   540  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   541  }
   542  
   543  // CreateUpdateSQLUserDefinedFunctionSender sends the CreateUpdateSQLUserDefinedFunction request. The method will close the
   544  // http.Response Body if it receives an error.
   545  func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunctionSender(req *http.Request) (future SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture, err error) {
   546  	var resp *http.Response
   547  	future.FutureAPI = &azure.Future{}
   548  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   549  	if err != nil {
   550  		return
   551  	}
   552  	var azf azure.Future
   553  	azf, err = azure.NewFutureFromResponse(resp)
   554  	future.FutureAPI = &azf
   555  	future.Result = future.result
   556  	return
   557  }
   558  
   559  // CreateUpdateSQLUserDefinedFunctionResponder handles the response to the CreateUpdateSQLUserDefinedFunction request. The method always
   560  // closes the http.Response Body.
   561  func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunctionResponder(resp *http.Response) (result SQLUserDefinedFunctionGetResults, err error) {
   562  	err = autorest.Respond(
   563  		resp,
   564  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   565  		autorest.ByUnmarshallingJSON(&result),
   566  		autorest.ByClosing())
   567  	result.Response = autorest.Response{Response: resp}
   568  	return
   569  }
   570  
   571  // DeleteSQLContainer deletes an existing Azure Cosmos DB SQL container.
   572  // Parameters:
   573  // resourceGroupName - the name of the resource group. The name is case insensitive.
   574  // accountName - cosmos DB database account name.
   575  // databaseName - cosmos DB database name.
   576  // containerName - cosmos DB container name.
   577  func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLResourcesDeleteSQLContainerFuture, err error) {
   578  	if tracing.IsEnabled() {
   579  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLContainer")
   580  		defer func() {
   581  			sc := -1
   582  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   583  				sc = result.FutureAPI.Response().StatusCode
   584  			}
   585  			tracing.EndSpan(ctx, sc, err)
   586  		}()
   587  	}
   588  	if err := validation.Validate([]validation.Validation{
   589  		{TargetValue: client.SubscriptionID,
   590  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   591  		{TargetValue: resourceGroupName,
   592  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   593  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   594  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   595  		{TargetValue: accountName,
   596  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   597  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   598  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   599  		return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLContainer", err.Error())
   600  	}
   601  
   602  	req, err := client.DeleteSQLContainerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName)
   603  	if err != nil {
   604  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLContainer", nil, "Failure preparing request")
   605  		return
   606  	}
   607  
   608  	result, err = client.DeleteSQLContainerSender(req)
   609  	if err != nil {
   610  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLContainer", result.Response(), "Failure sending request")
   611  		return
   612  	}
   613  
   614  	return
   615  }
   616  
   617  // DeleteSQLContainerPreparer prepares the DeleteSQLContainer request.
   618  func (client SQLResourcesClient) DeleteSQLContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) {
   619  	pathParameters := map[string]interface{}{
   620  		"accountName":       autorest.Encode("path", accountName),
   621  		"containerName":     autorest.Encode("path", containerName),
   622  		"databaseName":      autorest.Encode("path", databaseName),
   623  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   624  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   625  	}
   626  
   627  	const APIVersion = "2021-03-15"
   628  	queryParameters := map[string]interface{}{
   629  		"api-version": APIVersion,
   630  	}
   631  
   632  	preparer := autorest.CreatePreparer(
   633  		autorest.AsDelete(),
   634  		autorest.WithBaseURL(client.BaseURI),
   635  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", pathParameters),
   636  		autorest.WithQueryParameters(queryParameters))
   637  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   638  }
   639  
   640  // DeleteSQLContainerSender sends the DeleteSQLContainer request. The method will close the
   641  // http.Response Body if it receives an error.
   642  func (client SQLResourcesClient) DeleteSQLContainerSender(req *http.Request) (future SQLResourcesDeleteSQLContainerFuture, err error) {
   643  	var resp *http.Response
   644  	future.FutureAPI = &azure.Future{}
   645  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   646  	if err != nil {
   647  		return
   648  	}
   649  	var azf azure.Future
   650  	azf, err = azure.NewFutureFromResponse(resp)
   651  	future.FutureAPI = &azf
   652  	future.Result = future.result
   653  	return
   654  }
   655  
   656  // DeleteSQLContainerResponder handles the response to the DeleteSQLContainer request. The method always
   657  // closes the http.Response Body.
   658  func (client SQLResourcesClient) DeleteSQLContainerResponder(resp *http.Response) (result autorest.Response, err error) {
   659  	err = autorest.Respond(
   660  		resp,
   661  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   662  		autorest.ByClosing())
   663  	result.Response = resp
   664  	return
   665  }
   666  
   667  // DeleteSQLDatabase deletes an existing Azure Cosmos DB SQL database.
   668  // Parameters:
   669  // resourceGroupName - the name of the resource group. The name is case insensitive.
   670  // accountName - cosmos DB database account name.
   671  // databaseName - cosmos DB database name.
   672  func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLResourcesDeleteSQLDatabaseFuture, err error) {
   673  	if tracing.IsEnabled() {
   674  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLDatabase")
   675  		defer func() {
   676  			sc := -1
   677  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   678  				sc = result.FutureAPI.Response().StatusCode
   679  			}
   680  			tracing.EndSpan(ctx, sc, err)
   681  		}()
   682  	}
   683  	if err := validation.Validate([]validation.Validation{
   684  		{TargetValue: client.SubscriptionID,
   685  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   686  		{TargetValue: resourceGroupName,
   687  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   688  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   689  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   690  		{TargetValue: accountName,
   691  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   692  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   693  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   694  		return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLDatabase", err.Error())
   695  	}
   696  
   697  	req, err := client.DeleteSQLDatabasePreparer(ctx, resourceGroupName, accountName, databaseName)
   698  	if err != nil {
   699  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLDatabase", nil, "Failure preparing request")
   700  		return
   701  	}
   702  
   703  	result, err = client.DeleteSQLDatabaseSender(req)
   704  	if err != nil {
   705  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLDatabase", result.Response(), "Failure sending request")
   706  		return
   707  	}
   708  
   709  	return
   710  }
   711  
   712  // DeleteSQLDatabasePreparer prepares the DeleteSQLDatabase request.
   713  func (client SQLResourcesClient) DeleteSQLDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) {
   714  	pathParameters := map[string]interface{}{
   715  		"accountName":       autorest.Encode("path", accountName),
   716  		"databaseName":      autorest.Encode("path", databaseName),
   717  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   718  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   719  	}
   720  
   721  	const APIVersion = "2021-03-15"
   722  	queryParameters := map[string]interface{}{
   723  		"api-version": APIVersion,
   724  	}
   725  
   726  	preparer := autorest.CreatePreparer(
   727  		autorest.AsDelete(),
   728  		autorest.WithBaseURL(client.BaseURI),
   729  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", pathParameters),
   730  		autorest.WithQueryParameters(queryParameters))
   731  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   732  }
   733  
   734  // DeleteSQLDatabaseSender sends the DeleteSQLDatabase request. The method will close the
   735  // http.Response Body if it receives an error.
   736  func (client SQLResourcesClient) DeleteSQLDatabaseSender(req *http.Request) (future SQLResourcesDeleteSQLDatabaseFuture, err error) {
   737  	var resp *http.Response
   738  	future.FutureAPI = &azure.Future{}
   739  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   740  	if err != nil {
   741  		return
   742  	}
   743  	var azf azure.Future
   744  	azf, err = azure.NewFutureFromResponse(resp)
   745  	future.FutureAPI = &azf
   746  	future.Result = future.result
   747  	return
   748  }
   749  
   750  // DeleteSQLDatabaseResponder handles the response to the DeleteSQLDatabase request. The method always
   751  // closes the http.Response Body.
   752  func (client SQLResourcesClient) DeleteSQLDatabaseResponder(resp *http.Response) (result autorest.Response, err error) {
   753  	err = autorest.Respond(
   754  		resp,
   755  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   756  		autorest.ByClosing())
   757  	result.Response = resp
   758  	return
   759  }
   760  
   761  // DeleteSQLStoredProcedure deletes an existing Azure Cosmos DB SQL storedProcedure.
   762  // Parameters:
   763  // resourceGroupName - the name of the resource group. The name is case insensitive.
   764  // accountName - cosmos DB database account name.
   765  // databaseName - cosmos DB database name.
   766  // containerName - cosmos DB container name.
   767  // storedProcedureName - cosmos DB storedProcedure name.
   768  func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (result SQLResourcesDeleteSQLStoredProcedureFuture, err error) {
   769  	if tracing.IsEnabled() {
   770  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLStoredProcedure")
   771  		defer func() {
   772  			sc := -1
   773  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   774  				sc = result.FutureAPI.Response().StatusCode
   775  			}
   776  			tracing.EndSpan(ctx, sc, err)
   777  		}()
   778  	}
   779  	if err := validation.Validate([]validation.Validation{
   780  		{TargetValue: client.SubscriptionID,
   781  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   782  		{TargetValue: resourceGroupName,
   783  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   784  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   785  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   786  		{TargetValue: accountName,
   787  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   788  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   789  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   790  		return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLStoredProcedure", err.Error())
   791  	}
   792  
   793  	req, err := client.DeleteSQLStoredProcedurePreparer(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName)
   794  	if err != nil {
   795  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLStoredProcedure", nil, "Failure preparing request")
   796  		return
   797  	}
   798  
   799  	result, err = client.DeleteSQLStoredProcedureSender(req)
   800  	if err != nil {
   801  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLStoredProcedure", result.Response(), "Failure sending request")
   802  		return
   803  	}
   804  
   805  	return
   806  }
   807  
   808  // DeleteSQLStoredProcedurePreparer prepares the DeleteSQLStoredProcedure request.
   809  func (client SQLResourcesClient) DeleteSQLStoredProcedurePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (*http.Request, error) {
   810  	pathParameters := map[string]interface{}{
   811  		"accountName":         autorest.Encode("path", accountName),
   812  		"containerName":       autorest.Encode("path", containerName),
   813  		"databaseName":        autorest.Encode("path", databaseName),
   814  		"resourceGroupName":   autorest.Encode("path", resourceGroupName),
   815  		"storedProcedureName": autorest.Encode("path", storedProcedureName),
   816  		"subscriptionId":      autorest.Encode("path", client.SubscriptionID),
   817  	}
   818  
   819  	const APIVersion = "2021-03-15"
   820  	queryParameters := map[string]interface{}{
   821  		"api-version": APIVersion,
   822  	}
   823  
   824  	preparer := autorest.CreatePreparer(
   825  		autorest.AsDelete(),
   826  		autorest.WithBaseURL(client.BaseURI),
   827  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", pathParameters),
   828  		autorest.WithQueryParameters(queryParameters))
   829  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   830  }
   831  
   832  // DeleteSQLStoredProcedureSender sends the DeleteSQLStoredProcedure request. The method will close the
   833  // http.Response Body if it receives an error.
   834  func (client SQLResourcesClient) DeleteSQLStoredProcedureSender(req *http.Request) (future SQLResourcesDeleteSQLStoredProcedureFuture, err error) {
   835  	var resp *http.Response
   836  	future.FutureAPI = &azure.Future{}
   837  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   838  	if err != nil {
   839  		return
   840  	}
   841  	var azf azure.Future
   842  	azf, err = azure.NewFutureFromResponse(resp)
   843  	future.FutureAPI = &azf
   844  	future.Result = future.result
   845  	return
   846  }
   847  
   848  // DeleteSQLStoredProcedureResponder handles the response to the DeleteSQLStoredProcedure request. The method always
   849  // closes the http.Response Body.
   850  func (client SQLResourcesClient) DeleteSQLStoredProcedureResponder(resp *http.Response) (result autorest.Response, err error) {
   851  	err = autorest.Respond(
   852  		resp,
   853  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   854  		autorest.ByClosing())
   855  	result.Response = resp
   856  	return
   857  }
   858  
   859  // DeleteSQLTrigger deletes an existing Azure Cosmos DB SQL trigger.
   860  // Parameters:
   861  // resourceGroupName - the name of the resource group. The name is case insensitive.
   862  // accountName - cosmos DB database account name.
   863  // databaseName - cosmos DB database name.
   864  // containerName - cosmos DB container name.
   865  // triggerName - cosmos DB trigger name.
   866  func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (result SQLResourcesDeleteSQLTriggerFuture, err error) {
   867  	if tracing.IsEnabled() {
   868  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLTrigger")
   869  		defer func() {
   870  			sc := -1
   871  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   872  				sc = result.FutureAPI.Response().StatusCode
   873  			}
   874  			tracing.EndSpan(ctx, sc, err)
   875  		}()
   876  	}
   877  	if err := validation.Validate([]validation.Validation{
   878  		{TargetValue: client.SubscriptionID,
   879  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   880  		{TargetValue: resourceGroupName,
   881  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   882  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   883  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   884  		{TargetValue: accountName,
   885  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   886  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   887  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   888  		return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLTrigger", err.Error())
   889  	}
   890  
   891  	req, err := client.DeleteSQLTriggerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName)
   892  	if err != nil {
   893  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLTrigger", nil, "Failure preparing request")
   894  		return
   895  	}
   896  
   897  	result, err = client.DeleteSQLTriggerSender(req)
   898  	if err != nil {
   899  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLTrigger", result.Response(), "Failure sending request")
   900  		return
   901  	}
   902  
   903  	return
   904  }
   905  
   906  // DeleteSQLTriggerPreparer prepares the DeleteSQLTrigger request.
   907  func (client SQLResourcesClient) DeleteSQLTriggerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (*http.Request, error) {
   908  	pathParameters := map[string]interface{}{
   909  		"accountName":       autorest.Encode("path", accountName),
   910  		"containerName":     autorest.Encode("path", containerName),
   911  		"databaseName":      autorest.Encode("path", databaseName),
   912  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   913  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   914  		"triggerName":       autorest.Encode("path", triggerName),
   915  	}
   916  
   917  	const APIVersion = "2021-03-15"
   918  	queryParameters := map[string]interface{}{
   919  		"api-version": APIVersion,
   920  	}
   921  
   922  	preparer := autorest.CreatePreparer(
   923  		autorest.AsDelete(),
   924  		autorest.WithBaseURL(client.BaseURI),
   925  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", pathParameters),
   926  		autorest.WithQueryParameters(queryParameters))
   927  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   928  }
   929  
   930  // DeleteSQLTriggerSender sends the DeleteSQLTrigger request. The method will close the
   931  // http.Response Body if it receives an error.
   932  func (client SQLResourcesClient) DeleteSQLTriggerSender(req *http.Request) (future SQLResourcesDeleteSQLTriggerFuture, err error) {
   933  	var resp *http.Response
   934  	future.FutureAPI = &azure.Future{}
   935  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   936  	if err != nil {
   937  		return
   938  	}
   939  	var azf azure.Future
   940  	azf, err = azure.NewFutureFromResponse(resp)
   941  	future.FutureAPI = &azf
   942  	future.Result = future.result
   943  	return
   944  }
   945  
   946  // DeleteSQLTriggerResponder handles the response to the DeleteSQLTrigger request. The method always
   947  // closes the http.Response Body.
   948  func (client SQLResourcesClient) DeleteSQLTriggerResponder(resp *http.Response) (result autorest.Response, err error) {
   949  	err = autorest.Respond(
   950  		resp,
   951  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   952  		autorest.ByClosing())
   953  	result.Response = resp
   954  	return
   955  }
   956  
   957  // DeleteSQLUserDefinedFunction deletes an existing Azure Cosmos DB SQL userDefinedFunction.
   958  // Parameters:
   959  // resourceGroupName - the name of the resource group. The name is case insensitive.
   960  // accountName - cosmos DB database account name.
   961  // databaseName - cosmos DB database name.
   962  // containerName - cosmos DB container name.
   963  // userDefinedFunctionName - cosmos DB userDefinedFunction name.
   964  func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (result SQLResourcesDeleteSQLUserDefinedFunctionFuture, err error) {
   965  	if tracing.IsEnabled() {
   966  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLUserDefinedFunction")
   967  		defer func() {
   968  			sc := -1
   969  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   970  				sc = result.FutureAPI.Response().StatusCode
   971  			}
   972  			tracing.EndSpan(ctx, sc, err)
   973  		}()
   974  	}
   975  	if err := validation.Validate([]validation.Validation{
   976  		{TargetValue: client.SubscriptionID,
   977  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   978  		{TargetValue: resourceGroupName,
   979  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   980  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   981  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   982  		{TargetValue: accountName,
   983  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   984  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   985  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   986  		return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLUserDefinedFunction", err.Error())
   987  	}
   988  
   989  	req, err := client.DeleteSQLUserDefinedFunctionPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName)
   990  	if err != nil {
   991  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLUserDefinedFunction", nil, "Failure preparing request")
   992  		return
   993  	}
   994  
   995  	result, err = client.DeleteSQLUserDefinedFunctionSender(req)
   996  	if err != nil {
   997  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLUserDefinedFunction", result.Response(), "Failure sending request")
   998  		return
   999  	}
  1000  
  1001  	return
  1002  }
  1003  
  1004  // DeleteSQLUserDefinedFunctionPreparer prepares the DeleteSQLUserDefinedFunction request.
  1005  func (client SQLResourcesClient) DeleteSQLUserDefinedFunctionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (*http.Request, error) {
  1006  	pathParameters := map[string]interface{}{
  1007  		"accountName":             autorest.Encode("path", accountName),
  1008  		"containerName":           autorest.Encode("path", containerName),
  1009  		"databaseName":            autorest.Encode("path", databaseName),
  1010  		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
  1011  		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
  1012  		"userDefinedFunctionName": autorest.Encode("path", userDefinedFunctionName),
  1013  	}
  1014  
  1015  	const APIVersion = "2021-03-15"
  1016  	queryParameters := map[string]interface{}{
  1017  		"api-version": APIVersion,
  1018  	}
  1019  
  1020  	preparer := autorest.CreatePreparer(
  1021  		autorest.AsDelete(),
  1022  		autorest.WithBaseURL(client.BaseURI),
  1023  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", pathParameters),
  1024  		autorest.WithQueryParameters(queryParameters))
  1025  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1026  }
  1027  
  1028  // DeleteSQLUserDefinedFunctionSender sends the DeleteSQLUserDefinedFunction request. The method will close the
  1029  // http.Response Body if it receives an error.
  1030  func (client SQLResourcesClient) DeleteSQLUserDefinedFunctionSender(req *http.Request) (future SQLResourcesDeleteSQLUserDefinedFunctionFuture, err error) {
  1031  	var resp *http.Response
  1032  	future.FutureAPI = &azure.Future{}
  1033  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1034  	if err != nil {
  1035  		return
  1036  	}
  1037  	var azf azure.Future
  1038  	azf, err = azure.NewFutureFromResponse(resp)
  1039  	future.FutureAPI = &azf
  1040  	future.Result = future.result
  1041  	return
  1042  }
  1043  
  1044  // DeleteSQLUserDefinedFunctionResponder handles the response to the DeleteSQLUserDefinedFunction request. The method always
  1045  // closes the http.Response Body.
  1046  func (client SQLResourcesClient) DeleteSQLUserDefinedFunctionResponder(resp *http.Response) (result autorest.Response, err error) {
  1047  	err = autorest.Respond(
  1048  		resp,
  1049  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
  1050  		autorest.ByClosing())
  1051  	result.Response = resp
  1052  	return
  1053  }
  1054  
  1055  // GetSQLContainer gets the SQL container under an existing Azure Cosmos DB database account.
  1056  // Parameters:
  1057  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1058  // accountName - cosmos DB database account name.
  1059  // databaseName - cosmos DB database name.
  1060  // containerName - cosmos DB container name.
  1061  func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLContainerGetResults, err error) {
  1062  	if tracing.IsEnabled() {
  1063  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLContainer")
  1064  		defer func() {
  1065  			sc := -1
  1066  			if result.Response.Response != nil {
  1067  				sc = result.Response.Response.StatusCode
  1068  			}
  1069  			tracing.EndSpan(ctx, sc, err)
  1070  		}()
  1071  	}
  1072  	if err := validation.Validate([]validation.Validation{
  1073  		{TargetValue: client.SubscriptionID,
  1074  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1075  		{TargetValue: resourceGroupName,
  1076  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1077  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1078  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1079  		{TargetValue: accountName,
  1080  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1081  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1082  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1083  		return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLContainer", err.Error())
  1084  	}
  1085  
  1086  	req, err := client.GetSQLContainerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName)
  1087  	if err != nil {
  1088  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainer", nil, "Failure preparing request")
  1089  		return
  1090  	}
  1091  
  1092  	resp, err := client.GetSQLContainerSender(req)
  1093  	if err != nil {
  1094  		result.Response = autorest.Response{Response: resp}
  1095  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainer", resp, "Failure sending request")
  1096  		return
  1097  	}
  1098  
  1099  	result, err = client.GetSQLContainerResponder(resp)
  1100  	if err != nil {
  1101  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainer", resp, "Failure responding to request")
  1102  		return
  1103  	}
  1104  
  1105  	return
  1106  }
  1107  
  1108  // GetSQLContainerPreparer prepares the GetSQLContainer request.
  1109  func (client SQLResourcesClient) GetSQLContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) {
  1110  	pathParameters := map[string]interface{}{
  1111  		"accountName":       autorest.Encode("path", accountName),
  1112  		"containerName":     autorest.Encode("path", containerName),
  1113  		"databaseName":      autorest.Encode("path", databaseName),
  1114  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1115  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1116  	}
  1117  
  1118  	const APIVersion = "2021-03-15"
  1119  	queryParameters := map[string]interface{}{
  1120  		"api-version": APIVersion,
  1121  	}
  1122  
  1123  	preparer := autorest.CreatePreparer(
  1124  		autorest.AsGet(),
  1125  		autorest.WithBaseURL(client.BaseURI),
  1126  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", pathParameters),
  1127  		autorest.WithQueryParameters(queryParameters))
  1128  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1129  }
  1130  
  1131  // GetSQLContainerSender sends the GetSQLContainer request. The method will close the
  1132  // http.Response Body if it receives an error.
  1133  func (client SQLResourcesClient) GetSQLContainerSender(req *http.Request) (*http.Response, error) {
  1134  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1135  }
  1136  
  1137  // GetSQLContainerResponder handles the response to the GetSQLContainer request. The method always
  1138  // closes the http.Response Body.
  1139  func (client SQLResourcesClient) GetSQLContainerResponder(resp *http.Response) (result SQLContainerGetResults, err error) {
  1140  	err = autorest.Respond(
  1141  		resp,
  1142  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1143  		autorest.ByUnmarshallingJSON(&result),
  1144  		autorest.ByClosing())
  1145  	result.Response = autorest.Response{Response: resp}
  1146  	return
  1147  }
  1148  
  1149  // GetSQLContainerThroughput gets the RUs per second of the SQL container under an existing Azure Cosmos DB database
  1150  // account.
  1151  // Parameters:
  1152  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1153  // accountName - cosmos DB database account name.
  1154  // databaseName - cosmos DB database name.
  1155  // containerName - cosmos DB container name.
  1156  func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result ThroughputSettingsGetResults, err error) {
  1157  	if tracing.IsEnabled() {
  1158  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLContainerThroughput")
  1159  		defer func() {
  1160  			sc := -1
  1161  			if result.Response.Response != nil {
  1162  				sc = result.Response.Response.StatusCode
  1163  			}
  1164  			tracing.EndSpan(ctx, sc, err)
  1165  		}()
  1166  	}
  1167  	if err := validation.Validate([]validation.Validation{
  1168  		{TargetValue: client.SubscriptionID,
  1169  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1170  		{TargetValue: resourceGroupName,
  1171  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1172  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1173  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1174  		{TargetValue: accountName,
  1175  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1176  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1177  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1178  		return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLContainerThroughput", err.Error())
  1179  	}
  1180  
  1181  	req, err := client.GetSQLContainerThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, containerName)
  1182  	if err != nil {
  1183  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainerThroughput", nil, "Failure preparing request")
  1184  		return
  1185  	}
  1186  
  1187  	resp, err := client.GetSQLContainerThroughputSender(req)
  1188  	if err != nil {
  1189  		result.Response = autorest.Response{Response: resp}
  1190  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainerThroughput", resp, "Failure sending request")
  1191  		return
  1192  	}
  1193  
  1194  	result, err = client.GetSQLContainerThroughputResponder(resp)
  1195  	if err != nil {
  1196  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainerThroughput", resp, "Failure responding to request")
  1197  		return
  1198  	}
  1199  
  1200  	return
  1201  }
  1202  
  1203  // GetSQLContainerThroughputPreparer prepares the GetSQLContainerThroughput request.
  1204  func (client SQLResourcesClient) GetSQLContainerThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) {
  1205  	pathParameters := map[string]interface{}{
  1206  		"accountName":       autorest.Encode("path", accountName),
  1207  		"containerName":     autorest.Encode("path", containerName),
  1208  		"databaseName":      autorest.Encode("path", databaseName),
  1209  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1210  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1211  	}
  1212  
  1213  	const APIVersion = "2021-03-15"
  1214  	queryParameters := map[string]interface{}{
  1215  		"api-version": APIVersion,
  1216  	}
  1217  
  1218  	preparer := autorest.CreatePreparer(
  1219  		autorest.AsGet(),
  1220  		autorest.WithBaseURL(client.BaseURI),
  1221  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", pathParameters),
  1222  		autorest.WithQueryParameters(queryParameters))
  1223  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1224  }
  1225  
  1226  // GetSQLContainerThroughputSender sends the GetSQLContainerThroughput request. The method will close the
  1227  // http.Response Body if it receives an error.
  1228  func (client SQLResourcesClient) GetSQLContainerThroughputSender(req *http.Request) (*http.Response, error) {
  1229  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1230  }
  1231  
  1232  // GetSQLContainerThroughputResponder handles the response to the GetSQLContainerThroughput request. The method always
  1233  // closes the http.Response Body.
  1234  func (client SQLResourcesClient) GetSQLContainerThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  1235  	err = autorest.Respond(
  1236  		resp,
  1237  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1238  		autorest.ByUnmarshallingJSON(&result),
  1239  		autorest.ByClosing())
  1240  	result.Response = autorest.Response{Response: resp}
  1241  	return
  1242  }
  1243  
  1244  // GetSQLDatabase gets the SQL database under an existing Azure Cosmos DB database account with the provided name.
  1245  // Parameters:
  1246  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1247  // accountName - cosmos DB database account name.
  1248  // databaseName - cosmos DB database name.
  1249  func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLDatabaseGetResults, err error) {
  1250  	if tracing.IsEnabled() {
  1251  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLDatabase")
  1252  		defer func() {
  1253  			sc := -1
  1254  			if result.Response.Response != nil {
  1255  				sc = result.Response.Response.StatusCode
  1256  			}
  1257  			tracing.EndSpan(ctx, sc, err)
  1258  		}()
  1259  	}
  1260  	if err := validation.Validate([]validation.Validation{
  1261  		{TargetValue: client.SubscriptionID,
  1262  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1263  		{TargetValue: resourceGroupName,
  1264  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1265  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1266  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1267  		{TargetValue: accountName,
  1268  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1269  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1270  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1271  		return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLDatabase", err.Error())
  1272  	}
  1273  
  1274  	req, err := client.GetSQLDatabasePreparer(ctx, resourceGroupName, accountName, databaseName)
  1275  	if err != nil {
  1276  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabase", nil, "Failure preparing request")
  1277  		return
  1278  	}
  1279  
  1280  	resp, err := client.GetSQLDatabaseSender(req)
  1281  	if err != nil {
  1282  		result.Response = autorest.Response{Response: resp}
  1283  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabase", resp, "Failure sending request")
  1284  		return
  1285  	}
  1286  
  1287  	result, err = client.GetSQLDatabaseResponder(resp)
  1288  	if err != nil {
  1289  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabase", resp, "Failure responding to request")
  1290  		return
  1291  	}
  1292  
  1293  	return
  1294  }
  1295  
  1296  // GetSQLDatabasePreparer prepares the GetSQLDatabase request.
  1297  func (client SQLResourcesClient) GetSQLDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) {
  1298  	pathParameters := map[string]interface{}{
  1299  		"accountName":       autorest.Encode("path", accountName),
  1300  		"databaseName":      autorest.Encode("path", databaseName),
  1301  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1302  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1303  	}
  1304  
  1305  	const APIVersion = "2021-03-15"
  1306  	queryParameters := map[string]interface{}{
  1307  		"api-version": APIVersion,
  1308  	}
  1309  
  1310  	preparer := autorest.CreatePreparer(
  1311  		autorest.AsGet(),
  1312  		autorest.WithBaseURL(client.BaseURI),
  1313  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", pathParameters),
  1314  		autorest.WithQueryParameters(queryParameters))
  1315  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1316  }
  1317  
  1318  // GetSQLDatabaseSender sends the GetSQLDatabase request. The method will close the
  1319  // http.Response Body if it receives an error.
  1320  func (client SQLResourcesClient) GetSQLDatabaseSender(req *http.Request) (*http.Response, error) {
  1321  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1322  }
  1323  
  1324  // GetSQLDatabaseResponder handles the response to the GetSQLDatabase request. The method always
  1325  // closes the http.Response Body.
  1326  func (client SQLResourcesClient) GetSQLDatabaseResponder(resp *http.Response) (result SQLDatabaseGetResults, err error) {
  1327  	err = autorest.Respond(
  1328  		resp,
  1329  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1330  		autorest.ByUnmarshallingJSON(&result),
  1331  		autorest.ByClosing())
  1332  	result.Response = autorest.Response{Response: resp}
  1333  	return
  1334  }
  1335  
  1336  // GetSQLDatabaseThroughput gets the RUs per second of the SQL database under an existing Azure Cosmos DB database
  1337  // account with the provided name.
  1338  // Parameters:
  1339  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1340  // accountName - cosmos DB database account name.
  1341  // databaseName - cosmos DB database name.
  1342  func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result ThroughputSettingsGetResults, err error) {
  1343  	if tracing.IsEnabled() {
  1344  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLDatabaseThroughput")
  1345  		defer func() {
  1346  			sc := -1
  1347  			if result.Response.Response != nil {
  1348  				sc = result.Response.Response.StatusCode
  1349  			}
  1350  			tracing.EndSpan(ctx, sc, err)
  1351  		}()
  1352  	}
  1353  	if err := validation.Validate([]validation.Validation{
  1354  		{TargetValue: client.SubscriptionID,
  1355  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1356  		{TargetValue: resourceGroupName,
  1357  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1358  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1359  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1360  		{TargetValue: accountName,
  1361  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1362  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1363  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1364  		return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", err.Error())
  1365  	}
  1366  
  1367  	req, err := client.GetSQLDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName)
  1368  	if err != nil {
  1369  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", nil, "Failure preparing request")
  1370  		return
  1371  	}
  1372  
  1373  	resp, err := client.GetSQLDatabaseThroughputSender(req)
  1374  	if err != nil {
  1375  		result.Response = autorest.Response{Response: resp}
  1376  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", resp, "Failure sending request")
  1377  		return
  1378  	}
  1379  
  1380  	result, err = client.GetSQLDatabaseThroughputResponder(resp)
  1381  	if err != nil {
  1382  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", resp, "Failure responding to request")
  1383  		return
  1384  	}
  1385  
  1386  	return
  1387  }
  1388  
  1389  // GetSQLDatabaseThroughputPreparer prepares the GetSQLDatabaseThroughput request.
  1390  func (client SQLResourcesClient) GetSQLDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) {
  1391  	pathParameters := map[string]interface{}{
  1392  		"accountName":       autorest.Encode("path", accountName),
  1393  		"databaseName":      autorest.Encode("path", databaseName),
  1394  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1395  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1396  	}
  1397  
  1398  	const APIVersion = "2021-03-15"
  1399  	queryParameters := map[string]interface{}{
  1400  		"api-version": APIVersion,
  1401  	}
  1402  
  1403  	preparer := autorest.CreatePreparer(
  1404  		autorest.AsGet(),
  1405  		autorest.WithBaseURL(client.BaseURI),
  1406  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default", pathParameters),
  1407  		autorest.WithQueryParameters(queryParameters))
  1408  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1409  }
  1410  
  1411  // GetSQLDatabaseThroughputSender sends the GetSQLDatabaseThroughput request. The method will close the
  1412  // http.Response Body if it receives an error.
  1413  func (client SQLResourcesClient) GetSQLDatabaseThroughputSender(req *http.Request) (*http.Response, error) {
  1414  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1415  }
  1416  
  1417  // GetSQLDatabaseThroughputResponder handles the response to the GetSQLDatabaseThroughput request. The method always
  1418  // closes the http.Response Body.
  1419  func (client SQLResourcesClient) GetSQLDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  1420  	err = autorest.Respond(
  1421  		resp,
  1422  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1423  		autorest.ByUnmarshallingJSON(&result),
  1424  		autorest.ByClosing())
  1425  	result.Response = autorest.Response{Response: resp}
  1426  	return
  1427  }
  1428  
  1429  // GetSQLStoredProcedure gets the SQL storedProcedure under an existing Azure Cosmos DB database account.
  1430  // Parameters:
  1431  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1432  // accountName - cosmos DB database account name.
  1433  // databaseName - cosmos DB database name.
  1434  // containerName - cosmos DB container name.
  1435  // storedProcedureName - cosmos DB storedProcedure name.
  1436  func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (result SQLStoredProcedureGetResults, err error) {
  1437  	if tracing.IsEnabled() {
  1438  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLStoredProcedure")
  1439  		defer func() {
  1440  			sc := -1
  1441  			if result.Response.Response != nil {
  1442  				sc = result.Response.Response.StatusCode
  1443  			}
  1444  			tracing.EndSpan(ctx, sc, err)
  1445  		}()
  1446  	}
  1447  	if err := validation.Validate([]validation.Validation{
  1448  		{TargetValue: client.SubscriptionID,
  1449  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1450  		{TargetValue: resourceGroupName,
  1451  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1452  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1453  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1454  		{TargetValue: accountName,
  1455  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1456  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1457  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1458  		return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLStoredProcedure", err.Error())
  1459  	}
  1460  
  1461  	req, err := client.GetSQLStoredProcedurePreparer(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName)
  1462  	if err != nil {
  1463  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLStoredProcedure", nil, "Failure preparing request")
  1464  		return
  1465  	}
  1466  
  1467  	resp, err := client.GetSQLStoredProcedureSender(req)
  1468  	if err != nil {
  1469  		result.Response = autorest.Response{Response: resp}
  1470  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLStoredProcedure", resp, "Failure sending request")
  1471  		return
  1472  	}
  1473  
  1474  	result, err = client.GetSQLStoredProcedureResponder(resp)
  1475  	if err != nil {
  1476  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLStoredProcedure", resp, "Failure responding to request")
  1477  		return
  1478  	}
  1479  
  1480  	return
  1481  }
  1482  
  1483  // GetSQLStoredProcedurePreparer prepares the GetSQLStoredProcedure request.
  1484  func (client SQLResourcesClient) GetSQLStoredProcedurePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (*http.Request, error) {
  1485  	pathParameters := map[string]interface{}{
  1486  		"accountName":         autorest.Encode("path", accountName),
  1487  		"containerName":       autorest.Encode("path", containerName),
  1488  		"databaseName":        autorest.Encode("path", databaseName),
  1489  		"resourceGroupName":   autorest.Encode("path", resourceGroupName),
  1490  		"storedProcedureName": autorest.Encode("path", storedProcedureName),
  1491  		"subscriptionId":      autorest.Encode("path", client.SubscriptionID),
  1492  	}
  1493  
  1494  	const APIVersion = "2021-03-15"
  1495  	queryParameters := map[string]interface{}{
  1496  		"api-version": APIVersion,
  1497  	}
  1498  
  1499  	preparer := autorest.CreatePreparer(
  1500  		autorest.AsGet(),
  1501  		autorest.WithBaseURL(client.BaseURI),
  1502  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", pathParameters),
  1503  		autorest.WithQueryParameters(queryParameters))
  1504  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1505  }
  1506  
  1507  // GetSQLStoredProcedureSender sends the GetSQLStoredProcedure request. The method will close the
  1508  // http.Response Body if it receives an error.
  1509  func (client SQLResourcesClient) GetSQLStoredProcedureSender(req *http.Request) (*http.Response, error) {
  1510  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1511  }
  1512  
  1513  // GetSQLStoredProcedureResponder handles the response to the GetSQLStoredProcedure request. The method always
  1514  // closes the http.Response Body.
  1515  func (client SQLResourcesClient) GetSQLStoredProcedureResponder(resp *http.Response) (result SQLStoredProcedureGetResults, err error) {
  1516  	err = autorest.Respond(
  1517  		resp,
  1518  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1519  		autorest.ByUnmarshallingJSON(&result),
  1520  		autorest.ByClosing())
  1521  	result.Response = autorest.Response{Response: resp}
  1522  	return
  1523  }
  1524  
  1525  // GetSQLTrigger gets the SQL trigger under an existing Azure Cosmos DB database account.
  1526  // Parameters:
  1527  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1528  // accountName - cosmos DB database account name.
  1529  // databaseName - cosmos DB database name.
  1530  // containerName - cosmos DB container name.
  1531  // triggerName - cosmos DB trigger name.
  1532  func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (result SQLTriggerGetResults, err error) {
  1533  	if tracing.IsEnabled() {
  1534  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLTrigger")
  1535  		defer func() {
  1536  			sc := -1
  1537  			if result.Response.Response != nil {
  1538  				sc = result.Response.Response.StatusCode
  1539  			}
  1540  			tracing.EndSpan(ctx, sc, err)
  1541  		}()
  1542  	}
  1543  	if err := validation.Validate([]validation.Validation{
  1544  		{TargetValue: client.SubscriptionID,
  1545  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1546  		{TargetValue: resourceGroupName,
  1547  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1548  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1549  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1550  		{TargetValue: accountName,
  1551  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1552  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1553  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1554  		return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLTrigger", err.Error())
  1555  	}
  1556  
  1557  	req, err := client.GetSQLTriggerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName)
  1558  	if err != nil {
  1559  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLTrigger", nil, "Failure preparing request")
  1560  		return
  1561  	}
  1562  
  1563  	resp, err := client.GetSQLTriggerSender(req)
  1564  	if err != nil {
  1565  		result.Response = autorest.Response{Response: resp}
  1566  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLTrigger", resp, "Failure sending request")
  1567  		return
  1568  	}
  1569  
  1570  	result, err = client.GetSQLTriggerResponder(resp)
  1571  	if err != nil {
  1572  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLTrigger", resp, "Failure responding to request")
  1573  		return
  1574  	}
  1575  
  1576  	return
  1577  }
  1578  
  1579  // GetSQLTriggerPreparer prepares the GetSQLTrigger request.
  1580  func (client SQLResourcesClient) GetSQLTriggerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (*http.Request, error) {
  1581  	pathParameters := map[string]interface{}{
  1582  		"accountName":       autorest.Encode("path", accountName),
  1583  		"containerName":     autorest.Encode("path", containerName),
  1584  		"databaseName":      autorest.Encode("path", databaseName),
  1585  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1586  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1587  		"triggerName":       autorest.Encode("path", triggerName),
  1588  	}
  1589  
  1590  	const APIVersion = "2021-03-15"
  1591  	queryParameters := map[string]interface{}{
  1592  		"api-version": APIVersion,
  1593  	}
  1594  
  1595  	preparer := autorest.CreatePreparer(
  1596  		autorest.AsGet(),
  1597  		autorest.WithBaseURL(client.BaseURI),
  1598  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", pathParameters),
  1599  		autorest.WithQueryParameters(queryParameters))
  1600  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1601  }
  1602  
  1603  // GetSQLTriggerSender sends the GetSQLTrigger request. The method will close the
  1604  // http.Response Body if it receives an error.
  1605  func (client SQLResourcesClient) GetSQLTriggerSender(req *http.Request) (*http.Response, error) {
  1606  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1607  }
  1608  
  1609  // GetSQLTriggerResponder handles the response to the GetSQLTrigger request. The method always
  1610  // closes the http.Response Body.
  1611  func (client SQLResourcesClient) GetSQLTriggerResponder(resp *http.Response) (result SQLTriggerGetResults, err error) {
  1612  	err = autorest.Respond(
  1613  		resp,
  1614  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1615  		autorest.ByUnmarshallingJSON(&result),
  1616  		autorest.ByClosing())
  1617  	result.Response = autorest.Response{Response: resp}
  1618  	return
  1619  }
  1620  
  1621  // GetSQLUserDefinedFunction gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account.
  1622  // Parameters:
  1623  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1624  // accountName - cosmos DB database account name.
  1625  // databaseName - cosmos DB database name.
  1626  // containerName - cosmos DB container name.
  1627  // userDefinedFunctionName - cosmos DB userDefinedFunction name.
  1628  func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (result SQLUserDefinedFunctionGetResults, err error) {
  1629  	if tracing.IsEnabled() {
  1630  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLUserDefinedFunction")
  1631  		defer func() {
  1632  			sc := -1
  1633  			if result.Response.Response != nil {
  1634  				sc = result.Response.Response.StatusCode
  1635  			}
  1636  			tracing.EndSpan(ctx, sc, err)
  1637  		}()
  1638  	}
  1639  	if err := validation.Validate([]validation.Validation{
  1640  		{TargetValue: client.SubscriptionID,
  1641  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1642  		{TargetValue: resourceGroupName,
  1643  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1644  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1645  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1646  		{TargetValue: accountName,
  1647  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1648  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1649  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1650  		return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", err.Error())
  1651  	}
  1652  
  1653  	req, err := client.GetSQLUserDefinedFunctionPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName)
  1654  	if err != nil {
  1655  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", nil, "Failure preparing request")
  1656  		return
  1657  	}
  1658  
  1659  	resp, err := client.GetSQLUserDefinedFunctionSender(req)
  1660  	if err != nil {
  1661  		result.Response = autorest.Response{Response: resp}
  1662  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", resp, "Failure sending request")
  1663  		return
  1664  	}
  1665  
  1666  	result, err = client.GetSQLUserDefinedFunctionResponder(resp)
  1667  	if err != nil {
  1668  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", resp, "Failure responding to request")
  1669  		return
  1670  	}
  1671  
  1672  	return
  1673  }
  1674  
  1675  // GetSQLUserDefinedFunctionPreparer prepares the GetSQLUserDefinedFunction request.
  1676  func (client SQLResourcesClient) GetSQLUserDefinedFunctionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (*http.Request, error) {
  1677  	pathParameters := map[string]interface{}{
  1678  		"accountName":             autorest.Encode("path", accountName),
  1679  		"containerName":           autorest.Encode("path", containerName),
  1680  		"databaseName":            autorest.Encode("path", databaseName),
  1681  		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
  1682  		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
  1683  		"userDefinedFunctionName": autorest.Encode("path", userDefinedFunctionName),
  1684  	}
  1685  
  1686  	const APIVersion = "2021-03-15"
  1687  	queryParameters := map[string]interface{}{
  1688  		"api-version": APIVersion,
  1689  	}
  1690  
  1691  	preparer := autorest.CreatePreparer(
  1692  		autorest.AsGet(),
  1693  		autorest.WithBaseURL(client.BaseURI),
  1694  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", pathParameters),
  1695  		autorest.WithQueryParameters(queryParameters))
  1696  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1697  }
  1698  
  1699  // GetSQLUserDefinedFunctionSender sends the GetSQLUserDefinedFunction request. The method will close the
  1700  // http.Response Body if it receives an error.
  1701  func (client SQLResourcesClient) GetSQLUserDefinedFunctionSender(req *http.Request) (*http.Response, error) {
  1702  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1703  }
  1704  
  1705  // GetSQLUserDefinedFunctionResponder handles the response to the GetSQLUserDefinedFunction request. The method always
  1706  // closes the http.Response Body.
  1707  func (client SQLResourcesClient) GetSQLUserDefinedFunctionResponder(resp *http.Response) (result SQLUserDefinedFunctionGetResults, err error) {
  1708  	err = autorest.Respond(
  1709  		resp,
  1710  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1711  		autorest.ByUnmarshallingJSON(&result),
  1712  		autorest.ByClosing())
  1713  	result.Response = autorest.Response{Response: resp}
  1714  	return
  1715  }
  1716  
  1717  // ListSQLContainers lists the SQL container under an existing Azure Cosmos DB database account.
  1718  // Parameters:
  1719  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1720  // accountName - cosmos DB database account name.
  1721  // databaseName - cosmos DB database name.
  1722  func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLContainerListResult, err error) {
  1723  	if tracing.IsEnabled() {
  1724  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLContainers")
  1725  		defer func() {
  1726  			sc := -1
  1727  			if result.Response.Response != nil {
  1728  				sc = result.Response.Response.StatusCode
  1729  			}
  1730  			tracing.EndSpan(ctx, sc, err)
  1731  		}()
  1732  	}
  1733  	if err := validation.Validate([]validation.Validation{
  1734  		{TargetValue: client.SubscriptionID,
  1735  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1736  		{TargetValue: resourceGroupName,
  1737  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1738  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1739  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1740  		{TargetValue: accountName,
  1741  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1742  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1743  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1744  		return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLContainers", err.Error())
  1745  	}
  1746  
  1747  	req, err := client.ListSQLContainersPreparer(ctx, resourceGroupName, accountName, databaseName)
  1748  	if err != nil {
  1749  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLContainers", nil, "Failure preparing request")
  1750  		return
  1751  	}
  1752  
  1753  	resp, err := client.ListSQLContainersSender(req)
  1754  	if err != nil {
  1755  		result.Response = autorest.Response{Response: resp}
  1756  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLContainers", resp, "Failure sending request")
  1757  		return
  1758  	}
  1759  
  1760  	result, err = client.ListSQLContainersResponder(resp)
  1761  	if err != nil {
  1762  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLContainers", resp, "Failure responding to request")
  1763  		return
  1764  	}
  1765  
  1766  	return
  1767  }
  1768  
  1769  // ListSQLContainersPreparer prepares the ListSQLContainers request.
  1770  func (client SQLResourcesClient) ListSQLContainersPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) {
  1771  	pathParameters := map[string]interface{}{
  1772  		"accountName":       autorest.Encode("path", accountName),
  1773  		"databaseName":      autorest.Encode("path", databaseName),
  1774  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1775  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1776  	}
  1777  
  1778  	const APIVersion = "2021-03-15"
  1779  	queryParameters := map[string]interface{}{
  1780  		"api-version": APIVersion,
  1781  	}
  1782  
  1783  	preparer := autorest.CreatePreparer(
  1784  		autorest.AsGet(),
  1785  		autorest.WithBaseURL(client.BaseURI),
  1786  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers", pathParameters),
  1787  		autorest.WithQueryParameters(queryParameters))
  1788  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1789  }
  1790  
  1791  // ListSQLContainersSender sends the ListSQLContainers request. The method will close the
  1792  // http.Response Body if it receives an error.
  1793  func (client SQLResourcesClient) ListSQLContainersSender(req *http.Request) (*http.Response, error) {
  1794  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1795  }
  1796  
  1797  // ListSQLContainersResponder handles the response to the ListSQLContainers request. The method always
  1798  // closes the http.Response Body.
  1799  func (client SQLResourcesClient) ListSQLContainersResponder(resp *http.Response) (result SQLContainerListResult, err error) {
  1800  	err = autorest.Respond(
  1801  		resp,
  1802  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1803  		autorest.ByUnmarshallingJSON(&result),
  1804  		autorest.ByClosing())
  1805  	result.Response = autorest.Response{Response: resp}
  1806  	return
  1807  }
  1808  
  1809  // ListSQLDatabases lists the SQL databases under an existing Azure Cosmos DB database account.
  1810  // Parameters:
  1811  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1812  // accountName - cosmos DB database account name.
  1813  func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceGroupName string, accountName string) (result SQLDatabaseListResult, err error) {
  1814  	if tracing.IsEnabled() {
  1815  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLDatabases")
  1816  		defer func() {
  1817  			sc := -1
  1818  			if result.Response.Response != nil {
  1819  				sc = result.Response.Response.StatusCode
  1820  			}
  1821  			tracing.EndSpan(ctx, sc, err)
  1822  		}()
  1823  	}
  1824  	if err := validation.Validate([]validation.Validation{
  1825  		{TargetValue: client.SubscriptionID,
  1826  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1827  		{TargetValue: resourceGroupName,
  1828  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1829  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1830  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1831  		{TargetValue: accountName,
  1832  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1833  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1834  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1835  		return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLDatabases", err.Error())
  1836  	}
  1837  
  1838  	req, err := client.ListSQLDatabasesPreparer(ctx, resourceGroupName, accountName)
  1839  	if err != nil {
  1840  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLDatabases", nil, "Failure preparing request")
  1841  		return
  1842  	}
  1843  
  1844  	resp, err := client.ListSQLDatabasesSender(req)
  1845  	if err != nil {
  1846  		result.Response = autorest.Response{Response: resp}
  1847  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLDatabases", resp, "Failure sending request")
  1848  		return
  1849  	}
  1850  
  1851  	result, err = client.ListSQLDatabasesResponder(resp)
  1852  	if err != nil {
  1853  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLDatabases", resp, "Failure responding to request")
  1854  		return
  1855  	}
  1856  
  1857  	return
  1858  }
  1859  
  1860  // ListSQLDatabasesPreparer prepares the ListSQLDatabases request.
  1861  func (client SQLResourcesClient) ListSQLDatabasesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
  1862  	pathParameters := map[string]interface{}{
  1863  		"accountName":       autorest.Encode("path", accountName),
  1864  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1865  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1866  	}
  1867  
  1868  	const APIVersion = "2021-03-15"
  1869  	queryParameters := map[string]interface{}{
  1870  		"api-version": APIVersion,
  1871  	}
  1872  
  1873  	preparer := autorest.CreatePreparer(
  1874  		autorest.AsGet(),
  1875  		autorest.WithBaseURL(client.BaseURI),
  1876  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases", pathParameters),
  1877  		autorest.WithQueryParameters(queryParameters))
  1878  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1879  }
  1880  
  1881  // ListSQLDatabasesSender sends the ListSQLDatabases request. The method will close the
  1882  // http.Response Body if it receives an error.
  1883  func (client SQLResourcesClient) ListSQLDatabasesSender(req *http.Request) (*http.Response, error) {
  1884  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1885  }
  1886  
  1887  // ListSQLDatabasesResponder handles the response to the ListSQLDatabases request. The method always
  1888  // closes the http.Response Body.
  1889  func (client SQLResourcesClient) ListSQLDatabasesResponder(resp *http.Response) (result SQLDatabaseListResult, err error) {
  1890  	err = autorest.Respond(
  1891  		resp,
  1892  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1893  		autorest.ByUnmarshallingJSON(&result),
  1894  		autorest.ByClosing())
  1895  	result.Response = autorest.Response{Response: resp}
  1896  	return
  1897  }
  1898  
  1899  // ListSQLStoredProcedures lists the SQL storedProcedure under an existing Azure Cosmos DB database account.
  1900  // Parameters:
  1901  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1902  // accountName - cosmos DB database account name.
  1903  // databaseName - cosmos DB database name.
  1904  // containerName - cosmos DB container name.
  1905  func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLStoredProcedureListResult, err error) {
  1906  	if tracing.IsEnabled() {
  1907  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLStoredProcedures")
  1908  		defer func() {
  1909  			sc := -1
  1910  			if result.Response.Response != nil {
  1911  				sc = result.Response.Response.StatusCode
  1912  			}
  1913  			tracing.EndSpan(ctx, sc, err)
  1914  		}()
  1915  	}
  1916  	if err := validation.Validate([]validation.Validation{
  1917  		{TargetValue: client.SubscriptionID,
  1918  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1919  		{TargetValue: resourceGroupName,
  1920  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1921  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1922  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1923  		{TargetValue: accountName,
  1924  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1925  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1926  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1927  		return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLStoredProcedures", err.Error())
  1928  	}
  1929  
  1930  	req, err := client.ListSQLStoredProceduresPreparer(ctx, resourceGroupName, accountName, databaseName, containerName)
  1931  	if err != nil {
  1932  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLStoredProcedures", nil, "Failure preparing request")
  1933  		return
  1934  	}
  1935  
  1936  	resp, err := client.ListSQLStoredProceduresSender(req)
  1937  	if err != nil {
  1938  		result.Response = autorest.Response{Response: resp}
  1939  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLStoredProcedures", resp, "Failure sending request")
  1940  		return
  1941  	}
  1942  
  1943  	result, err = client.ListSQLStoredProceduresResponder(resp)
  1944  	if err != nil {
  1945  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLStoredProcedures", resp, "Failure responding to request")
  1946  		return
  1947  	}
  1948  
  1949  	return
  1950  }
  1951  
  1952  // ListSQLStoredProceduresPreparer prepares the ListSQLStoredProcedures request.
  1953  func (client SQLResourcesClient) ListSQLStoredProceduresPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) {
  1954  	pathParameters := map[string]interface{}{
  1955  		"accountName":       autorest.Encode("path", accountName),
  1956  		"containerName":     autorest.Encode("path", containerName),
  1957  		"databaseName":      autorest.Encode("path", databaseName),
  1958  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1959  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1960  	}
  1961  
  1962  	const APIVersion = "2021-03-15"
  1963  	queryParameters := map[string]interface{}{
  1964  		"api-version": APIVersion,
  1965  	}
  1966  
  1967  	preparer := autorest.CreatePreparer(
  1968  		autorest.AsGet(),
  1969  		autorest.WithBaseURL(client.BaseURI),
  1970  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures", pathParameters),
  1971  		autorest.WithQueryParameters(queryParameters))
  1972  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1973  }
  1974  
  1975  // ListSQLStoredProceduresSender sends the ListSQLStoredProcedures request. The method will close the
  1976  // http.Response Body if it receives an error.
  1977  func (client SQLResourcesClient) ListSQLStoredProceduresSender(req *http.Request) (*http.Response, error) {
  1978  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1979  }
  1980  
  1981  // ListSQLStoredProceduresResponder handles the response to the ListSQLStoredProcedures request. The method always
  1982  // closes the http.Response Body.
  1983  func (client SQLResourcesClient) ListSQLStoredProceduresResponder(resp *http.Response) (result SQLStoredProcedureListResult, err error) {
  1984  	err = autorest.Respond(
  1985  		resp,
  1986  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1987  		autorest.ByUnmarshallingJSON(&result),
  1988  		autorest.ByClosing())
  1989  	result.Response = autorest.Response{Response: resp}
  1990  	return
  1991  }
  1992  
  1993  // ListSQLTriggers lists the SQL trigger under an existing Azure Cosmos DB database account.
  1994  // Parameters:
  1995  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1996  // accountName - cosmos DB database account name.
  1997  // databaseName - cosmos DB database name.
  1998  // containerName - cosmos DB container name.
  1999  func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLTriggerListResult, err error) {
  2000  	if tracing.IsEnabled() {
  2001  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLTriggers")
  2002  		defer func() {
  2003  			sc := -1
  2004  			if result.Response.Response != nil {
  2005  				sc = result.Response.Response.StatusCode
  2006  			}
  2007  			tracing.EndSpan(ctx, sc, err)
  2008  		}()
  2009  	}
  2010  	if err := validation.Validate([]validation.Validation{
  2011  		{TargetValue: client.SubscriptionID,
  2012  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  2013  		{TargetValue: resourceGroupName,
  2014  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  2015  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  2016  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  2017  		{TargetValue: accountName,
  2018  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  2019  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  2020  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  2021  		return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLTriggers", err.Error())
  2022  	}
  2023  
  2024  	req, err := client.ListSQLTriggersPreparer(ctx, resourceGroupName, accountName, databaseName, containerName)
  2025  	if err != nil {
  2026  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLTriggers", nil, "Failure preparing request")
  2027  		return
  2028  	}
  2029  
  2030  	resp, err := client.ListSQLTriggersSender(req)
  2031  	if err != nil {
  2032  		result.Response = autorest.Response{Response: resp}
  2033  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLTriggers", resp, "Failure sending request")
  2034  		return
  2035  	}
  2036  
  2037  	result, err = client.ListSQLTriggersResponder(resp)
  2038  	if err != nil {
  2039  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLTriggers", resp, "Failure responding to request")
  2040  		return
  2041  	}
  2042  
  2043  	return
  2044  }
  2045  
  2046  // ListSQLTriggersPreparer prepares the ListSQLTriggers request.
  2047  func (client SQLResourcesClient) ListSQLTriggersPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) {
  2048  	pathParameters := map[string]interface{}{
  2049  		"accountName":       autorest.Encode("path", accountName),
  2050  		"containerName":     autorest.Encode("path", containerName),
  2051  		"databaseName":      autorest.Encode("path", databaseName),
  2052  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  2053  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  2054  	}
  2055  
  2056  	const APIVersion = "2021-03-15"
  2057  	queryParameters := map[string]interface{}{
  2058  		"api-version": APIVersion,
  2059  	}
  2060  
  2061  	preparer := autorest.CreatePreparer(
  2062  		autorest.AsGet(),
  2063  		autorest.WithBaseURL(client.BaseURI),
  2064  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers", pathParameters),
  2065  		autorest.WithQueryParameters(queryParameters))
  2066  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2067  }
  2068  
  2069  // ListSQLTriggersSender sends the ListSQLTriggers request. The method will close the
  2070  // http.Response Body if it receives an error.
  2071  func (client SQLResourcesClient) ListSQLTriggersSender(req *http.Request) (*http.Response, error) {
  2072  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  2073  }
  2074  
  2075  // ListSQLTriggersResponder handles the response to the ListSQLTriggers request. The method always
  2076  // closes the http.Response Body.
  2077  func (client SQLResourcesClient) ListSQLTriggersResponder(resp *http.Response) (result SQLTriggerListResult, err error) {
  2078  	err = autorest.Respond(
  2079  		resp,
  2080  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2081  		autorest.ByUnmarshallingJSON(&result),
  2082  		autorest.ByClosing())
  2083  	result.Response = autorest.Response{Response: resp}
  2084  	return
  2085  }
  2086  
  2087  // ListSQLUserDefinedFunctions lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account.
  2088  // Parameters:
  2089  // resourceGroupName - the name of the resource group. The name is case insensitive.
  2090  // accountName - cosmos DB database account name.
  2091  // databaseName - cosmos DB database name.
  2092  // containerName - cosmos DB container name.
  2093  func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLUserDefinedFunctionListResult, err error) {
  2094  	if tracing.IsEnabled() {
  2095  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLUserDefinedFunctions")
  2096  		defer func() {
  2097  			sc := -1
  2098  			if result.Response.Response != nil {
  2099  				sc = result.Response.Response.StatusCode
  2100  			}
  2101  			tracing.EndSpan(ctx, sc, err)
  2102  		}()
  2103  	}
  2104  	if err := validation.Validate([]validation.Validation{
  2105  		{TargetValue: client.SubscriptionID,
  2106  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  2107  		{TargetValue: resourceGroupName,
  2108  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  2109  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  2110  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  2111  		{TargetValue: accountName,
  2112  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  2113  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  2114  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  2115  		return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", err.Error())
  2116  	}
  2117  
  2118  	req, err := client.ListSQLUserDefinedFunctionsPreparer(ctx, resourceGroupName, accountName, databaseName, containerName)
  2119  	if err != nil {
  2120  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", nil, "Failure preparing request")
  2121  		return
  2122  	}
  2123  
  2124  	resp, err := client.ListSQLUserDefinedFunctionsSender(req)
  2125  	if err != nil {
  2126  		result.Response = autorest.Response{Response: resp}
  2127  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", resp, "Failure sending request")
  2128  		return
  2129  	}
  2130  
  2131  	result, err = client.ListSQLUserDefinedFunctionsResponder(resp)
  2132  	if err != nil {
  2133  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", resp, "Failure responding to request")
  2134  		return
  2135  	}
  2136  
  2137  	return
  2138  }
  2139  
  2140  // ListSQLUserDefinedFunctionsPreparer prepares the ListSQLUserDefinedFunctions request.
  2141  func (client SQLResourcesClient) ListSQLUserDefinedFunctionsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) {
  2142  	pathParameters := map[string]interface{}{
  2143  		"accountName":       autorest.Encode("path", accountName),
  2144  		"containerName":     autorest.Encode("path", containerName),
  2145  		"databaseName":      autorest.Encode("path", databaseName),
  2146  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  2147  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  2148  	}
  2149  
  2150  	const APIVersion = "2021-03-15"
  2151  	queryParameters := map[string]interface{}{
  2152  		"api-version": APIVersion,
  2153  	}
  2154  
  2155  	preparer := autorest.CreatePreparer(
  2156  		autorest.AsGet(),
  2157  		autorest.WithBaseURL(client.BaseURI),
  2158  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions", pathParameters),
  2159  		autorest.WithQueryParameters(queryParameters))
  2160  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2161  }
  2162  
  2163  // ListSQLUserDefinedFunctionsSender sends the ListSQLUserDefinedFunctions request. The method will close the
  2164  // http.Response Body if it receives an error.
  2165  func (client SQLResourcesClient) ListSQLUserDefinedFunctionsSender(req *http.Request) (*http.Response, error) {
  2166  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  2167  }
  2168  
  2169  // ListSQLUserDefinedFunctionsResponder handles the response to the ListSQLUserDefinedFunctions request. The method always
  2170  // closes the http.Response Body.
  2171  func (client SQLResourcesClient) ListSQLUserDefinedFunctionsResponder(resp *http.Response) (result SQLUserDefinedFunctionListResult, err error) {
  2172  	err = autorest.Respond(
  2173  		resp,
  2174  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2175  		autorest.ByUnmarshallingJSON(&result),
  2176  		autorest.ByClosing())
  2177  	result.Response = autorest.Response{Response: resp}
  2178  	return
  2179  }
  2180  
  2181  // MigrateSQLContainerToAutoscale migrate an Azure Cosmos DB SQL container from manual throughput to autoscale
  2182  // Parameters:
  2183  // resourceGroupName - the name of the resource group. The name is case insensitive.
  2184  // accountName - cosmos DB database account name.
  2185  // databaseName - cosmos DB database name.
  2186  // containerName - cosmos DB container name.
  2187  func (client SQLResourcesClient) MigrateSQLContainerToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLResourcesMigrateSQLContainerToAutoscaleFuture, err error) {
  2188  	if tracing.IsEnabled() {
  2189  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLContainerToAutoscale")
  2190  		defer func() {
  2191  			sc := -1
  2192  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  2193  				sc = result.FutureAPI.Response().StatusCode
  2194  			}
  2195  			tracing.EndSpan(ctx, sc, err)
  2196  		}()
  2197  	}
  2198  	if err := validation.Validate([]validation.Validation{
  2199  		{TargetValue: client.SubscriptionID,
  2200  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  2201  		{TargetValue: resourceGroupName,
  2202  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  2203  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  2204  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  2205  		{TargetValue: accountName,
  2206  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  2207  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  2208  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  2209  		return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLContainerToAutoscale", err.Error())
  2210  	}
  2211  
  2212  	req, err := client.MigrateSQLContainerToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName, containerName)
  2213  	if err != nil {
  2214  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToAutoscale", nil, "Failure preparing request")
  2215  		return
  2216  	}
  2217  
  2218  	result, err = client.MigrateSQLContainerToAutoscaleSender(req)
  2219  	if err != nil {
  2220  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToAutoscale", result.Response(), "Failure sending request")
  2221  		return
  2222  	}
  2223  
  2224  	return
  2225  }
  2226  
  2227  // MigrateSQLContainerToAutoscalePreparer prepares the MigrateSQLContainerToAutoscale request.
  2228  func (client SQLResourcesClient) MigrateSQLContainerToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) {
  2229  	pathParameters := map[string]interface{}{
  2230  		"accountName":       autorest.Encode("path", accountName),
  2231  		"containerName":     autorest.Encode("path", containerName),
  2232  		"databaseName":      autorest.Encode("path", databaseName),
  2233  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  2234  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  2235  	}
  2236  
  2237  	const APIVersion = "2021-03-15"
  2238  	queryParameters := map[string]interface{}{
  2239  		"api-version": APIVersion,
  2240  	}
  2241  
  2242  	preparer := autorest.CreatePreparer(
  2243  		autorest.AsPost(),
  2244  		autorest.WithBaseURL(client.BaseURI),
  2245  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale", pathParameters),
  2246  		autorest.WithQueryParameters(queryParameters))
  2247  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2248  }
  2249  
  2250  // MigrateSQLContainerToAutoscaleSender sends the MigrateSQLContainerToAutoscale request. The method will close the
  2251  // http.Response Body if it receives an error.
  2252  func (client SQLResourcesClient) MigrateSQLContainerToAutoscaleSender(req *http.Request) (future SQLResourcesMigrateSQLContainerToAutoscaleFuture, err error) {
  2253  	var resp *http.Response
  2254  	future.FutureAPI = &azure.Future{}
  2255  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  2256  	if err != nil {
  2257  		return
  2258  	}
  2259  	var azf azure.Future
  2260  	azf, err = azure.NewFutureFromResponse(resp)
  2261  	future.FutureAPI = &azf
  2262  	future.Result = future.result
  2263  	return
  2264  }
  2265  
  2266  // MigrateSQLContainerToAutoscaleResponder handles the response to the MigrateSQLContainerToAutoscale request. The method always
  2267  // closes the http.Response Body.
  2268  func (client SQLResourcesClient) MigrateSQLContainerToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  2269  	err = autorest.Respond(
  2270  		resp,
  2271  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  2272  		autorest.ByUnmarshallingJSON(&result),
  2273  		autorest.ByClosing())
  2274  	result.Response = autorest.Response{Response: resp}
  2275  	return
  2276  }
  2277  
  2278  // MigrateSQLContainerToManualThroughput migrate an Azure Cosmos DB SQL container from autoscale to manual throughput
  2279  // Parameters:
  2280  // resourceGroupName - the name of the resource group. The name is case insensitive.
  2281  // accountName - cosmos DB database account name.
  2282  // databaseName - cosmos DB database name.
  2283  // containerName - cosmos DB container name.
  2284  func (client SQLResourcesClient) MigrateSQLContainerToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLResourcesMigrateSQLContainerToManualThroughputFuture, err error) {
  2285  	if tracing.IsEnabled() {
  2286  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLContainerToManualThroughput")
  2287  		defer func() {
  2288  			sc := -1
  2289  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  2290  				sc = result.FutureAPI.Response().StatusCode
  2291  			}
  2292  			tracing.EndSpan(ctx, sc, err)
  2293  		}()
  2294  	}
  2295  	if err := validation.Validate([]validation.Validation{
  2296  		{TargetValue: client.SubscriptionID,
  2297  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  2298  		{TargetValue: resourceGroupName,
  2299  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  2300  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  2301  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  2302  		{TargetValue: accountName,
  2303  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  2304  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  2305  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  2306  		return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLContainerToManualThroughput", err.Error())
  2307  	}
  2308  
  2309  	req, err := client.MigrateSQLContainerToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, containerName)
  2310  	if err != nil {
  2311  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToManualThroughput", nil, "Failure preparing request")
  2312  		return
  2313  	}
  2314  
  2315  	result, err = client.MigrateSQLContainerToManualThroughputSender(req)
  2316  	if err != nil {
  2317  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToManualThroughput", result.Response(), "Failure sending request")
  2318  		return
  2319  	}
  2320  
  2321  	return
  2322  }
  2323  
  2324  // MigrateSQLContainerToManualThroughputPreparer prepares the MigrateSQLContainerToManualThroughput request.
  2325  func (client SQLResourcesClient) MigrateSQLContainerToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) {
  2326  	pathParameters := map[string]interface{}{
  2327  		"accountName":       autorest.Encode("path", accountName),
  2328  		"containerName":     autorest.Encode("path", containerName),
  2329  		"databaseName":      autorest.Encode("path", databaseName),
  2330  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  2331  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  2332  	}
  2333  
  2334  	const APIVersion = "2021-03-15"
  2335  	queryParameters := map[string]interface{}{
  2336  		"api-version": APIVersion,
  2337  	}
  2338  
  2339  	preparer := autorest.CreatePreparer(
  2340  		autorest.AsPost(),
  2341  		autorest.WithBaseURL(client.BaseURI),
  2342  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput", pathParameters),
  2343  		autorest.WithQueryParameters(queryParameters))
  2344  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2345  }
  2346  
  2347  // MigrateSQLContainerToManualThroughputSender sends the MigrateSQLContainerToManualThroughput request. The method will close the
  2348  // http.Response Body if it receives an error.
  2349  func (client SQLResourcesClient) MigrateSQLContainerToManualThroughputSender(req *http.Request) (future SQLResourcesMigrateSQLContainerToManualThroughputFuture, err error) {
  2350  	var resp *http.Response
  2351  	future.FutureAPI = &azure.Future{}
  2352  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  2353  	if err != nil {
  2354  		return
  2355  	}
  2356  	var azf azure.Future
  2357  	azf, err = azure.NewFutureFromResponse(resp)
  2358  	future.FutureAPI = &azf
  2359  	future.Result = future.result
  2360  	return
  2361  }
  2362  
  2363  // MigrateSQLContainerToManualThroughputResponder handles the response to the MigrateSQLContainerToManualThroughput request. The method always
  2364  // closes the http.Response Body.
  2365  func (client SQLResourcesClient) MigrateSQLContainerToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  2366  	err = autorest.Respond(
  2367  		resp,
  2368  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  2369  		autorest.ByUnmarshallingJSON(&result),
  2370  		autorest.ByClosing())
  2371  	result.Response = autorest.Response{Response: resp}
  2372  	return
  2373  }
  2374  
  2375  // MigrateSQLDatabaseToAutoscale migrate an Azure Cosmos DB SQL database from manual throughput to autoscale
  2376  // Parameters:
  2377  // resourceGroupName - the name of the resource group. The name is case insensitive.
  2378  // accountName - cosmos DB database account name.
  2379  // databaseName - cosmos DB database name.
  2380  func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLResourcesMigrateSQLDatabaseToAutoscaleFuture, err error) {
  2381  	if tracing.IsEnabled() {
  2382  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLDatabaseToAutoscale")
  2383  		defer func() {
  2384  			sc := -1
  2385  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  2386  				sc = result.FutureAPI.Response().StatusCode
  2387  			}
  2388  			tracing.EndSpan(ctx, sc, err)
  2389  		}()
  2390  	}
  2391  	if err := validation.Validate([]validation.Validation{
  2392  		{TargetValue: client.SubscriptionID,
  2393  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  2394  		{TargetValue: resourceGroupName,
  2395  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  2396  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  2397  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  2398  		{TargetValue: accountName,
  2399  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  2400  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  2401  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  2402  		return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLDatabaseToAutoscale", err.Error())
  2403  	}
  2404  
  2405  	req, err := client.MigrateSQLDatabaseToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName)
  2406  	if err != nil {
  2407  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToAutoscale", nil, "Failure preparing request")
  2408  		return
  2409  	}
  2410  
  2411  	result, err = client.MigrateSQLDatabaseToAutoscaleSender(req)
  2412  	if err != nil {
  2413  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToAutoscale", result.Response(), "Failure sending request")
  2414  		return
  2415  	}
  2416  
  2417  	return
  2418  }
  2419  
  2420  // MigrateSQLDatabaseToAutoscalePreparer prepares the MigrateSQLDatabaseToAutoscale request.
  2421  func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) {
  2422  	pathParameters := map[string]interface{}{
  2423  		"accountName":       autorest.Encode("path", accountName),
  2424  		"databaseName":      autorest.Encode("path", databaseName),
  2425  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  2426  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  2427  	}
  2428  
  2429  	const APIVersion = "2021-03-15"
  2430  	queryParameters := map[string]interface{}{
  2431  		"api-version": APIVersion,
  2432  	}
  2433  
  2434  	preparer := autorest.CreatePreparer(
  2435  		autorest.AsPost(),
  2436  		autorest.WithBaseURL(client.BaseURI),
  2437  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale", pathParameters),
  2438  		autorest.WithQueryParameters(queryParameters))
  2439  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2440  }
  2441  
  2442  // MigrateSQLDatabaseToAutoscaleSender sends the MigrateSQLDatabaseToAutoscale request. The method will close the
  2443  // http.Response Body if it receives an error.
  2444  func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscaleSender(req *http.Request) (future SQLResourcesMigrateSQLDatabaseToAutoscaleFuture, err error) {
  2445  	var resp *http.Response
  2446  	future.FutureAPI = &azure.Future{}
  2447  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  2448  	if err != nil {
  2449  		return
  2450  	}
  2451  	var azf azure.Future
  2452  	azf, err = azure.NewFutureFromResponse(resp)
  2453  	future.FutureAPI = &azf
  2454  	future.Result = future.result
  2455  	return
  2456  }
  2457  
  2458  // MigrateSQLDatabaseToAutoscaleResponder handles the response to the MigrateSQLDatabaseToAutoscale request. The method always
  2459  // closes the http.Response Body.
  2460  func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  2461  	err = autorest.Respond(
  2462  		resp,
  2463  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  2464  		autorest.ByUnmarshallingJSON(&result),
  2465  		autorest.ByClosing())
  2466  	result.Response = autorest.Response{Response: resp}
  2467  	return
  2468  }
  2469  
  2470  // MigrateSQLDatabaseToManualThroughput migrate an Azure Cosmos DB SQL database from autoscale to manual throughput
  2471  // Parameters:
  2472  // resourceGroupName - the name of the resource group. The name is case insensitive.
  2473  // accountName - cosmos DB database account name.
  2474  // databaseName - cosmos DB database name.
  2475  func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLResourcesMigrateSQLDatabaseToManualThroughputFuture, err error) {
  2476  	if tracing.IsEnabled() {
  2477  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLDatabaseToManualThroughput")
  2478  		defer func() {
  2479  			sc := -1
  2480  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  2481  				sc = result.FutureAPI.Response().StatusCode
  2482  			}
  2483  			tracing.EndSpan(ctx, sc, err)
  2484  		}()
  2485  	}
  2486  	if err := validation.Validate([]validation.Validation{
  2487  		{TargetValue: client.SubscriptionID,
  2488  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  2489  		{TargetValue: resourceGroupName,
  2490  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  2491  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  2492  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  2493  		{TargetValue: accountName,
  2494  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  2495  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  2496  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  2497  		return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLDatabaseToManualThroughput", err.Error())
  2498  	}
  2499  
  2500  	req, err := client.MigrateSQLDatabaseToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName)
  2501  	if err != nil {
  2502  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToManualThroughput", nil, "Failure preparing request")
  2503  		return
  2504  	}
  2505  
  2506  	result, err = client.MigrateSQLDatabaseToManualThroughputSender(req)
  2507  	if err != nil {
  2508  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToManualThroughput", result.Response(), "Failure sending request")
  2509  		return
  2510  	}
  2511  
  2512  	return
  2513  }
  2514  
  2515  // MigrateSQLDatabaseToManualThroughputPreparer prepares the MigrateSQLDatabaseToManualThroughput request.
  2516  func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) {
  2517  	pathParameters := map[string]interface{}{
  2518  		"accountName":       autorest.Encode("path", accountName),
  2519  		"databaseName":      autorest.Encode("path", databaseName),
  2520  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  2521  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  2522  	}
  2523  
  2524  	const APIVersion = "2021-03-15"
  2525  	queryParameters := map[string]interface{}{
  2526  		"api-version": APIVersion,
  2527  	}
  2528  
  2529  	preparer := autorest.CreatePreparer(
  2530  		autorest.AsPost(),
  2531  		autorest.WithBaseURL(client.BaseURI),
  2532  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput", pathParameters),
  2533  		autorest.WithQueryParameters(queryParameters))
  2534  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2535  }
  2536  
  2537  // MigrateSQLDatabaseToManualThroughputSender sends the MigrateSQLDatabaseToManualThroughput request. The method will close the
  2538  // http.Response Body if it receives an error.
  2539  func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughputSender(req *http.Request) (future SQLResourcesMigrateSQLDatabaseToManualThroughputFuture, err error) {
  2540  	var resp *http.Response
  2541  	future.FutureAPI = &azure.Future{}
  2542  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  2543  	if err != nil {
  2544  		return
  2545  	}
  2546  	var azf azure.Future
  2547  	azf, err = azure.NewFutureFromResponse(resp)
  2548  	future.FutureAPI = &azf
  2549  	future.Result = future.result
  2550  	return
  2551  }
  2552  
  2553  // MigrateSQLDatabaseToManualThroughputResponder handles the response to the MigrateSQLDatabaseToManualThroughput request. The method always
  2554  // closes the http.Response Body.
  2555  func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  2556  	err = autorest.Respond(
  2557  		resp,
  2558  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  2559  		autorest.ByUnmarshallingJSON(&result),
  2560  		autorest.ByClosing())
  2561  	result.Response = autorest.Response{Response: resp}
  2562  	return
  2563  }
  2564  
  2565  // UpdateSQLContainerThroughput update RUs per second of an Azure Cosmos DB SQL container
  2566  // Parameters:
  2567  // resourceGroupName - the name of the resource group. The name is case insensitive.
  2568  // accountName - cosmos DB database account name.
  2569  // databaseName - cosmos DB database name.
  2570  // containerName - cosmos DB container name.
  2571  // updateThroughputParameters - the parameters to provide for the RUs per second of the current SQL container.
  2572  func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result SQLResourcesUpdateSQLContainerThroughputFuture, err error) {
  2573  	if tracing.IsEnabled() {
  2574  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.UpdateSQLContainerThroughput")
  2575  		defer func() {
  2576  			sc := -1
  2577  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  2578  				sc = result.FutureAPI.Response().StatusCode
  2579  			}
  2580  			tracing.EndSpan(ctx, sc, err)
  2581  		}()
  2582  	}
  2583  	if err := validation.Validate([]validation.Validation{
  2584  		{TargetValue: client.SubscriptionID,
  2585  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  2586  		{TargetValue: resourceGroupName,
  2587  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  2588  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  2589  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  2590  		{TargetValue: accountName,
  2591  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  2592  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  2593  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
  2594  		{TargetValue: updateThroughputParameters,
  2595  			Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true,
  2596  				Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true,
  2597  					Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false,
  2598  						Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}},
  2599  					}},
  2600  				}}}}}); err != nil {
  2601  		return result, validation.NewError("documentdb.SQLResourcesClient", "UpdateSQLContainerThroughput", err.Error())
  2602  	}
  2603  
  2604  	req, err := client.UpdateSQLContainerThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters)
  2605  	if err != nil {
  2606  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLContainerThroughput", nil, "Failure preparing request")
  2607  		return
  2608  	}
  2609  
  2610  	result, err = client.UpdateSQLContainerThroughputSender(req)
  2611  	if err != nil {
  2612  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLContainerThroughput", result.Response(), "Failure sending request")
  2613  		return
  2614  	}
  2615  
  2616  	return
  2617  }
  2618  
  2619  // UpdateSQLContainerThroughputPreparer prepares the UpdateSQLContainerThroughput request.
  2620  func (client SQLResourcesClient) UpdateSQLContainerThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) {
  2621  	pathParameters := map[string]interface{}{
  2622  		"accountName":       autorest.Encode("path", accountName),
  2623  		"containerName":     autorest.Encode("path", containerName),
  2624  		"databaseName":      autorest.Encode("path", databaseName),
  2625  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  2626  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  2627  	}
  2628  
  2629  	const APIVersion = "2021-03-15"
  2630  	queryParameters := map[string]interface{}{
  2631  		"api-version": APIVersion,
  2632  	}
  2633  
  2634  	preparer := autorest.CreatePreparer(
  2635  		autorest.AsContentType("application/json; charset=utf-8"),
  2636  		autorest.AsPut(),
  2637  		autorest.WithBaseURL(client.BaseURI),
  2638  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", pathParameters),
  2639  		autorest.WithJSON(updateThroughputParameters),
  2640  		autorest.WithQueryParameters(queryParameters))
  2641  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2642  }
  2643  
  2644  // UpdateSQLContainerThroughputSender sends the UpdateSQLContainerThroughput request. The method will close the
  2645  // http.Response Body if it receives an error.
  2646  func (client SQLResourcesClient) UpdateSQLContainerThroughputSender(req *http.Request) (future SQLResourcesUpdateSQLContainerThroughputFuture, err error) {
  2647  	var resp *http.Response
  2648  	future.FutureAPI = &azure.Future{}
  2649  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  2650  	if err != nil {
  2651  		return
  2652  	}
  2653  	var azf azure.Future
  2654  	azf, err = azure.NewFutureFromResponse(resp)
  2655  	future.FutureAPI = &azf
  2656  	future.Result = future.result
  2657  	return
  2658  }
  2659  
  2660  // UpdateSQLContainerThroughputResponder handles the response to the UpdateSQLContainerThroughput request. The method always
  2661  // closes the http.Response Body.
  2662  func (client SQLResourcesClient) UpdateSQLContainerThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  2663  	err = autorest.Respond(
  2664  		resp,
  2665  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  2666  		autorest.ByUnmarshallingJSON(&result),
  2667  		autorest.ByClosing())
  2668  	result.Response = autorest.Response{Response: resp}
  2669  	return
  2670  }
  2671  
  2672  // UpdateSQLDatabaseThroughput update RUs per second of an Azure Cosmos DB SQL database
  2673  // Parameters:
  2674  // resourceGroupName - the name of the resource group. The name is case insensitive.
  2675  // accountName - cosmos DB database account name.
  2676  // databaseName - cosmos DB database name.
  2677  // updateThroughputParameters - the parameters to provide for the RUs per second of the current SQL database.
  2678  func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result SQLResourcesUpdateSQLDatabaseThroughputFuture, err error) {
  2679  	if tracing.IsEnabled() {
  2680  		ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.UpdateSQLDatabaseThroughput")
  2681  		defer func() {
  2682  			sc := -1
  2683  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  2684  				sc = result.FutureAPI.Response().StatusCode
  2685  			}
  2686  			tracing.EndSpan(ctx, sc, err)
  2687  		}()
  2688  	}
  2689  	if err := validation.Validate([]validation.Validation{
  2690  		{TargetValue: client.SubscriptionID,
  2691  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  2692  		{TargetValue: resourceGroupName,
  2693  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  2694  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  2695  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  2696  		{TargetValue: accountName,
  2697  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  2698  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  2699  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
  2700  		{TargetValue: updateThroughputParameters,
  2701  			Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true,
  2702  				Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true,
  2703  					Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false,
  2704  						Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}},
  2705  					}},
  2706  				}}}}}); err != nil {
  2707  		return result, validation.NewError("documentdb.SQLResourcesClient", "UpdateSQLDatabaseThroughput", err.Error())
  2708  	}
  2709  
  2710  	req, err := client.UpdateSQLDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters)
  2711  	if err != nil {
  2712  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLDatabaseThroughput", nil, "Failure preparing request")
  2713  		return
  2714  	}
  2715  
  2716  	result, err = client.UpdateSQLDatabaseThroughputSender(req)
  2717  	if err != nil {
  2718  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLDatabaseThroughput", result.Response(), "Failure sending request")
  2719  		return
  2720  	}
  2721  
  2722  	return
  2723  }
  2724  
  2725  // UpdateSQLDatabaseThroughputPreparer prepares the UpdateSQLDatabaseThroughput request.
  2726  func (client SQLResourcesClient) UpdateSQLDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) {
  2727  	pathParameters := map[string]interface{}{
  2728  		"accountName":       autorest.Encode("path", accountName),
  2729  		"databaseName":      autorest.Encode("path", databaseName),
  2730  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  2731  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  2732  	}
  2733  
  2734  	const APIVersion = "2021-03-15"
  2735  	queryParameters := map[string]interface{}{
  2736  		"api-version": APIVersion,
  2737  	}
  2738  
  2739  	preparer := autorest.CreatePreparer(
  2740  		autorest.AsContentType("application/json; charset=utf-8"),
  2741  		autorest.AsPut(),
  2742  		autorest.WithBaseURL(client.BaseURI),
  2743  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default", pathParameters),
  2744  		autorest.WithJSON(updateThroughputParameters),
  2745  		autorest.WithQueryParameters(queryParameters))
  2746  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2747  }
  2748  
  2749  // UpdateSQLDatabaseThroughputSender sends the UpdateSQLDatabaseThroughput request. The method will close the
  2750  // http.Response Body if it receives an error.
  2751  func (client SQLResourcesClient) UpdateSQLDatabaseThroughputSender(req *http.Request) (future SQLResourcesUpdateSQLDatabaseThroughputFuture, err error) {
  2752  	var resp *http.Response
  2753  	future.FutureAPI = &azure.Future{}
  2754  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  2755  	if err != nil {
  2756  		return
  2757  	}
  2758  	var azf azure.Future
  2759  	azf, err = azure.NewFutureFromResponse(resp)
  2760  	future.FutureAPI = &azf
  2761  	future.Result = future.result
  2762  	return
  2763  }
  2764  
  2765  // UpdateSQLDatabaseThroughputResponder handles the response to the UpdateSQLDatabaseThroughput request. The method always
  2766  // closes the http.Response Body.
  2767  func (client SQLResourcesClient) UpdateSQLDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  2768  	err = autorest.Respond(
  2769  		resp,
  2770  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  2771  		autorest.ByUnmarshallingJSON(&result),
  2772  		autorest.ByClosing())
  2773  	result.Response = autorest.Response{Response: resp}
  2774  	return
  2775  }
  2776  

View as plain text