...

Source file src/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-03-01/web/client.go

Documentation: github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-03-01/web

     1  // Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details.
     2  //
     3  // Package web implements the Azure ARM Web service API version 2021-03-01.
     4  //
     5  // WebSite Management Client
     6  package web
     7  
     8  // Copyright (c) Microsoft Corporation. All rights reserved.
     9  // Licensed under the MIT License. See License.txt in the project root for license information.
    10  //
    11  // Code generated by Microsoft (R) AutoRest Code Generator.
    12  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
    13  
    14  import (
    15  	"context"
    16  	"github.com/Azure/go-autorest/autorest"
    17  	"github.com/Azure/go-autorest/autorest/azure"
    18  	"github.com/Azure/go-autorest/autorest/validation"
    19  	"github.com/Azure/go-autorest/tracing"
    20  	"net/http"
    21  )
    22  
    23  const (
    24  	// DefaultBaseURI is the default URI used for the service Web
    25  	DefaultBaseURI = "https://management.azure.com"
    26  )
    27  
    28  // BaseClient is the base client for Web.
    29  type BaseClient struct {
    30  	autorest.Client
    31  	BaseURI        string
    32  	SubscriptionID string
    33  }
    34  
    35  // New creates an instance of the BaseClient client.
    36  func New(subscriptionID string) BaseClient {
    37  	return NewWithBaseURI(DefaultBaseURI, subscriptionID)
    38  }
    39  
    40  // NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint.  Use this when interacting with
    41  // an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
    42  func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
    43  	return BaseClient{
    44  		Client:         autorest.NewClientWithUserAgent(UserAgent()),
    45  		BaseURI:        baseURI,
    46  		SubscriptionID: subscriptionID,
    47  	}
    48  }
    49  
    50  // CheckNameAvailability description for Check if a resource name is available.
    51  // Parameters:
    52  // request - name availability request.
    53  func (client BaseClient) CheckNameAvailability(ctx context.Context, request ResourceNameAvailabilityRequest) (result ResourceNameAvailability, err error) {
    54  	if tracing.IsEnabled() {
    55  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckNameAvailability")
    56  		defer func() {
    57  			sc := -1
    58  			if result.Response.Response != nil {
    59  				sc = result.Response.Response.StatusCode
    60  			}
    61  			tracing.EndSpan(ctx, sc, err)
    62  		}()
    63  	}
    64  	if err := validation.Validate([]validation.Validation{
    65  		{TargetValue: request,
    66  			Constraints: []validation.Constraint{{Target: "request.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
    67  		return result, validation.NewError("web.BaseClient", "CheckNameAvailability", err.Error())
    68  	}
    69  
    70  	req, err := client.CheckNameAvailabilityPreparer(ctx, request)
    71  	if err != nil {
    72  		err = autorest.NewErrorWithError(err, "web.BaseClient", "CheckNameAvailability", nil, "Failure preparing request")
    73  		return
    74  	}
    75  
    76  	resp, err := client.CheckNameAvailabilitySender(req)
    77  	if err != nil {
    78  		result.Response = autorest.Response{Response: resp}
    79  		err = autorest.NewErrorWithError(err, "web.BaseClient", "CheckNameAvailability", resp, "Failure sending request")
    80  		return
    81  	}
    82  
    83  	result, err = client.CheckNameAvailabilityResponder(resp)
    84  	if err != nil {
    85  		err = autorest.NewErrorWithError(err, "web.BaseClient", "CheckNameAvailability", resp, "Failure responding to request")
    86  		return
    87  	}
    88  
    89  	return
    90  }
    91  
    92  // CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
    93  func (client BaseClient) CheckNameAvailabilityPreparer(ctx context.Context, request ResourceNameAvailabilityRequest) (*http.Request, error) {
    94  	pathParameters := map[string]interface{}{
    95  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
    96  	}
    97  
    98  	const APIVersion = "2021-03-01"
    99  	queryParameters := map[string]interface{}{
   100  		"api-version": APIVersion,
   101  	}
   102  
   103  	preparer := autorest.CreatePreparer(
   104  		autorest.AsContentType("application/json; charset=utf-8"),
   105  		autorest.AsPost(),
   106  		autorest.WithBaseURL(client.BaseURI),
   107  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability", pathParameters),
   108  		autorest.WithJSON(request),
   109  		autorest.WithQueryParameters(queryParameters))
   110  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   111  }
   112  
   113  // CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
   114  // http.Response Body if it receives an error.
   115  func (client BaseClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
   116  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   117  }
   118  
   119  // CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
   120  // closes the http.Response Body.
   121  func (client BaseClient) CheckNameAvailabilityResponder(resp *http.Response) (result ResourceNameAvailability, err error) {
   122  	err = autorest.Respond(
   123  		resp,
   124  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   125  		autorest.ByUnmarshallingJSON(&result),
   126  		autorest.ByClosing())
   127  	result.Response = autorest.Response{Response: resp}
   128  	return
   129  }
   130  
   131  // GetPublishingUser description for Gets publishing user
   132  func (client BaseClient) GetPublishingUser(ctx context.Context) (result User, err error) {
   133  	if tracing.IsEnabled() {
   134  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPublishingUser")
   135  		defer func() {
   136  			sc := -1
   137  			if result.Response.Response != nil {
   138  				sc = result.Response.Response.StatusCode
   139  			}
   140  			tracing.EndSpan(ctx, sc, err)
   141  		}()
   142  	}
   143  	req, err := client.GetPublishingUserPreparer(ctx)
   144  	if err != nil {
   145  		err = autorest.NewErrorWithError(err, "web.BaseClient", "GetPublishingUser", nil, "Failure preparing request")
   146  		return
   147  	}
   148  
   149  	resp, err := client.GetPublishingUserSender(req)
   150  	if err != nil {
   151  		result.Response = autorest.Response{Response: resp}
   152  		err = autorest.NewErrorWithError(err, "web.BaseClient", "GetPublishingUser", resp, "Failure sending request")
   153  		return
   154  	}
   155  
   156  	result, err = client.GetPublishingUserResponder(resp)
   157  	if err != nil {
   158  		err = autorest.NewErrorWithError(err, "web.BaseClient", "GetPublishingUser", resp, "Failure responding to request")
   159  		return
   160  	}
   161  
   162  	return
   163  }
   164  
   165  // GetPublishingUserPreparer prepares the GetPublishingUser request.
   166  func (client BaseClient) GetPublishingUserPreparer(ctx context.Context) (*http.Request, error) {
   167  	const APIVersion = "2021-03-01"
   168  	queryParameters := map[string]interface{}{
   169  		"api-version": APIVersion,
   170  	}
   171  
   172  	preparer := autorest.CreatePreparer(
   173  		autorest.AsGet(),
   174  		autorest.WithBaseURL(client.BaseURI),
   175  		autorest.WithPath("/providers/Microsoft.Web/publishingUsers/web"),
   176  		autorest.WithQueryParameters(queryParameters))
   177  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   178  }
   179  
   180  // GetPublishingUserSender sends the GetPublishingUser request. The method will close the
   181  // http.Response Body if it receives an error.
   182  func (client BaseClient) GetPublishingUserSender(req *http.Request) (*http.Response, error) {
   183  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   184  }
   185  
   186  // GetPublishingUserResponder handles the response to the GetPublishingUser request. The method always
   187  // closes the http.Response Body.
   188  func (client BaseClient) GetPublishingUserResponder(resp *http.Response) (result User, err error) {
   189  	err = autorest.Respond(
   190  		resp,
   191  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   192  		autorest.ByUnmarshallingJSON(&result),
   193  		autorest.ByClosing())
   194  	result.Response = autorest.Response{Response: resp}
   195  	return
   196  }
   197  
   198  // GetSourceControl description for Gets source control token
   199  // Parameters:
   200  // sourceControlType - type of source control
   201  func (client BaseClient) GetSourceControl(ctx context.Context, sourceControlType string) (result SourceControl, err error) {
   202  	if tracing.IsEnabled() {
   203  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSourceControl")
   204  		defer func() {
   205  			sc := -1
   206  			if result.Response.Response != nil {
   207  				sc = result.Response.Response.StatusCode
   208  			}
   209  			tracing.EndSpan(ctx, sc, err)
   210  		}()
   211  	}
   212  	req, err := client.GetSourceControlPreparer(ctx, sourceControlType)
   213  	if err != nil {
   214  		err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSourceControl", nil, "Failure preparing request")
   215  		return
   216  	}
   217  
   218  	resp, err := client.GetSourceControlSender(req)
   219  	if err != nil {
   220  		result.Response = autorest.Response{Response: resp}
   221  		err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSourceControl", resp, "Failure sending request")
   222  		return
   223  	}
   224  
   225  	result, err = client.GetSourceControlResponder(resp)
   226  	if err != nil {
   227  		err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSourceControl", resp, "Failure responding to request")
   228  		return
   229  	}
   230  
   231  	return
   232  }
   233  
   234  // GetSourceControlPreparer prepares the GetSourceControl request.
   235  func (client BaseClient) GetSourceControlPreparer(ctx context.Context, sourceControlType string) (*http.Request, error) {
   236  	pathParameters := map[string]interface{}{
   237  		"sourceControlType": autorest.Encode("path", sourceControlType),
   238  	}
   239  
   240  	const APIVersion = "2021-03-01"
   241  	queryParameters := map[string]interface{}{
   242  		"api-version": APIVersion,
   243  	}
   244  
   245  	preparer := autorest.CreatePreparer(
   246  		autorest.AsGet(),
   247  		autorest.WithBaseURL(client.BaseURI),
   248  		autorest.WithPathParameters("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}", pathParameters),
   249  		autorest.WithQueryParameters(queryParameters))
   250  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   251  }
   252  
   253  // GetSourceControlSender sends the GetSourceControl request. The method will close the
   254  // http.Response Body if it receives an error.
   255  func (client BaseClient) GetSourceControlSender(req *http.Request) (*http.Response, error) {
   256  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   257  }
   258  
   259  // GetSourceControlResponder handles the response to the GetSourceControl request. The method always
   260  // closes the http.Response Body.
   261  func (client BaseClient) GetSourceControlResponder(resp *http.Response) (result SourceControl, err error) {
   262  	err = autorest.Respond(
   263  		resp,
   264  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   265  		autorest.ByUnmarshallingJSON(&result),
   266  		autorest.ByClosing())
   267  	result.Response = autorest.Response{Response: resp}
   268  	return
   269  }
   270  
   271  // GetSubscriptionDeploymentLocations description for Gets list of available geo regions plus ministamps
   272  func (client BaseClient) GetSubscriptionDeploymentLocations(ctx context.Context) (result DeploymentLocations, err error) {
   273  	if tracing.IsEnabled() {
   274  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSubscriptionDeploymentLocations")
   275  		defer func() {
   276  			sc := -1
   277  			if result.Response.Response != nil {
   278  				sc = result.Response.Response.StatusCode
   279  			}
   280  			tracing.EndSpan(ctx, sc, err)
   281  		}()
   282  	}
   283  	req, err := client.GetSubscriptionDeploymentLocationsPreparer(ctx)
   284  	if err != nil {
   285  		err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSubscriptionDeploymentLocations", nil, "Failure preparing request")
   286  		return
   287  	}
   288  
   289  	resp, err := client.GetSubscriptionDeploymentLocationsSender(req)
   290  	if err != nil {
   291  		result.Response = autorest.Response{Response: resp}
   292  		err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSubscriptionDeploymentLocations", resp, "Failure sending request")
   293  		return
   294  	}
   295  
   296  	result, err = client.GetSubscriptionDeploymentLocationsResponder(resp)
   297  	if err != nil {
   298  		err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSubscriptionDeploymentLocations", resp, "Failure responding to request")
   299  		return
   300  	}
   301  
   302  	return
   303  }
   304  
   305  // GetSubscriptionDeploymentLocationsPreparer prepares the GetSubscriptionDeploymentLocations request.
   306  func (client BaseClient) GetSubscriptionDeploymentLocationsPreparer(ctx context.Context) (*http.Request, error) {
   307  	pathParameters := map[string]interface{}{
   308  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   309  	}
   310  
   311  	const APIVersion = "2021-03-01"
   312  	queryParameters := map[string]interface{}{
   313  		"api-version": APIVersion,
   314  	}
   315  
   316  	preparer := autorest.CreatePreparer(
   317  		autorest.AsGet(),
   318  		autorest.WithBaseURL(client.BaseURI),
   319  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations", pathParameters),
   320  		autorest.WithQueryParameters(queryParameters))
   321  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   322  }
   323  
   324  // GetSubscriptionDeploymentLocationsSender sends the GetSubscriptionDeploymentLocations request. The method will close the
   325  // http.Response Body if it receives an error.
   326  func (client BaseClient) GetSubscriptionDeploymentLocationsSender(req *http.Request) (*http.Response, error) {
   327  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   328  }
   329  
   330  // GetSubscriptionDeploymentLocationsResponder handles the response to the GetSubscriptionDeploymentLocations request. The method always
   331  // closes the http.Response Body.
   332  func (client BaseClient) GetSubscriptionDeploymentLocationsResponder(resp *http.Response) (result DeploymentLocations, err error) {
   333  	err = autorest.Respond(
   334  		resp,
   335  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   336  		autorest.ByUnmarshallingJSON(&result),
   337  		autorest.ByClosing())
   338  	result.Response = autorest.Response{Response: resp}
   339  	return
   340  }
   341  
   342  // ListBillingMeters description for Gets a list of meters for a given location.
   343  // Parameters:
   344  // billingLocation - azure Location of billable resource
   345  // osType - app Service OS type meters used for
   346  func (client BaseClient) ListBillingMeters(ctx context.Context, billingLocation string, osType string) (result BillingMeterCollectionPage, err error) {
   347  	if tracing.IsEnabled() {
   348  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListBillingMeters")
   349  		defer func() {
   350  			sc := -1
   351  			if result.bmc.Response.Response != nil {
   352  				sc = result.bmc.Response.Response.StatusCode
   353  			}
   354  			tracing.EndSpan(ctx, sc, err)
   355  		}()
   356  	}
   357  	result.fn = client.listBillingMetersNextResults
   358  	req, err := client.ListBillingMetersPreparer(ctx, billingLocation, osType)
   359  	if err != nil {
   360  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListBillingMeters", nil, "Failure preparing request")
   361  		return
   362  	}
   363  
   364  	resp, err := client.ListBillingMetersSender(req)
   365  	if err != nil {
   366  		result.bmc.Response = autorest.Response{Response: resp}
   367  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListBillingMeters", resp, "Failure sending request")
   368  		return
   369  	}
   370  
   371  	result.bmc, err = client.ListBillingMetersResponder(resp)
   372  	if err != nil {
   373  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListBillingMeters", resp, "Failure responding to request")
   374  		return
   375  	}
   376  	if result.bmc.hasNextLink() && result.bmc.IsEmpty() {
   377  		err = result.NextWithContext(ctx)
   378  		return
   379  	}
   380  
   381  	return
   382  }
   383  
   384  // ListBillingMetersPreparer prepares the ListBillingMeters request.
   385  func (client BaseClient) ListBillingMetersPreparer(ctx context.Context, billingLocation string, osType string) (*http.Request, error) {
   386  	pathParameters := map[string]interface{}{
   387  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   388  	}
   389  
   390  	const APIVersion = "2021-03-01"
   391  	queryParameters := map[string]interface{}{
   392  		"api-version": APIVersion,
   393  	}
   394  	if len(billingLocation) > 0 {
   395  		queryParameters["billingLocation"] = autorest.Encode("query", billingLocation)
   396  	}
   397  	if len(osType) > 0 {
   398  		queryParameters["osType"] = autorest.Encode("query", osType)
   399  	}
   400  
   401  	preparer := autorest.CreatePreparer(
   402  		autorest.AsGet(),
   403  		autorest.WithBaseURL(client.BaseURI),
   404  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters", pathParameters),
   405  		autorest.WithQueryParameters(queryParameters))
   406  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   407  }
   408  
   409  // ListBillingMetersSender sends the ListBillingMeters request. The method will close the
   410  // http.Response Body if it receives an error.
   411  func (client BaseClient) ListBillingMetersSender(req *http.Request) (*http.Response, error) {
   412  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   413  }
   414  
   415  // ListBillingMetersResponder handles the response to the ListBillingMeters request. The method always
   416  // closes the http.Response Body.
   417  func (client BaseClient) ListBillingMetersResponder(resp *http.Response) (result BillingMeterCollection, err error) {
   418  	err = autorest.Respond(
   419  		resp,
   420  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   421  		autorest.ByUnmarshallingJSON(&result),
   422  		autorest.ByClosing())
   423  	result.Response = autorest.Response{Response: resp}
   424  	return
   425  }
   426  
   427  // listBillingMetersNextResults retrieves the next set of results, if any.
   428  func (client BaseClient) listBillingMetersNextResults(ctx context.Context, lastResults BillingMeterCollection) (result BillingMeterCollection, err error) {
   429  	req, err := lastResults.billingMeterCollectionPreparer(ctx)
   430  	if err != nil {
   431  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listBillingMetersNextResults", nil, "Failure preparing next results request")
   432  	}
   433  	if req == nil {
   434  		return
   435  	}
   436  	resp, err := client.ListBillingMetersSender(req)
   437  	if err != nil {
   438  		result.Response = autorest.Response{Response: resp}
   439  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listBillingMetersNextResults", resp, "Failure sending next results request")
   440  	}
   441  	result, err = client.ListBillingMetersResponder(resp)
   442  	if err != nil {
   443  		err = autorest.NewErrorWithError(err, "web.BaseClient", "listBillingMetersNextResults", resp, "Failure responding to next results request")
   444  	}
   445  	return
   446  }
   447  
   448  // ListBillingMetersComplete enumerates all values, automatically crossing page boundaries as required.
   449  func (client BaseClient) ListBillingMetersComplete(ctx context.Context, billingLocation string, osType string) (result BillingMeterCollectionIterator, err error) {
   450  	if tracing.IsEnabled() {
   451  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListBillingMeters")
   452  		defer func() {
   453  			sc := -1
   454  			if result.Response().Response.Response != nil {
   455  				sc = result.page.Response().Response.Response.StatusCode
   456  			}
   457  			tracing.EndSpan(ctx, sc, err)
   458  		}()
   459  	}
   460  	result.page, err = client.ListBillingMeters(ctx, billingLocation, osType)
   461  	return
   462  }
   463  
   464  // ListCustomHostNameSites sends the list custom host name sites request.
   465  func (client BaseClient) ListCustomHostNameSites(ctx context.Context) (result CustomHostnameSitesCollectionPage, err error) {
   466  	if tracing.IsEnabled() {
   467  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListCustomHostNameSites")
   468  		defer func() {
   469  			sc := -1
   470  			if result.chsc.Response.Response != nil {
   471  				sc = result.chsc.Response.Response.StatusCode
   472  			}
   473  			tracing.EndSpan(ctx, sc, err)
   474  		}()
   475  	}
   476  	result.fn = client.listCustomHostNameSitesNextResults
   477  	req, err := client.ListCustomHostNameSitesPreparer(ctx)
   478  	if err != nil {
   479  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListCustomHostNameSites", nil, "Failure preparing request")
   480  		return
   481  	}
   482  
   483  	resp, err := client.ListCustomHostNameSitesSender(req)
   484  	if err != nil {
   485  		result.chsc.Response = autorest.Response{Response: resp}
   486  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListCustomHostNameSites", resp, "Failure sending request")
   487  		return
   488  	}
   489  
   490  	result.chsc, err = client.ListCustomHostNameSitesResponder(resp)
   491  	if err != nil {
   492  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListCustomHostNameSites", resp, "Failure responding to request")
   493  		return
   494  	}
   495  	if result.chsc.hasNextLink() && result.chsc.IsEmpty() {
   496  		err = result.NextWithContext(ctx)
   497  		return
   498  	}
   499  
   500  	return
   501  }
   502  
   503  // ListCustomHostNameSitesPreparer prepares the ListCustomHostNameSites request.
   504  func (client BaseClient) ListCustomHostNameSitesPreparer(ctx context.Context) (*http.Request, error) {
   505  	pathParameters := map[string]interface{}{
   506  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   507  	}
   508  
   509  	const APIVersion = "2021-03-01"
   510  	queryParameters := map[string]interface{}{
   511  		"api-version": APIVersion,
   512  	}
   513  
   514  	preparer := autorest.CreatePreparer(
   515  		autorest.AsGet(),
   516  		autorest.WithBaseURL(client.BaseURI),
   517  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites", pathParameters),
   518  		autorest.WithQueryParameters(queryParameters))
   519  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   520  }
   521  
   522  // ListCustomHostNameSitesSender sends the ListCustomHostNameSites request. The method will close the
   523  // http.Response Body if it receives an error.
   524  func (client BaseClient) ListCustomHostNameSitesSender(req *http.Request) (*http.Response, error) {
   525  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   526  }
   527  
   528  // ListCustomHostNameSitesResponder handles the response to the ListCustomHostNameSites request. The method always
   529  // closes the http.Response Body.
   530  func (client BaseClient) ListCustomHostNameSitesResponder(resp *http.Response) (result CustomHostnameSitesCollection, err error) {
   531  	err = autorest.Respond(
   532  		resp,
   533  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   534  		autorest.ByUnmarshallingJSON(&result),
   535  		autorest.ByClosing())
   536  	result.Response = autorest.Response{Response: resp}
   537  	return
   538  }
   539  
   540  // listCustomHostNameSitesNextResults retrieves the next set of results, if any.
   541  func (client BaseClient) listCustomHostNameSitesNextResults(ctx context.Context, lastResults CustomHostnameSitesCollection) (result CustomHostnameSitesCollection, err error) {
   542  	req, err := lastResults.customHostnameSitesCollectionPreparer(ctx)
   543  	if err != nil {
   544  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listCustomHostNameSitesNextResults", nil, "Failure preparing next results request")
   545  	}
   546  	if req == nil {
   547  		return
   548  	}
   549  	resp, err := client.ListCustomHostNameSitesSender(req)
   550  	if err != nil {
   551  		result.Response = autorest.Response{Response: resp}
   552  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listCustomHostNameSitesNextResults", resp, "Failure sending next results request")
   553  	}
   554  	result, err = client.ListCustomHostNameSitesResponder(resp)
   555  	if err != nil {
   556  		err = autorest.NewErrorWithError(err, "web.BaseClient", "listCustomHostNameSitesNextResults", resp, "Failure responding to next results request")
   557  	}
   558  	return
   559  }
   560  
   561  // ListCustomHostNameSitesComplete enumerates all values, automatically crossing page boundaries as required.
   562  func (client BaseClient) ListCustomHostNameSitesComplete(ctx context.Context) (result CustomHostnameSitesCollectionIterator, err error) {
   563  	if tracing.IsEnabled() {
   564  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListCustomHostNameSites")
   565  		defer func() {
   566  			sc := -1
   567  			if result.Response().Response.Response != nil {
   568  				sc = result.page.Response().Response.Response.StatusCode
   569  			}
   570  			tracing.EndSpan(ctx, sc, err)
   571  		}()
   572  	}
   573  	result.page, err = client.ListCustomHostNameSites(ctx)
   574  	return
   575  }
   576  
   577  // ListGeoRegions description for Get a list of available geographical regions.
   578  // Parameters:
   579  // sku - name of SKU used to filter the regions.
   580  // linuxWorkersEnabled - specify <code>true</code> if you want to filter to only regions that support Linux
   581  // workers.
   582  // xenonWorkersEnabled - specify <code>true</code> if you want to filter to only regions that support Xenon
   583  // workers.
   584  // linuxDynamicWorkersEnabled - specify <code>true</code> if you want to filter to only regions that support
   585  // Linux Consumption Workers.
   586  func (client BaseClient) ListGeoRegions(ctx context.Context, sku SkuName, linuxWorkersEnabled *bool, xenonWorkersEnabled *bool, linuxDynamicWorkersEnabled *bool) (result GeoRegionCollectionPage, err error) {
   587  	if tracing.IsEnabled() {
   588  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListGeoRegions")
   589  		defer func() {
   590  			sc := -1
   591  			if result.grc.Response.Response != nil {
   592  				sc = result.grc.Response.Response.StatusCode
   593  			}
   594  			tracing.EndSpan(ctx, sc, err)
   595  		}()
   596  	}
   597  	result.fn = client.listGeoRegionsNextResults
   598  	req, err := client.ListGeoRegionsPreparer(ctx, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled)
   599  	if err != nil {
   600  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListGeoRegions", nil, "Failure preparing request")
   601  		return
   602  	}
   603  
   604  	resp, err := client.ListGeoRegionsSender(req)
   605  	if err != nil {
   606  		result.grc.Response = autorest.Response{Response: resp}
   607  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListGeoRegions", resp, "Failure sending request")
   608  		return
   609  	}
   610  
   611  	result.grc, err = client.ListGeoRegionsResponder(resp)
   612  	if err != nil {
   613  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListGeoRegions", resp, "Failure responding to request")
   614  		return
   615  	}
   616  	if result.grc.hasNextLink() && result.grc.IsEmpty() {
   617  		err = result.NextWithContext(ctx)
   618  		return
   619  	}
   620  
   621  	return
   622  }
   623  
   624  // ListGeoRegionsPreparer prepares the ListGeoRegions request.
   625  func (client BaseClient) ListGeoRegionsPreparer(ctx context.Context, sku SkuName, linuxWorkersEnabled *bool, xenonWorkersEnabled *bool, linuxDynamicWorkersEnabled *bool) (*http.Request, error) {
   626  	pathParameters := map[string]interface{}{
   627  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   628  	}
   629  
   630  	const APIVersion = "2021-03-01"
   631  	queryParameters := map[string]interface{}{
   632  		"api-version": APIVersion,
   633  	}
   634  	if len(string(sku)) > 0 {
   635  		queryParameters["sku"] = autorest.Encode("query", sku)
   636  	}
   637  	if linuxWorkersEnabled != nil {
   638  		queryParameters["linuxWorkersEnabled"] = autorest.Encode("query", *linuxWorkersEnabled)
   639  	}
   640  	if xenonWorkersEnabled != nil {
   641  		queryParameters["xenonWorkersEnabled"] = autorest.Encode("query", *xenonWorkersEnabled)
   642  	}
   643  	if linuxDynamicWorkersEnabled != nil {
   644  		queryParameters["linuxDynamicWorkersEnabled"] = autorest.Encode("query", *linuxDynamicWorkersEnabled)
   645  	}
   646  
   647  	preparer := autorest.CreatePreparer(
   648  		autorest.AsGet(),
   649  		autorest.WithBaseURL(client.BaseURI),
   650  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions", pathParameters),
   651  		autorest.WithQueryParameters(queryParameters))
   652  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   653  }
   654  
   655  // ListGeoRegionsSender sends the ListGeoRegions request. The method will close the
   656  // http.Response Body if it receives an error.
   657  func (client BaseClient) ListGeoRegionsSender(req *http.Request) (*http.Response, error) {
   658  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   659  }
   660  
   661  // ListGeoRegionsResponder handles the response to the ListGeoRegions request. The method always
   662  // closes the http.Response Body.
   663  func (client BaseClient) ListGeoRegionsResponder(resp *http.Response) (result GeoRegionCollection, err error) {
   664  	err = autorest.Respond(
   665  		resp,
   666  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   667  		autorest.ByUnmarshallingJSON(&result),
   668  		autorest.ByClosing())
   669  	result.Response = autorest.Response{Response: resp}
   670  	return
   671  }
   672  
   673  // listGeoRegionsNextResults retrieves the next set of results, if any.
   674  func (client BaseClient) listGeoRegionsNextResults(ctx context.Context, lastResults GeoRegionCollection) (result GeoRegionCollection, err error) {
   675  	req, err := lastResults.geoRegionCollectionPreparer(ctx)
   676  	if err != nil {
   677  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listGeoRegionsNextResults", nil, "Failure preparing next results request")
   678  	}
   679  	if req == nil {
   680  		return
   681  	}
   682  	resp, err := client.ListGeoRegionsSender(req)
   683  	if err != nil {
   684  		result.Response = autorest.Response{Response: resp}
   685  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listGeoRegionsNextResults", resp, "Failure sending next results request")
   686  	}
   687  	result, err = client.ListGeoRegionsResponder(resp)
   688  	if err != nil {
   689  		err = autorest.NewErrorWithError(err, "web.BaseClient", "listGeoRegionsNextResults", resp, "Failure responding to next results request")
   690  	}
   691  	return
   692  }
   693  
   694  // ListGeoRegionsComplete enumerates all values, automatically crossing page boundaries as required.
   695  func (client BaseClient) ListGeoRegionsComplete(ctx context.Context, sku SkuName, linuxWorkersEnabled *bool, xenonWorkersEnabled *bool, linuxDynamicWorkersEnabled *bool) (result GeoRegionCollectionIterator, err error) {
   696  	if tracing.IsEnabled() {
   697  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListGeoRegions")
   698  		defer func() {
   699  			sc := -1
   700  			if result.Response().Response.Response != nil {
   701  				sc = result.page.Response().Response.Response.StatusCode
   702  			}
   703  			tracing.EndSpan(ctx, sc, err)
   704  		}()
   705  	}
   706  	result.page, err = client.ListGeoRegions(ctx, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled)
   707  	return
   708  }
   709  
   710  // ListPremierAddOnOffers description for List all premier add-on offers.
   711  func (client BaseClient) ListPremierAddOnOffers(ctx context.Context) (result PremierAddOnOfferCollectionPage, err error) {
   712  	if tracing.IsEnabled() {
   713  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListPremierAddOnOffers")
   714  		defer func() {
   715  			sc := -1
   716  			if result.paooc.Response.Response != nil {
   717  				sc = result.paooc.Response.Response.StatusCode
   718  			}
   719  			tracing.EndSpan(ctx, sc, err)
   720  		}()
   721  	}
   722  	result.fn = client.listPremierAddOnOffersNextResults
   723  	req, err := client.ListPremierAddOnOffersPreparer(ctx)
   724  	if err != nil {
   725  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListPremierAddOnOffers", nil, "Failure preparing request")
   726  		return
   727  	}
   728  
   729  	resp, err := client.ListPremierAddOnOffersSender(req)
   730  	if err != nil {
   731  		result.paooc.Response = autorest.Response{Response: resp}
   732  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListPremierAddOnOffers", resp, "Failure sending request")
   733  		return
   734  	}
   735  
   736  	result.paooc, err = client.ListPremierAddOnOffersResponder(resp)
   737  	if err != nil {
   738  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListPremierAddOnOffers", resp, "Failure responding to request")
   739  		return
   740  	}
   741  	if result.paooc.hasNextLink() && result.paooc.IsEmpty() {
   742  		err = result.NextWithContext(ctx)
   743  		return
   744  	}
   745  
   746  	return
   747  }
   748  
   749  // ListPremierAddOnOffersPreparer prepares the ListPremierAddOnOffers request.
   750  func (client BaseClient) ListPremierAddOnOffersPreparer(ctx context.Context) (*http.Request, error) {
   751  	pathParameters := map[string]interface{}{
   752  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   753  	}
   754  
   755  	const APIVersion = "2021-03-01"
   756  	queryParameters := map[string]interface{}{
   757  		"api-version": APIVersion,
   758  	}
   759  
   760  	preparer := autorest.CreatePreparer(
   761  		autorest.AsGet(),
   762  		autorest.WithBaseURL(client.BaseURI),
   763  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers", pathParameters),
   764  		autorest.WithQueryParameters(queryParameters))
   765  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   766  }
   767  
   768  // ListPremierAddOnOffersSender sends the ListPremierAddOnOffers request. The method will close the
   769  // http.Response Body if it receives an error.
   770  func (client BaseClient) ListPremierAddOnOffersSender(req *http.Request) (*http.Response, error) {
   771  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   772  }
   773  
   774  // ListPremierAddOnOffersResponder handles the response to the ListPremierAddOnOffers request. The method always
   775  // closes the http.Response Body.
   776  func (client BaseClient) ListPremierAddOnOffersResponder(resp *http.Response) (result PremierAddOnOfferCollection, err error) {
   777  	err = autorest.Respond(
   778  		resp,
   779  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   780  		autorest.ByUnmarshallingJSON(&result),
   781  		autorest.ByClosing())
   782  	result.Response = autorest.Response{Response: resp}
   783  	return
   784  }
   785  
   786  // listPremierAddOnOffersNextResults retrieves the next set of results, if any.
   787  func (client BaseClient) listPremierAddOnOffersNextResults(ctx context.Context, lastResults PremierAddOnOfferCollection) (result PremierAddOnOfferCollection, err error) {
   788  	req, err := lastResults.premierAddOnOfferCollectionPreparer(ctx)
   789  	if err != nil {
   790  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listPremierAddOnOffersNextResults", nil, "Failure preparing next results request")
   791  	}
   792  	if req == nil {
   793  		return
   794  	}
   795  	resp, err := client.ListPremierAddOnOffersSender(req)
   796  	if err != nil {
   797  		result.Response = autorest.Response{Response: resp}
   798  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listPremierAddOnOffersNextResults", resp, "Failure sending next results request")
   799  	}
   800  	result, err = client.ListPremierAddOnOffersResponder(resp)
   801  	if err != nil {
   802  		err = autorest.NewErrorWithError(err, "web.BaseClient", "listPremierAddOnOffersNextResults", resp, "Failure responding to next results request")
   803  	}
   804  	return
   805  }
   806  
   807  // ListPremierAddOnOffersComplete enumerates all values, automatically crossing page boundaries as required.
   808  func (client BaseClient) ListPremierAddOnOffersComplete(ctx context.Context) (result PremierAddOnOfferCollectionIterator, err error) {
   809  	if tracing.IsEnabled() {
   810  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListPremierAddOnOffers")
   811  		defer func() {
   812  			sc := -1
   813  			if result.Response().Response.Response != nil {
   814  				sc = result.page.Response().Response.Response.StatusCode
   815  			}
   816  			tracing.EndSpan(ctx, sc, err)
   817  		}()
   818  	}
   819  	result.page, err = client.ListPremierAddOnOffers(ctx)
   820  	return
   821  }
   822  
   823  // ListSiteIdentifiersAssignedToHostName description for List all apps that are assigned to a hostname.
   824  // Parameters:
   825  // nameIdentifier - hostname information.
   826  func (client BaseClient) ListSiteIdentifiersAssignedToHostName(ctx context.Context, nameIdentifier NameIdentifier) (result IdentifierCollectionPage, err error) {
   827  	if tracing.IsEnabled() {
   828  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSiteIdentifiersAssignedToHostName")
   829  		defer func() {
   830  			sc := -1
   831  			if result.ic.Response.Response != nil {
   832  				sc = result.ic.Response.Response.StatusCode
   833  			}
   834  			tracing.EndSpan(ctx, sc, err)
   835  		}()
   836  	}
   837  	result.fn = client.listSiteIdentifiersAssignedToHostNameNextResults
   838  	req, err := client.ListSiteIdentifiersAssignedToHostNamePreparer(ctx, nameIdentifier)
   839  	if err != nil {
   840  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSiteIdentifiersAssignedToHostName", nil, "Failure preparing request")
   841  		return
   842  	}
   843  
   844  	resp, err := client.ListSiteIdentifiersAssignedToHostNameSender(req)
   845  	if err != nil {
   846  		result.ic.Response = autorest.Response{Response: resp}
   847  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSiteIdentifiersAssignedToHostName", resp, "Failure sending request")
   848  		return
   849  	}
   850  
   851  	result.ic, err = client.ListSiteIdentifiersAssignedToHostNameResponder(resp)
   852  	if err != nil {
   853  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSiteIdentifiersAssignedToHostName", resp, "Failure responding to request")
   854  		return
   855  	}
   856  	if result.ic.hasNextLink() && result.ic.IsEmpty() {
   857  		err = result.NextWithContext(ctx)
   858  		return
   859  	}
   860  
   861  	return
   862  }
   863  
   864  // ListSiteIdentifiersAssignedToHostNamePreparer prepares the ListSiteIdentifiersAssignedToHostName request.
   865  func (client BaseClient) ListSiteIdentifiersAssignedToHostNamePreparer(ctx context.Context, nameIdentifier NameIdentifier) (*http.Request, error) {
   866  	pathParameters := map[string]interface{}{
   867  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   868  	}
   869  
   870  	const APIVersion = "2021-03-01"
   871  	queryParameters := map[string]interface{}{
   872  		"api-version": APIVersion,
   873  	}
   874  
   875  	preparer := autorest.CreatePreparer(
   876  		autorest.AsContentType("application/json; charset=utf-8"),
   877  		autorest.AsPost(),
   878  		autorest.WithBaseURL(client.BaseURI),
   879  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName", pathParameters),
   880  		autorest.WithJSON(nameIdentifier),
   881  		autorest.WithQueryParameters(queryParameters))
   882  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   883  }
   884  
   885  // ListSiteIdentifiersAssignedToHostNameSender sends the ListSiteIdentifiersAssignedToHostName request. The method will close the
   886  // http.Response Body if it receives an error.
   887  func (client BaseClient) ListSiteIdentifiersAssignedToHostNameSender(req *http.Request) (*http.Response, error) {
   888  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   889  }
   890  
   891  // ListSiteIdentifiersAssignedToHostNameResponder handles the response to the ListSiteIdentifiersAssignedToHostName request. The method always
   892  // closes the http.Response Body.
   893  func (client BaseClient) ListSiteIdentifiersAssignedToHostNameResponder(resp *http.Response) (result IdentifierCollection, err error) {
   894  	err = autorest.Respond(
   895  		resp,
   896  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   897  		autorest.ByUnmarshallingJSON(&result),
   898  		autorest.ByClosing())
   899  	result.Response = autorest.Response{Response: resp}
   900  	return
   901  }
   902  
   903  // listSiteIdentifiersAssignedToHostNameNextResults retrieves the next set of results, if any.
   904  func (client BaseClient) listSiteIdentifiersAssignedToHostNameNextResults(ctx context.Context, lastResults IdentifierCollection) (result IdentifierCollection, err error) {
   905  	req, err := lastResults.identifierCollectionPreparer(ctx)
   906  	if err != nil {
   907  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listSiteIdentifiersAssignedToHostNameNextResults", nil, "Failure preparing next results request")
   908  	}
   909  	if req == nil {
   910  		return
   911  	}
   912  	resp, err := client.ListSiteIdentifiersAssignedToHostNameSender(req)
   913  	if err != nil {
   914  		result.Response = autorest.Response{Response: resp}
   915  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listSiteIdentifiersAssignedToHostNameNextResults", resp, "Failure sending next results request")
   916  	}
   917  	result, err = client.ListSiteIdentifiersAssignedToHostNameResponder(resp)
   918  	if err != nil {
   919  		err = autorest.NewErrorWithError(err, "web.BaseClient", "listSiteIdentifiersAssignedToHostNameNextResults", resp, "Failure responding to next results request")
   920  	}
   921  	return
   922  }
   923  
   924  // ListSiteIdentifiersAssignedToHostNameComplete enumerates all values, automatically crossing page boundaries as required.
   925  func (client BaseClient) ListSiteIdentifiersAssignedToHostNameComplete(ctx context.Context, nameIdentifier NameIdentifier) (result IdentifierCollectionIterator, err error) {
   926  	if tracing.IsEnabled() {
   927  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSiteIdentifiersAssignedToHostName")
   928  		defer func() {
   929  			sc := -1
   930  			if result.Response().Response.Response != nil {
   931  				sc = result.page.Response().Response.Response.StatusCode
   932  			}
   933  			tracing.EndSpan(ctx, sc, err)
   934  		}()
   935  	}
   936  	result.page, err = client.ListSiteIdentifiersAssignedToHostName(ctx, nameIdentifier)
   937  	return
   938  }
   939  
   940  // ListSkus description for List all SKUs.
   941  func (client BaseClient) ListSkus(ctx context.Context) (result SkuInfos, err error) {
   942  	if tracing.IsEnabled() {
   943  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSkus")
   944  		defer func() {
   945  			sc := -1
   946  			if result.Response.Response != nil {
   947  				sc = result.Response.Response.StatusCode
   948  			}
   949  			tracing.EndSpan(ctx, sc, err)
   950  		}()
   951  	}
   952  	req, err := client.ListSkusPreparer(ctx)
   953  	if err != nil {
   954  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSkus", nil, "Failure preparing request")
   955  		return
   956  	}
   957  
   958  	resp, err := client.ListSkusSender(req)
   959  	if err != nil {
   960  		result.Response = autorest.Response{Response: resp}
   961  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSkus", resp, "Failure sending request")
   962  		return
   963  	}
   964  
   965  	result, err = client.ListSkusResponder(resp)
   966  	if err != nil {
   967  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSkus", resp, "Failure responding to request")
   968  		return
   969  	}
   970  
   971  	return
   972  }
   973  
   974  // ListSkusPreparer prepares the ListSkus request.
   975  func (client BaseClient) ListSkusPreparer(ctx context.Context) (*http.Request, error) {
   976  	pathParameters := map[string]interface{}{
   977  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   978  	}
   979  
   980  	const APIVersion = "2021-03-01"
   981  	queryParameters := map[string]interface{}{
   982  		"api-version": APIVersion,
   983  	}
   984  
   985  	preparer := autorest.CreatePreparer(
   986  		autorest.AsGet(),
   987  		autorest.WithBaseURL(client.BaseURI),
   988  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus", pathParameters),
   989  		autorest.WithQueryParameters(queryParameters))
   990  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   991  }
   992  
   993  // ListSkusSender sends the ListSkus request. The method will close the
   994  // http.Response Body if it receives an error.
   995  func (client BaseClient) ListSkusSender(req *http.Request) (*http.Response, error) {
   996  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   997  }
   998  
   999  // ListSkusResponder handles the response to the ListSkus request. The method always
  1000  // closes the http.Response Body.
  1001  func (client BaseClient) ListSkusResponder(resp *http.Response) (result SkuInfos, err error) {
  1002  	err = autorest.Respond(
  1003  		resp,
  1004  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1005  		autorest.ByUnmarshallingJSON(&result),
  1006  		autorest.ByClosing())
  1007  	result.Response = autorest.Response{Response: resp}
  1008  	return
  1009  }
  1010  
  1011  // ListSourceControls description for Gets the source controls available for Azure websites.
  1012  func (client BaseClient) ListSourceControls(ctx context.Context) (result SourceControlCollectionPage, err error) {
  1013  	if tracing.IsEnabled() {
  1014  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSourceControls")
  1015  		defer func() {
  1016  			sc := -1
  1017  			if result.scc.Response.Response != nil {
  1018  				sc = result.scc.Response.Response.StatusCode
  1019  			}
  1020  			tracing.EndSpan(ctx, sc, err)
  1021  		}()
  1022  	}
  1023  	result.fn = client.listSourceControlsNextResults
  1024  	req, err := client.ListSourceControlsPreparer(ctx)
  1025  	if err != nil {
  1026  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSourceControls", nil, "Failure preparing request")
  1027  		return
  1028  	}
  1029  
  1030  	resp, err := client.ListSourceControlsSender(req)
  1031  	if err != nil {
  1032  		result.scc.Response = autorest.Response{Response: resp}
  1033  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSourceControls", resp, "Failure sending request")
  1034  		return
  1035  	}
  1036  
  1037  	result.scc, err = client.ListSourceControlsResponder(resp)
  1038  	if err != nil {
  1039  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSourceControls", resp, "Failure responding to request")
  1040  		return
  1041  	}
  1042  	if result.scc.hasNextLink() && result.scc.IsEmpty() {
  1043  		err = result.NextWithContext(ctx)
  1044  		return
  1045  	}
  1046  
  1047  	return
  1048  }
  1049  
  1050  // ListSourceControlsPreparer prepares the ListSourceControls request.
  1051  func (client BaseClient) ListSourceControlsPreparer(ctx context.Context) (*http.Request, error) {
  1052  	const APIVersion = "2021-03-01"
  1053  	queryParameters := map[string]interface{}{
  1054  		"api-version": APIVersion,
  1055  	}
  1056  
  1057  	preparer := autorest.CreatePreparer(
  1058  		autorest.AsGet(),
  1059  		autorest.WithBaseURL(client.BaseURI),
  1060  		autorest.WithPath("/providers/Microsoft.Web/sourcecontrols"),
  1061  		autorest.WithQueryParameters(queryParameters))
  1062  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1063  }
  1064  
  1065  // ListSourceControlsSender sends the ListSourceControls request. The method will close the
  1066  // http.Response Body if it receives an error.
  1067  func (client BaseClient) ListSourceControlsSender(req *http.Request) (*http.Response, error) {
  1068  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1069  }
  1070  
  1071  // ListSourceControlsResponder handles the response to the ListSourceControls request. The method always
  1072  // closes the http.Response Body.
  1073  func (client BaseClient) ListSourceControlsResponder(resp *http.Response) (result SourceControlCollection, err error) {
  1074  	err = autorest.Respond(
  1075  		resp,
  1076  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1077  		autorest.ByUnmarshallingJSON(&result),
  1078  		autorest.ByClosing())
  1079  	result.Response = autorest.Response{Response: resp}
  1080  	return
  1081  }
  1082  
  1083  // listSourceControlsNextResults retrieves the next set of results, if any.
  1084  func (client BaseClient) listSourceControlsNextResults(ctx context.Context, lastResults SourceControlCollection) (result SourceControlCollection, err error) {
  1085  	req, err := lastResults.sourceControlCollectionPreparer(ctx)
  1086  	if err != nil {
  1087  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listSourceControlsNextResults", nil, "Failure preparing next results request")
  1088  	}
  1089  	if req == nil {
  1090  		return
  1091  	}
  1092  	resp, err := client.ListSourceControlsSender(req)
  1093  	if err != nil {
  1094  		result.Response = autorest.Response{Response: resp}
  1095  		return result, autorest.NewErrorWithError(err, "web.BaseClient", "listSourceControlsNextResults", resp, "Failure sending next results request")
  1096  	}
  1097  	result, err = client.ListSourceControlsResponder(resp)
  1098  	if err != nil {
  1099  		err = autorest.NewErrorWithError(err, "web.BaseClient", "listSourceControlsNextResults", resp, "Failure responding to next results request")
  1100  	}
  1101  	return
  1102  }
  1103  
  1104  // ListSourceControlsComplete enumerates all values, automatically crossing page boundaries as required.
  1105  func (client BaseClient) ListSourceControlsComplete(ctx context.Context) (result SourceControlCollectionIterator, err error) {
  1106  	if tracing.IsEnabled() {
  1107  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSourceControls")
  1108  		defer func() {
  1109  			sc := -1
  1110  			if result.Response().Response.Response != nil {
  1111  				sc = result.page.Response().Response.Response.StatusCode
  1112  			}
  1113  			tracing.EndSpan(ctx, sc, err)
  1114  		}()
  1115  	}
  1116  	result.page, err = client.ListSourceControls(ctx)
  1117  	return
  1118  }
  1119  
  1120  // Move description for Move resources between resource groups.
  1121  // Parameters:
  1122  // resourceGroupName - name of the resource group to which the resource belongs.
  1123  // moveResourceEnvelope - object that represents the resource to move.
  1124  func (client BaseClient) Move(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (result autorest.Response, err error) {
  1125  	if tracing.IsEnabled() {
  1126  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Move")
  1127  		defer func() {
  1128  			sc := -1
  1129  			if result.Response != nil {
  1130  				sc = result.Response.StatusCode
  1131  			}
  1132  			tracing.EndSpan(ctx, sc, err)
  1133  		}()
  1134  	}
  1135  	if err := validation.Validate([]validation.Validation{
  1136  		{TargetValue: resourceGroupName,
  1137  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1138  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1139  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}},
  1140  		{TargetValue: moveResourceEnvelope,
  1141  			Constraints: []validation.Constraint{{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.Null, Rule: false,
  1142  				Chain: []validation.Constraint{{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1143  					{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.MinLength, Rule: 1, Chain: nil},
  1144  					{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.Pattern, Rule: ` ^[-\w\._\(\)]+[^\.]$`, Chain: nil},
  1145  				}}}}}); err != nil {
  1146  		return result, validation.NewError("web.BaseClient", "Move", err.Error())
  1147  	}
  1148  
  1149  	req, err := client.MovePreparer(ctx, resourceGroupName, moveResourceEnvelope)
  1150  	if err != nil {
  1151  		err = autorest.NewErrorWithError(err, "web.BaseClient", "Move", nil, "Failure preparing request")
  1152  		return
  1153  	}
  1154  
  1155  	resp, err := client.MoveSender(req)
  1156  	if err != nil {
  1157  		result.Response = resp
  1158  		err = autorest.NewErrorWithError(err, "web.BaseClient", "Move", resp, "Failure sending request")
  1159  		return
  1160  	}
  1161  
  1162  	result, err = client.MoveResponder(resp)
  1163  	if err != nil {
  1164  		err = autorest.NewErrorWithError(err, "web.BaseClient", "Move", resp, "Failure responding to request")
  1165  		return
  1166  	}
  1167  
  1168  	return
  1169  }
  1170  
  1171  // MovePreparer prepares the Move request.
  1172  func (client BaseClient) MovePreparer(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (*http.Request, error) {
  1173  	pathParameters := map[string]interface{}{
  1174  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1175  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1176  	}
  1177  
  1178  	const APIVersion = "2021-03-01"
  1179  	queryParameters := map[string]interface{}{
  1180  		"api-version": APIVersion,
  1181  	}
  1182  
  1183  	preparer := autorest.CreatePreparer(
  1184  		autorest.AsContentType("application/json; charset=utf-8"),
  1185  		autorest.AsPost(),
  1186  		autorest.WithBaseURL(client.BaseURI),
  1187  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources", pathParameters),
  1188  		autorest.WithJSON(moveResourceEnvelope),
  1189  		autorest.WithQueryParameters(queryParameters))
  1190  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1191  }
  1192  
  1193  // MoveSender sends the Move request. The method will close the
  1194  // http.Response Body if it receives an error.
  1195  func (client BaseClient) MoveSender(req *http.Request) (*http.Response, error) {
  1196  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1197  }
  1198  
  1199  // MoveResponder handles the response to the Move request. The method always
  1200  // closes the http.Response Body.
  1201  func (client BaseClient) MoveResponder(resp *http.Response) (result autorest.Response, err error) {
  1202  	err = autorest.Respond(
  1203  		resp,
  1204  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
  1205  		autorest.ByClosing())
  1206  	result.Response = resp
  1207  	return
  1208  }
  1209  
  1210  // UpdatePublishingUser description for Updates publishing user
  1211  // Parameters:
  1212  // userDetails - details of publishing user
  1213  func (client BaseClient) UpdatePublishingUser(ctx context.Context, userDetails User) (result User, err error) {
  1214  	if tracing.IsEnabled() {
  1215  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdatePublishingUser")
  1216  		defer func() {
  1217  			sc := -1
  1218  			if result.Response.Response != nil {
  1219  				sc = result.Response.Response.StatusCode
  1220  			}
  1221  			tracing.EndSpan(ctx, sc, err)
  1222  		}()
  1223  	}
  1224  	if err := validation.Validate([]validation.Validation{
  1225  		{TargetValue: userDetails,
  1226  			Constraints: []validation.Constraint{{Target: "userDetails.UserProperties", Name: validation.Null, Rule: false,
  1227  				Chain: []validation.Constraint{{Target: "userDetails.UserProperties.PublishingUserName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
  1228  		return result, validation.NewError("web.BaseClient", "UpdatePublishingUser", err.Error())
  1229  	}
  1230  
  1231  	req, err := client.UpdatePublishingUserPreparer(ctx, userDetails)
  1232  	if err != nil {
  1233  		err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdatePublishingUser", nil, "Failure preparing request")
  1234  		return
  1235  	}
  1236  
  1237  	resp, err := client.UpdatePublishingUserSender(req)
  1238  	if err != nil {
  1239  		result.Response = autorest.Response{Response: resp}
  1240  		err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdatePublishingUser", resp, "Failure sending request")
  1241  		return
  1242  	}
  1243  
  1244  	result, err = client.UpdatePublishingUserResponder(resp)
  1245  	if err != nil {
  1246  		err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdatePublishingUser", resp, "Failure responding to request")
  1247  		return
  1248  	}
  1249  
  1250  	return
  1251  }
  1252  
  1253  // UpdatePublishingUserPreparer prepares the UpdatePublishingUser request.
  1254  func (client BaseClient) UpdatePublishingUserPreparer(ctx context.Context, userDetails User) (*http.Request, error) {
  1255  	const APIVersion = "2021-03-01"
  1256  	queryParameters := map[string]interface{}{
  1257  		"api-version": APIVersion,
  1258  	}
  1259  
  1260  	preparer := autorest.CreatePreparer(
  1261  		autorest.AsContentType("application/json; charset=utf-8"),
  1262  		autorest.AsPut(),
  1263  		autorest.WithBaseURL(client.BaseURI),
  1264  		autorest.WithPath("/providers/Microsoft.Web/publishingUsers/web"),
  1265  		autorest.WithJSON(userDetails),
  1266  		autorest.WithQueryParameters(queryParameters))
  1267  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1268  }
  1269  
  1270  // UpdatePublishingUserSender sends the UpdatePublishingUser request. The method will close the
  1271  // http.Response Body if it receives an error.
  1272  func (client BaseClient) UpdatePublishingUserSender(req *http.Request) (*http.Response, error) {
  1273  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1274  }
  1275  
  1276  // UpdatePublishingUserResponder handles the response to the UpdatePublishingUser request. The method always
  1277  // closes the http.Response Body.
  1278  func (client BaseClient) UpdatePublishingUserResponder(resp *http.Response) (result User, err error) {
  1279  	err = autorest.Respond(
  1280  		resp,
  1281  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1282  		autorest.ByUnmarshallingJSON(&result),
  1283  		autorest.ByClosing())
  1284  	result.Response = autorest.Response{Response: resp}
  1285  	return
  1286  }
  1287  
  1288  // UpdateSourceControl description for Updates source control token
  1289  // Parameters:
  1290  // sourceControlType - type of source control
  1291  // requestMessage - source control token information
  1292  func (client BaseClient) UpdateSourceControl(ctx context.Context, sourceControlType string, requestMessage SourceControl) (result SourceControl, err error) {
  1293  	if tracing.IsEnabled() {
  1294  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateSourceControl")
  1295  		defer func() {
  1296  			sc := -1
  1297  			if result.Response.Response != nil {
  1298  				sc = result.Response.Response.StatusCode
  1299  			}
  1300  			tracing.EndSpan(ctx, sc, err)
  1301  		}()
  1302  	}
  1303  	req, err := client.UpdateSourceControlPreparer(ctx, sourceControlType, requestMessage)
  1304  	if err != nil {
  1305  		err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdateSourceControl", nil, "Failure preparing request")
  1306  		return
  1307  	}
  1308  
  1309  	resp, err := client.UpdateSourceControlSender(req)
  1310  	if err != nil {
  1311  		result.Response = autorest.Response{Response: resp}
  1312  		err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdateSourceControl", resp, "Failure sending request")
  1313  		return
  1314  	}
  1315  
  1316  	result, err = client.UpdateSourceControlResponder(resp)
  1317  	if err != nil {
  1318  		err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdateSourceControl", resp, "Failure responding to request")
  1319  		return
  1320  	}
  1321  
  1322  	return
  1323  }
  1324  
  1325  // UpdateSourceControlPreparer prepares the UpdateSourceControl request.
  1326  func (client BaseClient) UpdateSourceControlPreparer(ctx context.Context, sourceControlType string, requestMessage SourceControl) (*http.Request, error) {
  1327  	pathParameters := map[string]interface{}{
  1328  		"sourceControlType": autorest.Encode("path", sourceControlType),
  1329  	}
  1330  
  1331  	const APIVersion = "2021-03-01"
  1332  	queryParameters := map[string]interface{}{
  1333  		"api-version": APIVersion,
  1334  	}
  1335  
  1336  	preparer := autorest.CreatePreparer(
  1337  		autorest.AsContentType("application/json; charset=utf-8"),
  1338  		autorest.AsPut(),
  1339  		autorest.WithBaseURL(client.BaseURI),
  1340  		autorest.WithPathParameters("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}", pathParameters),
  1341  		autorest.WithJSON(requestMessage),
  1342  		autorest.WithQueryParameters(queryParameters))
  1343  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1344  }
  1345  
  1346  // UpdateSourceControlSender sends the UpdateSourceControl request. The method will close the
  1347  // http.Response Body if it receives an error.
  1348  func (client BaseClient) UpdateSourceControlSender(req *http.Request) (*http.Response, error) {
  1349  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1350  }
  1351  
  1352  // UpdateSourceControlResponder handles the response to the UpdateSourceControl request. The method always
  1353  // closes the http.Response Body.
  1354  func (client BaseClient) UpdateSourceControlResponder(resp *http.Response) (result SourceControl, err error) {
  1355  	err = autorest.Respond(
  1356  		resp,
  1357  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1358  		autorest.ByUnmarshallingJSON(&result),
  1359  		autorest.ByClosing())
  1360  	result.Response = autorest.Response{Response: resp}
  1361  	return
  1362  }
  1363  
  1364  // Validate description for Validate if a resource can be created.
  1365  // Parameters:
  1366  // resourceGroupName - name of the resource group to which the resource belongs.
  1367  // validateRequest - request with the resources to validate.
  1368  func (client BaseClient) Validate(ctx context.Context, resourceGroupName string, validateRequest ValidateRequest) (result ValidateResponse, err error) {
  1369  	if tracing.IsEnabled() {
  1370  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Validate")
  1371  		defer func() {
  1372  			sc := -1
  1373  			if result.Response.Response != nil {
  1374  				sc = result.Response.Response.StatusCode
  1375  			}
  1376  			tracing.EndSpan(ctx, sc, err)
  1377  		}()
  1378  	}
  1379  	if err := validation.Validate([]validation.Validation{
  1380  		{TargetValue: resourceGroupName,
  1381  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1382  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1383  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}},
  1384  		{TargetValue: validateRequest,
  1385  			Constraints: []validation.Constraint{{Target: "validateRequest.Name", Name: validation.Null, Rule: true, Chain: nil},
  1386  				{Target: "validateRequest.Location", Name: validation.Null, Rule: true, Chain: nil},
  1387  				{Target: "validateRequest.ValidateProperties", Name: validation.Null, Rule: true,
  1388  					Chain: []validation.Constraint{{Target: "validateRequest.ValidateProperties.Capacity", Name: validation.Null, Rule: false,
  1389  						Chain: []validation.Constraint{{Target: "validateRequest.ValidateProperties.Capacity", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}},
  1390  						{Target: "validateRequest.ValidateProperties.AppServiceEnvironment", Name: validation.Null, Rule: false,
  1391  							Chain: []validation.Constraint{{Target: "validateRequest.ValidateProperties.AppServiceEnvironment.VirtualNetwork", Name: validation.Null, Rule: true,
  1392  								Chain: []validation.Constraint{{Target: "validateRequest.ValidateProperties.AppServiceEnvironment.VirtualNetwork.ID", Name: validation.Null, Rule: true, Chain: nil}}},
  1393  							}},
  1394  					}}}}}); err != nil {
  1395  		return result, validation.NewError("web.BaseClient", "Validate", err.Error())
  1396  	}
  1397  
  1398  	req, err := client.ValidatePreparer(ctx, resourceGroupName, validateRequest)
  1399  	if err != nil {
  1400  		err = autorest.NewErrorWithError(err, "web.BaseClient", "Validate", nil, "Failure preparing request")
  1401  		return
  1402  	}
  1403  
  1404  	resp, err := client.ValidateSender(req)
  1405  	if err != nil {
  1406  		result.Response = autorest.Response{Response: resp}
  1407  		err = autorest.NewErrorWithError(err, "web.BaseClient", "Validate", resp, "Failure sending request")
  1408  		return
  1409  	}
  1410  
  1411  	result, err = client.ValidateResponder(resp)
  1412  	if err != nil {
  1413  		err = autorest.NewErrorWithError(err, "web.BaseClient", "Validate", resp, "Failure responding to request")
  1414  		return
  1415  	}
  1416  
  1417  	return
  1418  }
  1419  
  1420  // ValidatePreparer prepares the Validate request.
  1421  func (client BaseClient) ValidatePreparer(ctx context.Context, resourceGroupName string, validateRequest ValidateRequest) (*http.Request, error) {
  1422  	pathParameters := map[string]interface{}{
  1423  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1424  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1425  	}
  1426  
  1427  	const APIVersion = "2021-03-01"
  1428  	queryParameters := map[string]interface{}{
  1429  		"api-version": APIVersion,
  1430  	}
  1431  
  1432  	preparer := autorest.CreatePreparer(
  1433  		autorest.AsContentType("application/json; charset=utf-8"),
  1434  		autorest.AsPost(),
  1435  		autorest.WithBaseURL(client.BaseURI),
  1436  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate", pathParameters),
  1437  		autorest.WithJSON(validateRequest),
  1438  		autorest.WithQueryParameters(queryParameters))
  1439  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1440  }
  1441  
  1442  // ValidateSender sends the Validate request. The method will close the
  1443  // http.Response Body if it receives an error.
  1444  func (client BaseClient) ValidateSender(req *http.Request) (*http.Response, error) {
  1445  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1446  }
  1447  
  1448  // ValidateResponder handles the response to the Validate request. The method always
  1449  // closes the http.Response Body.
  1450  func (client BaseClient) ValidateResponder(resp *http.Response) (result ValidateResponse, err error) {
  1451  	err = autorest.Respond(
  1452  		resp,
  1453  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1454  		autorest.ByUnmarshallingJSON(&result),
  1455  		autorest.ByClosing())
  1456  	result.Response = autorest.Response{Response: resp}
  1457  	return
  1458  }
  1459  
  1460  // ValidateMove description for Validate whether a resource can be moved.
  1461  // Parameters:
  1462  // resourceGroupName - name of the resource group to which the resource belongs.
  1463  // moveResourceEnvelope - object that represents the resource to move.
  1464  func (client BaseClient) ValidateMove(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (result autorest.Response, err error) {
  1465  	if tracing.IsEnabled() {
  1466  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ValidateMove")
  1467  		defer func() {
  1468  			sc := -1
  1469  			if result.Response != nil {
  1470  				sc = result.Response.StatusCode
  1471  			}
  1472  			tracing.EndSpan(ctx, sc, err)
  1473  		}()
  1474  	}
  1475  	if err := validation.Validate([]validation.Validation{
  1476  		{TargetValue: resourceGroupName,
  1477  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1478  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
  1479  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}},
  1480  		{TargetValue: moveResourceEnvelope,
  1481  			Constraints: []validation.Constraint{{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.Null, Rule: false,
  1482  				Chain: []validation.Constraint{{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.MaxLength, Rule: 90, Chain: nil},
  1483  					{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.MinLength, Rule: 1, Chain: nil},
  1484  					{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.Pattern, Rule: ` ^[-\w\._\(\)]+[^\.]$`, Chain: nil},
  1485  				}}}}}); err != nil {
  1486  		return result, validation.NewError("web.BaseClient", "ValidateMove", err.Error())
  1487  	}
  1488  
  1489  	req, err := client.ValidateMovePreparer(ctx, resourceGroupName, moveResourceEnvelope)
  1490  	if err != nil {
  1491  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateMove", nil, "Failure preparing request")
  1492  		return
  1493  	}
  1494  
  1495  	resp, err := client.ValidateMoveSender(req)
  1496  	if err != nil {
  1497  		result.Response = resp
  1498  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateMove", resp, "Failure sending request")
  1499  		return
  1500  	}
  1501  
  1502  	result, err = client.ValidateMoveResponder(resp)
  1503  	if err != nil {
  1504  		err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateMove", resp, "Failure responding to request")
  1505  		return
  1506  	}
  1507  
  1508  	return
  1509  }
  1510  
  1511  // ValidateMovePreparer prepares the ValidateMove request.
  1512  func (client BaseClient) ValidateMovePreparer(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (*http.Request, error) {
  1513  	pathParameters := map[string]interface{}{
  1514  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
  1515  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
  1516  	}
  1517  
  1518  	const APIVersion = "2021-03-01"
  1519  	queryParameters := map[string]interface{}{
  1520  		"api-version": APIVersion,
  1521  	}
  1522  
  1523  	preparer := autorest.CreatePreparer(
  1524  		autorest.AsContentType("application/json; charset=utf-8"),
  1525  		autorest.AsPost(),
  1526  		autorest.WithBaseURL(client.BaseURI),
  1527  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources", pathParameters),
  1528  		autorest.WithJSON(moveResourceEnvelope),
  1529  		autorest.WithQueryParameters(queryParameters))
  1530  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1531  }
  1532  
  1533  // ValidateMoveSender sends the ValidateMove request. The method will close the
  1534  // http.Response Body if it receives an error.
  1535  func (client BaseClient) ValidateMoveSender(req *http.Request) (*http.Response, error) {
  1536  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1537  }
  1538  
  1539  // ValidateMoveResponder handles the response to the ValidateMove request. The method always
  1540  // closes the http.Response Body.
  1541  func (client BaseClient) ValidateMoveResponder(resp *http.Response) (result autorest.Response, err error) {
  1542  	err = autorest.Respond(
  1543  		resp,
  1544  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
  1545  		autorest.ByClosing())
  1546  	result.Response = resp
  1547  	return
  1548  }
  1549  
  1550  // VerifyHostingEnvironmentVnet description for Verifies if this VNET is compatible with an App Service Environment by
  1551  // analyzing the Network Security Group rules.
  1552  // Parameters:
  1553  // parameters - VNET information
  1554  func (client BaseClient) VerifyHostingEnvironmentVnet(ctx context.Context, parameters VnetParameters) (result VnetValidationFailureDetails, err error) {
  1555  	if tracing.IsEnabled() {
  1556  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.VerifyHostingEnvironmentVnet")
  1557  		defer func() {
  1558  			sc := -1
  1559  			if result.Response.Response != nil {
  1560  				sc = result.Response.Response.StatusCode
  1561  			}
  1562  			tracing.EndSpan(ctx, sc, err)
  1563  		}()
  1564  	}
  1565  	req, err := client.VerifyHostingEnvironmentVnetPreparer(ctx, parameters)
  1566  	if err != nil {
  1567  		err = autorest.NewErrorWithError(err, "web.BaseClient", "VerifyHostingEnvironmentVnet", nil, "Failure preparing request")
  1568  		return
  1569  	}
  1570  
  1571  	resp, err := client.VerifyHostingEnvironmentVnetSender(req)
  1572  	if err != nil {
  1573  		result.Response = autorest.Response{Response: resp}
  1574  		err = autorest.NewErrorWithError(err, "web.BaseClient", "VerifyHostingEnvironmentVnet", resp, "Failure sending request")
  1575  		return
  1576  	}
  1577  
  1578  	result, err = client.VerifyHostingEnvironmentVnetResponder(resp)
  1579  	if err != nil {
  1580  		err = autorest.NewErrorWithError(err, "web.BaseClient", "VerifyHostingEnvironmentVnet", resp, "Failure responding to request")
  1581  		return
  1582  	}
  1583  
  1584  	return
  1585  }
  1586  
  1587  // VerifyHostingEnvironmentVnetPreparer prepares the VerifyHostingEnvironmentVnet request.
  1588  func (client BaseClient) VerifyHostingEnvironmentVnetPreparer(ctx context.Context, parameters VnetParameters) (*http.Request, error) {
  1589  	pathParameters := map[string]interface{}{
  1590  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
  1591  	}
  1592  
  1593  	const APIVersion = "2021-03-01"
  1594  	queryParameters := map[string]interface{}{
  1595  		"api-version": APIVersion,
  1596  	}
  1597  
  1598  	preparer := autorest.CreatePreparer(
  1599  		autorest.AsContentType("application/json; charset=utf-8"),
  1600  		autorest.AsPost(),
  1601  		autorest.WithBaseURL(client.BaseURI),
  1602  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet", pathParameters),
  1603  		autorest.WithJSON(parameters),
  1604  		autorest.WithQueryParameters(queryParameters))
  1605  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1606  }
  1607  
  1608  // VerifyHostingEnvironmentVnetSender sends the VerifyHostingEnvironmentVnet request. The method will close the
  1609  // http.Response Body if it receives an error.
  1610  func (client BaseClient) VerifyHostingEnvironmentVnetSender(req *http.Request) (*http.Response, error) {
  1611  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
  1612  }
  1613  
  1614  // VerifyHostingEnvironmentVnetResponder handles the response to the VerifyHostingEnvironmentVnet request. The method always
  1615  // closes the http.Response Body.
  1616  func (client BaseClient) VerifyHostingEnvironmentVnetResponder(resp *http.Response) (result VnetValidationFailureDetails, err error) {
  1617  	err = autorest.Respond(
  1618  		resp,
  1619  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1620  		autorest.ByUnmarshallingJSON(&result),
  1621  		autorest.ByClosing())
  1622  	result.Response = autorest.Response{Response: resp}
  1623  	return
  1624  }
  1625  

View as plain text