...

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

Documentation: github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-05-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  // CassandraResourcesClient is the client for the CassandraResources methods of the Documentdb service.
    19  type CassandraResourcesClient struct {
    20  	BaseClient
    21  }
    22  
    23  // NewCassandraResourcesClient creates an instance of the CassandraResourcesClient client.
    24  func NewCassandraResourcesClient(subscriptionID string) CassandraResourcesClient {
    25  	return NewCassandraResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID)
    26  }
    27  
    28  // NewCassandraResourcesClientWithBaseURI creates an instance of the CassandraResourcesClient client using a custom
    29  // endpoint.  Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
    30  // stack).
    31  func NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string) CassandraResourcesClient {
    32  	return CassandraResourcesClient{NewWithBaseURI(baseURI, subscriptionID)}
    33  }
    34  
    35  // CreateUpdateCassandraKeyspace create or update an Azure Cosmos DB Cassandra keyspace
    36  // Parameters:
    37  // resourceGroupName - the name of the resource group. The name is case insensitive.
    38  // accountName - cosmos DB database account name.
    39  // keyspaceName - cosmos DB keyspace name.
    40  // createUpdateCassandraKeyspaceParameters - the parameters to provide for the current Cassandra keyspace.
    41  func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters CassandraKeyspaceCreateUpdateParameters) (result CassandraResourcesCreateUpdateCassandraKeyspaceFuture, err error) {
    42  	if tracing.IsEnabled() {
    43  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.CreateUpdateCassandraKeyspace")
    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: createUpdateCassandraKeyspaceParameters,
    64  			Constraints: []validation.Constraint{{Target: "createUpdateCassandraKeyspaceParameters.CassandraKeyspaceCreateUpdateProperties", Name: validation.Null, Rule: true,
    65  				Chain: []validation.Constraint{{Target: "createUpdateCassandraKeyspaceParameters.CassandraKeyspaceCreateUpdateProperties.Resource", Name: validation.Null, Rule: true,
    66  					Chain: []validation.Constraint{{Target: "createUpdateCassandraKeyspaceParameters.CassandraKeyspaceCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}},
    67  				}}}}}); err != nil {
    68  		return result, validation.NewError("documentdb.CassandraResourcesClient", "CreateUpdateCassandraKeyspace", err.Error())
    69  	}
    70  
    71  	req, err := client.CreateUpdateCassandraKeyspacePreparer(ctx, resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters)
    72  	if err != nil {
    73  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraKeyspace", nil, "Failure preparing request")
    74  		return
    75  	}
    76  
    77  	result, err = client.CreateUpdateCassandraKeyspaceSender(req)
    78  	if err != nil {
    79  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraKeyspace", result.Response(), "Failure sending request")
    80  		return
    81  	}
    82  
    83  	return
    84  }
    85  
    86  // CreateUpdateCassandraKeyspacePreparer prepares the CreateUpdateCassandraKeyspace request.
    87  func (client CassandraResourcesClient) CreateUpdateCassandraKeyspacePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters CassandraKeyspaceCreateUpdateParameters) (*http.Request, error) {
    88  	pathParameters := map[string]interface{}{
    89  		"accountName":       autorest.Encode("path", accountName),
    90  		"keyspaceName":      autorest.Encode("path", keyspaceName),
    91  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
    92  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
    93  	}
    94  
    95  	const APIVersion = "2021-05-15"
    96  	queryParameters := map[string]interface{}{
    97  		"api-version": APIVersion,
    98  	}
    99  
   100  	preparer := autorest.CreatePreparer(
   101  		autorest.AsContentType("application/json; charset=utf-8"),
   102  		autorest.AsPut(),
   103  		autorest.WithBaseURL(client.BaseURI),
   104  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", pathParameters),
   105  		autorest.WithJSON(createUpdateCassandraKeyspaceParameters),
   106  		autorest.WithQueryParameters(queryParameters))
   107  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   108  }
   109  
   110  // CreateUpdateCassandraKeyspaceSender sends the CreateUpdateCassandraKeyspace request. The method will close the
   111  // http.Response Body if it receives an error.
   112  func (client CassandraResourcesClient) CreateUpdateCassandraKeyspaceSender(req *http.Request) (future CassandraResourcesCreateUpdateCassandraKeyspaceFuture, err error) {
   113  	var resp *http.Response
   114  	future.FutureAPI = &azure.Future{}
   115  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   116  	if err != nil {
   117  		return
   118  	}
   119  	var azf azure.Future
   120  	azf, err = azure.NewFutureFromResponse(resp)
   121  	future.FutureAPI = &azf
   122  	future.Result = future.result
   123  	return
   124  }
   125  
   126  // CreateUpdateCassandraKeyspaceResponder handles the response to the CreateUpdateCassandraKeyspace request. The method always
   127  // closes the http.Response Body.
   128  func (client CassandraResourcesClient) CreateUpdateCassandraKeyspaceResponder(resp *http.Response) (result CassandraKeyspaceGetResults, err error) {
   129  	err = autorest.Respond(
   130  		resp,
   131  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   132  		autorest.ByUnmarshallingJSON(&result),
   133  		autorest.ByClosing())
   134  	result.Response = autorest.Response{Response: resp}
   135  	return
   136  }
   137  
   138  // CreateUpdateCassandraTable create or update an Azure Cosmos DB Cassandra Table
   139  // Parameters:
   140  // resourceGroupName - the name of the resource group. The name is case insensitive.
   141  // accountName - cosmos DB database account name.
   142  // keyspaceName - cosmos DB keyspace name.
   143  // tableName - cosmos DB table name.
   144  // createUpdateCassandraTableParameters - the parameters to provide for the current Cassandra Table.
   145  func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters CassandraTableCreateUpdateParameters) (result CassandraResourcesCreateUpdateCassandraTableFuture, err error) {
   146  	if tracing.IsEnabled() {
   147  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.CreateUpdateCassandraTable")
   148  		defer func() {
   149  			sc := -1
   150  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   151  				sc = result.FutureAPI.Response().StatusCode
   152  			}
   153  			tracing.EndSpan(ctx, sc, err)
   154  		}()
   155  	}
   156  	if err := validation.Validate([]validation.Validation{
   157  		{TargetValue: client.SubscriptionID,
   158  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   159  		{TargetValue: resourceGroupName,
   160  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   161  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   162  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   163  		{TargetValue: accountName,
   164  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   165  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   166  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
   167  		{TargetValue: createUpdateCassandraTableParameters,
   168  			Constraints: []validation.Constraint{{Target: "createUpdateCassandraTableParameters.CassandraTableCreateUpdateProperties", Name: validation.Null, Rule: true,
   169  				Chain: []validation.Constraint{{Target: "createUpdateCassandraTableParameters.CassandraTableCreateUpdateProperties.Resource", Name: validation.Null, Rule: true,
   170  					Chain: []validation.Constraint{{Target: "createUpdateCassandraTableParameters.CassandraTableCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}},
   171  				}}}}}); err != nil {
   172  		return result, validation.NewError("documentdb.CassandraResourcesClient", "CreateUpdateCassandraTable", err.Error())
   173  	}
   174  
   175  	req, err := client.CreateUpdateCassandraTablePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters)
   176  	if err != nil {
   177  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraTable", nil, "Failure preparing request")
   178  		return
   179  	}
   180  
   181  	result, err = client.CreateUpdateCassandraTableSender(req)
   182  	if err != nil {
   183  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraTable", result.Response(), "Failure sending request")
   184  		return
   185  	}
   186  
   187  	return
   188  }
   189  
   190  // CreateUpdateCassandraTablePreparer prepares the CreateUpdateCassandraTable request.
   191  func (client CassandraResourcesClient) CreateUpdateCassandraTablePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters CassandraTableCreateUpdateParameters) (*http.Request, error) {
   192  	pathParameters := map[string]interface{}{
   193  		"accountName":       autorest.Encode("path", accountName),
   194  		"keyspaceName":      autorest.Encode("path", keyspaceName),
   195  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   196  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   197  		"tableName":         autorest.Encode("path", tableName),
   198  	}
   199  
   200  	const APIVersion = "2021-05-15"
   201  	queryParameters := map[string]interface{}{
   202  		"api-version": APIVersion,
   203  	}
   204  
   205  	preparer := autorest.CreatePreparer(
   206  		autorest.AsContentType("application/json; charset=utf-8"),
   207  		autorest.AsPut(),
   208  		autorest.WithBaseURL(client.BaseURI),
   209  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", pathParameters),
   210  		autorest.WithJSON(createUpdateCassandraTableParameters),
   211  		autorest.WithQueryParameters(queryParameters))
   212  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   213  }
   214  
   215  // CreateUpdateCassandraTableSender sends the CreateUpdateCassandraTable request. The method will close the
   216  // http.Response Body if it receives an error.
   217  func (client CassandraResourcesClient) CreateUpdateCassandraTableSender(req *http.Request) (future CassandraResourcesCreateUpdateCassandraTableFuture, err error) {
   218  	var resp *http.Response
   219  	future.FutureAPI = &azure.Future{}
   220  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   221  	if err != nil {
   222  		return
   223  	}
   224  	var azf azure.Future
   225  	azf, err = azure.NewFutureFromResponse(resp)
   226  	future.FutureAPI = &azf
   227  	future.Result = future.result
   228  	return
   229  }
   230  
   231  // CreateUpdateCassandraTableResponder handles the response to the CreateUpdateCassandraTable request. The method always
   232  // closes the http.Response Body.
   233  func (client CassandraResourcesClient) CreateUpdateCassandraTableResponder(resp *http.Response) (result CassandraTableGetResults, err error) {
   234  	err = autorest.Respond(
   235  		resp,
   236  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   237  		autorest.ByUnmarshallingJSON(&result),
   238  		autorest.ByClosing())
   239  	result.Response = autorest.Response{Response: resp}
   240  	return
   241  }
   242  
   243  // DeleteCassandraKeyspace deletes an existing Azure Cosmos DB Cassandra keyspace.
   244  // Parameters:
   245  // resourceGroupName - the name of the resource group. The name is case insensitive.
   246  // accountName - cosmos DB database account name.
   247  // keyspaceName - cosmos DB keyspace name.
   248  func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraResourcesDeleteCassandraKeyspaceFuture, err error) {
   249  	if tracing.IsEnabled() {
   250  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.DeleteCassandraKeyspace")
   251  		defer func() {
   252  			sc := -1
   253  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   254  				sc = result.FutureAPI.Response().StatusCode
   255  			}
   256  			tracing.EndSpan(ctx, sc, err)
   257  		}()
   258  	}
   259  	if err := validation.Validate([]validation.Validation{
   260  		{TargetValue: client.SubscriptionID,
   261  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   262  		{TargetValue: resourceGroupName,
   263  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   264  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   265  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   266  		{TargetValue: accountName,
   267  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   268  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   269  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   270  		return result, validation.NewError("documentdb.CassandraResourcesClient", "DeleteCassandraKeyspace", err.Error())
   271  	}
   272  
   273  	req, err := client.DeleteCassandraKeyspacePreparer(ctx, resourceGroupName, accountName, keyspaceName)
   274  	if err != nil {
   275  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraKeyspace", nil, "Failure preparing request")
   276  		return
   277  	}
   278  
   279  	result, err = client.DeleteCassandraKeyspaceSender(req)
   280  	if err != nil {
   281  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraKeyspace", result.Response(), "Failure sending request")
   282  		return
   283  	}
   284  
   285  	return
   286  }
   287  
   288  // DeleteCassandraKeyspacePreparer prepares the DeleteCassandraKeyspace request.
   289  func (client CassandraResourcesClient) DeleteCassandraKeyspacePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) {
   290  	pathParameters := map[string]interface{}{
   291  		"accountName":       autorest.Encode("path", accountName),
   292  		"keyspaceName":      autorest.Encode("path", keyspaceName),
   293  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   294  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   295  	}
   296  
   297  	const APIVersion = "2021-05-15"
   298  	queryParameters := map[string]interface{}{
   299  		"api-version": APIVersion,
   300  	}
   301  
   302  	preparer := autorest.CreatePreparer(
   303  		autorest.AsDelete(),
   304  		autorest.WithBaseURL(client.BaseURI),
   305  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", pathParameters),
   306  		autorest.WithQueryParameters(queryParameters))
   307  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   308  }
   309  
   310  // DeleteCassandraKeyspaceSender sends the DeleteCassandraKeyspace request. The method will close the
   311  // http.Response Body if it receives an error.
   312  func (client CassandraResourcesClient) DeleteCassandraKeyspaceSender(req *http.Request) (future CassandraResourcesDeleteCassandraKeyspaceFuture, err error) {
   313  	var resp *http.Response
   314  	future.FutureAPI = &azure.Future{}
   315  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   316  	if err != nil {
   317  		return
   318  	}
   319  	var azf azure.Future
   320  	azf, err = azure.NewFutureFromResponse(resp)
   321  	future.FutureAPI = &azf
   322  	future.Result = future.result
   323  	return
   324  }
   325  
   326  // DeleteCassandraKeyspaceResponder handles the response to the DeleteCassandraKeyspace request. The method always
   327  // closes the http.Response Body.
   328  func (client CassandraResourcesClient) DeleteCassandraKeyspaceResponder(resp *http.Response) (result autorest.Response, err error) {
   329  	err = autorest.Respond(
   330  		resp,
   331  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   332  		autorest.ByClosing())
   333  	result.Response = resp
   334  	return
   335  }
   336  
   337  // DeleteCassandraTable deletes an existing Azure Cosmos DB Cassandra table.
   338  // Parameters:
   339  // resourceGroupName - the name of the resource group. The name is case insensitive.
   340  // accountName - cosmos DB database account name.
   341  // keyspaceName - cosmos DB keyspace name.
   342  // tableName - cosmos DB table name.
   343  func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraResourcesDeleteCassandraTableFuture, err error) {
   344  	if tracing.IsEnabled() {
   345  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.DeleteCassandraTable")
   346  		defer func() {
   347  			sc := -1
   348  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   349  				sc = result.FutureAPI.Response().StatusCode
   350  			}
   351  			tracing.EndSpan(ctx, sc, err)
   352  		}()
   353  	}
   354  	if err := validation.Validate([]validation.Validation{
   355  		{TargetValue: client.SubscriptionID,
   356  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   357  		{TargetValue: resourceGroupName,
   358  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   359  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   360  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   361  		{TargetValue: accountName,
   362  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   363  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   364  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   365  		return result, validation.NewError("documentdb.CassandraResourcesClient", "DeleteCassandraTable", err.Error())
   366  	}
   367  
   368  	req, err := client.DeleteCassandraTablePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName)
   369  	if err != nil {
   370  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraTable", nil, "Failure preparing request")
   371  		return
   372  	}
   373  
   374  	result, err = client.DeleteCassandraTableSender(req)
   375  	if err != nil {
   376  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraTable", result.Response(), "Failure sending request")
   377  		return
   378  	}
   379  
   380  	return
   381  }
   382  
   383  // DeleteCassandraTablePreparer prepares the DeleteCassandraTable request.
   384  func (client CassandraResourcesClient) DeleteCassandraTablePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) {
   385  	pathParameters := map[string]interface{}{
   386  		"accountName":       autorest.Encode("path", accountName),
   387  		"keyspaceName":      autorest.Encode("path", keyspaceName),
   388  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   389  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   390  		"tableName":         autorest.Encode("path", tableName),
   391  	}
   392  
   393  	const APIVersion = "2021-05-15"
   394  	queryParameters := map[string]interface{}{
   395  		"api-version": APIVersion,
   396  	}
   397  
   398  	preparer := autorest.CreatePreparer(
   399  		autorest.AsDelete(),
   400  		autorest.WithBaseURL(client.BaseURI),
   401  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", pathParameters),
   402  		autorest.WithQueryParameters(queryParameters))
   403  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   404  }
   405  
   406  // DeleteCassandraTableSender sends the DeleteCassandraTable request. The method will close the
   407  // http.Response Body if it receives an error.
   408  func (client CassandraResourcesClient) DeleteCassandraTableSender(req *http.Request) (future CassandraResourcesDeleteCassandraTableFuture, err error) {
   409  	var resp *http.Response
   410  	future.FutureAPI = &azure.Future{}
   411  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   412  	if err != nil {
   413  		return
   414  	}
   415  	var azf azure.Future
   416  	azf, err = azure.NewFutureFromResponse(resp)
   417  	future.FutureAPI = &azf
   418  	future.Result = future.result
   419  	return
   420  }
   421  
   422  // DeleteCassandraTableResponder handles the response to the DeleteCassandraTable request. The method always
   423  // closes the http.Response Body.
   424  func (client CassandraResourcesClient) DeleteCassandraTableResponder(resp *http.Response) (result autorest.Response, err error) {
   425  	err = autorest.Respond(
   426  		resp,
   427  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   428  		autorest.ByClosing())
   429  	result.Response = resp
   430  	return
   431  }
   432  
   433  // GetCassandraKeyspace gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the
   434  // provided name.
   435  // Parameters:
   436  // resourceGroupName - the name of the resource group. The name is case insensitive.
   437  // accountName - cosmos DB database account name.
   438  // keyspaceName - cosmos DB keyspace name.
   439  func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraKeyspaceGetResults, err error) {
   440  	if tracing.IsEnabled() {
   441  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraKeyspace")
   442  		defer func() {
   443  			sc := -1
   444  			if result.Response.Response != nil {
   445  				sc = result.Response.Response.StatusCode
   446  			}
   447  			tracing.EndSpan(ctx, sc, err)
   448  		}()
   449  	}
   450  	if err := validation.Validate([]validation.Validation{
   451  		{TargetValue: client.SubscriptionID,
   452  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   453  		{TargetValue: resourceGroupName,
   454  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   455  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   456  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   457  		{TargetValue: accountName,
   458  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   459  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   460  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   461  		return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraKeyspace", err.Error())
   462  	}
   463  
   464  	req, err := client.GetCassandraKeyspacePreparer(ctx, resourceGroupName, accountName, keyspaceName)
   465  	if err != nil {
   466  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspace", nil, "Failure preparing request")
   467  		return
   468  	}
   469  
   470  	resp, err := client.GetCassandraKeyspaceSender(req)
   471  	if err != nil {
   472  		result.Response = autorest.Response{Response: resp}
   473  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspace", resp, "Failure sending request")
   474  		return
   475  	}
   476  
   477  	result, err = client.GetCassandraKeyspaceResponder(resp)
   478  	if err != nil {
   479  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspace", resp, "Failure responding to request")
   480  		return
   481  	}
   482  
   483  	return
   484  }
   485  
   486  // GetCassandraKeyspacePreparer prepares the GetCassandraKeyspace request.
   487  func (client CassandraResourcesClient) GetCassandraKeyspacePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) {
   488  	pathParameters := map[string]interface{}{
   489  		"accountName":       autorest.Encode("path", accountName),
   490  		"keyspaceName":      autorest.Encode("path", keyspaceName),
   491  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   492  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   493  	}
   494  
   495  	const APIVersion = "2021-05-15"
   496  	queryParameters := map[string]interface{}{
   497  		"api-version": APIVersion,
   498  	}
   499  
   500  	preparer := autorest.CreatePreparer(
   501  		autorest.AsGet(),
   502  		autorest.WithBaseURL(client.BaseURI),
   503  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", pathParameters),
   504  		autorest.WithQueryParameters(queryParameters))
   505  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   506  }
   507  
   508  // GetCassandraKeyspaceSender sends the GetCassandraKeyspace request. The method will close the
   509  // http.Response Body if it receives an error.
   510  func (client CassandraResourcesClient) GetCassandraKeyspaceSender(req *http.Request) (*http.Response, error) {
   511  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   512  }
   513  
   514  // GetCassandraKeyspaceResponder handles the response to the GetCassandraKeyspace request. The method always
   515  // closes the http.Response Body.
   516  func (client CassandraResourcesClient) GetCassandraKeyspaceResponder(resp *http.Response) (result CassandraKeyspaceGetResults, err error) {
   517  	err = autorest.Respond(
   518  		resp,
   519  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   520  		autorest.ByUnmarshallingJSON(&result),
   521  		autorest.ByClosing())
   522  	result.Response = autorest.Response{Response: resp}
   523  	return
   524  }
   525  
   526  // GetCassandraKeyspaceThroughput gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB
   527  // database account with the provided name.
   528  // Parameters:
   529  // resourceGroupName - the name of the resource group. The name is case insensitive.
   530  // accountName - cosmos DB database account name.
   531  // keyspaceName - cosmos DB keyspace name.
   532  func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result ThroughputSettingsGetResults, err error) {
   533  	if tracing.IsEnabled() {
   534  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraKeyspaceThroughput")
   535  		defer func() {
   536  			sc := -1
   537  			if result.Response.Response != nil {
   538  				sc = result.Response.Response.StatusCode
   539  			}
   540  			tracing.EndSpan(ctx, sc, err)
   541  		}()
   542  	}
   543  	if err := validation.Validate([]validation.Validation{
   544  		{TargetValue: client.SubscriptionID,
   545  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   546  		{TargetValue: resourceGroupName,
   547  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   548  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   549  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   550  		{TargetValue: accountName,
   551  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   552  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   553  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   554  		return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", err.Error())
   555  	}
   556  
   557  	req, err := client.GetCassandraKeyspaceThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName)
   558  	if err != nil {
   559  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", nil, "Failure preparing request")
   560  		return
   561  	}
   562  
   563  	resp, err := client.GetCassandraKeyspaceThroughputSender(req)
   564  	if err != nil {
   565  		result.Response = autorest.Response{Response: resp}
   566  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", resp, "Failure sending request")
   567  		return
   568  	}
   569  
   570  	result, err = client.GetCassandraKeyspaceThroughputResponder(resp)
   571  	if err != nil {
   572  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", resp, "Failure responding to request")
   573  		return
   574  	}
   575  
   576  	return
   577  }
   578  
   579  // GetCassandraKeyspaceThroughputPreparer prepares the GetCassandraKeyspaceThroughput request.
   580  func (client CassandraResourcesClient) GetCassandraKeyspaceThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) {
   581  	pathParameters := map[string]interface{}{
   582  		"accountName":       autorest.Encode("path", accountName),
   583  		"keyspaceName":      autorest.Encode("path", keyspaceName),
   584  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   585  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   586  	}
   587  
   588  	const APIVersion = "2021-05-15"
   589  	queryParameters := map[string]interface{}{
   590  		"api-version": APIVersion,
   591  	}
   592  
   593  	preparer := autorest.CreatePreparer(
   594  		autorest.AsGet(),
   595  		autorest.WithBaseURL(client.BaseURI),
   596  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", pathParameters),
   597  		autorest.WithQueryParameters(queryParameters))
   598  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   599  }
   600  
   601  // GetCassandraKeyspaceThroughputSender sends the GetCassandraKeyspaceThroughput request. The method will close the
   602  // http.Response Body if it receives an error.
   603  func (client CassandraResourcesClient) GetCassandraKeyspaceThroughputSender(req *http.Request) (*http.Response, error) {
   604  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   605  }
   606  
   607  // GetCassandraKeyspaceThroughputResponder handles the response to the GetCassandraKeyspaceThroughput request. The method always
   608  // closes the http.Response Body.
   609  func (client CassandraResourcesClient) GetCassandraKeyspaceThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
   610  	err = autorest.Respond(
   611  		resp,
   612  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   613  		autorest.ByUnmarshallingJSON(&result),
   614  		autorest.ByClosing())
   615  	result.Response = autorest.Response{Response: resp}
   616  	return
   617  }
   618  
   619  // GetCassandraTable gets the Cassandra table under an existing Azure Cosmos DB database account.
   620  // Parameters:
   621  // resourceGroupName - the name of the resource group. The name is case insensitive.
   622  // accountName - cosmos DB database account name.
   623  // keyspaceName - cosmos DB keyspace name.
   624  // tableName - cosmos DB table name.
   625  func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraTableGetResults, err error) {
   626  	if tracing.IsEnabled() {
   627  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraTable")
   628  		defer func() {
   629  			sc := -1
   630  			if result.Response.Response != nil {
   631  				sc = result.Response.Response.StatusCode
   632  			}
   633  			tracing.EndSpan(ctx, sc, err)
   634  		}()
   635  	}
   636  	if err := validation.Validate([]validation.Validation{
   637  		{TargetValue: client.SubscriptionID,
   638  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   639  		{TargetValue: resourceGroupName,
   640  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   641  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   642  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   643  		{TargetValue: accountName,
   644  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   645  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   646  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   647  		return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraTable", err.Error())
   648  	}
   649  
   650  	req, err := client.GetCassandraTablePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName)
   651  	if err != nil {
   652  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTable", nil, "Failure preparing request")
   653  		return
   654  	}
   655  
   656  	resp, err := client.GetCassandraTableSender(req)
   657  	if err != nil {
   658  		result.Response = autorest.Response{Response: resp}
   659  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTable", resp, "Failure sending request")
   660  		return
   661  	}
   662  
   663  	result, err = client.GetCassandraTableResponder(resp)
   664  	if err != nil {
   665  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTable", resp, "Failure responding to request")
   666  		return
   667  	}
   668  
   669  	return
   670  }
   671  
   672  // GetCassandraTablePreparer prepares the GetCassandraTable request.
   673  func (client CassandraResourcesClient) GetCassandraTablePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) {
   674  	pathParameters := map[string]interface{}{
   675  		"accountName":       autorest.Encode("path", accountName),
   676  		"keyspaceName":      autorest.Encode("path", keyspaceName),
   677  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   678  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   679  		"tableName":         autorest.Encode("path", tableName),
   680  	}
   681  
   682  	const APIVersion = "2021-05-15"
   683  	queryParameters := map[string]interface{}{
   684  		"api-version": APIVersion,
   685  	}
   686  
   687  	preparer := autorest.CreatePreparer(
   688  		autorest.AsGet(),
   689  		autorest.WithBaseURL(client.BaseURI),
   690  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", pathParameters),
   691  		autorest.WithQueryParameters(queryParameters))
   692  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   693  }
   694  
   695  // GetCassandraTableSender sends the GetCassandraTable request. The method will close the
   696  // http.Response Body if it receives an error.
   697  func (client CassandraResourcesClient) GetCassandraTableSender(req *http.Request) (*http.Response, error) {
   698  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   699  }
   700  
   701  // GetCassandraTableResponder handles the response to the GetCassandraTable request. The method always
   702  // closes the http.Response Body.
   703  func (client CassandraResourcesClient) GetCassandraTableResponder(resp *http.Response) (result CassandraTableGetResults, err error) {
   704  	err = autorest.Respond(
   705  		resp,
   706  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   707  		autorest.ByUnmarshallingJSON(&result),
   708  		autorest.ByClosing())
   709  	result.Response = autorest.Response{Response: resp}
   710  	return
   711  }
   712  
   713  // GetCassandraTableThroughput gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB
   714  // database account with the provided name.
   715  // Parameters:
   716  // resourceGroupName - the name of the resource group. The name is case insensitive.
   717  // accountName - cosmos DB database account name.
   718  // keyspaceName - cosmos DB keyspace name.
   719  // tableName - cosmos DB table name.
   720  func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result ThroughputSettingsGetResults, err error) {
   721  	if tracing.IsEnabled() {
   722  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraTableThroughput")
   723  		defer func() {
   724  			sc := -1
   725  			if result.Response.Response != nil {
   726  				sc = result.Response.Response.StatusCode
   727  			}
   728  			tracing.EndSpan(ctx, sc, err)
   729  		}()
   730  	}
   731  	if err := validation.Validate([]validation.Validation{
   732  		{TargetValue: client.SubscriptionID,
   733  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   734  		{TargetValue: resourceGroupName,
   735  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   736  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   737  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   738  		{TargetValue: accountName,
   739  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   740  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   741  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   742  		return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", err.Error())
   743  	}
   744  
   745  	req, err := client.GetCassandraTableThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName)
   746  	if err != nil {
   747  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", nil, "Failure preparing request")
   748  		return
   749  	}
   750  
   751  	resp, err := client.GetCassandraTableThroughputSender(req)
   752  	if err != nil {
   753  		result.Response = autorest.Response{Response: resp}
   754  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", resp, "Failure sending request")
   755  		return
   756  	}
   757  
   758  	result, err = client.GetCassandraTableThroughputResponder(resp)
   759  	if err != nil {
   760  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", resp, "Failure responding to request")
   761  		return
   762  	}
   763  
   764  	return
   765  }
   766  
   767  // GetCassandraTableThroughputPreparer prepares the GetCassandraTableThroughput request.
   768  func (client CassandraResourcesClient) GetCassandraTableThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) {
   769  	pathParameters := map[string]interface{}{
   770  		"accountName":       autorest.Encode("path", accountName),
   771  		"keyspaceName":      autorest.Encode("path", keyspaceName),
   772  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   773  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   774  		"tableName":         autorest.Encode("path", tableName),
   775  	}
   776  
   777  	const APIVersion = "2021-05-15"
   778  	queryParameters := map[string]interface{}{
   779  		"api-version": APIVersion,
   780  	}
   781  
   782  	preparer := autorest.CreatePreparer(
   783  		autorest.AsGet(),
   784  		autorest.WithBaseURL(client.BaseURI),
   785  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default", pathParameters),
   786  		autorest.WithQueryParameters(queryParameters))
   787  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   788  }
   789  
   790  // GetCassandraTableThroughputSender sends the GetCassandraTableThroughput request. The method will close the
   791  // http.Response Body if it receives an error.
   792  func (client CassandraResourcesClient) GetCassandraTableThroughputSender(req *http.Request) (*http.Response, error) {
   793  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   794  }
   795  
   796  // GetCassandraTableThroughputResponder handles the response to the GetCassandraTableThroughput request. The method always
   797  // closes the http.Response Body.
   798  func (client CassandraResourcesClient) GetCassandraTableThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
   799  	err = autorest.Respond(
   800  		resp,
   801  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   802  		autorest.ByUnmarshallingJSON(&result),
   803  		autorest.ByClosing())
   804  	result.Response = autorest.Response{Response: resp}
   805  	return
   806  }
   807  
   808  // ListCassandraKeyspaces lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.
   809  // Parameters:
   810  // resourceGroupName - the name of the resource group. The name is case insensitive.
   811  // accountName - cosmos DB database account name.
   812  func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Context, resourceGroupName string, accountName string) (result CassandraKeyspaceListResult, err error) {
   813  	if tracing.IsEnabled() {
   814  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.ListCassandraKeyspaces")
   815  		defer func() {
   816  			sc := -1
   817  			if result.Response.Response != nil {
   818  				sc = result.Response.Response.StatusCode
   819  			}
   820  			tracing.EndSpan(ctx, sc, err)
   821  		}()
   822  	}
   823  	if err := validation.Validate([]validation.Validation{
   824  		{TargetValue: client.SubscriptionID,
   825  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   826  		{TargetValue: resourceGroupName,
   827  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   828  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   829  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   830  		{TargetValue: accountName,
   831  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   832  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   833  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   834  		return result, validation.NewError("documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", err.Error())
   835  	}
   836  
   837  	req, err := client.ListCassandraKeyspacesPreparer(ctx, resourceGroupName, accountName)
   838  	if err != nil {
   839  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", nil, "Failure preparing request")
   840  		return
   841  	}
   842  
   843  	resp, err := client.ListCassandraKeyspacesSender(req)
   844  	if err != nil {
   845  		result.Response = autorest.Response{Response: resp}
   846  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", resp, "Failure sending request")
   847  		return
   848  	}
   849  
   850  	result, err = client.ListCassandraKeyspacesResponder(resp)
   851  	if err != nil {
   852  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", resp, "Failure responding to request")
   853  		return
   854  	}
   855  
   856  	return
   857  }
   858  
   859  // ListCassandraKeyspacesPreparer prepares the ListCassandraKeyspaces request.
   860  func (client CassandraResourcesClient) ListCassandraKeyspacesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
   861  	pathParameters := map[string]interface{}{
   862  		"accountName":       autorest.Encode("path", accountName),
   863  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   864  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   865  	}
   866  
   867  	const APIVersion = "2021-05-15"
   868  	queryParameters := map[string]interface{}{
   869  		"api-version": APIVersion,
   870  	}
   871  
   872  	preparer := autorest.CreatePreparer(
   873  		autorest.AsGet(),
   874  		autorest.WithBaseURL(client.BaseURI),
   875  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces", pathParameters),
   876  		autorest.WithQueryParameters(queryParameters))
   877  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   878  }
   879  
   880  // ListCassandraKeyspacesSender sends the ListCassandraKeyspaces request. The method will close the
   881  // http.Response Body if it receives an error.
   882  func (client CassandraResourcesClient) ListCassandraKeyspacesSender(req *http.Request) (*http.Response, error) {
   883  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   884  }
   885  
   886  // ListCassandraKeyspacesResponder handles the response to the ListCassandraKeyspaces request. The method always
   887  // closes the http.Response Body.
   888  func (client CassandraResourcesClient) ListCassandraKeyspacesResponder(resp *http.Response) (result CassandraKeyspaceListResult, err error) {
   889  	err = autorest.Respond(
   890  		resp,
   891  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   892  		autorest.ByUnmarshallingJSON(&result),
   893  		autorest.ByClosing())
   894  	result.Response = autorest.Response{Response: resp}
   895  	return
   896  }
   897  
   898  // ListCassandraTables lists the Cassandra table under an existing Azure Cosmos DB database account.
   899  // Parameters:
   900  // resourceGroupName - the name of the resource group. The name is case insensitive.
   901  // accountName - cosmos DB database account name.
   902  // keyspaceName - cosmos DB keyspace name.
   903  func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraTableListResult, err error) {
   904  	if tracing.IsEnabled() {
   905  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.ListCassandraTables")
   906  		defer func() {
   907  			sc := -1
   908  			if result.Response.Response != nil {
   909  				sc = result.Response.Response.StatusCode
   910  			}
   911  			tracing.EndSpan(ctx, sc, err)
   912  		}()
   913  	}
   914  	if err := validation.Validate([]validation.Validation{
   915  		{TargetValue: client.SubscriptionID,
   916  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
   917  		{TargetValue: resourceGroupName,
   918  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   919  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   920  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   921  		{TargetValue: accountName,
   922  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
   923  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
   924  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
   925  		return result, validation.NewError("documentdb.CassandraResourcesClient", "ListCassandraTables", err.Error())
   926  	}
   927  
   928  	req, err := client.ListCassandraTablesPreparer(ctx, resourceGroupName, accountName, keyspaceName)
   929  	if err != nil {
   930  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraTables", nil, "Failure preparing request")
   931  		return
   932  	}
   933  
   934  	resp, err := client.ListCassandraTablesSender(req)
   935  	if err != nil {
   936  		result.Response = autorest.Response{Response: resp}
   937  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraTables", resp, "Failure sending request")
   938  		return
   939  	}
   940  
   941  	result, err = client.ListCassandraTablesResponder(resp)
   942  	if err != nil {
   943  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraTables", resp, "Failure responding to request")
   944  		return
   945  	}
   946  
   947  	return
   948  }
   949  
   950  // ListCassandraTablesPreparer prepares the ListCassandraTables request.
   951  func (client CassandraResourcesClient) ListCassandraTablesPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) {
   952  	pathParameters := map[string]interface{}{
   953  		"accountName":       autorest.Encode("path", accountName),
   954  		"keyspaceName":      autorest.Encode("path", keyspaceName),
   955  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   956  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   957  	}
   958  
   959  	const APIVersion = "2021-05-15"
   960  	queryParameters := map[string]interface{}{
   961  		"api-version": APIVersion,
   962  	}
   963  
   964  	preparer := autorest.CreatePreparer(
   965  		autorest.AsGet(),
   966  		autorest.WithBaseURL(client.BaseURI),
   967  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables", pathParameters),
   968  		autorest.WithQueryParameters(queryParameters))
   969  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   970  }
   971  
   972  // ListCassandraTablesSender sends the ListCassandraTables request. The method will close the
   973  // http.Response Body if it receives an error.
   974  func (client CassandraResourcesClient) ListCassandraTablesSender(req *http.Request) (*http.Response, error) {
   975  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   976  }
   977  
   978  // ListCassandraTablesResponder handles the response to the ListCassandraTables request. The method always
   979  // closes the http.Response Body.
   980  func (client CassandraResourcesClient) ListCassandraTablesResponder(resp *http.Response) (result CassandraTableListResult, err error) {
   981  	err = autorest.Respond(
   982  		resp,
   983  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   984  		autorest.ByUnmarshallingJSON(&result),
   985  		autorest.ByClosing())
   986  	result.Response = autorest.Response{Response: resp}
   987  	return
   988  }
   989  
   990  // MigrateCassandraKeyspaceToAutoscale migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to
   991  // autoscale
   992  // Parameters:
   993  // resourceGroupName - the name of the resource group. The name is case insensitive.
   994  // accountName - cosmos DB database account name.
   995  // keyspaceName - cosmos DB keyspace name.
   996  func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture, err error) {
   997  	if tracing.IsEnabled() {
   998  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraKeyspaceToAutoscale")
   999  		defer func() {
  1000  			sc := -1
  1001  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  1002  				sc = result.FutureAPI.Response().StatusCode
  1003  			}
  1004  			tracing.EndSpan(ctx, sc, err)
  1005  		}()
  1006  	}
  1007  	if err := validation.Validate([]validation.Validation{
  1008  		{TargetValue: client.SubscriptionID,
  1009  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1010  		{TargetValue: resourceGroupName,
  1011  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1012  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1013  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1014  		{TargetValue: accountName,
  1015  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1016  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1017  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1018  		return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToAutoscale", err.Error())
  1019  	}
  1020  
  1021  	req, err := client.MigrateCassandraKeyspaceToAutoscalePreparer(ctx, resourceGroupName, accountName, keyspaceName)
  1022  	if err != nil {
  1023  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToAutoscale", nil, "Failure preparing request")
  1024  		return
  1025  	}
  1026  
  1027  	result, err = client.MigrateCassandraKeyspaceToAutoscaleSender(req)
  1028  	if err != nil {
  1029  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToAutoscale", result.Response(), "Failure sending request")
  1030  		return
  1031  	}
  1032  
  1033  	return
  1034  }
  1035  
  1036  // MigrateCassandraKeyspaceToAutoscalePreparer prepares the MigrateCassandraKeyspaceToAutoscale request.
  1037  func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) {
  1038  	pathParameters := map[string]interface{}{
  1039  		"accountName":       autorest.Encode("path", accountName),
  1040  		"keyspaceName":      autorest.Encode("path", keyspaceName),
  1041  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1042  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1043  	}
  1044  
  1045  	const APIVersion = "2021-05-15"
  1046  	queryParameters := map[string]interface{}{
  1047  		"api-version": APIVersion,
  1048  	}
  1049  
  1050  	preparer := autorest.CreatePreparer(
  1051  		autorest.AsPost(),
  1052  		autorest.WithBaseURL(client.BaseURI),
  1053  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale", pathParameters),
  1054  		autorest.WithQueryParameters(queryParameters))
  1055  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1056  }
  1057  
  1058  // MigrateCassandraKeyspaceToAutoscaleSender sends the MigrateCassandraKeyspaceToAutoscale request. The method will close the
  1059  // http.Response Body if it receives an error.
  1060  func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscaleSender(req *http.Request) (future CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture, err error) {
  1061  	var resp *http.Response
  1062  	future.FutureAPI = &azure.Future{}
  1063  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1064  	if err != nil {
  1065  		return
  1066  	}
  1067  	var azf azure.Future
  1068  	azf, err = azure.NewFutureFromResponse(resp)
  1069  	future.FutureAPI = &azf
  1070  	future.Result = future.result
  1071  	return
  1072  }
  1073  
  1074  // MigrateCassandraKeyspaceToAutoscaleResponder handles the response to the MigrateCassandraKeyspaceToAutoscale request. The method always
  1075  // closes the http.Response Body.
  1076  func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  1077  	err = autorest.Respond(
  1078  		resp,
  1079  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  1080  		autorest.ByUnmarshallingJSON(&result),
  1081  		autorest.ByClosing())
  1082  	result.Response = autorest.Response{Response: resp}
  1083  	return
  1084  }
  1085  
  1086  // MigrateCassandraKeyspaceToManualThroughput migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual
  1087  // throughput
  1088  // Parameters:
  1089  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1090  // accountName - cosmos DB database account name.
  1091  // keyspaceName - cosmos DB keyspace name.
  1092  func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture, err error) {
  1093  	if tracing.IsEnabled() {
  1094  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraKeyspaceToManualThroughput")
  1095  		defer func() {
  1096  			sc := -1
  1097  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  1098  				sc = result.FutureAPI.Response().StatusCode
  1099  			}
  1100  			tracing.EndSpan(ctx, sc, err)
  1101  		}()
  1102  	}
  1103  	if err := validation.Validate([]validation.Validation{
  1104  		{TargetValue: client.SubscriptionID,
  1105  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1106  		{TargetValue: resourceGroupName,
  1107  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1108  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1109  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1110  		{TargetValue: accountName,
  1111  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1112  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1113  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1114  		return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToManualThroughput", err.Error())
  1115  	}
  1116  
  1117  	req, err := client.MigrateCassandraKeyspaceToManualThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName)
  1118  	if err != nil {
  1119  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToManualThroughput", nil, "Failure preparing request")
  1120  		return
  1121  	}
  1122  
  1123  	result, err = client.MigrateCassandraKeyspaceToManualThroughputSender(req)
  1124  	if err != nil {
  1125  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToManualThroughput", result.Response(), "Failure sending request")
  1126  		return
  1127  	}
  1128  
  1129  	return
  1130  }
  1131  
  1132  // MigrateCassandraKeyspaceToManualThroughputPreparer prepares the MigrateCassandraKeyspaceToManualThroughput request.
  1133  func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) {
  1134  	pathParameters := map[string]interface{}{
  1135  		"accountName":       autorest.Encode("path", accountName),
  1136  		"keyspaceName":      autorest.Encode("path", keyspaceName),
  1137  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1138  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1139  	}
  1140  
  1141  	const APIVersion = "2021-05-15"
  1142  	queryParameters := map[string]interface{}{
  1143  		"api-version": APIVersion,
  1144  	}
  1145  
  1146  	preparer := autorest.CreatePreparer(
  1147  		autorest.AsPost(),
  1148  		autorest.WithBaseURL(client.BaseURI),
  1149  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput", pathParameters),
  1150  		autorest.WithQueryParameters(queryParameters))
  1151  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1152  }
  1153  
  1154  // MigrateCassandraKeyspaceToManualThroughputSender sends the MigrateCassandraKeyspaceToManualThroughput request. The method will close the
  1155  // http.Response Body if it receives an error.
  1156  func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughputSender(req *http.Request) (future CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture, err error) {
  1157  	var resp *http.Response
  1158  	future.FutureAPI = &azure.Future{}
  1159  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1160  	if err != nil {
  1161  		return
  1162  	}
  1163  	var azf azure.Future
  1164  	azf, err = azure.NewFutureFromResponse(resp)
  1165  	future.FutureAPI = &azf
  1166  	future.Result = future.result
  1167  	return
  1168  }
  1169  
  1170  // MigrateCassandraKeyspaceToManualThroughputResponder handles the response to the MigrateCassandraKeyspaceToManualThroughput request. The method always
  1171  // closes the http.Response Body.
  1172  func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  1173  	err = autorest.Respond(
  1174  		resp,
  1175  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  1176  		autorest.ByUnmarshallingJSON(&result),
  1177  		autorest.ByClosing())
  1178  	result.Response = autorest.Response{Response: resp}
  1179  	return
  1180  }
  1181  
  1182  // MigrateCassandraTableToAutoscale migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale
  1183  // Parameters:
  1184  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1185  // accountName - cosmos DB database account name.
  1186  // keyspaceName - cosmos DB keyspace name.
  1187  // tableName - cosmos DB table name.
  1188  func (client CassandraResourcesClient) MigrateCassandraTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraResourcesMigrateCassandraTableToAutoscaleFuture, err error) {
  1189  	if tracing.IsEnabled() {
  1190  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraTableToAutoscale")
  1191  		defer func() {
  1192  			sc := -1
  1193  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  1194  				sc = result.FutureAPI.Response().StatusCode
  1195  			}
  1196  			tracing.EndSpan(ctx, sc, err)
  1197  		}()
  1198  	}
  1199  	if err := validation.Validate([]validation.Validation{
  1200  		{TargetValue: client.SubscriptionID,
  1201  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1202  		{TargetValue: resourceGroupName,
  1203  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1204  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1205  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1206  		{TargetValue: accountName,
  1207  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1208  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1209  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1210  		return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraTableToAutoscale", err.Error())
  1211  	}
  1212  
  1213  	req, err := client.MigrateCassandraTableToAutoscalePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName)
  1214  	if err != nil {
  1215  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToAutoscale", nil, "Failure preparing request")
  1216  		return
  1217  	}
  1218  
  1219  	result, err = client.MigrateCassandraTableToAutoscaleSender(req)
  1220  	if err != nil {
  1221  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToAutoscale", result.Response(), "Failure sending request")
  1222  		return
  1223  	}
  1224  
  1225  	return
  1226  }
  1227  
  1228  // MigrateCassandraTableToAutoscalePreparer prepares the MigrateCassandraTableToAutoscale request.
  1229  func (client CassandraResourcesClient) MigrateCassandraTableToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) {
  1230  	pathParameters := map[string]interface{}{
  1231  		"accountName":       autorest.Encode("path", accountName),
  1232  		"keyspaceName":      autorest.Encode("path", keyspaceName),
  1233  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1234  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1235  		"tableName":         autorest.Encode("path", tableName),
  1236  	}
  1237  
  1238  	const APIVersion = "2021-05-15"
  1239  	queryParameters := map[string]interface{}{
  1240  		"api-version": APIVersion,
  1241  	}
  1242  
  1243  	preparer := autorest.CreatePreparer(
  1244  		autorest.AsPost(),
  1245  		autorest.WithBaseURL(client.BaseURI),
  1246  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale", pathParameters),
  1247  		autorest.WithQueryParameters(queryParameters))
  1248  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1249  }
  1250  
  1251  // MigrateCassandraTableToAutoscaleSender sends the MigrateCassandraTableToAutoscale request. The method will close the
  1252  // http.Response Body if it receives an error.
  1253  func (client CassandraResourcesClient) MigrateCassandraTableToAutoscaleSender(req *http.Request) (future CassandraResourcesMigrateCassandraTableToAutoscaleFuture, err error) {
  1254  	var resp *http.Response
  1255  	future.FutureAPI = &azure.Future{}
  1256  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1257  	if err != nil {
  1258  		return
  1259  	}
  1260  	var azf azure.Future
  1261  	azf, err = azure.NewFutureFromResponse(resp)
  1262  	future.FutureAPI = &azf
  1263  	future.Result = future.result
  1264  	return
  1265  }
  1266  
  1267  // MigrateCassandraTableToAutoscaleResponder handles the response to the MigrateCassandraTableToAutoscale request. The method always
  1268  // closes the http.Response Body.
  1269  func (client CassandraResourcesClient) MigrateCassandraTableToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  1270  	err = autorest.Respond(
  1271  		resp,
  1272  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  1273  		autorest.ByUnmarshallingJSON(&result),
  1274  		autorest.ByClosing())
  1275  	result.Response = autorest.Response{Response: resp}
  1276  	return
  1277  }
  1278  
  1279  // MigrateCassandraTableToManualThroughput migrate an Azure Cosmos DB Cassandra table from autoscale to manual
  1280  // throughput
  1281  // Parameters:
  1282  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1283  // accountName - cosmos DB database account name.
  1284  // keyspaceName - cosmos DB keyspace name.
  1285  // tableName - cosmos DB table name.
  1286  func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraResourcesMigrateCassandraTableToManualThroughputFuture, err error) {
  1287  	if tracing.IsEnabled() {
  1288  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraTableToManualThroughput")
  1289  		defer func() {
  1290  			sc := -1
  1291  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  1292  				sc = result.FutureAPI.Response().StatusCode
  1293  			}
  1294  			tracing.EndSpan(ctx, sc, err)
  1295  		}()
  1296  	}
  1297  	if err := validation.Validate([]validation.Validation{
  1298  		{TargetValue: client.SubscriptionID,
  1299  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1300  		{TargetValue: resourceGroupName,
  1301  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1302  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1303  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1304  		{TargetValue: accountName,
  1305  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1306  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1307  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil {
  1308  		return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraTableToManualThroughput", err.Error())
  1309  	}
  1310  
  1311  	req, err := client.MigrateCassandraTableToManualThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName)
  1312  	if err != nil {
  1313  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToManualThroughput", nil, "Failure preparing request")
  1314  		return
  1315  	}
  1316  
  1317  	result, err = client.MigrateCassandraTableToManualThroughputSender(req)
  1318  	if err != nil {
  1319  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToManualThroughput", result.Response(), "Failure sending request")
  1320  		return
  1321  	}
  1322  
  1323  	return
  1324  }
  1325  
  1326  // MigrateCassandraTableToManualThroughputPreparer prepares the MigrateCassandraTableToManualThroughput request.
  1327  func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) {
  1328  	pathParameters := map[string]interface{}{
  1329  		"accountName":       autorest.Encode("path", accountName),
  1330  		"keyspaceName":      autorest.Encode("path", keyspaceName),
  1331  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1332  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1333  		"tableName":         autorest.Encode("path", tableName),
  1334  	}
  1335  
  1336  	const APIVersion = "2021-05-15"
  1337  	queryParameters := map[string]interface{}{
  1338  		"api-version": APIVersion,
  1339  	}
  1340  
  1341  	preparer := autorest.CreatePreparer(
  1342  		autorest.AsPost(),
  1343  		autorest.WithBaseURL(client.BaseURI),
  1344  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput", pathParameters),
  1345  		autorest.WithQueryParameters(queryParameters))
  1346  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1347  }
  1348  
  1349  // MigrateCassandraTableToManualThroughputSender sends the MigrateCassandraTableToManualThroughput request. The method will close the
  1350  // http.Response Body if it receives an error.
  1351  func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughputSender(req *http.Request) (future CassandraResourcesMigrateCassandraTableToManualThroughputFuture, err error) {
  1352  	var resp *http.Response
  1353  	future.FutureAPI = &azure.Future{}
  1354  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1355  	if err != nil {
  1356  		return
  1357  	}
  1358  	var azf azure.Future
  1359  	azf, err = azure.NewFutureFromResponse(resp)
  1360  	future.FutureAPI = &azf
  1361  	future.Result = future.result
  1362  	return
  1363  }
  1364  
  1365  // MigrateCassandraTableToManualThroughputResponder handles the response to the MigrateCassandraTableToManualThroughput request. The method always
  1366  // closes the http.Response Body.
  1367  func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  1368  	err = autorest.Respond(
  1369  		resp,
  1370  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  1371  		autorest.ByUnmarshallingJSON(&result),
  1372  		autorest.ByClosing())
  1373  	result.Response = autorest.Response{Response: resp}
  1374  	return
  1375  }
  1376  
  1377  // UpdateCassandraKeyspaceThroughput update RUs per second of an Azure Cosmos DB Cassandra Keyspace
  1378  // Parameters:
  1379  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1380  // accountName - cosmos DB database account name.
  1381  // keyspaceName - cosmos DB keyspace name.
  1382  // updateThroughputParameters - the RUs per second of the parameters to provide for the current Cassandra
  1383  // Keyspace.
  1384  func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result CassandraResourcesUpdateCassandraKeyspaceThroughputFuture, err error) {
  1385  	if tracing.IsEnabled() {
  1386  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.UpdateCassandraKeyspaceThroughput")
  1387  		defer func() {
  1388  			sc := -1
  1389  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  1390  				sc = result.FutureAPI.Response().StatusCode
  1391  			}
  1392  			tracing.EndSpan(ctx, sc, err)
  1393  		}()
  1394  	}
  1395  	if err := validation.Validate([]validation.Validation{
  1396  		{TargetValue: client.SubscriptionID,
  1397  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1398  		{TargetValue: resourceGroupName,
  1399  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1400  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1401  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1402  		{TargetValue: accountName,
  1403  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1404  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1405  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
  1406  		{TargetValue: updateThroughputParameters,
  1407  			Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true,
  1408  				Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true,
  1409  					Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false,
  1410  						Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}},
  1411  					}},
  1412  				}}}}}); err != nil {
  1413  		return result, validation.NewError("documentdb.CassandraResourcesClient", "UpdateCassandraKeyspaceThroughput", err.Error())
  1414  	}
  1415  
  1416  	req, err := client.UpdateCassandraKeyspaceThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, updateThroughputParameters)
  1417  	if err != nil {
  1418  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraKeyspaceThroughput", nil, "Failure preparing request")
  1419  		return
  1420  	}
  1421  
  1422  	result, err = client.UpdateCassandraKeyspaceThroughputSender(req)
  1423  	if err != nil {
  1424  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraKeyspaceThroughput", result.Response(), "Failure sending request")
  1425  		return
  1426  	}
  1427  
  1428  	return
  1429  }
  1430  
  1431  // UpdateCassandraKeyspaceThroughputPreparer prepares the UpdateCassandraKeyspaceThroughput request.
  1432  func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) {
  1433  	pathParameters := map[string]interface{}{
  1434  		"accountName":       autorest.Encode("path", accountName),
  1435  		"keyspaceName":      autorest.Encode("path", keyspaceName),
  1436  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1437  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1438  	}
  1439  
  1440  	const APIVersion = "2021-05-15"
  1441  	queryParameters := map[string]interface{}{
  1442  		"api-version": APIVersion,
  1443  	}
  1444  
  1445  	preparer := autorest.CreatePreparer(
  1446  		autorest.AsContentType("application/json; charset=utf-8"),
  1447  		autorest.AsPut(),
  1448  		autorest.WithBaseURL(client.BaseURI),
  1449  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", pathParameters),
  1450  		autorest.WithJSON(updateThroughputParameters),
  1451  		autorest.WithQueryParameters(queryParameters))
  1452  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1453  }
  1454  
  1455  // UpdateCassandraKeyspaceThroughputSender sends the UpdateCassandraKeyspaceThroughput request. The method will close the
  1456  // http.Response Body if it receives an error.
  1457  func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughputSender(req *http.Request) (future CassandraResourcesUpdateCassandraKeyspaceThroughputFuture, err error) {
  1458  	var resp *http.Response
  1459  	future.FutureAPI = &azure.Future{}
  1460  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1461  	if err != nil {
  1462  		return
  1463  	}
  1464  	var azf azure.Future
  1465  	azf, err = azure.NewFutureFromResponse(resp)
  1466  	future.FutureAPI = &azf
  1467  	future.Result = future.result
  1468  	return
  1469  }
  1470  
  1471  // UpdateCassandraKeyspaceThroughputResponder handles the response to the UpdateCassandraKeyspaceThroughput request. The method always
  1472  // closes the http.Response Body.
  1473  func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  1474  	err = autorest.Respond(
  1475  		resp,
  1476  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  1477  		autorest.ByUnmarshallingJSON(&result),
  1478  		autorest.ByClosing())
  1479  	result.Response = autorest.Response{Response: resp}
  1480  	return
  1481  }
  1482  
  1483  // UpdateCassandraTableThroughput update RUs per second of an Azure Cosmos DB Cassandra table
  1484  // Parameters:
  1485  // resourceGroupName - the name of the resource group. The name is case insensitive.
  1486  // accountName - cosmos DB database account name.
  1487  // keyspaceName - cosmos DB keyspace name.
  1488  // tableName - cosmos DB table name.
  1489  // updateThroughputParameters - the RUs per second of the parameters to provide for the current Cassandra
  1490  // table.
  1491  func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result CassandraResourcesUpdateCassandraTableThroughputFuture, err error) {
  1492  	if tracing.IsEnabled() {
  1493  		ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.UpdateCassandraTableThroughput")
  1494  		defer func() {
  1495  			sc := -1
  1496  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  1497  				sc = result.FutureAPI.Response().StatusCode
  1498  			}
  1499  			tracing.EndSpan(ctx, sc, err)
  1500  		}()
  1501  	}
  1502  	if err := validation.Validate([]validation.Validation{
  1503  		{TargetValue: client.SubscriptionID,
  1504  			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
  1505  		{TargetValue: resourceGroupName,
  1506  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1507  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1508  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
  1509  		{TargetValue: accountName,
  1510  			Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
  1511  				{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
  1512  				{Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}},
  1513  		{TargetValue: updateThroughputParameters,
  1514  			Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true,
  1515  				Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true,
  1516  					Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false,
  1517  						Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}},
  1518  					}},
  1519  				}}}}}); err != nil {
  1520  		return result, validation.NewError("documentdb.CassandraResourcesClient", "UpdateCassandraTableThroughput", err.Error())
  1521  	}
  1522  
  1523  	req, err := client.UpdateCassandraTableThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters)
  1524  	if err != nil {
  1525  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraTableThroughput", nil, "Failure preparing request")
  1526  		return
  1527  	}
  1528  
  1529  	result, err = client.UpdateCassandraTableThroughputSender(req)
  1530  	if err != nil {
  1531  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraTableThroughput", result.Response(), "Failure sending request")
  1532  		return
  1533  	}
  1534  
  1535  	return
  1536  }
  1537  
  1538  // UpdateCassandraTableThroughputPreparer prepares the UpdateCassandraTableThroughput request.
  1539  func (client CassandraResourcesClient) UpdateCassandraTableThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) {
  1540  	pathParameters := map[string]interface{}{
  1541  		"accountName":       autorest.Encode("path", accountName),
  1542  		"keyspaceName":      autorest.Encode("path", keyspaceName),
  1543  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1544  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1545  		"tableName":         autorest.Encode("path", tableName),
  1546  	}
  1547  
  1548  	const APIVersion = "2021-05-15"
  1549  	queryParameters := map[string]interface{}{
  1550  		"api-version": APIVersion,
  1551  	}
  1552  
  1553  	preparer := autorest.CreatePreparer(
  1554  		autorest.AsContentType("application/json; charset=utf-8"),
  1555  		autorest.AsPut(),
  1556  		autorest.WithBaseURL(client.BaseURI),
  1557  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default", pathParameters),
  1558  		autorest.WithJSON(updateThroughputParameters),
  1559  		autorest.WithQueryParameters(queryParameters))
  1560  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1561  }
  1562  
  1563  // UpdateCassandraTableThroughputSender sends the UpdateCassandraTableThroughput request. The method will close the
  1564  // http.Response Body if it receives an error.
  1565  func (client CassandraResourcesClient) UpdateCassandraTableThroughputSender(req *http.Request) (future CassandraResourcesUpdateCassandraTableThroughputFuture, err error) {
  1566  	var resp *http.Response
  1567  	future.FutureAPI = &azure.Future{}
  1568  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1569  	if err != nil {
  1570  		return
  1571  	}
  1572  	var azf azure.Future
  1573  	azf, err = azure.NewFutureFromResponse(resp)
  1574  	future.FutureAPI = &azf
  1575  	future.Result = future.result
  1576  	return
  1577  }
  1578  
  1579  // UpdateCassandraTableThroughputResponder handles the response to the UpdateCassandraTableThroughput request. The method always
  1580  // closes the http.Response Body.
  1581  func (client CassandraResourcesClient) UpdateCassandraTableThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) {
  1582  	err = autorest.Respond(
  1583  		resp,
  1584  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  1585  		autorest.ByUnmarshallingJSON(&result),
  1586  		autorest.ByClosing())
  1587  	result.Response = autorest.Response{Response: resp}
  1588  	return
  1589  }
  1590  

View as plain text