...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/mgmt/2015-10-01-preview/account/account.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/mgmt/2015-10-01-preview/account

     1  package account
     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  // Client is the creates an Azure Data Lake Analytics account management client.
    19  type Client struct {
    20  	BaseClient
    21  }
    22  
    23  // NewClient creates an instance of the Client client.
    24  func NewClient(subscriptionID string) Client {
    25  	return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
    26  }
    27  
    28  // NewClientWithBaseURI creates an instance of the Client client using a custom endpoint.  Use this when interacting
    29  // with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
    30  func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
    31  	return Client{NewWithBaseURI(baseURI, subscriptionID)}
    32  }
    33  
    34  // AddDataLakeStoreAccount updates the specified Data Lake Analytics account to include the additional Data Lake Store
    35  // account.
    36  // Parameters:
    37  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
    38  // accountName - the name of the Data Lake Analytics account to which to add the Data Lake Store account.
    39  // dataLakeStoreAccountName - the name of the Data Lake Store account to add.
    40  // parameters - the details of the Data Lake Store account.
    41  func (client Client) AddDataLakeStoreAccount(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string, parameters AddDataLakeStoreParameters) (result autorest.Response, err error) {
    42  	if tracing.IsEnabled() {
    43  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.AddDataLakeStoreAccount")
    44  		defer func() {
    45  			sc := -1
    46  			if result.Response != nil {
    47  				sc = result.Response.StatusCode
    48  			}
    49  			tracing.EndSpan(ctx, sc, err)
    50  		}()
    51  	}
    52  	if err := validation.Validate([]validation.Validation{
    53  		{TargetValue: parameters,
    54  			Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
    55  		return result, validation.NewError("account.Client", "AddDataLakeStoreAccount", err.Error())
    56  	}
    57  
    58  	req, err := client.AddDataLakeStoreAccountPreparer(ctx, resourceGroupName, accountName, dataLakeStoreAccountName, parameters)
    59  	if err != nil {
    60  		err = autorest.NewErrorWithError(err, "account.Client", "AddDataLakeStoreAccount", nil, "Failure preparing request")
    61  		return
    62  	}
    63  
    64  	resp, err := client.AddDataLakeStoreAccountSender(req)
    65  	if err != nil {
    66  		result.Response = resp
    67  		err = autorest.NewErrorWithError(err, "account.Client", "AddDataLakeStoreAccount", resp, "Failure sending request")
    68  		return
    69  	}
    70  
    71  	result, err = client.AddDataLakeStoreAccountResponder(resp)
    72  	if err != nil {
    73  		err = autorest.NewErrorWithError(err, "account.Client", "AddDataLakeStoreAccount", resp, "Failure responding to request")
    74  		return
    75  	}
    76  
    77  	return
    78  }
    79  
    80  // AddDataLakeStoreAccountPreparer prepares the AddDataLakeStoreAccount request.
    81  func (client Client) AddDataLakeStoreAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string, parameters AddDataLakeStoreParameters) (*http.Request, error) {
    82  	pathParameters := map[string]interface{}{
    83  		"accountName":              autorest.Encode("path", accountName),
    84  		"dataLakeStoreAccountName": autorest.Encode("path", dataLakeStoreAccountName),
    85  		"resourceGroupName":        autorest.Encode("path", resourceGroupName),
    86  		"subscriptionId":           autorest.Encode("path", client.SubscriptionID),
    87  	}
    88  
    89  	const APIVersion = "2015-10-01-preview"
    90  	queryParameters := map[string]interface{}{
    91  		"api-version": APIVersion,
    92  	}
    93  
    94  	preparer := autorest.CreatePreparer(
    95  		autorest.AsContentType("application/json; charset=utf-8"),
    96  		autorest.AsPut(),
    97  		autorest.WithBaseURL(client.BaseURI),
    98  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}", pathParameters),
    99  		autorest.WithJSON(parameters),
   100  		autorest.WithQueryParameters(queryParameters))
   101  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   102  }
   103  
   104  // AddDataLakeStoreAccountSender sends the AddDataLakeStoreAccount request. The method will close the
   105  // http.Response Body if it receives an error.
   106  func (client Client) AddDataLakeStoreAccountSender(req *http.Request) (*http.Response, error) {
   107  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   108  }
   109  
   110  // AddDataLakeStoreAccountResponder handles the response to the AddDataLakeStoreAccount request. The method always
   111  // closes the http.Response Body.
   112  func (client Client) AddDataLakeStoreAccountResponder(resp *http.Response) (result autorest.Response, err error) {
   113  	err = autorest.Respond(
   114  		resp,
   115  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   116  		autorest.ByClosing())
   117  	result.Response = resp
   118  	return
   119  }
   120  
   121  // AddStorageAccount updates the specified Data Lake Analytics account to add an Azure Storage account.
   122  // Parameters:
   123  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
   124  // accountName - the name of the Data Lake Analytics account to which to add the Azure Storage account.
   125  // storageAccountName - the name of the Azure Storage account to add
   126  // parameters - the parameters containing the access key and optional suffix for the Azure Storage Account.
   127  func (client Client) AddStorageAccount(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, parameters AddStorageAccountParameters) (result autorest.Response, err error) {
   128  	if tracing.IsEnabled() {
   129  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.AddStorageAccount")
   130  		defer func() {
   131  			sc := -1
   132  			if result.Response != nil {
   133  				sc = result.Response.StatusCode
   134  			}
   135  			tracing.EndSpan(ctx, sc, err)
   136  		}()
   137  	}
   138  	if err := validation.Validate([]validation.Validation{
   139  		{TargetValue: parameters,
   140  			Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true,
   141  				Chain: []validation.Constraint{{Target: "parameters.Properties.AccessKey", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
   142  		return result, validation.NewError("account.Client", "AddStorageAccount", err.Error())
   143  	}
   144  
   145  	req, err := client.AddStorageAccountPreparer(ctx, resourceGroupName, accountName, storageAccountName, parameters)
   146  	if err != nil {
   147  		err = autorest.NewErrorWithError(err, "account.Client", "AddStorageAccount", nil, "Failure preparing request")
   148  		return
   149  	}
   150  
   151  	resp, err := client.AddStorageAccountSender(req)
   152  	if err != nil {
   153  		result.Response = resp
   154  		err = autorest.NewErrorWithError(err, "account.Client", "AddStorageAccount", resp, "Failure sending request")
   155  		return
   156  	}
   157  
   158  	result, err = client.AddStorageAccountResponder(resp)
   159  	if err != nil {
   160  		err = autorest.NewErrorWithError(err, "account.Client", "AddStorageAccount", resp, "Failure responding to request")
   161  		return
   162  	}
   163  
   164  	return
   165  }
   166  
   167  // AddStorageAccountPreparer prepares the AddStorageAccount request.
   168  func (client Client) AddStorageAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, parameters AddStorageAccountParameters) (*http.Request, error) {
   169  	pathParameters := map[string]interface{}{
   170  		"accountName":        autorest.Encode("path", accountName),
   171  		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
   172  		"storageAccountName": autorest.Encode("path", storageAccountName),
   173  		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
   174  	}
   175  
   176  	const APIVersion = "2015-10-01-preview"
   177  	queryParameters := map[string]interface{}{
   178  		"api-version": APIVersion,
   179  	}
   180  
   181  	preparer := autorest.CreatePreparer(
   182  		autorest.AsContentType("application/json; charset=utf-8"),
   183  		autorest.AsPut(),
   184  		autorest.WithBaseURL(client.BaseURI),
   185  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}", pathParameters),
   186  		autorest.WithJSON(parameters),
   187  		autorest.WithQueryParameters(queryParameters))
   188  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   189  }
   190  
   191  // AddStorageAccountSender sends the AddStorageAccount request. The method will close the
   192  // http.Response Body if it receives an error.
   193  func (client Client) AddStorageAccountSender(req *http.Request) (*http.Response, error) {
   194  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   195  }
   196  
   197  // AddStorageAccountResponder handles the response to the AddStorageAccount request. The method always
   198  // closes the http.Response Body.
   199  func (client Client) AddStorageAccountResponder(resp *http.Response) (result autorest.Response, err error) {
   200  	err = autorest.Respond(
   201  		resp,
   202  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   203  		autorest.ByClosing())
   204  	result.Response = resp
   205  	return
   206  }
   207  
   208  // Create creates the specified Data Lake Analytics account. This supplies the user with computation services for Data
   209  // Lake Analytics workloads
   210  // Parameters:
   211  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.the
   212  // account will be associated with.
   213  // name - the name of the Data Lake Analytics account to create.
   214  // parameters - parameters supplied to the create Data Lake Analytics account operation.
   215  func (client Client) Create(ctx context.Context, resourceGroupName string, name string, parameters DataLakeAnalyticsAccount) (result CreateFuture, err error) {
   216  	if tracing.IsEnabled() {
   217  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.Create")
   218  		defer func() {
   219  			sc := -1
   220  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   221  				sc = result.FutureAPI.Response().StatusCode
   222  			}
   223  			tracing.EndSpan(ctx, sc, err)
   224  		}()
   225  	}
   226  	req, err := client.CreatePreparer(ctx, resourceGroupName, name, parameters)
   227  	if err != nil {
   228  		err = autorest.NewErrorWithError(err, "account.Client", "Create", nil, "Failure preparing request")
   229  		return
   230  	}
   231  
   232  	result, err = client.CreateSender(req)
   233  	if err != nil {
   234  		err = autorest.NewErrorWithError(err, "account.Client", "Create", result.Response(), "Failure sending request")
   235  		return
   236  	}
   237  
   238  	return
   239  }
   240  
   241  // CreatePreparer prepares the Create request.
   242  func (client Client) CreatePreparer(ctx context.Context, resourceGroupName string, name string, parameters DataLakeAnalyticsAccount) (*http.Request, error) {
   243  	pathParameters := map[string]interface{}{
   244  		"name":              autorest.Encode("path", name),
   245  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   246  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   247  	}
   248  
   249  	const APIVersion = "2015-10-01-preview"
   250  	queryParameters := map[string]interface{}{
   251  		"api-version": APIVersion,
   252  	}
   253  
   254  	parameters.Type = nil
   255  	parameters.ID = nil
   256  	preparer := autorest.CreatePreparer(
   257  		autorest.AsContentType("application/json; charset=utf-8"),
   258  		autorest.AsPut(),
   259  		autorest.WithBaseURL(client.BaseURI),
   260  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}", pathParameters),
   261  		autorest.WithJSON(parameters),
   262  		autorest.WithQueryParameters(queryParameters))
   263  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   264  }
   265  
   266  // CreateSender sends the Create request. The method will close the
   267  // http.Response Body if it receives an error.
   268  func (client Client) CreateSender(req *http.Request) (future CreateFuture, err error) {
   269  	var resp *http.Response
   270  	future.FutureAPI = &azure.Future{}
   271  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   272  	if err != nil {
   273  		return
   274  	}
   275  	var azf azure.Future
   276  	azf, err = azure.NewFutureFromResponse(resp)
   277  	future.FutureAPI = &azf
   278  	future.Result = future.result
   279  	return
   280  }
   281  
   282  // CreateResponder handles the response to the Create request. The method always
   283  // closes the http.Response Body.
   284  func (client Client) CreateResponder(resp *http.Response) (result DataLakeAnalyticsAccount, err error) {
   285  	err = autorest.Respond(
   286  		resp,
   287  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
   288  		autorest.ByUnmarshallingJSON(&result),
   289  		autorest.ByClosing())
   290  	result.Response = autorest.Response{Response: resp}
   291  	return
   292  }
   293  
   294  // Delete begins the delete process for the Data Lake Analytics account object specified by the account name.
   295  // Parameters:
   296  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
   297  // accountName - the name of the Data Lake Analytics account to delete
   298  func (client Client) Delete(ctx context.Context, resourceGroupName string, accountName string) (result DeleteFuture, err error) {
   299  	if tracing.IsEnabled() {
   300  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete")
   301  		defer func() {
   302  			sc := -1
   303  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   304  				sc = result.FutureAPI.Response().StatusCode
   305  			}
   306  			tracing.EndSpan(ctx, sc, err)
   307  		}()
   308  	}
   309  	req, err := client.DeletePreparer(ctx, resourceGroupName, accountName)
   310  	if err != nil {
   311  		err = autorest.NewErrorWithError(err, "account.Client", "Delete", nil, "Failure preparing request")
   312  		return
   313  	}
   314  
   315  	result, err = client.DeleteSender(req)
   316  	if err != nil {
   317  		err = autorest.NewErrorWithError(err, "account.Client", "Delete", result.Response(), "Failure sending request")
   318  		return
   319  	}
   320  
   321  	return
   322  }
   323  
   324  // DeletePreparer prepares the Delete request.
   325  func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
   326  	pathParameters := map[string]interface{}{
   327  		"accountName":       autorest.Encode("path", accountName),
   328  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   329  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   330  	}
   331  
   332  	const APIVersion = "2015-10-01-preview"
   333  	queryParameters := map[string]interface{}{
   334  		"api-version": APIVersion,
   335  	}
   336  
   337  	preparer := autorest.CreatePreparer(
   338  		autorest.AsDelete(),
   339  		autorest.WithBaseURL(client.BaseURI),
   340  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}", pathParameters),
   341  		autorest.WithQueryParameters(queryParameters))
   342  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   343  }
   344  
   345  // DeleteSender sends the Delete request. The method will close the
   346  // http.Response Body if it receives an error.
   347  func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err error) {
   348  	var resp *http.Response
   349  	future.FutureAPI = &azure.Future{}
   350  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   351  	if err != nil {
   352  		return
   353  	}
   354  	var azf azure.Future
   355  	azf, err = azure.NewFutureFromResponse(resp)
   356  	future.FutureAPI = &azf
   357  	future.Result = future.result
   358  	return
   359  }
   360  
   361  // DeleteResponder handles the response to the Delete request. The method always
   362  // closes the http.Response Body.
   363  func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
   364  	err = autorest.Respond(
   365  		resp,
   366  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusNotFound),
   367  		autorest.ByClosing())
   368  	result.Response = resp
   369  	return
   370  }
   371  
   372  // DeleteDataLakeStoreAccount updates the Data Lake Analytics account specified to remove the specified Data Lake Store
   373  // account.
   374  // Parameters:
   375  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
   376  // accountName - the name of the Data Lake Analytics account from which to remove the Data Lake Store account.
   377  // dataLakeStoreAccountName - the name of the Data Lake Store account to remove
   378  func (client Client) DeleteDataLakeStoreAccount(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string) (result autorest.Response, err error) {
   379  	if tracing.IsEnabled() {
   380  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteDataLakeStoreAccount")
   381  		defer func() {
   382  			sc := -1
   383  			if result.Response != nil {
   384  				sc = result.Response.StatusCode
   385  			}
   386  			tracing.EndSpan(ctx, sc, err)
   387  		}()
   388  	}
   389  	req, err := client.DeleteDataLakeStoreAccountPreparer(ctx, resourceGroupName, accountName, dataLakeStoreAccountName)
   390  	if err != nil {
   391  		err = autorest.NewErrorWithError(err, "account.Client", "DeleteDataLakeStoreAccount", nil, "Failure preparing request")
   392  		return
   393  	}
   394  
   395  	resp, err := client.DeleteDataLakeStoreAccountSender(req)
   396  	if err != nil {
   397  		result.Response = resp
   398  		err = autorest.NewErrorWithError(err, "account.Client", "DeleteDataLakeStoreAccount", resp, "Failure sending request")
   399  		return
   400  	}
   401  
   402  	result, err = client.DeleteDataLakeStoreAccountResponder(resp)
   403  	if err != nil {
   404  		err = autorest.NewErrorWithError(err, "account.Client", "DeleteDataLakeStoreAccount", resp, "Failure responding to request")
   405  		return
   406  	}
   407  
   408  	return
   409  }
   410  
   411  // DeleteDataLakeStoreAccountPreparer prepares the DeleteDataLakeStoreAccount request.
   412  func (client Client) DeleteDataLakeStoreAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string) (*http.Request, error) {
   413  	pathParameters := map[string]interface{}{
   414  		"accountName":              autorest.Encode("path", accountName),
   415  		"dataLakeStoreAccountName": autorest.Encode("path", dataLakeStoreAccountName),
   416  		"resourceGroupName":        autorest.Encode("path", resourceGroupName),
   417  		"subscriptionId":           autorest.Encode("path", client.SubscriptionID),
   418  	}
   419  
   420  	const APIVersion = "2015-10-01-preview"
   421  	queryParameters := map[string]interface{}{
   422  		"api-version": APIVersion,
   423  	}
   424  
   425  	preparer := autorest.CreatePreparer(
   426  		autorest.AsDelete(),
   427  		autorest.WithBaseURL(client.BaseURI),
   428  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}", pathParameters),
   429  		autorest.WithQueryParameters(queryParameters))
   430  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   431  }
   432  
   433  // DeleteDataLakeStoreAccountSender sends the DeleteDataLakeStoreAccount request. The method will close the
   434  // http.Response Body if it receives an error.
   435  func (client Client) DeleteDataLakeStoreAccountSender(req *http.Request) (*http.Response, error) {
   436  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   437  }
   438  
   439  // DeleteDataLakeStoreAccountResponder handles the response to the DeleteDataLakeStoreAccount request. The method always
   440  // closes the http.Response Body.
   441  func (client Client) DeleteDataLakeStoreAccountResponder(resp *http.Response) (result autorest.Response, err error) {
   442  	err = autorest.Respond(
   443  		resp,
   444  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   445  		autorest.ByClosing())
   446  	result.Response = resp
   447  	return
   448  }
   449  
   450  // DeleteStorageAccount updates the specified Data Lake Analytics account to remove an Azure Storage account.
   451  // Parameters:
   452  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
   453  // accountName - the name of the Data Lake Analytics account from which to remove the Azure Storage account.
   454  // storageAccountName - the name of the Azure Storage account to remove
   455  func (client Client) DeleteStorageAccount(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (result autorest.Response, err error) {
   456  	if tracing.IsEnabled() {
   457  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteStorageAccount")
   458  		defer func() {
   459  			sc := -1
   460  			if result.Response != nil {
   461  				sc = result.Response.StatusCode
   462  			}
   463  			tracing.EndSpan(ctx, sc, err)
   464  		}()
   465  	}
   466  	req, err := client.DeleteStorageAccountPreparer(ctx, resourceGroupName, accountName, storageAccountName)
   467  	if err != nil {
   468  		err = autorest.NewErrorWithError(err, "account.Client", "DeleteStorageAccount", nil, "Failure preparing request")
   469  		return
   470  	}
   471  
   472  	resp, err := client.DeleteStorageAccountSender(req)
   473  	if err != nil {
   474  		result.Response = resp
   475  		err = autorest.NewErrorWithError(err, "account.Client", "DeleteStorageAccount", resp, "Failure sending request")
   476  		return
   477  	}
   478  
   479  	result, err = client.DeleteStorageAccountResponder(resp)
   480  	if err != nil {
   481  		err = autorest.NewErrorWithError(err, "account.Client", "DeleteStorageAccount", resp, "Failure responding to request")
   482  		return
   483  	}
   484  
   485  	return
   486  }
   487  
   488  // DeleteStorageAccountPreparer prepares the DeleteStorageAccount request.
   489  func (client Client) DeleteStorageAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (*http.Request, error) {
   490  	pathParameters := map[string]interface{}{
   491  		"accountName":        autorest.Encode("path", accountName),
   492  		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
   493  		"storageAccountName": autorest.Encode("path", storageAccountName),
   494  		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
   495  	}
   496  
   497  	const APIVersion = "2015-10-01-preview"
   498  	queryParameters := map[string]interface{}{
   499  		"api-version": APIVersion,
   500  	}
   501  
   502  	preparer := autorest.CreatePreparer(
   503  		autorest.AsDelete(),
   504  		autorest.WithBaseURL(client.BaseURI),
   505  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}", pathParameters),
   506  		autorest.WithQueryParameters(queryParameters))
   507  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   508  }
   509  
   510  // DeleteStorageAccountSender sends the DeleteStorageAccount request. The method will close the
   511  // http.Response Body if it receives an error.
   512  func (client Client) DeleteStorageAccountSender(req *http.Request) (*http.Response, error) {
   513  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   514  }
   515  
   516  // DeleteStorageAccountResponder handles the response to the DeleteStorageAccount request. The method always
   517  // closes the http.Response Body.
   518  func (client Client) DeleteStorageAccountResponder(resp *http.Response) (result autorest.Response, err error) {
   519  	err = autorest.Respond(
   520  		resp,
   521  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   522  		autorest.ByClosing())
   523  	result.Response = resp
   524  	return
   525  }
   526  
   527  // Get gets details of the specified Data Lake Analytics account.
   528  // Parameters:
   529  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
   530  // accountName - the name of the Data Lake Analytics account to retrieve.
   531  func (client Client) Get(ctx context.Context, resourceGroupName string, accountName string) (result DataLakeAnalyticsAccount, err error) {
   532  	if tracing.IsEnabled() {
   533  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get")
   534  		defer func() {
   535  			sc := -1
   536  			if result.Response.Response != nil {
   537  				sc = result.Response.Response.StatusCode
   538  			}
   539  			tracing.EndSpan(ctx, sc, err)
   540  		}()
   541  	}
   542  	req, err := client.GetPreparer(ctx, resourceGroupName, accountName)
   543  	if err != nil {
   544  		err = autorest.NewErrorWithError(err, "account.Client", "Get", nil, "Failure preparing request")
   545  		return
   546  	}
   547  
   548  	resp, err := client.GetSender(req)
   549  	if err != nil {
   550  		result.Response = autorest.Response{Response: resp}
   551  		err = autorest.NewErrorWithError(err, "account.Client", "Get", resp, "Failure sending request")
   552  		return
   553  	}
   554  
   555  	result, err = client.GetResponder(resp)
   556  	if err != nil {
   557  		err = autorest.NewErrorWithError(err, "account.Client", "Get", resp, "Failure responding to request")
   558  		return
   559  	}
   560  
   561  	return
   562  }
   563  
   564  // GetPreparer prepares the Get request.
   565  func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
   566  	pathParameters := map[string]interface{}{
   567  		"accountName":       autorest.Encode("path", accountName),
   568  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   569  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   570  	}
   571  
   572  	const APIVersion = "2015-10-01-preview"
   573  	queryParameters := map[string]interface{}{
   574  		"api-version": APIVersion,
   575  	}
   576  
   577  	preparer := autorest.CreatePreparer(
   578  		autorest.AsGet(),
   579  		autorest.WithBaseURL(client.BaseURI),
   580  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}", pathParameters),
   581  		autorest.WithQueryParameters(queryParameters))
   582  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   583  }
   584  
   585  // GetSender sends the Get request. The method will close the
   586  // http.Response Body if it receives an error.
   587  func (client Client) GetSender(req *http.Request) (*http.Response, error) {
   588  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   589  }
   590  
   591  // GetResponder handles the response to the Get request. The method always
   592  // closes the http.Response Body.
   593  func (client Client) GetResponder(resp *http.Response) (result DataLakeAnalyticsAccount, err error) {
   594  	err = autorest.Respond(
   595  		resp,
   596  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   597  		autorest.ByUnmarshallingJSON(&result),
   598  		autorest.ByClosing())
   599  	result.Response = autorest.Response{Response: resp}
   600  	return
   601  }
   602  
   603  // GetDataLakeStoreAccount gets the specified Data Lake Store account details in the specified Data Lake Analytics
   604  // account.
   605  // Parameters:
   606  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
   607  // accountName - the name of the Data Lake Analytics account from which to retrieve the Data Lake Store account
   608  // details.
   609  // dataLakeStoreAccountName - the name of the Data Lake Store account to retrieve
   610  func (client Client) GetDataLakeStoreAccount(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string) (result DataLakeStoreAccountInfo, err error) {
   611  	if tracing.IsEnabled() {
   612  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetDataLakeStoreAccount")
   613  		defer func() {
   614  			sc := -1
   615  			if result.Response.Response != nil {
   616  				sc = result.Response.Response.StatusCode
   617  			}
   618  			tracing.EndSpan(ctx, sc, err)
   619  		}()
   620  	}
   621  	req, err := client.GetDataLakeStoreAccountPreparer(ctx, resourceGroupName, accountName, dataLakeStoreAccountName)
   622  	if err != nil {
   623  		err = autorest.NewErrorWithError(err, "account.Client", "GetDataLakeStoreAccount", nil, "Failure preparing request")
   624  		return
   625  	}
   626  
   627  	resp, err := client.GetDataLakeStoreAccountSender(req)
   628  	if err != nil {
   629  		result.Response = autorest.Response{Response: resp}
   630  		err = autorest.NewErrorWithError(err, "account.Client", "GetDataLakeStoreAccount", resp, "Failure sending request")
   631  		return
   632  	}
   633  
   634  	result, err = client.GetDataLakeStoreAccountResponder(resp)
   635  	if err != nil {
   636  		err = autorest.NewErrorWithError(err, "account.Client", "GetDataLakeStoreAccount", resp, "Failure responding to request")
   637  		return
   638  	}
   639  
   640  	return
   641  }
   642  
   643  // GetDataLakeStoreAccountPreparer prepares the GetDataLakeStoreAccount request.
   644  func (client Client) GetDataLakeStoreAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string) (*http.Request, error) {
   645  	pathParameters := map[string]interface{}{
   646  		"accountName":              autorest.Encode("path", accountName),
   647  		"dataLakeStoreAccountName": autorest.Encode("path", dataLakeStoreAccountName),
   648  		"resourceGroupName":        autorest.Encode("path", resourceGroupName),
   649  		"subscriptionId":           autorest.Encode("path", client.SubscriptionID),
   650  	}
   651  
   652  	const APIVersion = "2015-10-01-preview"
   653  	queryParameters := map[string]interface{}{
   654  		"api-version": APIVersion,
   655  	}
   656  
   657  	preparer := autorest.CreatePreparer(
   658  		autorest.AsGet(),
   659  		autorest.WithBaseURL(client.BaseURI),
   660  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}", pathParameters),
   661  		autorest.WithQueryParameters(queryParameters))
   662  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   663  }
   664  
   665  // GetDataLakeStoreAccountSender sends the GetDataLakeStoreAccount request. The method will close the
   666  // http.Response Body if it receives an error.
   667  func (client Client) GetDataLakeStoreAccountSender(req *http.Request) (*http.Response, error) {
   668  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   669  }
   670  
   671  // GetDataLakeStoreAccountResponder handles the response to the GetDataLakeStoreAccount request. The method always
   672  // closes the http.Response Body.
   673  func (client Client) GetDataLakeStoreAccountResponder(resp *http.Response) (result DataLakeStoreAccountInfo, err error) {
   674  	err = autorest.Respond(
   675  		resp,
   676  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   677  		autorest.ByUnmarshallingJSON(&result),
   678  		autorest.ByClosing())
   679  	result.Response = autorest.Response{Response: resp}
   680  	return
   681  }
   682  
   683  // GetStorageAccount gets the specified Azure Storage account linked to the given Data Lake Analytics account.
   684  // Parameters:
   685  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
   686  // accountName - the name of the Data Lake Analytics account from which to retrieve Azure storage account
   687  // details.
   688  // storageAccountName - the name of the Azure Storage account for which to retrieve the details.
   689  func (client Client) GetStorageAccount(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (result StorageAccountInfo, err error) {
   690  	if tracing.IsEnabled() {
   691  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetStorageAccount")
   692  		defer func() {
   693  			sc := -1
   694  			if result.Response.Response != nil {
   695  				sc = result.Response.Response.StatusCode
   696  			}
   697  			tracing.EndSpan(ctx, sc, err)
   698  		}()
   699  	}
   700  	req, err := client.GetStorageAccountPreparer(ctx, resourceGroupName, accountName, storageAccountName)
   701  	if err != nil {
   702  		err = autorest.NewErrorWithError(err, "account.Client", "GetStorageAccount", nil, "Failure preparing request")
   703  		return
   704  	}
   705  
   706  	resp, err := client.GetStorageAccountSender(req)
   707  	if err != nil {
   708  		result.Response = autorest.Response{Response: resp}
   709  		err = autorest.NewErrorWithError(err, "account.Client", "GetStorageAccount", resp, "Failure sending request")
   710  		return
   711  	}
   712  
   713  	result, err = client.GetStorageAccountResponder(resp)
   714  	if err != nil {
   715  		err = autorest.NewErrorWithError(err, "account.Client", "GetStorageAccount", resp, "Failure responding to request")
   716  		return
   717  	}
   718  
   719  	return
   720  }
   721  
   722  // GetStorageAccountPreparer prepares the GetStorageAccount request.
   723  func (client Client) GetStorageAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (*http.Request, error) {
   724  	pathParameters := map[string]interface{}{
   725  		"accountName":        autorest.Encode("path", accountName),
   726  		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
   727  		"storageAccountName": autorest.Encode("path", storageAccountName),
   728  		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
   729  	}
   730  
   731  	const APIVersion = "2015-10-01-preview"
   732  	queryParameters := map[string]interface{}{
   733  		"api-version": APIVersion,
   734  	}
   735  
   736  	preparer := autorest.CreatePreparer(
   737  		autorest.AsGet(),
   738  		autorest.WithBaseURL(client.BaseURI),
   739  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}", pathParameters),
   740  		autorest.WithQueryParameters(queryParameters))
   741  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   742  }
   743  
   744  // GetStorageAccountSender sends the GetStorageAccount request. The method will close the
   745  // http.Response Body if it receives an error.
   746  func (client Client) GetStorageAccountSender(req *http.Request) (*http.Response, error) {
   747  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   748  }
   749  
   750  // GetStorageAccountResponder handles the response to the GetStorageAccount request. The method always
   751  // closes the http.Response Body.
   752  func (client Client) GetStorageAccountResponder(resp *http.Response) (result StorageAccountInfo, err error) {
   753  	err = autorest.Respond(
   754  		resp,
   755  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   756  		autorest.ByUnmarshallingJSON(&result),
   757  		autorest.ByClosing())
   758  	result.Response = autorest.Response{Response: resp}
   759  	return
   760  }
   761  
   762  // GetStorageContainer gets the specified Azure Storage container associated with the given Data Lake Analytics and
   763  // Azure Storage accounts.
   764  // Parameters:
   765  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
   766  // accountName - the name of the Data Lake Analytics account for which to retrieve blob container.
   767  // storageAccountName - the name of the Azure storage account from which to retrieve the blob container.
   768  // containerName - the name of the Azure storage container to retrieve
   769  func (client Client) GetStorageContainer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, containerName string) (result BlobContainer, err error) {
   770  	if tracing.IsEnabled() {
   771  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetStorageContainer")
   772  		defer func() {
   773  			sc := -1
   774  			if result.Response.Response != nil {
   775  				sc = result.Response.Response.StatusCode
   776  			}
   777  			tracing.EndSpan(ctx, sc, err)
   778  		}()
   779  	}
   780  	req, err := client.GetStorageContainerPreparer(ctx, resourceGroupName, accountName, storageAccountName, containerName)
   781  	if err != nil {
   782  		err = autorest.NewErrorWithError(err, "account.Client", "GetStorageContainer", nil, "Failure preparing request")
   783  		return
   784  	}
   785  
   786  	resp, err := client.GetStorageContainerSender(req)
   787  	if err != nil {
   788  		result.Response = autorest.Response{Response: resp}
   789  		err = autorest.NewErrorWithError(err, "account.Client", "GetStorageContainer", resp, "Failure sending request")
   790  		return
   791  	}
   792  
   793  	result, err = client.GetStorageContainerResponder(resp)
   794  	if err != nil {
   795  		err = autorest.NewErrorWithError(err, "account.Client", "GetStorageContainer", resp, "Failure responding to request")
   796  		return
   797  	}
   798  
   799  	return
   800  }
   801  
   802  // GetStorageContainerPreparer prepares the GetStorageContainer request.
   803  func (client Client) GetStorageContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, containerName string) (*http.Request, error) {
   804  	pathParameters := map[string]interface{}{
   805  		"accountName":        autorest.Encode("path", accountName),
   806  		"containerName":      autorest.Encode("path", containerName),
   807  		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
   808  		"storageAccountName": autorest.Encode("path", storageAccountName),
   809  		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
   810  	}
   811  
   812  	const APIVersion = "2015-10-01-preview"
   813  	queryParameters := map[string]interface{}{
   814  		"api-version": APIVersion,
   815  	}
   816  
   817  	preparer := autorest.CreatePreparer(
   818  		autorest.AsGet(),
   819  		autorest.WithBaseURL(client.BaseURI),
   820  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers/{containerName}", pathParameters),
   821  		autorest.WithQueryParameters(queryParameters))
   822  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   823  }
   824  
   825  // GetStorageContainerSender sends the GetStorageContainer request. The method will close the
   826  // http.Response Body if it receives an error.
   827  func (client Client) GetStorageContainerSender(req *http.Request) (*http.Response, error) {
   828  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   829  }
   830  
   831  // GetStorageContainerResponder handles the response to the GetStorageContainer request. The method always
   832  // closes the http.Response Body.
   833  func (client Client) GetStorageContainerResponder(resp *http.Response) (result BlobContainer, err error) {
   834  	err = autorest.Respond(
   835  		resp,
   836  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   837  		autorest.ByUnmarshallingJSON(&result),
   838  		autorest.ByClosing())
   839  	result.Response = autorest.Response{Response: resp}
   840  	return
   841  }
   842  
   843  // List gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a
   844  // link to the next page, if any.
   845  // Parameters:
   846  // filter - oData filter. Optional.
   847  // top - the number of items to return. Optional.
   848  // skip - the number of items to skip over before returning elements. Optional.
   849  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
   850  // Categories/$expand=Products would expand Product data in line with each Category entry. Optional.
   851  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
   852  // Categories?$select=CategoryName,Description. Optional.
   853  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
   854  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
   855  // Optional.
   856  // count - the Boolean value of true or false to request a count of the matching resources included with the
   857  // resources in the response, e.g. Categories?$count=true. Optional.
   858  // search - a free form search. A free-text search expression to match for whether a particular entry should be
   859  // included in the feed, e.g. Categories?$search=blue OR green. Optional.
   860  // formatParameter - the desired return format. Return the response in particular format without access to
   861  // request headers for standard content-type negotiation (e.g Orders?$format=json). Optional.
   862  func (client Client) List(ctx context.Context, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListResultPage, err error) {
   863  	if tracing.IsEnabled() {
   864  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.List")
   865  		defer func() {
   866  			sc := -1
   867  			if result.dlaalr.Response.Response != nil {
   868  				sc = result.dlaalr.Response.Response.StatusCode
   869  			}
   870  			tracing.EndSpan(ctx, sc, err)
   871  		}()
   872  	}
   873  	result.fn = client.listNextResults
   874  	req, err := client.ListPreparer(ctx, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter)
   875  	if err != nil {
   876  		err = autorest.NewErrorWithError(err, "account.Client", "List", nil, "Failure preparing request")
   877  		return
   878  	}
   879  
   880  	resp, err := client.ListSender(req)
   881  	if err != nil {
   882  		result.dlaalr.Response = autorest.Response{Response: resp}
   883  		err = autorest.NewErrorWithError(err, "account.Client", "List", resp, "Failure sending request")
   884  		return
   885  	}
   886  
   887  	result.dlaalr, err = client.ListResponder(resp)
   888  	if err != nil {
   889  		err = autorest.NewErrorWithError(err, "account.Client", "List", resp, "Failure responding to request")
   890  		return
   891  	}
   892  	if result.dlaalr.hasNextLink() && result.dlaalr.IsEmpty() {
   893  		err = result.NextWithContext(ctx)
   894  		return
   895  	}
   896  
   897  	return
   898  }
   899  
   900  // ListPreparer prepares the List request.
   901  func (client Client) ListPreparer(ctx context.Context, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (*http.Request, error) {
   902  	pathParameters := map[string]interface{}{
   903  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   904  	}
   905  
   906  	const APIVersion = "2015-10-01-preview"
   907  	queryParameters := map[string]interface{}{
   908  		"api-version": APIVersion,
   909  	}
   910  	if len(filter) > 0 {
   911  		queryParameters["$filter"] = autorest.Encode("query", filter)
   912  	}
   913  	if top != nil {
   914  		queryParameters["$top"] = autorest.Encode("query", *top)
   915  	}
   916  	if skip != nil {
   917  		queryParameters["$skip"] = autorest.Encode("query", *skip)
   918  	}
   919  	if len(expand) > 0 {
   920  		queryParameters["$expand"] = autorest.Encode("query", expand)
   921  	}
   922  	if len(selectParameter) > 0 {
   923  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
   924  	}
   925  	if len(orderby) > 0 {
   926  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
   927  	}
   928  	if count != nil {
   929  		queryParameters["$count"] = autorest.Encode("query", *count)
   930  	}
   931  	if len(search) > 0 {
   932  		queryParameters["$search"] = autorest.Encode("query", search)
   933  	}
   934  	if len(formatParameter) > 0 {
   935  		queryParameters["$format"] = autorest.Encode("query", formatParameter)
   936  	}
   937  
   938  	preparer := autorest.CreatePreparer(
   939  		autorest.AsGet(),
   940  		autorest.WithBaseURL(client.BaseURI),
   941  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DataLakeAnalytics/accounts", pathParameters),
   942  		autorest.WithQueryParameters(queryParameters))
   943  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   944  }
   945  
   946  // ListSender sends the List request. The method will close the
   947  // http.Response Body if it receives an error.
   948  func (client Client) ListSender(req *http.Request) (*http.Response, error) {
   949  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   950  }
   951  
   952  // ListResponder handles the response to the List request. The method always
   953  // closes the http.Response Body.
   954  func (client Client) ListResponder(resp *http.Response) (result DataLakeAnalyticsAccountListResult, err error) {
   955  	err = autorest.Respond(
   956  		resp,
   957  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   958  		autorest.ByUnmarshallingJSON(&result),
   959  		autorest.ByClosing())
   960  	result.Response = autorest.Response{Response: resp}
   961  	return
   962  }
   963  
   964  // listNextResults retrieves the next set of results, if any.
   965  func (client Client) listNextResults(ctx context.Context, lastResults DataLakeAnalyticsAccountListResult) (result DataLakeAnalyticsAccountListResult, err error) {
   966  	req, err := lastResults.dataLakeAnalyticsAccountListResultPreparer(ctx)
   967  	if err != nil {
   968  		return result, autorest.NewErrorWithError(err, "account.Client", "listNextResults", nil, "Failure preparing next results request")
   969  	}
   970  	if req == nil {
   971  		return
   972  	}
   973  	resp, err := client.ListSender(req)
   974  	if err != nil {
   975  		result.Response = autorest.Response{Response: resp}
   976  		return result, autorest.NewErrorWithError(err, "account.Client", "listNextResults", resp, "Failure sending next results request")
   977  	}
   978  	result, err = client.ListResponder(resp)
   979  	if err != nil {
   980  		err = autorest.NewErrorWithError(err, "account.Client", "listNextResults", resp, "Failure responding to next results request")
   981  	}
   982  	return
   983  }
   984  
   985  // ListComplete enumerates all values, automatically crossing page boundaries as required.
   986  func (client Client) ListComplete(ctx context.Context, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListResultIterator, err error) {
   987  	if tracing.IsEnabled() {
   988  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.List")
   989  		defer func() {
   990  			sc := -1
   991  			if result.Response().Response.Response != nil {
   992  				sc = result.page.Response().Response.Response.StatusCode
   993  			}
   994  			tracing.EndSpan(ctx, sc, err)
   995  		}()
   996  	}
   997  	result.page, err = client.List(ctx, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter)
   998  	return
   999  }
  1000  
  1001  // ListByResourceGroup gets the first page of Data Lake Analytics accounts, if any, within a specific resource group.
  1002  // This includes a link to the next page, if any.
  1003  // Parameters:
  1004  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
  1005  // filter - oData filter. Optional.
  1006  // top - the number of items to return. Optional.
  1007  // skip - the number of items to skip over before returning elements. Optional.
  1008  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  1009  // Categories/$expand=Products would expand Product data in line with each Category entry. Optional.
  1010  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  1011  // Categories?$select=CategoryName,Description. Optional.
  1012  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  1013  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  1014  // Optional.
  1015  // count - the Boolean value of true or false to request a count of the matching resources included with the
  1016  // resources in the response, e.g. Categories?$count=true. Optional.
  1017  // search - a free form search. A free-text search expression to match for whether a particular entry should be
  1018  // included in the feed, e.g. Categories?$search=blue OR green. Optional.
  1019  // formatParameter - the return format. Return the response in particular format without access to request
  1020  // headers for standard content-type negotiation (e.g Orders?$format=json). Optional.
  1021  func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListResultPage, err error) {
  1022  	if tracing.IsEnabled() {
  1023  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup")
  1024  		defer func() {
  1025  			sc := -1
  1026  			if result.dlaalr.Response.Response != nil {
  1027  				sc = result.dlaalr.Response.Response.StatusCode
  1028  			}
  1029  			tracing.EndSpan(ctx, sc, err)
  1030  		}()
  1031  	}
  1032  	result.fn = client.listByResourceGroupNextResults
  1033  	req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter)
  1034  	if err != nil {
  1035  		err = autorest.NewErrorWithError(err, "account.Client", "ListByResourceGroup", nil, "Failure preparing request")
  1036  		return
  1037  	}
  1038  
  1039  	resp, err := client.ListByResourceGroupSender(req)
  1040  	if err != nil {
  1041  		result.dlaalr.Response = autorest.Response{Response: resp}
  1042  		err = autorest.NewErrorWithError(err, "account.Client", "ListByResourceGroup", resp, "Failure sending request")
  1043  		return
  1044  	}
  1045  
  1046  	result.dlaalr, err = client.ListByResourceGroupResponder(resp)
  1047  	if err != nil {
  1048  		err = autorest.NewErrorWithError(err, "account.Client", "ListByResourceGroup", resp, "Failure responding to request")
  1049  		return
  1050  	}
  1051  	if result.dlaalr.hasNextLink() && result.dlaalr.IsEmpty() {
  1052  		err = result.NextWithContext(ctx)
  1053  		return
  1054  	}
  1055  
  1056  	return
  1057  }
  1058  
  1059  // ListByResourceGroupPreparer prepares the ListByResourceGroup request.
  1060  func (client Client) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (*http.Request, error) {
  1061  	pathParameters := map[string]interface{}{
  1062  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1063  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1064  	}
  1065  
  1066  	const APIVersion = "2015-10-01-preview"
  1067  	queryParameters := map[string]interface{}{
  1068  		"api-version": APIVersion,
  1069  	}
  1070  	if len(filter) > 0 {
  1071  		queryParameters["$filter"] = autorest.Encode("query", filter)
  1072  	}
  1073  	if top != nil {
  1074  		queryParameters["$top"] = autorest.Encode("query", *top)
  1075  	}
  1076  	if skip != nil {
  1077  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  1078  	}
  1079  	if len(expand) > 0 {
  1080  		queryParameters["$expand"] = autorest.Encode("query", expand)
  1081  	}
  1082  	if len(selectParameter) > 0 {
  1083  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  1084  	}
  1085  	if len(orderby) > 0 {
  1086  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  1087  	}
  1088  	if count != nil {
  1089  		queryParameters["$count"] = autorest.Encode("query", *count)
  1090  	}
  1091  	if len(search) > 0 {
  1092  		queryParameters["$search"] = autorest.Encode("query", search)
  1093  	}
  1094  	if len(formatParameter) > 0 {
  1095  		queryParameters["$format"] = autorest.Encode("query", formatParameter)
  1096  	}
  1097  
  1098  	preparer := autorest.CreatePreparer(
  1099  		autorest.AsGet(),
  1100  		autorest.WithBaseURL(client.BaseURI),
  1101  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts", pathParameters),
  1102  		autorest.WithQueryParameters(queryParameters))
  1103  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1104  }
  1105  
  1106  // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
  1107  // http.Response Body if it receives an error.
  1108  func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
  1109  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1110  }
  1111  
  1112  // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
  1113  // closes the http.Response Body.
  1114  func (client Client) ListByResourceGroupResponder(resp *http.Response) (result DataLakeAnalyticsAccountListResult, err error) {
  1115  	err = autorest.Respond(
  1116  		resp,
  1117  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1118  		autorest.ByUnmarshallingJSON(&result),
  1119  		autorest.ByClosing())
  1120  	result.Response = autorest.Response{Response: resp}
  1121  	return
  1122  }
  1123  
  1124  // listByResourceGroupNextResults retrieves the next set of results, if any.
  1125  func (client Client) listByResourceGroupNextResults(ctx context.Context, lastResults DataLakeAnalyticsAccountListResult) (result DataLakeAnalyticsAccountListResult, err error) {
  1126  	req, err := lastResults.dataLakeAnalyticsAccountListResultPreparer(ctx)
  1127  	if err != nil {
  1128  		return result, autorest.NewErrorWithError(err, "account.Client", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
  1129  	}
  1130  	if req == nil {
  1131  		return
  1132  	}
  1133  	resp, err := client.ListByResourceGroupSender(req)
  1134  	if err != nil {
  1135  		result.Response = autorest.Response{Response: resp}
  1136  		return result, autorest.NewErrorWithError(err, "account.Client", "listByResourceGroupNextResults", resp, "Failure sending next results request")
  1137  	}
  1138  	result, err = client.ListByResourceGroupResponder(resp)
  1139  	if err != nil {
  1140  		err = autorest.NewErrorWithError(err, "account.Client", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
  1141  	}
  1142  	return
  1143  }
  1144  
  1145  // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
  1146  func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListResultIterator, err error) {
  1147  	if tracing.IsEnabled() {
  1148  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup")
  1149  		defer func() {
  1150  			sc := -1
  1151  			if result.Response().Response.Response != nil {
  1152  				sc = result.page.Response().Response.Response.StatusCode
  1153  			}
  1154  			tracing.EndSpan(ctx, sc, err)
  1155  		}()
  1156  	}
  1157  	result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter)
  1158  	return
  1159  }
  1160  
  1161  // ListDataLakeStoreAccounts gets the first page of Data Lake Store accounts linked to the specified Data Lake
  1162  // Analytics account. The response includes a link to the next page, if any.
  1163  // Parameters:
  1164  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
  1165  // accountName - the name of the Data Lake Analytics account for which to list Data Lake Store accounts.
  1166  // filter - oData filter. Optional.
  1167  // top - the number of items to return. Optional.
  1168  // skip - the number of items to skip over before returning elements. Optional.
  1169  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  1170  // Categories/$expand=Products would expand Product data in line with each Category entry. Optional.
  1171  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  1172  // Categories?$select=CategoryName,Description. Optional.
  1173  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  1174  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  1175  // Optional.
  1176  // count - the Boolean value of true or false to request a count of the matching resources included with the
  1177  // resources in the response, e.g. Categories?$count=true. Optional.
  1178  // search - a free form search. A free-text search expression to match for whether a particular entry should be
  1179  // included in the feed, e.g. Categories?$search=blue OR green. Optional.
  1180  // formatParameter - the desired return format. Return the response in particular format without access to
  1181  // request headers for standard content-type negotiation (e.g Orders?$format=json). Optional.
  1182  func (client Client) ListDataLakeStoreAccounts(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListDataLakeStoreResultPage, err error) {
  1183  	if tracing.IsEnabled() {
  1184  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListDataLakeStoreAccounts")
  1185  		defer func() {
  1186  			sc := -1
  1187  			if result.dlaaldlsr.Response.Response != nil {
  1188  				sc = result.dlaaldlsr.Response.Response.StatusCode
  1189  			}
  1190  			tracing.EndSpan(ctx, sc, err)
  1191  		}()
  1192  	}
  1193  	result.fn = client.listDataLakeStoreAccountsNextResults
  1194  	req, err := client.ListDataLakeStoreAccountsPreparer(ctx, resourceGroupName, accountName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter)
  1195  	if err != nil {
  1196  		err = autorest.NewErrorWithError(err, "account.Client", "ListDataLakeStoreAccounts", nil, "Failure preparing request")
  1197  		return
  1198  	}
  1199  
  1200  	resp, err := client.ListDataLakeStoreAccountsSender(req)
  1201  	if err != nil {
  1202  		result.dlaaldlsr.Response = autorest.Response{Response: resp}
  1203  		err = autorest.NewErrorWithError(err, "account.Client", "ListDataLakeStoreAccounts", resp, "Failure sending request")
  1204  		return
  1205  	}
  1206  
  1207  	result.dlaaldlsr, err = client.ListDataLakeStoreAccountsResponder(resp)
  1208  	if err != nil {
  1209  		err = autorest.NewErrorWithError(err, "account.Client", "ListDataLakeStoreAccounts", resp, "Failure responding to request")
  1210  		return
  1211  	}
  1212  	if result.dlaaldlsr.hasNextLink() && result.dlaaldlsr.IsEmpty() {
  1213  		err = result.NextWithContext(ctx)
  1214  		return
  1215  	}
  1216  
  1217  	return
  1218  }
  1219  
  1220  // ListDataLakeStoreAccountsPreparer prepares the ListDataLakeStoreAccounts request.
  1221  func (client Client) ListDataLakeStoreAccountsPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (*http.Request, error) {
  1222  	pathParameters := map[string]interface{}{
  1223  		"accountName":       autorest.Encode("path", accountName),
  1224  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1225  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1226  	}
  1227  
  1228  	const APIVersion = "2015-10-01-preview"
  1229  	queryParameters := map[string]interface{}{
  1230  		"api-version": APIVersion,
  1231  	}
  1232  	if len(filter) > 0 {
  1233  		queryParameters["$filter"] = autorest.Encode("query", filter)
  1234  	}
  1235  	if top != nil {
  1236  		queryParameters["$top"] = autorest.Encode("query", *top)
  1237  	}
  1238  	if skip != nil {
  1239  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  1240  	}
  1241  	if len(expand) > 0 {
  1242  		queryParameters["$expand"] = autorest.Encode("query", expand)
  1243  	}
  1244  	if len(selectParameter) > 0 {
  1245  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  1246  	}
  1247  	if len(orderby) > 0 {
  1248  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  1249  	}
  1250  	if count != nil {
  1251  		queryParameters["$count"] = autorest.Encode("query", *count)
  1252  	}
  1253  	if len(search) > 0 {
  1254  		queryParameters["$search"] = autorest.Encode("query", search)
  1255  	}
  1256  	if len(formatParameter) > 0 {
  1257  		queryParameters["$format"] = autorest.Encode("query", formatParameter)
  1258  	}
  1259  
  1260  	preparer := autorest.CreatePreparer(
  1261  		autorest.AsGet(),
  1262  		autorest.WithBaseURL(client.BaseURI),
  1263  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/", pathParameters),
  1264  		autorest.WithQueryParameters(queryParameters))
  1265  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1266  }
  1267  
  1268  // ListDataLakeStoreAccountsSender sends the ListDataLakeStoreAccounts request. The method will close the
  1269  // http.Response Body if it receives an error.
  1270  func (client Client) ListDataLakeStoreAccountsSender(req *http.Request) (*http.Response, error) {
  1271  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1272  }
  1273  
  1274  // ListDataLakeStoreAccountsResponder handles the response to the ListDataLakeStoreAccounts request. The method always
  1275  // closes the http.Response Body.
  1276  func (client Client) ListDataLakeStoreAccountsResponder(resp *http.Response) (result DataLakeAnalyticsAccountListDataLakeStoreResult, err error) {
  1277  	err = autorest.Respond(
  1278  		resp,
  1279  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1280  		autorest.ByUnmarshallingJSON(&result),
  1281  		autorest.ByClosing())
  1282  	result.Response = autorest.Response{Response: resp}
  1283  	return
  1284  }
  1285  
  1286  // listDataLakeStoreAccountsNextResults retrieves the next set of results, if any.
  1287  func (client Client) listDataLakeStoreAccountsNextResults(ctx context.Context, lastResults DataLakeAnalyticsAccountListDataLakeStoreResult) (result DataLakeAnalyticsAccountListDataLakeStoreResult, err error) {
  1288  	req, err := lastResults.dataLakeAnalyticsAccountListDataLakeStoreResultPreparer(ctx)
  1289  	if err != nil {
  1290  		return result, autorest.NewErrorWithError(err, "account.Client", "listDataLakeStoreAccountsNextResults", nil, "Failure preparing next results request")
  1291  	}
  1292  	if req == nil {
  1293  		return
  1294  	}
  1295  	resp, err := client.ListDataLakeStoreAccountsSender(req)
  1296  	if err != nil {
  1297  		result.Response = autorest.Response{Response: resp}
  1298  		return result, autorest.NewErrorWithError(err, "account.Client", "listDataLakeStoreAccountsNextResults", resp, "Failure sending next results request")
  1299  	}
  1300  	result, err = client.ListDataLakeStoreAccountsResponder(resp)
  1301  	if err != nil {
  1302  		err = autorest.NewErrorWithError(err, "account.Client", "listDataLakeStoreAccountsNextResults", resp, "Failure responding to next results request")
  1303  	}
  1304  	return
  1305  }
  1306  
  1307  // ListDataLakeStoreAccountsComplete enumerates all values, automatically crossing page boundaries as required.
  1308  func (client Client) ListDataLakeStoreAccountsComplete(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListDataLakeStoreResultIterator, err error) {
  1309  	if tracing.IsEnabled() {
  1310  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListDataLakeStoreAccounts")
  1311  		defer func() {
  1312  			sc := -1
  1313  			if result.Response().Response.Response != nil {
  1314  				sc = result.page.Response().Response.Response.StatusCode
  1315  			}
  1316  			tracing.EndSpan(ctx, sc, err)
  1317  		}()
  1318  	}
  1319  	result.page, err = client.ListDataLakeStoreAccounts(ctx, resourceGroupName, accountName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter)
  1320  	return
  1321  }
  1322  
  1323  // ListSasTokens gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and
  1324  // container combination.
  1325  // Parameters:
  1326  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
  1327  // accountName - the name of the Data Lake Analytics account from which an Azure Storage account's SAS token is
  1328  // being requested.
  1329  // storageAccountName - the name of the Azure storage account for which the SAS token is being requested.
  1330  // containerName - the name of the Azure storage container for which the SAS token is being requested.
  1331  func (client Client) ListSasTokens(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, containerName string) (result ListSasTokensResultPage, err error) {
  1332  	if tracing.IsEnabled() {
  1333  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListSasTokens")
  1334  		defer func() {
  1335  			sc := -1
  1336  			if result.lstr.Response.Response != nil {
  1337  				sc = result.lstr.Response.Response.StatusCode
  1338  			}
  1339  			tracing.EndSpan(ctx, sc, err)
  1340  		}()
  1341  	}
  1342  	result.fn = client.listSasTokensNextResults
  1343  	req, err := client.ListSasTokensPreparer(ctx, resourceGroupName, accountName, storageAccountName, containerName)
  1344  	if err != nil {
  1345  		err = autorest.NewErrorWithError(err, "account.Client", "ListSasTokens", nil, "Failure preparing request")
  1346  		return
  1347  	}
  1348  
  1349  	resp, err := client.ListSasTokensSender(req)
  1350  	if err != nil {
  1351  		result.lstr.Response = autorest.Response{Response: resp}
  1352  		err = autorest.NewErrorWithError(err, "account.Client", "ListSasTokens", resp, "Failure sending request")
  1353  		return
  1354  	}
  1355  
  1356  	result.lstr, err = client.ListSasTokensResponder(resp)
  1357  	if err != nil {
  1358  		err = autorest.NewErrorWithError(err, "account.Client", "ListSasTokens", resp, "Failure responding to request")
  1359  		return
  1360  	}
  1361  	if result.lstr.hasNextLink() && result.lstr.IsEmpty() {
  1362  		err = result.NextWithContext(ctx)
  1363  		return
  1364  	}
  1365  
  1366  	return
  1367  }
  1368  
  1369  // ListSasTokensPreparer prepares the ListSasTokens request.
  1370  func (client Client) ListSasTokensPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, containerName string) (*http.Request, error) {
  1371  	pathParameters := map[string]interface{}{
  1372  		"accountName":        autorest.Encode("path", accountName),
  1373  		"containerName":      autorest.Encode("path", containerName),
  1374  		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
  1375  		"storageAccountName": autorest.Encode("path", storageAccountName),
  1376  		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
  1377  	}
  1378  
  1379  	const APIVersion = "2015-10-01-preview"
  1380  	queryParameters := map[string]interface{}{
  1381  		"api-version": APIVersion,
  1382  	}
  1383  
  1384  	preparer := autorest.CreatePreparer(
  1385  		autorest.AsPost(),
  1386  		autorest.WithBaseURL(client.BaseURI),
  1387  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers/{containerName}/listSasTokens", pathParameters),
  1388  		autorest.WithQueryParameters(queryParameters))
  1389  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1390  }
  1391  
  1392  // ListSasTokensSender sends the ListSasTokens request. The method will close the
  1393  // http.Response Body if it receives an error.
  1394  func (client Client) ListSasTokensSender(req *http.Request) (*http.Response, error) {
  1395  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1396  }
  1397  
  1398  // ListSasTokensResponder handles the response to the ListSasTokens request. The method always
  1399  // closes the http.Response Body.
  1400  func (client Client) ListSasTokensResponder(resp *http.Response) (result ListSasTokensResult, err error) {
  1401  	err = autorest.Respond(
  1402  		resp,
  1403  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1404  		autorest.ByUnmarshallingJSON(&result),
  1405  		autorest.ByClosing())
  1406  	result.Response = autorest.Response{Response: resp}
  1407  	return
  1408  }
  1409  
  1410  // listSasTokensNextResults retrieves the next set of results, if any.
  1411  func (client Client) listSasTokensNextResults(ctx context.Context, lastResults ListSasTokensResult) (result ListSasTokensResult, err error) {
  1412  	req, err := lastResults.listSasTokensResultPreparer(ctx)
  1413  	if err != nil {
  1414  		return result, autorest.NewErrorWithError(err, "account.Client", "listSasTokensNextResults", nil, "Failure preparing next results request")
  1415  	}
  1416  	if req == nil {
  1417  		return
  1418  	}
  1419  	resp, err := client.ListSasTokensSender(req)
  1420  	if err != nil {
  1421  		result.Response = autorest.Response{Response: resp}
  1422  		return result, autorest.NewErrorWithError(err, "account.Client", "listSasTokensNextResults", resp, "Failure sending next results request")
  1423  	}
  1424  	result, err = client.ListSasTokensResponder(resp)
  1425  	if err != nil {
  1426  		err = autorest.NewErrorWithError(err, "account.Client", "listSasTokensNextResults", resp, "Failure responding to next results request")
  1427  	}
  1428  	return
  1429  }
  1430  
  1431  // ListSasTokensComplete enumerates all values, automatically crossing page boundaries as required.
  1432  func (client Client) ListSasTokensComplete(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, containerName string) (result ListSasTokensResultIterator, err error) {
  1433  	if tracing.IsEnabled() {
  1434  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListSasTokens")
  1435  		defer func() {
  1436  			sc := -1
  1437  			if result.Response().Response.Response != nil {
  1438  				sc = result.page.Response().Response.Response.StatusCode
  1439  			}
  1440  			tracing.EndSpan(ctx, sc, err)
  1441  		}()
  1442  	}
  1443  	result.page, err = client.ListSasTokens(ctx, resourceGroupName, accountName, storageAccountName, containerName)
  1444  	return
  1445  }
  1446  
  1447  // ListStorageAccounts gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake
  1448  // Analytics account. The response includes a link to the next page, if any.
  1449  // Parameters:
  1450  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
  1451  // accountName - the name of the Data Lake Analytics account for which to list Azure Storage accounts.
  1452  // filter - the OData filter. Optional.
  1453  // top - the number of items to return. Optional.
  1454  // skip - the number of items to skip over before returning elements. Optional.
  1455  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  1456  // Categories/$expand=Products would expand Product data in line with each Category entry. Optional.
  1457  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  1458  // Categories?$select=CategoryName,Description. Optional.
  1459  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  1460  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  1461  // Optional.
  1462  // count - the Boolean value of true or false to request a count of the matching resources included with the
  1463  // resources in the response, e.g. Categories?$count=true. Optional.
  1464  // search - a free form search. A free-text search expression to match for whether a particular entry should be
  1465  // included in the feed, e.g. Categories?$search=blue OR green. Optional.
  1466  // formatParameter - the desired return format. Return the response in particular format without access to
  1467  // request headers for standard content-type negotiation (e.g Orders?$format=json). Optional.
  1468  func (client Client) ListStorageAccounts(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListStorageAccountsResultPage, err error) {
  1469  	if tracing.IsEnabled() {
  1470  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListStorageAccounts")
  1471  		defer func() {
  1472  			sc := -1
  1473  			if result.dlaalsar.Response.Response != nil {
  1474  				sc = result.dlaalsar.Response.Response.StatusCode
  1475  			}
  1476  			tracing.EndSpan(ctx, sc, err)
  1477  		}()
  1478  	}
  1479  	result.fn = client.listStorageAccountsNextResults
  1480  	req, err := client.ListStorageAccountsPreparer(ctx, resourceGroupName, accountName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter)
  1481  	if err != nil {
  1482  		err = autorest.NewErrorWithError(err, "account.Client", "ListStorageAccounts", nil, "Failure preparing request")
  1483  		return
  1484  	}
  1485  
  1486  	resp, err := client.ListStorageAccountsSender(req)
  1487  	if err != nil {
  1488  		result.dlaalsar.Response = autorest.Response{Response: resp}
  1489  		err = autorest.NewErrorWithError(err, "account.Client", "ListStorageAccounts", resp, "Failure sending request")
  1490  		return
  1491  	}
  1492  
  1493  	result.dlaalsar, err = client.ListStorageAccountsResponder(resp)
  1494  	if err != nil {
  1495  		err = autorest.NewErrorWithError(err, "account.Client", "ListStorageAccounts", resp, "Failure responding to request")
  1496  		return
  1497  	}
  1498  	if result.dlaalsar.hasNextLink() && result.dlaalsar.IsEmpty() {
  1499  		err = result.NextWithContext(ctx)
  1500  		return
  1501  	}
  1502  
  1503  	return
  1504  }
  1505  
  1506  // ListStorageAccountsPreparer prepares the ListStorageAccounts request.
  1507  func (client Client) ListStorageAccountsPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (*http.Request, error) {
  1508  	pathParameters := map[string]interface{}{
  1509  		"accountName":       autorest.Encode("path", accountName),
  1510  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1511  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1512  	}
  1513  
  1514  	const APIVersion = "2015-10-01-preview"
  1515  	queryParameters := map[string]interface{}{
  1516  		"api-version": APIVersion,
  1517  	}
  1518  	if len(filter) > 0 {
  1519  		queryParameters["$filter"] = autorest.Encode("query", filter)
  1520  	}
  1521  	if top != nil {
  1522  		queryParameters["$top"] = autorest.Encode("query", *top)
  1523  	}
  1524  	if skip != nil {
  1525  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  1526  	}
  1527  	if len(expand) > 0 {
  1528  		queryParameters["$expand"] = autorest.Encode("query", expand)
  1529  	}
  1530  	if len(selectParameter) > 0 {
  1531  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  1532  	}
  1533  	if len(orderby) > 0 {
  1534  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  1535  	}
  1536  	if count != nil {
  1537  		queryParameters["$count"] = autorest.Encode("query", *count)
  1538  	}
  1539  	if len(search) > 0 {
  1540  		queryParameters["$search"] = autorest.Encode("query", search)
  1541  	}
  1542  	if len(formatParameter) > 0 {
  1543  		queryParameters["$format"] = autorest.Encode("query", formatParameter)
  1544  	}
  1545  
  1546  	preparer := autorest.CreatePreparer(
  1547  		autorest.AsGet(),
  1548  		autorest.WithBaseURL(client.BaseURI),
  1549  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/", pathParameters),
  1550  		autorest.WithQueryParameters(queryParameters))
  1551  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1552  }
  1553  
  1554  // ListStorageAccountsSender sends the ListStorageAccounts request. The method will close the
  1555  // http.Response Body if it receives an error.
  1556  func (client Client) ListStorageAccountsSender(req *http.Request) (*http.Response, error) {
  1557  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1558  }
  1559  
  1560  // ListStorageAccountsResponder handles the response to the ListStorageAccounts request. The method always
  1561  // closes the http.Response Body.
  1562  func (client Client) ListStorageAccountsResponder(resp *http.Response) (result DataLakeAnalyticsAccountListStorageAccountsResult, err error) {
  1563  	err = autorest.Respond(
  1564  		resp,
  1565  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1566  		autorest.ByUnmarshallingJSON(&result),
  1567  		autorest.ByClosing())
  1568  	result.Response = autorest.Response{Response: resp}
  1569  	return
  1570  }
  1571  
  1572  // listStorageAccountsNextResults retrieves the next set of results, if any.
  1573  func (client Client) listStorageAccountsNextResults(ctx context.Context, lastResults DataLakeAnalyticsAccountListStorageAccountsResult) (result DataLakeAnalyticsAccountListStorageAccountsResult, err error) {
  1574  	req, err := lastResults.dataLakeAnalyticsAccountListStorageAccountsResultPreparer(ctx)
  1575  	if err != nil {
  1576  		return result, autorest.NewErrorWithError(err, "account.Client", "listStorageAccountsNextResults", nil, "Failure preparing next results request")
  1577  	}
  1578  	if req == nil {
  1579  		return
  1580  	}
  1581  	resp, err := client.ListStorageAccountsSender(req)
  1582  	if err != nil {
  1583  		result.Response = autorest.Response{Response: resp}
  1584  		return result, autorest.NewErrorWithError(err, "account.Client", "listStorageAccountsNextResults", resp, "Failure sending next results request")
  1585  	}
  1586  	result, err = client.ListStorageAccountsResponder(resp)
  1587  	if err != nil {
  1588  		err = autorest.NewErrorWithError(err, "account.Client", "listStorageAccountsNextResults", resp, "Failure responding to next results request")
  1589  	}
  1590  	return
  1591  }
  1592  
  1593  // ListStorageAccountsComplete enumerates all values, automatically crossing page boundaries as required.
  1594  func (client Client) ListStorageAccountsComplete(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListStorageAccountsResultIterator, err error) {
  1595  	if tracing.IsEnabled() {
  1596  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListStorageAccounts")
  1597  		defer func() {
  1598  			sc := -1
  1599  			if result.Response().Response.Response != nil {
  1600  				sc = result.page.Response().Response.Response.StatusCode
  1601  			}
  1602  			tracing.EndSpan(ctx, sc, err)
  1603  		}()
  1604  	}
  1605  	result.page, err = client.ListStorageAccounts(ctx, resourceGroupName, accountName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter)
  1606  	return
  1607  }
  1608  
  1609  // ListStorageContainers lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics
  1610  // and Azure Storage account combination. The response includes a link to the next page of results, if any.
  1611  // Parameters:
  1612  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
  1613  // accountName - the name of the Data Lake Analytics account for which to list Azure Storage blob containers.
  1614  // storageAccountName - the name of the Azure storage account from which to list blob containers.
  1615  func (client Client) ListStorageContainers(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (result ListBlobContainersResultPage, err error) {
  1616  	if tracing.IsEnabled() {
  1617  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListStorageContainers")
  1618  		defer func() {
  1619  			sc := -1
  1620  			if result.lbcr.Response.Response != nil {
  1621  				sc = result.lbcr.Response.Response.StatusCode
  1622  			}
  1623  			tracing.EndSpan(ctx, sc, err)
  1624  		}()
  1625  	}
  1626  	result.fn = client.listStorageContainersNextResults
  1627  	req, err := client.ListStorageContainersPreparer(ctx, resourceGroupName, accountName, storageAccountName)
  1628  	if err != nil {
  1629  		err = autorest.NewErrorWithError(err, "account.Client", "ListStorageContainers", nil, "Failure preparing request")
  1630  		return
  1631  	}
  1632  
  1633  	resp, err := client.ListStorageContainersSender(req)
  1634  	if err != nil {
  1635  		result.lbcr.Response = autorest.Response{Response: resp}
  1636  		err = autorest.NewErrorWithError(err, "account.Client", "ListStorageContainers", resp, "Failure sending request")
  1637  		return
  1638  	}
  1639  
  1640  	result.lbcr, err = client.ListStorageContainersResponder(resp)
  1641  	if err != nil {
  1642  		err = autorest.NewErrorWithError(err, "account.Client", "ListStorageContainers", resp, "Failure responding to request")
  1643  		return
  1644  	}
  1645  	if result.lbcr.hasNextLink() && result.lbcr.IsEmpty() {
  1646  		err = result.NextWithContext(ctx)
  1647  		return
  1648  	}
  1649  
  1650  	return
  1651  }
  1652  
  1653  // ListStorageContainersPreparer prepares the ListStorageContainers request.
  1654  func (client Client) ListStorageContainersPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (*http.Request, error) {
  1655  	pathParameters := map[string]interface{}{
  1656  		"accountName":        autorest.Encode("path", accountName),
  1657  		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
  1658  		"storageAccountName": autorest.Encode("path", storageAccountName),
  1659  		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
  1660  	}
  1661  
  1662  	const APIVersion = "2015-10-01-preview"
  1663  	queryParameters := map[string]interface{}{
  1664  		"api-version": APIVersion,
  1665  	}
  1666  
  1667  	preparer := autorest.CreatePreparer(
  1668  		autorest.AsGet(),
  1669  		autorest.WithBaseURL(client.BaseURI),
  1670  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers", pathParameters),
  1671  		autorest.WithQueryParameters(queryParameters))
  1672  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1673  }
  1674  
  1675  // ListStorageContainersSender sends the ListStorageContainers request. The method will close the
  1676  // http.Response Body if it receives an error.
  1677  func (client Client) ListStorageContainersSender(req *http.Request) (*http.Response, error) {
  1678  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1679  }
  1680  
  1681  // ListStorageContainersResponder handles the response to the ListStorageContainers request. The method always
  1682  // closes the http.Response Body.
  1683  func (client Client) ListStorageContainersResponder(resp *http.Response) (result ListBlobContainersResult, err error) {
  1684  	err = autorest.Respond(
  1685  		resp,
  1686  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1687  		autorest.ByUnmarshallingJSON(&result),
  1688  		autorest.ByClosing())
  1689  	result.Response = autorest.Response{Response: resp}
  1690  	return
  1691  }
  1692  
  1693  // listStorageContainersNextResults retrieves the next set of results, if any.
  1694  func (client Client) listStorageContainersNextResults(ctx context.Context, lastResults ListBlobContainersResult) (result ListBlobContainersResult, err error) {
  1695  	req, err := lastResults.listBlobContainersResultPreparer(ctx)
  1696  	if err != nil {
  1697  		return result, autorest.NewErrorWithError(err, "account.Client", "listStorageContainersNextResults", nil, "Failure preparing next results request")
  1698  	}
  1699  	if req == nil {
  1700  		return
  1701  	}
  1702  	resp, err := client.ListStorageContainersSender(req)
  1703  	if err != nil {
  1704  		result.Response = autorest.Response{Response: resp}
  1705  		return result, autorest.NewErrorWithError(err, "account.Client", "listStorageContainersNextResults", resp, "Failure sending next results request")
  1706  	}
  1707  	result, err = client.ListStorageContainersResponder(resp)
  1708  	if err != nil {
  1709  		err = autorest.NewErrorWithError(err, "account.Client", "listStorageContainersNextResults", resp, "Failure responding to next results request")
  1710  	}
  1711  	return
  1712  }
  1713  
  1714  // ListStorageContainersComplete enumerates all values, automatically crossing page boundaries as required.
  1715  func (client Client) ListStorageContainersComplete(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (result ListBlobContainersResultIterator, err error) {
  1716  	if tracing.IsEnabled() {
  1717  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListStorageContainers")
  1718  		defer func() {
  1719  			sc := -1
  1720  			if result.Response().Response.Response != nil {
  1721  				sc = result.page.Response().Response.Response.StatusCode
  1722  			}
  1723  			tracing.EndSpan(ctx, sc, err)
  1724  		}()
  1725  	}
  1726  	result.page, err = client.ListStorageContainers(ctx, resourceGroupName, accountName, storageAccountName)
  1727  	return
  1728  }
  1729  
  1730  // Update updates the Data Lake Analytics account object specified by the accountName with the contents of the account
  1731  // object.
  1732  // Parameters:
  1733  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
  1734  // name - the name of the Data Lake Analytics account to update.
  1735  // parameters - parameters supplied to the update Data Lake Analytics account operation.
  1736  func (client Client) Update(ctx context.Context, resourceGroupName string, name string, parameters DataLakeAnalyticsAccount) (result UpdateFuture, err error) {
  1737  	if tracing.IsEnabled() {
  1738  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update")
  1739  		defer func() {
  1740  			sc := -1
  1741  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
  1742  				sc = result.FutureAPI.Response().StatusCode
  1743  			}
  1744  			tracing.EndSpan(ctx, sc, err)
  1745  		}()
  1746  	}
  1747  	req, err := client.UpdatePreparer(ctx, resourceGroupName, name, parameters)
  1748  	if err != nil {
  1749  		err = autorest.NewErrorWithError(err, "account.Client", "Update", nil, "Failure preparing request")
  1750  		return
  1751  	}
  1752  
  1753  	result, err = client.UpdateSender(req)
  1754  	if err != nil {
  1755  		err = autorest.NewErrorWithError(err, "account.Client", "Update", result.Response(), "Failure sending request")
  1756  		return
  1757  	}
  1758  
  1759  	return
  1760  }
  1761  
  1762  // UpdatePreparer prepares the Update request.
  1763  func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, parameters DataLakeAnalyticsAccount) (*http.Request, error) {
  1764  	pathParameters := map[string]interface{}{
  1765  		"name":              autorest.Encode("path", name),
  1766  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1767  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1768  	}
  1769  
  1770  	const APIVersion = "2015-10-01-preview"
  1771  	queryParameters := map[string]interface{}{
  1772  		"api-version": APIVersion,
  1773  	}
  1774  
  1775  	parameters.Type = nil
  1776  	parameters.ID = nil
  1777  	preparer := autorest.CreatePreparer(
  1778  		autorest.AsContentType("application/json; charset=utf-8"),
  1779  		autorest.AsPatch(),
  1780  		autorest.WithBaseURL(client.BaseURI),
  1781  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}", pathParameters),
  1782  		autorest.WithJSON(parameters),
  1783  		autorest.WithQueryParameters(queryParameters))
  1784  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1785  }
  1786  
  1787  // UpdateSender sends the Update request. The method will close the
  1788  // http.Response Body if it receives an error.
  1789  func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, err error) {
  1790  	var resp *http.Response
  1791  	future.FutureAPI = &azure.Future{}
  1792  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1793  	if err != nil {
  1794  		return
  1795  	}
  1796  	var azf azure.Future
  1797  	azf, err = azure.NewFutureFromResponse(resp)
  1798  	future.FutureAPI = &azf
  1799  	future.Result = future.result
  1800  	return
  1801  }
  1802  
  1803  // UpdateResponder handles the response to the Update request. The method always
  1804  // closes the http.Response Body.
  1805  func (client Client) UpdateResponder(resp *http.Response) (result DataLakeAnalyticsAccount, err error) {
  1806  	err = autorest.Respond(
  1807  		resp,
  1808  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
  1809  		autorest.ByUnmarshallingJSON(&result),
  1810  		autorest.ByClosing())
  1811  	result.Response = autorest.Response{Response: resp}
  1812  	return
  1813  }
  1814  
  1815  // UpdateStorageAccount updates the Data Lake Analytics account to replace Azure Storage blob account details, such as
  1816  // the access key and/or suffix.
  1817  // Parameters:
  1818  // resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.
  1819  // accountName - the name of the Data Lake Analytics account to modify storage accounts in
  1820  // storageAccountName - the Azure Storage account to modify
  1821  // parameters - the parameters containing the access key and suffix to update the storage account with.
  1822  func (client Client) UpdateStorageAccount(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, parameters AddStorageAccountParameters) (result autorest.Response, err error) {
  1823  	if tracing.IsEnabled() {
  1824  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateStorageAccount")
  1825  		defer func() {
  1826  			sc := -1
  1827  			if result.Response != nil {
  1828  				sc = result.Response.StatusCode
  1829  			}
  1830  			tracing.EndSpan(ctx, sc, err)
  1831  		}()
  1832  	}
  1833  	req, err := client.UpdateStorageAccountPreparer(ctx, resourceGroupName, accountName, storageAccountName, parameters)
  1834  	if err != nil {
  1835  		err = autorest.NewErrorWithError(err, "account.Client", "UpdateStorageAccount", nil, "Failure preparing request")
  1836  		return
  1837  	}
  1838  
  1839  	resp, err := client.UpdateStorageAccountSender(req)
  1840  	if err != nil {
  1841  		result.Response = resp
  1842  		err = autorest.NewErrorWithError(err, "account.Client", "UpdateStorageAccount", resp, "Failure sending request")
  1843  		return
  1844  	}
  1845  
  1846  	result, err = client.UpdateStorageAccountResponder(resp)
  1847  	if err != nil {
  1848  		err = autorest.NewErrorWithError(err, "account.Client", "UpdateStorageAccount", resp, "Failure responding to request")
  1849  		return
  1850  	}
  1851  
  1852  	return
  1853  }
  1854  
  1855  // UpdateStorageAccountPreparer prepares the UpdateStorageAccount request.
  1856  func (client Client) UpdateStorageAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, parameters AddStorageAccountParameters) (*http.Request, error) {
  1857  	pathParameters := map[string]interface{}{
  1858  		"accountName":        autorest.Encode("path", accountName),
  1859  		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
  1860  		"storageAccountName": autorest.Encode("path", storageAccountName),
  1861  		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
  1862  	}
  1863  
  1864  	const APIVersion = "2015-10-01-preview"
  1865  	queryParameters := map[string]interface{}{
  1866  		"api-version": APIVersion,
  1867  	}
  1868  
  1869  	preparer := autorest.CreatePreparer(
  1870  		autorest.AsContentType("application/json; charset=utf-8"),
  1871  		autorest.AsPatch(),
  1872  		autorest.WithBaseURL(client.BaseURI),
  1873  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}", pathParameters),
  1874  		autorest.WithJSON(parameters),
  1875  		autorest.WithQueryParameters(queryParameters))
  1876  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1877  }
  1878  
  1879  // UpdateStorageAccountSender sends the UpdateStorageAccount request. The method will close the
  1880  // http.Response Body if it receives an error.
  1881  func (client Client) UpdateStorageAccountSender(req *http.Request) (*http.Response, error) {
  1882  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1883  }
  1884  
  1885  // UpdateStorageAccountResponder handles the response to the UpdateStorageAccount request. The method always
  1886  // closes the http.Response Body.
  1887  func (client Client) UpdateStorageAccountResponder(resp *http.Response) (result autorest.Response, err error) {
  1888  	err = autorest.Respond(
  1889  		resp,
  1890  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1891  		autorest.ByClosing())
  1892  	result.Response = resp
  1893  	return
  1894  }
  1895  

View as plain text