...

Source file src/github.com/Azure/azure-sdk-for-go/services/solutions/mgmt/2017-12-01/managedapplications/applications.go

Documentation: github.com/Azure/azure-sdk-for-go/services/solutions/mgmt/2017-12-01/managedapplications

     1  package managedapplications
     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  // ApplicationsClient is the ARM applications
    19  type ApplicationsClient struct {
    20  	BaseClient
    21  }
    22  
    23  // NewApplicationsClient creates an instance of the ApplicationsClient client.
    24  func NewApplicationsClient(subscriptionID string) ApplicationsClient {
    25  	return NewApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
    26  }
    27  
    28  // NewApplicationsClientWithBaseURI creates an instance of the ApplicationsClient client using a custom endpoint.  Use
    29  // this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
    30  func NewApplicationsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationsClient {
    31  	return ApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)}
    32  }
    33  
    34  // CreateOrUpdate creates or updates a managed application.
    35  // Parameters:
    36  // resourceGroupName - the name of the resource group. The name is case insensitive.
    37  // applicationName - the name of the managed application.
    38  // parameters - parameters supplied to the create or update a managed application.
    39  func (client ApplicationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationName string, parameters Application) (result ApplicationsCreateOrUpdateFuture, err error) {
    40  	if tracing.IsEnabled() {
    41  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.CreateOrUpdate")
    42  		defer func() {
    43  			sc := -1
    44  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
    45  				sc = result.FutureAPI.Response().StatusCode
    46  			}
    47  			tracing.EndSpan(ctx, sc, err)
    48  		}()
    49  	}
    50  	if err := validation.Validate([]validation.Validation{
    51  		{TargetValue: resourceGroupName,
    52  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
    53  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
    54  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
    55  		{TargetValue: applicationName,
    56  			Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 64, Chain: nil},
    57  				{Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
    58  		{TargetValue: parameters,
    59  			Constraints: []validation.Constraint{{Target: "parameters.ApplicationProperties", Name: validation.Null, Rule: true,
    60  				Chain: []validation.Constraint{{Target: "parameters.ApplicationProperties.ManagedResourceGroupID", Name: validation.Null, Rule: true, Chain: nil}}},
    61  				{Target: "parameters.Plan", Name: validation.Null, Rule: false,
    62  					Chain: []validation.Constraint{{Target: "parameters.Plan.Name", Name: validation.Null, Rule: true, Chain: nil},
    63  						{Target: "parameters.Plan.Publisher", Name: validation.Null, Rule: true, Chain: nil},
    64  						{Target: "parameters.Plan.Product", Name: validation.Null, Rule: true, Chain: nil},
    65  						{Target: "parameters.Plan.Version", Name: validation.Null, Rule: true, Chain: nil},
    66  					}},
    67  				{Target: "parameters.Kind", Name: validation.Null, Rule: true,
    68  					Chain: []validation.Constraint{{Target: "parameters.Kind", Name: validation.Pattern, Rule: `^[-\w\._,\(\)]+$`, Chain: nil}}}}}}); err != nil {
    69  		return result, validation.NewError("managedapplications.ApplicationsClient", "CreateOrUpdate", err.Error())
    70  	}
    71  
    72  	req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationName, parameters)
    73  	if err != nil {
    74  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "CreateOrUpdate", nil, "Failure preparing request")
    75  		return
    76  	}
    77  
    78  	result, err = client.CreateOrUpdateSender(req)
    79  	if err != nil {
    80  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
    81  		return
    82  	}
    83  
    84  	return
    85  }
    86  
    87  // CreateOrUpdatePreparer prepares the CreateOrUpdate request.
    88  func (client ApplicationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, applicationName string, parameters Application) (*http.Request, error) {
    89  	pathParameters := map[string]interface{}{
    90  		"applicationName":   autorest.Encode("path", applicationName),
    91  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
    92  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
    93  	}
    94  
    95  	const APIVersion = "2017-12-01"
    96  	queryParameters := map[string]interface{}{
    97  		"api-version": APIVersion,
    98  	}
    99  
   100  	preparer := autorest.CreatePreparer(
   101  		autorest.AsContentType("application/json; charset=utf-8"),
   102  		autorest.AsPut(),
   103  		autorest.WithBaseURL(client.BaseURI),
   104  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", pathParameters),
   105  		autorest.WithJSON(parameters),
   106  		autorest.WithQueryParameters(queryParameters))
   107  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   108  }
   109  
   110  // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
   111  // http.Response Body if it receives an error.
   112  func (client ApplicationsClient) CreateOrUpdateSender(req *http.Request) (future ApplicationsCreateOrUpdateFuture, err error) {
   113  	var resp *http.Response
   114  	future.FutureAPI = &azure.Future{}
   115  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   116  	if err != nil {
   117  		return
   118  	}
   119  	var azf azure.Future
   120  	azf, err = azure.NewFutureFromResponse(resp)
   121  	future.FutureAPI = &azf
   122  	future.Result = future.result
   123  	return
   124  }
   125  
   126  // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
   127  // closes the http.Response Body.
   128  func (client ApplicationsClient) CreateOrUpdateResponder(resp *http.Response) (result Application, err error) {
   129  	err = autorest.Respond(
   130  		resp,
   131  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
   132  		autorest.ByUnmarshallingJSON(&result),
   133  		autorest.ByClosing())
   134  	result.Response = autorest.Response{Response: resp}
   135  	return
   136  }
   137  
   138  // CreateOrUpdateByID creates or updates a managed application.
   139  // Parameters:
   140  // applicationID - the fully qualified ID of the managed application, including the managed application name
   141  // and the managed application resource type. Use the format,
   142  // /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}
   143  // parameters - parameters supplied to the create or update a managed application.
   144  func (client ApplicationsClient) CreateOrUpdateByID(ctx context.Context, applicationID string, parameters Application) (result ApplicationsCreateOrUpdateByIDFuture, err error) {
   145  	if tracing.IsEnabled() {
   146  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.CreateOrUpdateByID")
   147  		defer func() {
   148  			sc := -1
   149  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   150  				sc = result.FutureAPI.Response().StatusCode
   151  			}
   152  			tracing.EndSpan(ctx, sc, err)
   153  		}()
   154  	}
   155  	if err := validation.Validate([]validation.Validation{
   156  		{TargetValue: parameters,
   157  			Constraints: []validation.Constraint{{Target: "parameters.ApplicationProperties", Name: validation.Null, Rule: true,
   158  				Chain: []validation.Constraint{{Target: "parameters.ApplicationProperties.ManagedResourceGroupID", Name: validation.Null, Rule: true, Chain: nil}}},
   159  				{Target: "parameters.Plan", Name: validation.Null, Rule: false,
   160  					Chain: []validation.Constraint{{Target: "parameters.Plan.Name", Name: validation.Null, Rule: true, Chain: nil},
   161  						{Target: "parameters.Plan.Publisher", Name: validation.Null, Rule: true, Chain: nil},
   162  						{Target: "parameters.Plan.Product", Name: validation.Null, Rule: true, Chain: nil},
   163  						{Target: "parameters.Plan.Version", Name: validation.Null, Rule: true, Chain: nil},
   164  					}},
   165  				{Target: "parameters.Kind", Name: validation.Null, Rule: true,
   166  					Chain: []validation.Constraint{{Target: "parameters.Kind", Name: validation.Pattern, Rule: `^[-\w\._,\(\)]+$`, Chain: nil}}}}}}); err != nil {
   167  		return result, validation.NewError("managedapplications.ApplicationsClient", "CreateOrUpdateByID", err.Error())
   168  	}
   169  
   170  	req, err := client.CreateOrUpdateByIDPreparer(ctx, applicationID, parameters)
   171  	if err != nil {
   172  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "CreateOrUpdateByID", nil, "Failure preparing request")
   173  		return
   174  	}
   175  
   176  	result, err = client.CreateOrUpdateByIDSender(req)
   177  	if err != nil {
   178  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "CreateOrUpdateByID", result.Response(), "Failure sending request")
   179  		return
   180  	}
   181  
   182  	return
   183  }
   184  
   185  // CreateOrUpdateByIDPreparer prepares the CreateOrUpdateByID request.
   186  func (client ApplicationsClient) CreateOrUpdateByIDPreparer(ctx context.Context, applicationID string, parameters Application) (*http.Request, error) {
   187  	pathParameters := map[string]interface{}{
   188  		"applicationId": applicationID,
   189  	}
   190  
   191  	const APIVersion = "2017-12-01"
   192  	queryParameters := map[string]interface{}{
   193  		"api-version": APIVersion,
   194  	}
   195  
   196  	preparer := autorest.CreatePreparer(
   197  		autorest.AsContentType("application/json; charset=utf-8"),
   198  		autorest.AsPut(),
   199  		autorest.WithBaseURL(client.BaseURI),
   200  		autorest.WithPathParameters("/{applicationId}", pathParameters),
   201  		autorest.WithJSON(parameters),
   202  		autorest.WithQueryParameters(queryParameters))
   203  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   204  }
   205  
   206  // CreateOrUpdateByIDSender sends the CreateOrUpdateByID request. The method will close the
   207  // http.Response Body if it receives an error.
   208  func (client ApplicationsClient) CreateOrUpdateByIDSender(req *http.Request) (future ApplicationsCreateOrUpdateByIDFuture, err error) {
   209  	var resp *http.Response
   210  	future.FutureAPI = &azure.Future{}
   211  	resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   212  	if err != nil {
   213  		return
   214  	}
   215  	var azf azure.Future
   216  	azf, err = azure.NewFutureFromResponse(resp)
   217  	future.FutureAPI = &azf
   218  	future.Result = future.result
   219  	return
   220  }
   221  
   222  // CreateOrUpdateByIDResponder handles the response to the CreateOrUpdateByID request. The method always
   223  // closes the http.Response Body.
   224  func (client ApplicationsClient) CreateOrUpdateByIDResponder(resp *http.Response) (result Application, err error) {
   225  	err = autorest.Respond(
   226  		resp,
   227  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
   228  		autorest.ByUnmarshallingJSON(&result),
   229  		autorest.ByClosing())
   230  	result.Response = autorest.Response{Response: resp}
   231  	return
   232  }
   233  
   234  // Delete deletes the managed application.
   235  // Parameters:
   236  // resourceGroupName - the name of the resource group. The name is case insensitive.
   237  // applicationName - the name of the managed application.
   238  func (client ApplicationsClient) Delete(ctx context.Context, resourceGroupName string, applicationName string) (result ApplicationsDeleteFuture, err error) {
   239  	if tracing.IsEnabled() {
   240  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.Delete")
   241  		defer func() {
   242  			sc := -1
   243  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   244  				sc = result.FutureAPI.Response().StatusCode
   245  			}
   246  			tracing.EndSpan(ctx, sc, err)
   247  		}()
   248  	}
   249  	if err := validation.Validate([]validation.Validation{
   250  		{TargetValue: resourceGroupName,
   251  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   252  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   253  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   254  		{TargetValue: applicationName,
   255  			Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 64, Chain: nil},
   256  				{Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
   257  		return result, validation.NewError("managedapplications.ApplicationsClient", "Delete", err.Error())
   258  	}
   259  
   260  	req, err := client.DeletePreparer(ctx, resourceGroupName, applicationName)
   261  	if err != nil {
   262  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "Delete", nil, "Failure preparing request")
   263  		return
   264  	}
   265  
   266  	result, err = client.DeleteSender(req)
   267  	if err != nil {
   268  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "Delete", result.Response(), "Failure sending request")
   269  		return
   270  	}
   271  
   272  	return
   273  }
   274  
   275  // DeletePreparer prepares the Delete request.
   276  func (client ApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationName string) (*http.Request, error) {
   277  	pathParameters := map[string]interface{}{
   278  		"applicationName":   autorest.Encode("path", applicationName),
   279  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   280  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   281  	}
   282  
   283  	const APIVersion = "2017-12-01"
   284  	queryParameters := map[string]interface{}{
   285  		"api-version": APIVersion,
   286  	}
   287  
   288  	preparer := autorest.CreatePreparer(
   289  		autorest.AsDelete(),
   290  		autorest.WithBaseURL(client.BaseURI),
   291  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", pathParameters),
   292  		autorest.WithQueryParameters(queryParameters))
   293  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   294  }
   295  
   296  // DeleteSender sends the Delete request. The method will close the
   297  // http.Response Body if it receives an error.
   298  func (client ApplicationsClient) DeleteSender(req *http.Request) (future ApplicationsDeleteFuture, err error) {
   299  	var resp *http.Response
   300  	future.FutureAPI = &azure.Future{}
   301  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   302  	if err != nil {
   303  		return
   304  	}
   305  	var azf azure.Future
   306  	azf, err = azure.NewFutureFromResponse(resp)
   307  	future.FutureAPI = &azf
   308  	future.Result = future.result
   309  	return
   310  }
   311  
   312  // DeleteResponder handles the response to the Delete request. The method always
   313  // closes the http.Response Body.
   314  func (client ApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
   315  	err = autorest.Respond(
   316  		resp,
   317  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   318  		autorest.ByClosing())
   319  	result.Response = resp
   320  	return
   321  }
   322  
   323  // DeleteByID deletes the managed application.
   324  // Parameters:
   325  // applicationID - the fully qualified ID of the managed application, including the managed application name
   326  // and the managed application resource type. Use the format,
   327  // /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}
   328  func (client ApplicationsClient) DeleteByID(ctx context.Context, applicationID string) (result ApplicationsDeleteByIDFuture, err error) {
   329  	if tracing.IsEnabled() {
   330  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.DeleteByID")
   331  		defer func() {
   332  			sc := -1
   333  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   334  				sc = result.FutureAPI.Response().StatusCode
   335  			}
   336  			tracing.EndSpan(ctx, sc, err)
   337  		}()
   338  	}
   339  	req, err := client.DeleteByIDPreparer(ctx, applicationID)
   340  	if err != nil {
   341  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "DeleteByID", nil, "Failure preparing request")
   342  		return
   343  	}
   344  
   345  	result, err = client.DeleteByIDSender(req)
   346  	if err != nil {
   347  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "DeleteByID", result.Response(), "Failure sending request")
   348  		return
   349  	}
   350  
   351  	return
   352  }
   353  
   354  // DeleteByIDPreparer prepares the DeleteByID request.
   355  func (client ApplicationsClient) DeleteByIDPreparer(ctx context.Context, applicationID string) (*http.Request, error) {
   356  	pathParameters := map[string]interface{}{
   357  		"applicationId": applicationID,
   358  	}
   359  
   360  	const APIVersion = "2017-12-01"
   361  	queryParameters := map[string]interface{}{
   362  		"api-version": APIVersion,
   363  	}
   364  
   365  	preparer := autorest.CreatePreparer(
   366  		autorest.AsDelete(),
   367  		autorest.WithBaseURL(client.BaseURI),
   368  		autorest.WithPathParameters("/{applicationId}", pathParameters),
   369  		autorest.WithQueryParameters(queryParameters))
   370  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   371  }
   372  
   373  // DeleteByIDSender sends the DeleteByID request. The method will close the
   374  // http.Response Body if it receives an error.
   375  func (client ApplicationsClient) DeleteByIDSender(req *http.Request) (future ApplicationsDeleteByIDFuture, err error) {
   376  	var resp *http.Response
   377  	future.FutureAPI = &azure.Future{}
   378  	resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   379  	if err != nil {
   380  		return
   381  	}
   382  	var azf azure.Future
   383  	azf, err = azure.NewFutureFromResponse(resp)
   384  	future.FutureAPI = &azf
   385  	future.Result = future.result
   386  	return
   387  }
   388  
   389  // DeleteByIDResponder handles the response to the DeleteByID request. The method always
   390  // closes the http.Response Body.
   391  func (client ApplicationsClient) DeleteByIDResponder(resp *http.Response) (result autorest.Response, err error) {
   392  	err = autorest.Respond(
   393  		resp,
   394  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   395  		autorest.ByClosing())
   396  	result.Response = resp
   397  	return
   398  }
   399  
   400  // Get gets the managed application.
   401  // Parameters:
   402  // resourceGroupName - the name of the resource group. The name is case insensitive.
   403  // applicationName - the name of the managed application.
   404  func (client ApplicationsClient) Get(ctx context.Context, resourceGroupName string, applicationName string) (result Application, err error) {
   405  	if tracing.IsEnabled() {
   406  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.Get")
   407  		defer func() {
   408  			sc := -1
   409  			if result.Response.Response != nil {
   410  				sc = result.Response.Response.StatusCode
   411  			}
   412  			tracing.EndSpan(ctx, sc, err)
   413  		}()
   414  	}
   415  	if err := validation.Validate([]validation.Validation{
   416  		{TargetValue: resourceGroupName,
   417  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   418  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   419  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   420  		{TargetValue: applicationName,
   421  			Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 64, Chain: nil},
   422  				{Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
   423  		return result, validation.NewError("managedapplications.ApplicationsClient", "Get", err.Error())
   424  	}
   425  
   426  	req, err := client.GetPreparer(ctx, resourceGroupName, applicationName)
   427  	if err != nil {
   428  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "Get", nil, "Failure preparing request")
   429  		return
   430  	}
   431  
   432  	resp, err := client.GetSender(req)
   433  	if err != nil {
   434  		result.Response = autorest.Response{Response: resp}
   435  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "Get", resp, "Failure sending request")
   436  		return
   437  	}
   438  
   439  	result, err = client.GetResponder(resp)
   440  	if err != nil {
   441  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "Get", resp, "Failure responding to request")
   442  		return
   443  	}
   444  
   445  	return
   446  }
   447  
   448  // GetPreparer prepares the Get request.
   449  func (client ApplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationName string) (*http.Request, error) {
   450  	pathParameters := map[string]interface{}{
   451  		"applicationName":   autorest.Encode("path", applicationName),
   452  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   453  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   454  	}
   455  
   456  	const APIVersion = "2017-12-01"
   457  	queryParameters := map[string]interface{}{
   458  		"api-version": APIVersion,
   459  	}
   460  
   461  	preparer := autorest.CreatePreparer(
   462  		autorest.AsGet(),
   463  		autorest.WithBaseURL(client.BaseURI),
   464  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", pathParameters),
   465  		autorest.WithQueryParameters(queryParameters))
   466  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   467  }
   468  
   469  // GetSender sends the Get request. The method will close the
   470  // http.Response Body if it receives an error.
   471  func (client ApplicationsClient) GetSender(req *http.Request) (*http.Response, error) {
   472  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   473  }
   474  
   475  // GetResponder handles the response to the Get request. The method always
   476  // closes the http.Response Body.
   477  func (client ApplicationsClient) GetResponder(resp *http.Response) (result Application, err error) {
   478  	err = autorest.Respond(
   479  		resp,
   480  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
   481  		autorest.ByUnmarshallingJSON(&result),
   482  		autorest.ByClosing())
   483  	result.Response = autorest.Response{Response: resp}
   484  	return
   485  }
   486  
   487  // GetByID gets the managed application.
   488  // Parameters:
   489  // applicationID - the fully qualified ID of the managed application, including the managed application name
   490  // and the managed application resource type. Use the format,
   491  // /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}
   492  func (client ApplicationsClient) GetByID(ctx context.Context, applicationID string) (result Application, err error) {
   493  	if tracing.IsEnabled() {
   494  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.GetByID")
   495  		defer func() {
   496  			sc := -1
   497  			if result.Response.Response != nil {
   498  				sc = result.Response.Response.StatusCode
   499  			}
   500  			tracing.EndSpan(ctx, sc, err)
   501  		}()
   502  	}
   503  	req, err := client.GetByIDPreparer(ctx, applicationID)
   504  	if err != nil {
   505  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "GetByID", nil, "Failure preparing request")
   506  		return
   507  	}
   508  
   509  	resp, err := client.GetByIDSender(req)
   510  	if err != nil {
   511  		result.Response = autorest.Response{Response: resp}
   512  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "GetByID", resp, "Failure sending request")
   513  		return
   514  	}
   515  
   516  	result, err = client.GetByIDResponder(resp)
   517  	if err != nil {
   518  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "GetByID", resp, "Failure responding to request")
   519  		return
   520  	}
   521  
   522  	return
   523  }
   524  
   525  // GetByIDPreparer prepares the GetByID request.
   526  func (client ApplicationsClient) GetByIDPreparer(ctx context.Context, applicationID string) (*http.Request, error) {
   527  	pathParameters := map[string]interface{}{
   528  		"applicationId": applicationID,
   529  	}
   530  
   531  	const APIVersion = "2017-12-01"
   532  	queryParameters := map[string]interface{}{
   533  		"api-version": APIVersion,
   534  	}
   535  
   536  	preparer := autorest.CreatePreparer(
   537  		autorest.AsGet(),
   538  		autorest.WithBaseURL(client.BaseURI),
   539  		autorest.WithPathParameters("/{applicationId}", pathParameters),
   540  		autorest.WithQueryParameters(queryParameters))
   541  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   542  }
   543  
   544  // GetByIDSender sends the GetByID request. The method will close the
   545  // http.Response Body if it receives an error.
   546  func (client ApplicationsClient) GetByIDSender(req *http.Request) (*http.Response, error) {
   547  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   548  }
   549  
   550  // GetByIDResponder handles the response to the GetByID request. The method always
   551  // closes the http.Response Body.
   552  func (client ApplicationsClient) GetByIDResponder(resp *http.Response) (result Application, err error) {
   553  	err = autorest.Respond(
   554  		resp,
   555  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
   556  		autorest.ByUnmarshallingJSON(&result),
   557  		autorest.ByClosing())
   558  	result.Response = autorest.Response{Response: resp}
   559  	return
   560  }
   561  
   562  // ListByResourceGroup lists all the applications within a resource group.
   563  // Parameters:
   564  // resourceGroupName - the name of the resource group. The name is case insensitive.
   565  func (client ApplicationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ApplicationListResultPage, err error) {
   566  	if tracing.IsEnabled() {
   567  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListByResourceGroup")
   568  		defer func() {
   569  			sc := -1
   570  			if result.alr.Response.Response != nil {
   571  				sc = result.alr.Response.Response.StatusCode
   572  			}
   573  			tracing.EndSpan(ctx, sc, err)
   574  		}()
   575  	}
   576  	if err := validation.Validate([]validation.Validation{
   577  		{TargetValue: resourceGroupName,
   578  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   579  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   580  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
   581  		return result, validation.NewError("managedapplications.ApplicationsClient", "ListByResourceGroup", err.Error())
   582  	}
   583  
   584  	result.fn = client.listByResourceGroupNextResults
   585  	req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
   586  	if err != nil {
   587  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "ListByResourceGroup", nil, "Failure preparing request")
   588  		return
   589  	}
   590  
   591  	resp, err := client.ListByResourceGroupSender(req)
   592  	if err != nil {
   593  		result.alr.Response = autorest.Response{Response: resp}
   594  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "ListByResourceGroup", resp, "Failure sending request")
   595  		return
   596  	}
   597  
   598  	result.alr, err = client.ListByResourceGroupResponder(resp)
   599  	if err != nil {
   600  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "ListByResourceGroup", resp, "Failure responding to request")
   601  		return
   602  	}
   603  	if result.alr.hasNextLink() && result.alr.IsEmpty() {
   604  		err = result.NextWithContext(ctx)
   605  		return
   606  	}
   607  
   608  	return
   609  }
   610  
   611  // ListByResourceGroupPreparer prepares the ListByResourceGroup request.
   612  func (client ApplicationsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
   613  	pathParameters := map[string]interface{}{
   614  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   615  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   616  	}
   617  
   618  	const APIVersion = "2017-12-01"
   619  	queryParameters := map[string]interface{}{
   620  		"api-version": APIVersion,
   621  	}
   622  
   623  	preparer := autorest.CreatePreparer(
   624  		autorest.AsGet(),
   625  		autorest.WithBaseURL(client.BaseURI),
   626  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications", pathParameters),
   627  		autorest.WithQueryParameters(queryParameters))
   628  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   629  }
   630  
   631  // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
   632  // http.Response Body if it receives an error.
   633  func (client ApplicationsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
   634  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   635  }
   636  
   637  // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
   638  // closes the http.Response Body.
   639  func (client ApplicationsClient) ListByResourceGroupResponder(resp *http.Response) (result ApplicationListResult, err error) {
   640  	err = autorest.Respond(
   641  		resp,
   642  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   643  		autorest.ByUnmarshallingJSON(&result),
   644  		autorest.ByClosing())
   645  	result.Response = autorest.Response{Response: resp}
   646  	return
   647  }
   648  
   649  // listByResourceGroupNextResults retrieves the next set of results, if any.
   650  func (client ApplicationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ApplicationListResult) (result ApplicationListResult, err error) {
   651  	req, err := lastResults.applicationListResultPreparer(ctx)
   652  	if err != nil {
   653  		return result, autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
   654  	}
   655  	if req == nil {
   656  		return
   657  	}
   658  	resp, err := client.ListByResourceGroupSender(req)
   659  	if err != nil {
   660  		result.Response = autorest.Response{Response: resp}
   661  		return result, autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
   662  	}
   663  	result, err = client.ListByResourceGroupResponder(resp)
   664  	if err != nil {
   665  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
   666  	}
   667  	return
   668  }
   669  
   670  // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
   671  func (client ApplicationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ApplicationListResultIterator, err error) {
   672  	if tracing.IsEnabled() {
   673  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListByResourceGroup")
   674  		defer func() {
   675  			sc := -1
   676  			if result.Response().Response.Response != nil {
   677  				sc = result.page.Response().Response.Response.StatusCode
   678  			}
   679  			tracing.EndSpan(ctx, sc, err)
   680  		}()
   681  	}
   682  	result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
   683  	return
   684  }
   685  
   686  // ListBySubscription gets all the applications within a subscription.
   687  func (client ApplicationsClient) ListBySubscription(ctx context.Context) (result ApplicationListResultPage, err error) {
   688  	if tracing.IsEnabled() {
   689  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListBySubscription")
   690  		defer func() {
   691  			sc := -1
   692  			if result.alr.Response.Response != nil {
   693  				sc = result.alr.Response.Response.StatusCode
   694  			}
   695  			tracing.EndSpan(ctx, sc, err)
   696  		}()
   697  	}
   698  	result.fn = client.listBySubscriptionNextResults
   699  	req, err := client.ListBySubscriptionPreparer(ctx)
   700  	if err != nil {
   701  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "ListBySubscription", nil, "Failure preparing request")
   702  		return
   703  	}
   704  
   705  	resp, err := client.ListBySubscriptionSender(req)
   706  	if err != nil {
   707  		result.alr.Response = autorest.Response{Response: resp}
   708  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "ListBySubscription", resp, "Failure sending request")
   709  		return
   710  	}
   711  
   712  	result.alr, err = client.ListBySubscriptionResponder(resp)
   713  	if err != nil {
   714  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "ListBySubscription", resp, "Failure responding to request")
   715  		return
   716  	}
   717  	if result.alr.hasNextLink() && result.alr.IsEmpty() {
   718  		err = result.NextWithContext(ctx)
   719  		return
   720  	}
   721  
   722  	return
   723  }
   724  
   725  // ListBySubscriptionPreparer prepares the ListBySubscription request.
   726  func (client ApplicationsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
   727  	pathParameters := map[string]interface{}{
   728  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   729  	}
   730  
   731  	const APIVersion = "2017-12-01"
   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}/providers/Microsoft.Solutions/applications", pathParameters),
   740  		autorest.WithQueryParameters(queryParameters))
   741  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   742  }
   743  
   744  // ListBySubscriptionSender sends the ListBySubscription request. The method will close the
   745  // http.Response Body if it receives an error.
   746  func (client ApplicationsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
   747  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   748  }
   749  
   750  // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
   751  // closes the http.Response Body.
   752  func (client ApplicationsClient) ListBySubscriptionResponder(resp *http.Response) (result ApplicationListResult, 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  // listBySubscriptionNextResults retrieves the next set of results, if any.
   763  func (client ApplicationsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ApplicationListResult) (result ApplicationListResult, err error) {
   764  	req, err := lastResults.applicationListResultPreparer(ctx)
   765  	if err != nil {
   766  		return result, autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request")
   767  	}
   768  	if req == nil {
   769  		return
   770  	}
   771  	resp, err := client.ListBySubscriptionSender(req)
   772  	if err != nil {
   773  		result.Response = autorest.Response{Response: resp}
   774  		return result, autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request")
   775  	}
   776  	result, err = client.ListBySubscriptionResponder(resp)
   777  	if err != nil {
   778  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request")
   779  	}
   780  	return
   781  }
   782  
   783  // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
   784  func (client ApplicationsClient) ListBySubscriptionComplete(ctx context.Context) (result ApplicationListResultIterator, err error) {
   785  	if tracing.IsEnabled() {
   786  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListBySubscription")
   787  		defer func() {
   788  			sc := -1
   789  			if result.Response().Response.Response != nil {
   790  				sc = result.page.Response().Response.Response.StatusCode
   791  			}
   792  			tracing.EndSpan(ctx, sc, err)
   793  		}()
   794  	}
   795  	result.page, err = client.ListBySubscription(ctx)
   796  	return
   797  }
   798  
   799  // Update updates an existing managed application.
   800  // Parameters:
   801  // resourceGroupName - the name of the resource group. The name is case insensitive.
   802  // applicationName - the name of the managed application.
   803  // parameters - parameters supplied to update an existing managed application.
   804  func (client ApplicationsClient) Update(ctx context.Context, resourceGroupName string, applicationName string, parameters *ApplicationPatchable) (result ApplicationsUpdateFuture, err error) {
   805  	if tracing.IsEnabled() {
   806  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.Update")
   807  		defer func() {
   808  			sc := -1
   809  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   810  				sc = result.FutureAPI.Response().StatusCode
   811  			}
   812  			tracing.EndSpan(ctx, sc, err)
   813  		}()
   814  	}
   815  	if err := validation.Validate([]validation.Validation{
   816  		{TargetValue: resourceGroupName,
   817  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   818  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   819  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
   820  		{TargetValue: applicationName,
   821  			Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 64, Chain: nil},
   822  				{Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
   823  		return result, validation.NewError("managedapplications.ApplicationsClient", "Update", err.Error())
   824  	}
   825  
   826  	req, err := client.UpdatePreparer(ctx, resourceGroupName, applicationName, parameters)
   827  	if err != nil {
   828  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "Update", nil, "Failure preparing request")
   829  		return
   830  	}
   831  
   832  	result, err = client.UpdateSender(req)
   833  	if err != nil {
   834  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "Update", result.Response(), "Failure sending request")
   835  		return
   836  	}
   837  
   838  	return
   839  }
   840  
   841  // UpdatePreparer prepares the Update request.
   842  func (client ApplicationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, applicationName string, parameters *ApplicationPatchable) (*http.Request, error) {
   843  	pathParameters := map[string]interface{}{
   844  		"applicationName":   autorest.Encode("path", applicationName),
   845  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   846  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   847  	}
   848  
   849  	const APIVersion = "2017-12-01"
   850  	queryParameters := map[string]interface{}{
   851  		"api-version": APIVersion,
   852  	}
   853  
   854  	preparer := autorest.CreatePreparer(
   855  		autorest.AsContentType("application/json; charset=utf-8"),
   856  		autorest.AsPatch(),
   857  		autorest.WithBaseURL(client.BaseURI),
   858  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", pathParameters),
   859  		autorest.WithQueryParameters(queryParameters))
   860  	if parameters != nil {
   861  		preparer = autorest.DecoratePreparer(preparer,
   862  			autorest.WithJSON(parameters))
   863  	}
   864  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   865  }
   866  
   867  // UpdateSender sends the Update request. The method will close the
   868  // http.Response Body if it receives an error.
   869  func (client ApplicationsClient) UpdateSender(req *http.Request) (future ApplicationsUpdateFuture, err error) {
   870  	var resp *http.Response
   871  	future.FutureAPI = &azure.Future{}
   872  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   873  	if err != nil {
   874  		return
   875  	}
   876  	var azf azure.Future
   877  	azf, err = azure.NewFutureFromResponse(resp)
   878  	future.FutureAPI = &azf
   879  	future.Result = future.result
   880  	return
   881  }
   882  
   883  // UpdateResponder handles the response to the Update request. The method always
   884  // closes the http.Response Body.
   885  func (client ApplicationsClient) UpdateResponder(resp *http.Response) (result ApplicationPatchable, err error) {
   886  	err = autorest.Respond(
   887  		resp,
   888  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   889  		autorest.ByUnmarshallingJSON(&result),
   890  		autorest.ByClosing())
   891  	result.Response = autorest.Response{Response: resp}
   892  	return
   893  }
   894  
   895  // UpdateByID updates an existing managed application.
   896  // Parameters:
   897  // applicationID - the fully qualified ID of the managed application, including the managed application name
   898  // and the managed application resource type. Use the format,
   899  // /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}
   900  // parameters - parameters supplied to update an existing managed application.
   901  func (client ApplicationsClient) UpdateByID(ctx context.Context, applicationID string, parameters *ApplicationPatchable) (result ApplicationsUpdateByIDFuture, err error) {
   902  	if tracing.IsEnabled() {
   903  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.UpdateByID")
   904  		defer func() {
   905  			sc := -1
   906  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   907  				sc = result.FutureAPI.Response().StatusCode
   908  			}
   909  			tracing.EndSpan(ctx, sc, err)
   910  		}()
   911  	}
   912  	req, err := client.UpdateByIDPreparer(ctx, applicationID, parameters)
   913  	if err != nil {
   914  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "UpdateByID", nil, "Failure preparing request")
   915  		return
   916  	}
   917  
   918  	result, err = client.UpdateByIDSender(req)
   919  	if err != nil {
   920  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsClient", "UpdateByID", result.Response(), "Failure sending request")
   921  		return
   922  	}
   923  
   924  	return
   925  }
   926  
   927  // UpdateByIDPreparer prepares the UpdateByID request.
   928  func (client ApplicationsClient) UpdateByIDPreparer(ctx context.Context, applicationID string, parameters *ApplicationPatchable) (*http.Request, error) {
   929  	pathParameters := map[string]interface{}{
   930  		"applicationId": applicationID,
   931  	}
   932  
   933  	const APIVersion = "2017-12-01"
   934  	queryParameters := map[string]interface{}{
   935  		"api-version": APIVersion,
   936  	}
   937  
   938  	preparer := autorest.CreatePreparer(
   939  		autorest.AsContentType("application/json; charset=utf-8"),
   940  		autorest.AsPatch(),
   941  		autorest.WithBaseURL(client.BaseURI),
   942  		autorest.WithPathParameters("/{applicationId}", pathParameters),
   943  		autorest.WithQueryParameters(queryParameters))
   944  	if parameters != nil {
   945  		preparer = autorest.DecoratePreparer(preparer,
   946  			autorest.WithJSON(parameters))
   947  	}
   948  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   949  }
   950  
   951  // UpdateByIDSender sends the UpdateByID request. The method will close the
   952  // http.Response Body if it receives an error.
   953  func (client ApplicationsClient) UpdateByIDSender(req *http.Request) (future ApplicationsUpdateByIDFuture, err error) {
   954  	var resp *http.Response
   955  	future.FutureAPI = &azure.Future{}
   956  	resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   957  	if err != nil {
   958  		return
   959  	}
   960  	var azf azure.Future
   961  	azf, err = azure.NewFutureFromResponse(resp)
   962  	future.FutureAPI = &azf
   963  	future.Result = future.result
   964  	return
   965  }
   966  
   967  // UpdateByIDResponder handles the response to the UpdateByID request. The method always
   968  // closes the http.Response Body.
   969  func (client ApplicationsClient) UpdateByIDResponder(resp *http.Response) (result ApplicationPatchable, err error) {
   970  	err = autorest.Respond(
   971  		resp,
   972  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   973  		autorest.ByUnmarshallingJSON(&result),
   974  		autorest.ByClosing())
   975  	result.Response = autorest.Response{Response: resp}
   976  	return
   977  }
   978  

View as plain text