...

Source file src/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/features/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/features

     1  package features
     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  	"encoding/json"
    12  	"github.com/Azure/go-autorest/autorest"
    13  	"github.com/Azure/go-autorest/autorest/azure"
    14  	"github.com/Azure/go-autorest/autorest/date"
    15  	"github.com/Azure/go-autorest/autorest/to"
    16  	"github.com/Azure/go-autorest/tracing"
    17  	"net/http"
    18  )
    19  
    20  // The package's fully qualified name.
    21  const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/features"
    22  
    23  // AliasPathType the type of the paths for alias.
    24  type AliasPathType struct {
    25  	// Path - The path of an alias.
    26  	Path *string `json:"path,omitempty"`
    27  	// APIVersions - The API versions.
    28  	APIVersions *[]string `json:"apiVersions,omitempty"`
    29  }
    30  
    31  // AliasType the alias type.
    32  type AliasType struct {
    33  	// Name - The alias name.
    34  	Name *string `json:"name,omitempty"`
    35  	// Paths - The paths for an alias.
    36  	Paths *[]AliasPathType `json:"paths,omitempty"`
    37  }
    38  
    39  // BasicDependency deployment dependency information.
    40  type BasicDependency struct {
    41  	// ID - The ID of the dependency.
    42  	ID *string `json:"id,omitempty"`
    43  	// ResourceType - The dependency resource type.
    44  	ResourceType *string `json:"resourceType,omitempty"`
    45  	// ResourceName - The dependency resource name.
    46  	ResourceName *string `json:"resourceName,omitempty"`
    47  }
    48  
    49  // CloudError an error response for a resource management request.
    50  type CloudError struct {
    51  	Error *ErrorResponse `json:"error,omitempty"`
    52  }
    53  
    54  // DebugSetting the debug setting.
    55  type DebugSetting struct {
    56  	// DetailLevel - Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information you are passing in during deployment. By logging information about the request or response, you could potentially expose sensitive data that is retrieved through the deployment operations.
    57  	DetailLevel *string `json:"detailLevel,omitempty"`
    58  }
    59  
    60  // Dependency deployment dependency information.
    61  type Dependency struct {
    62  	// DependsOn - The list of dependencies.
    63  	DependsOn *[]BasicDependency `json:"dependsOn,omitempty"`
    64  	// ID - The ID of the dependency.
    65  	ID *string `json:"id,omitempty"`
    66  	// ResourceType - The dependency resource type.
    67  	ResourceType *string `json:"resourceType,omitempty"`
    68  	// ResourceName - The dependency resource name.
    69  	ResourceName *string `json:"resourceName,omitempty"`
    70  }
    71  
    72  // Deployment deployment operation parameters.
    73  type Deployment struct {
    74  	// Location - The location to store the deployment data.
    75  	Location *string `json:"location,omitempty"`
    76  	// Properties - The deployment properties.
    77  	Properties *DeploymentProperties `json:"properties,omitempty"`
    78  }
    79  
    80  // DeploymentExportResult the deployment export result.
    81  type DeploymentExportResult struct {
    82  	autorest.Response `json:"-"`
    83  	// Template - The template content.
    84  	Template interface{} `json:"template,omitempty"`
    85  }
    86  
    87  // DeploymentExtended deployment information.
    88  type DeploymentExtended struct {
    89  	autorest.Response `json:"-"`
    90  	// ID - READ-ONLY; The ID of the deployment.
    91  	ID *string `json:"id,omitempty"`
    92  	// Name - READ-ONLY; The name of the deployment.
    93  	Name *string `json:"name,omitempty"`
    94  	// Type - READ-ONLY; The type of the deployment.
    95  	Type *string `json:"type,omitempty"`
    96  	// Location - the location of the deployment.
    97  	Location *string `json:"location,omitempty"`
    98  	// Properties - Deployment properties.
    99  	Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
   100  }
   101  
   102  // MarshalJSON is the custom marshaler for DeploymentExtended.
   103  func (de DeploymentExtended) MarshalJSON() ([]byte, error) {
   104  	objectMap := make(map[string]interface{})
   105  	if de.Location != nil {
   106  		objectMap["location"] = de.Location
   107  	}
   108  	if de.Properties != nil {
   109  		objectMap["properties"] = de.Properties
   110  	}
   111  	return json.Marshal(objectMap)
   112  }
   113  
   114  // DeploymentExtendedFilter deployment filter.
   115  type DeploymentExtendedFilter struct {
   116  	// ProvisioningState - The provisioning state.
   117  	ProvisioningState *string `json:"provisioningState,omitempty"`
   118  }
   119  
   120  // DeploymentListResult list of deployments.
   121  type DeploymentListResult struct {
   122  	autorest.Response `json:"-"`
   123  	// Value - An array of deployments.
   124  	Value *[]DeploymentExtended `json:"value,omitempty"`
   125  	// NextLink - READ-ONLY; The URL to use for getting the next set of results.
   126  	NextLink *string `json:"nextLink,omitempty"`
   127  }
   128  
   129  // MarshalJSON is the custom marshaler for DeploymentListResult.
   130  func (dlr DeploymentListResult) MarshalJSON() ([]byte, error) {
   131  	objectMap := make(map[string]interface{})
   132  	if dlr.Value != nil {
   133  		objectMap["value"] = dlr.Value
   134  	}
   135  	return json.Marshal(objectMap)
   136  }
   137  
   138  // DeploymentListResultIterator provides access to a complete listing of DeploymentExtended values.
   139  type DeploymentListResultIterator struct {
   140  	i    int
   141  	page DeploymentListResultPage
   142  }
   143  
   144  // NextWithContext advances to the next value.  If there was an error making
   145  // the request the iterator does not advance and the error is returned.
   146  func (iter *DeploymentListResultIterator) NextWithContext(ctx context.Context) (err error) {
   147  	if tracing.IsEnabled() {
   148  		ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentListResultIterator.NextWithContext")
   149  		defer func() {
   150  			sc := -1
   151  			if iter.Response().Response.Response != nil {
   152  				sc = iter.Response().Response.Response.StatusCode
   153  			}
   154  			tracing.EndSpan(ctx, sc, err)
   155  		}()
   156  	}
   157  	iter.i++
   158  	if iter.i < len(iter.page.Values()) {
   159  		return nil
   160  	}
   161  	err = iter.page.NextWithContext(ctx)
   162  	if err != nil {
   163  		iter.i--
   164  		return err
   165  	}
   166  	iter.i = 0
   167  	return nil
   168  }
   169  
   170  // Next advances to the next value.  If there was an error making
   171  // the request the iterator does not advance and the error is returned.
   172  // Deprecated: Use NextWithContext() instead.
   173  func (iter *DeploymentListResultIterator) Next() error {
   174  	return iter.NextWithContext(context.Background())
   175  }
   176  
   177  // NotDone returns true if the enumeration should be started or is not yet complete.
   178  func (iter DeploymentListResultIterator) NotDone() bool {
   179  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   180  }
   181  
   182  // Response returns the raw server response from the last page request.
   183  func (iter DeploymentListResultIterator) Response() DeploymentListResult {
   184  	return iter.page.Response()
   185  }
   186  
   187  // Value returns the current value or a zero-initialized value if the
   188  // iterator has advanced beyond the end of the collection.
   189  func (iter DeploymentListResultIterator) Value() DeploymentExtended {
   190  	if !iter.page.NotDone() {
   191  		return DeploymentExtended{}
   192  	}
   193  	return iter.page.Values()[iter.i]
   194  }
   195  
   196  // Creates a new instance of the DeploymentListResultIterator type.
   197  func NewDeploymentListResultIterator(page DeploymentListResultPage) DeploymentListResultIterator {
   198  	return DeploymentListResultIterator{page: page}
   199  }
   200  
   201  // IsEmpty returns true if the ListResult contains no values.
   202  func (dlr DeploymentListResult) IsEmpty() bool {
   203  	return dlr.Value == nil || len(*dlr.Value) == 0
   204  }
   205  
   206  // hasNextLink returns true if the NextLink is not empty.
   207  func (dlr DeploymentListResult) hasNextLink() bool {
   208  	return dlr.NextLink != nil && len(*dlr.NextLink) != 0
   209  }
   210  
   211  // deploymentListResultPreparer prepares a request to retrieve the next set of results.
   212  // It returns nil if no more results exist.
   213  func (dlr DeploymentListResult) deploymentListResultPreparer(ctx context.Context) (*http.Request, error) {
   214  	if !dlr.hasNextLink() {
   215  		return nil, nil
   216  	}
   217  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   218  		autorest.AsJSON(),
   219  		autorest.AsGet(),
   220  		autorest.WithBaseURL(to.String(dlr.NextLink)))
   221  }
   222  
   223  // DeploymentListResultPage contains a page of DeploymentExtended values.
   224  type DeploymentListResultPage struct {
   225  	fn  func(context.Context, DeploymentListResult) (DeploymentListResult, error)
   226  	dlr DeploymentListResult
   227  }
   228  
   229  // NextWithContext advances to the next page of values.  If there was an error making
   230  // the request the page does not advance and the error is returned.
   231  func (page *DeploymentListResultPage) NextWithContext(ctx context.Context) (err error) {
   232  	if tracing.IsEnabled() {
   233  		ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentListResultPage.NextWithContext")
   234  		defer func() {
   235  			sc := -1
   236  			if page.Response().Response.Response != nil {
   237  				sc = page.Response().Response.Response.StatusCode
   238  			}
   239  			tracing.EndSpan(ctx, sc, err)
   240  		}()
   241  	}
   242  	for {
   243  		next, err := page.fn(ctx, page.dlr)
   244  		if err != nil {
   245  			return err
   246  		}
   247  		page.dlr = next
   248  		if !next.hasNextLink() || !next.IsEmpty() {
   249  			break
   250  		}
   251  	}
   252  	return nil
   253  }
   254  
   255  // Next advances to the next page of values.  If there was an error making
   256  // the request the page does not advance and the error is returned.
   257  // Deprecated: Use NextWithContext() instead.
   258  func (page *DeploymentListResultPage) Next() error {
   259  	return page.NextWithContext(context.Background())
   260  }
   261  
   262  // NotDone returns true if the page enumeration should be started or is not yet complete.
   263  func (page DeploymentListResultPage) NotDone() bool {
   264  	return !page.dlr.IsEmpty()
   265  }
   266  
   267  // Response returns the raw server response from the last page request.
   268  func (page DeploymentListResultPage) Response() DeploymentListResult {
   269  	return page.dlr
   270  }
   271  
   272  // Values returns the slice of values for the current page or nil if there are no values.
   273  func (page DeploymentListResultPage) Values() []DeploymentExtended {
   274  	if page.dlr.IsEmpty() {
   275  		return nil
   276  	}
   277  	return *page.dlr.Value
   278  }
   279  
   280  // Creates a new instance of the DeploymentListResultPage type.
   281  func NewDeploymentListResultPage(cur DeploymentListResult, getNextPage func(context.Context, DeploymentListResult) (DeploymentListResult, error)) DeploymentListResultPage {
   282  	return DeploymentListResultPage{
   283  		fn:  getNextPage,
   284  		dlr: cur,
   285  	}
   286  }
   287  
   288  // DeploymentOperation deployment operation information.
   289  type DeploymentOperation struct {
   290  	autorest.Response `json:"-"`
   291  	// ID - READ-ONLY; Full deployment operation ID.
   292  	ID *string `json:"id,omitempty"`
   293  	// OperationID - READ-ONLY; Deployment operation ID.
   294  	OperationID *string `json:"operationId,omitempty"`
   295  	// Properties - Deployment properties.
   296  	Properties *DeploymentOperationProperties `json:"properties,omitempty"`
   297  }
   298  
   299  // MarshalJSON is the custom marshaler for DeploymentOperation.
   300  func (do DeploymentOperation) MarshalJSON() ([]byte, error) {
   301  	objectMap := make(map[string]interface{})
   302  	if do.Properties != nil {
   303  		objectMap["properties"] = do.Properties
   304  	}
   305  	return json.Marshal(objectMap)
   306  }
   307  
   308  // DeploymentOperationProperties deployment operation properties.
   309  type DeploymentOperationProperties struct {
   310  	// ProvisioningState - READ-ONLY; The state of the provisioning.
   311  	ProvisioningState *string `json:"provisioningState,omitempty"`
   312  	// Timestamp - READ-ONLY; The date and time of the operation.
   313  	Timestamp *date.Time `json:"timestamp,omitempty"`
   314  	// Duration - READ-ONLY; The duration of the operation.
   315  	Duration *string `json:"duration,omitempty"`
   316  	// ServiceRequestID - READ-ONLY; Deployment operation service request id.
   317  	ServiceRequestID *string `json:"serviceRequestId,omitempty"`
   318  	// StatusCode - READ-ONLY; Operation status code.
   319  	StatusCode *string `json:"statusCode,omitempty"`
   320  	// StatusMessage - READ-ONLY; Operation status message.
   321  	StatusMessage interface{} `json:"statusMessage,omitempty"`
   322  	// TargetResource - READ-ONLY; The target resource.
   323  	TargetResource *TargetResource `json:"targetResource,omitempty"`
   324  	// Request - READ-ONLY; The HTTP request message.
   325  	Request *HTTPMessage `json:"request,omitempty"`
   326  	// Response - READ-ONLY; The HTTP response message.
   327  	Response *HTTPMessage `json:"response,omitempty"`
   328  }
   329  
   330  // MarshalJSON is the custom marshaler for DeploymentOperationProperties.
   331  func (dop DeploymentOperationProperties) MarshalJSON() ([]byte, error) {
   332  	objectMap := make(map[string]interface{})
   333  	return json.Marshal(objectMap)
   334  }
   335  
   336  // DeploymentOperationsListResult list of deployment operations.
   337  type DeploymentOperationsListResult struct {
   338  	autorest.Response `json:"-"`
   339  	// Value - An array of deployment operations.
   340  	Value *[]DeploymentOperation `json:"value,omitempty"`
   341  	// NextLink - READ-ONLY; The URL to use for getting the next set of results.
   342  	NextLink *string `json:"nextLink,omitempty"`
   343  }
   344  
   345  // MarshalJSON is the custom marshaler for DeploymentOperationsListResult.
   346  func (dolr DeploymentOperationsListResult) MarshalJSON() ([]byte, error) {
   347  	objectMap := make(map[string]interface{})
   348  	if dolr.Value != nil {
   349  		objectMap["value"] = dolr.Value
   350  	}
   351  	return json.Marshal(objectMap)
   352  }
   353  
   354  // DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation
   355  // values.
   356  type DeploymentOperationsListResultIterator struct {
   357  	i    int
   358  	page DeploymentOperationsListResultPage
   359  }
   360  
   361  // NextWithContext advances to the next value.  If there was an error making
   362  // the request the iterator does not advance and the error is returned.
   363  func (iter *DeploymentOperationsListResultIterator) NextWithContext(ctx context.Context) (err error) {
   364  	if tracing.IsEnabled() {
   365  		ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsListResultIterator.NextWithContext")
   366  		defer func() {
   367  			sc := -1
   368  			if iter.Response().Response.Response != nil {
   369  				sc = iter.Response().Response.Response.StatusCode
   370  			}
   371  			tracing.EndSpan(ctx, sc, err)
   372  		}()
   373  	}
   374  	iter.i++
   375  	if iter.i < len(iter.page.Values()) {
   376  		return nil
   377  	}
   378  	err = iter.page.NextWithContext(ctx)
   379  	if err != nil {
   380  		iter.i--
   381  		return err
   382  	}
   383  	iter.i = 0
   384  	return nil
   385  }
   386  
   387  // Next advances to the next value.  If there was an error making
   388  // the request the iterator does not advance and the error is returned.
   389  // Deprecated: Use NextWithContext() instead.
   390  func (iter *DeploymentOperationsListResultIterator) Next() error {
   391  	return iter.NextWithContext(context.Background())
   392  }
   393  
   394  // NotDone returns true if the enumeration should be started or is not yet complete.
   395  func (iter DeploymentOperationsListResultIterator) NotDone() bool {
   396  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   397  }
   398  
   399  // Response returns the raw server response from the last page request.
   400  func (iter DeploymentOperationsListResultIterator) Response() DeploymentOperationsListResult {
   401  	return iter.page.Response()
   402  }
   403  
   404  // Value returns the current value or a zero-initialized value if the
   405  // iterator has advanced beyond the end of the collection.
   406  func (iter DeploymentOperationsListResultIterator) Value() DeploymentOperation {
   407  	if !iter.page.NotDone() {
   408  		return DeploymentOperation{}
   409  	}
   410  	return iter.page.Values()[iter.i]
   411  }
   412  
   413  // Creates a new instance of the DeploymentOperationsListResultIterator type.
   414  func NewDeploymentOperationsListResultIterator(page DeploymentOperationsListResultPage) DeploymentOperationsListResultIterator {
   415  	return DeploymentOperationsListResultIterator{page: page}
   416  }
   417  
   418  // IsEmpty returns true if the ListResult contains no values.
   419  func (dolr DeploymentOperationsListResult) IsEmpty() bool {
   420  	return dolr.Value == nil || len(*dolr.Value) == 0
   421  }
   422  
   423  // hasNextLink returns true if the NextLink is not empty.
   424  func (dolr DeploymentOperationsListResult) hasNextLink() bool {
   425  	return dolr.NextLink != nil && len(*dolr.NextLink) != 0
   426  }
   427  
   428  // deploymentOperationsListResultPreparer prepares a request to retrieve the next set of results.
   429  // It returns nil if no more results exist.
   430  func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPreparer(ctx context.Context) (*http.Request, error) {
   431  	if !dolr.hasNextLink() {
   432  		return nil, nil
   433  	}
   434  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   435  		autorest.AsJSON(),
   436  		autorest.AsGet(),
   437  		autorest.WithBaseURL(to.String(dolr.NextLink)))
   438  }
   439  
   440  // DeploymentOperationsListResultPage contains a page of DeploymentOperation values.
   441  type DeploymentOperationsListResultPage struct {
   442  	fn   func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)
   443  	dolr DeploymentOperationsListResult
   444  }
   445  
   446  // NextWithContext advances to the next page of values.  If there was an error making
   447  // the request the page does not advance and the error is returned.
   448  func (page *DeploymentOperationsListResultPage) NextWithContext(ctx context.Context) (err error) {
   449  	if tracing.IsEnabled() {
   450  		ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsListResultPage.NextWithContext")
   451  		defer func() {
   452  			sc := -1
   453  			if page.Response().Response.Response != nil {
   454  				sc = page.Response().Response.Response.StatusCode
   455  			}
   456  			tracing.EndSpan(ctx, sc, err)
   457  		}()
   458  	}
   459  	for {
   460  		next, err := page.fn(ctx, page.dolr)
   461  		if err != nil {
   462  			return err
   463  		}
   464  		page.dolr = next
   465  		if !next.hasNextLink() || !next.IsEmpty() {
   466  			break
   467  		}
   468  	}
   469  	return nil
   470  }
   471  
   472  // Next advances to the next page of values.  If there was an error making
   473  // the request the page does not advance and the error is returned.
   474  // Deprecated: Use NextWithContext() instead.
   475  func (page *DeploymentOperationsListResultPage) Next() error {
   476  	return page.NextWithContext(context.Background())
   477  }
   478  
   479  // NotDone returns true if the page enumeration should be started or is not yet complete.
   480  func (page DeploymentOperationsListResultPage) NotDone() bool {
   481  	return !page.dolr.IsEmpty()
   482  }
   483  
   484  // Response returns the raw server response from the last page request.
   485  func (page DeploymentOperationsListResultPage) Response() DeploymentOperationsListResult {
   486  	return page.dolr
   487  }
   488  
   489  // Values returns the slice of values for the current page or nil if there are no values.
   490  func (page DeploymentOperationsListResultPage) Values() []DeploymentOperation {
   491  	if page.dolr.IsEmpty() {
   492  		return nil
   493  	}
   494  	return *page.dolr.Value
   495  }
   496  
   497  // Creates a new instance of the DeploymentOperationsListResultPage type.
   498  func NewDeploymentOperationsListResultPage(cur DeploymentOperationsListResult, getNextPage func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)) DeploymentOperationsListResultPage {
   499  	return DeploymentOperationsListResultPage{
   500  		fn:   getNextPage,
   501  		dolr: cur,
   502  	}
   503  }
   504  
   505  // DeploymentProperties deployment properties.
   506  type DeploymentProperties struct {
   507  	// Template - The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both.
   508  	Template interface{} `json:"template,omitempty"`
   509  	// TemplateLink - The URI of the template. Use either the templateLink property or the template property, but not both.
   510  	TemplateLink *TemplateLink `json:"templateLink,omitempty"`
   511  	// Parameters - Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string.
   512  	Parameters interface{} `json:"parameters,omitempty"`
   513  	// ParametersLink - The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both.
   514  	ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
   515  	// Mode - The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. Possible values include: 'Incremental', 'Complete'
   516  	Mode DeploymentMode `json:"mode,omitempty"`
   517  	// DebugSetting - The debug setting of the deployment.
   518  	DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
   519  	// OnErrorDeployment - The deployment on error behavior.
   520  	OnErrorDeployment *OnErrorDeployment `json:"onErrorDeployment,omitempty"`
   521  }
   522  
   523  // DeploymentPropertiesExtended deployment properties with additional details.
   524  type DeploymentPropertiesExtended struct {
   525  	// ProvisioningState - READ-ONLY; The state of the provisioning.
   526  	ProvisioningState *string `json:"provisioningState,omitempty"`
   527  	// CorrelationID - READ-ONLY; The correlation ID of the deployment.
   528  	CorrelationID *string `json:"correlationId,omitempty"`
   529  	// Timestamp - READ-ONLY; The timestamp of the template deployment.
   530  	Timestamp *date.Time `json:"timestamp,omitempty"`
   531  	// Duration - READ-ONLY; The duration of the template deployment.
   532  	Duration *string `json:"duration,omitempty"`
   533  	// Outputs - Key/value pairs that represent deployment output.
   534  	Outputs interface{} `json:"outputs,omitempty"`
   535  	// Providers - The list of resource providers needed for the deployment.
   536  	Providers *[]Provider `json:"providers,omitempty"`
   537  	// Dependencies - The list of deployment dependencies.
   538  	Dependencies *[]Dependency `json:"dependencies,omitempty"`
   539  	// Template - The template content. Use only one of Template or TemplateLink.
   540  	Template interface{} `json:"template,omitempty"`
   541  	// TemplateLink - The URI referencing the template. Use only one of Template or TemplateLink.
   542  	TemplateLink *TemplateLink `json:"templateLink,omitempty"`
   543  	// Parameters - Deployment parameters. Use only one of Parameters or ParametersLink.
   544  	Parameters interface{} `json:"parameters,omitempty"`
   545  	// ParametersLink - The URI referencing the parameters. Use only one of Parameters or ParametersLink.
   546  	ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
   547  	// Mode - The deployment mode. Possible values are Incremental and Complete. Possible values include: 'Incremental', 'Complete'
   548  	Mode DeploymentMode `json:"mode,omitempty"`
   549  	// DebugSetting - The debug setting of the deployment.
   550  	DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
   551  	// OnErrorDeployment - The deployment on error behavior.
   552  	OnErrorDeployment *OnErrorDeploymentExtended `json:"onErrorDeployment,omitempty"`
   553  }
   554  
   555  // MarshalJSON is the custom marshaler for DeploymentPropertiesExtended.
   556  func (dpe DeploymentPropertiesExtended) MarshalJSON() ([]byte, error) {
   557  	objectMap := make(map[string]interface{})
   558  	if dpe.Outputs != nil {
   559  		objectMap["outputs"] = dpe.Outputs
   560  	}
   561  	if dpe.Providers != nil {
   562  		objectMap["providers"] = dpe.Providers
   563  	}
   564  	if dpe.Dependencies != nil {
   565  		objectMap["dependencies"] = dpe.Dependencies
   566  	}
   567  	if dpe.Template != nil {
   568  		objectMap["template"] = dpe.Template
   569  	}
   570  	if dpe.TemplateLink != nil {
   571  		objectMap["templateLink"] = dpe.TemplateLink
   572  	}
   573  	if dpe.Parameters != nil {
   574  		objectMap["parameters"] = dpe.Parameters
   575  	}
   576  	if dpe.ParametersLink != nil {
   577  		objectMap["parametersLink"] = dpe.ParametersLink
   578  	}
   579  	if dpe.Mode != "" {
   580  		objectMap["mode"] = dpe.Mode
   581  	}
   582  	if dpe.DebugSetting != nil {
   583  		objectMap["debugSetting"] = dpe.DebugSetting
   584  	}
   585  	if dpe.OnErrorDeployment != nil {
   586  		objectMap["onErrorDeployment"] = dpe.OnErrorDeployment
   587  	}
   588  	return json.Marshal(objectMap)
   589  }
   590  
   591  // DeploymentsCreateOrUpdateAtManagementGroupScopeFuture an abstraction for monitoring and retrieving the
   592  // results of a long-running operation.
   593  type DeploymentsCreateOrUpdateAtManagementGroupScopeFuture struct {
   594  	azure.FutureAPI
   595  	// Result returns the result of the asynchronous operation.
   596  	// If the operation has not completed it will return an error.
   597  	Result func(DeploymentsClient) (DeploymentExtended, error)
   598  }
   599  
   600  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   601  func (future *DeploymentsCreateOrUpdateAtManagementGroupScopeFuture) UnmarshalJSON(body []byte) error {
   602  	var azFuture azure.Future
   603  	if err := json.Unmarshal(body, &azFuture); err != nil {
   604  		return err
   605  	}
   606  	future.FutureAPI = &azFuture
   607  	future.Result = future.result
   608  	return nil
   609  }
   610  
   611  // result is the default implementation for DeploymentsCreateOrUpdateAtManagementGroupScopeFuture.Result.
   612  func (future *DeploymentsCreateOrUpdateAtManagementGroupScopeFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
   613  	var done bool
   614  	done, err = future.DoneWithContext(context.Background(), client)
   615  	if err != nil {
   616  		err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtManagementGroupScopeFuture", "Result", future.Response(), "Polling failure")
   617  		return
   618  	}
   619  	if !done {
   620  		de.Response.Response = future.Response()
   621  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsCreateOrUpdateAtManagementGroupScopeFuture")
   622  		return
   623  	}
   624  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   625  	if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
   626  		de, err = client.CreateOrUpdateAtManagementGroupScopeResponder(de.Response.Response)
   627  		if err != nil {
   628  			err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtManagementGroupScopeFuture", "Result", de.Response.Response, "Failure responding to request")
   629  		}
   630  	}
   631  	return
   632  }
   633  
   634  // DeploymentsCreateOrUpdateAtScopeFuture an abstraction for monitoring and retrieving the results of a
   635  // long-running operation.
   636  type DeploymentsCreateOrUpdateAtScopeFuture struct {
   637  	azure.FutureAPI
   638  	// Result returns the result of the asynchronous operation.
   639  	// If the operation has not completed it will return an error.
   640  	Result func(DeploymentsClient) (DeploymentExtended, error)
   641  }
   642  
   643  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   644  func (future *DeploymentsCreateOrUpdateAtScopeFuture) UnmarshalJSON(body []byte) error {
   645  	var azFuture azure.Future
   646  	if err := json.Unmarshal(body, &azFuture); err != nil {
   647  		return err
   648  	}
   649  	future.FutureAPI = &azFuture
   650  	future.Result = future.result
   651  	return nil
   652  }
   653  
   654  // result is the default implementation for DeploymentsCreateOrUpdateAtScopeFuture.Result.
   655  func (future *DeploymentsCreateOrUpdateAtScopeFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
   656  	var done bool
   657  	done, err = future.DoneWithContext(context.Background(), client)
   658  	if err != nil {
   659  		err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtScopeFuture", "Result", future.Response(), "Polling failure")
   660  		return
   661  	}
   662  	if !done {
   663  		de.Response.Response = future.Response()
   664  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsCreateOrUpdateAtScopeFuture")
   665  		return
   666  	}
   667  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   668  	if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
   669  		de, err = client.CreateOrUpdateAtScopeResponder(de.Response.Response)
   670  		if err != nil {
   671  			err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtScopeFuture", "Result", de.Response.Response, "Failure responding to request")
   672  		}
   673  	}
   674  	return
   675  }
   676  
   677  // DeploymentsCreateOrUpdateAtSubscriptionScopeFuture an abstraction for monitoring and retrieving the
   678  // results of a long-running operation.
   679  type DeploymentsCreateOrUpdateAtSubscriptionScopeFuture struct {
   680  	azure.FutureAPI
   681  	// Result returns the result of the asynchronous operation.
   682  	// If the operation has not completed it will return an error.
   683  	Result func(DeploymentsClient) (DeploymentExtended, error)
   684  }
   685  
   686  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   687  func (future *DeploymentsCreateOrUpdateAtSubscriptionScopeFuture) UnmarshalJSON(body []byte) error {
   688  	var azFuture azure.Future
   689  	if err := json.Unmarshal(body, &azFuture); err != nil {
   690  		return err
   691  	}
   692  	future.FutureAPI = &azFuture
   693  	future.Result = future.result
   694  	return nil
   695  }
   696  
   697  // result is the default implementation for DeploymentsCreateOrUpdateAtSubscriptionScopeFuture.Result.
   698  func (future *DeploymentsCreateOrUpdateAtSubscriptionScopeFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
   699  	var done bool
   700  	done, err = future.DoneWithContext(context.Background(), client)
   701  	if err != nil {
   702  		err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture", "Result", future.Response(), "Polling failure")
   703  		return
   704  	}
   705  	if !done {
   706  		de.Response.Response = future.Response()
   707  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture")
   708  		return
   709  	}
   710  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   711  	if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
   712  		de, err = client.CreateOrUpdateAtSubscriptionScopeResponder(de.Response.Response)
   713  		if err != nil {
   714  			err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture", "Result", de.Response.Response, "Failure responding to request")
   715  		}
   716  	}
   717  	return
   718  }
   719  
   720  // DeploymentsCreateOrUpdateAtTenantScopeFuture an abstraction for monitoring and retrieving the results of
   721  // a long-running operation.
   722  type DeploymentsCreateOrUpdateAtTenantScopeFuture struct {
   723  	azure.FutureAPI
   724  	// Result returns the result of the asynchronous operation.
   725  	// If the operation has not completed it will return an error.
   726  	Result func(DeploymentsClient) (DeploymentExtended, error)
   727  }
   728  
   729  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   730  func (future *DeploymentsCreateOrUpdateAtTenantScopeFuture) UnmarshalJSON(body []byte) error {
   731  	var azFuture azure.Future
   732  	if err := json.Unmarshal(body, &azFuture); err != nil {
   733  		return err
   734  	}
   735  	future.FutureAPI = &azFuture
   736  	future.Result = future.result
   737  	return nil
   738  }
   739  
   740  // result is the default implementation for DeploymentsCreateOrUpdateAtTenantScopeFuture.Result.
   741  func (future *DeploymentsCreateOrUpdateAtTenantScopeFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
   742  	var done bool
   743  	done, err = future.DoneWithContext(context.Background(), client)
   744  	if err != nil {
   745  		err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtTenantScopeFuture", "Result", future.Response(), "Polling failure")
   746  		return
   747  	}
   748  	if !done {
   749  		de.Response.Response = future.Response()
   750  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsCreateOrUpdateAtTenantScopeFuture")
   751  		return
   752  	}
   753  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   754  	if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
   755  		de, err = client.CreateOrUpdateAtTenantScopeResponder(de.Response.Response)
   756  		if err != nil {
   757  			err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtTenantScopeFuture", "Result", de.Response.Response, "Failure responding to request")
   758  		}
   759  	}
   760  	return
   761  }
   762  
   763  // DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
   764  // long-running operation.
   765  type DeploymentsCreateOrUpdateFuture struct {
   766  	azure.FutureAPI
   767  	// Result returns the result of the asynchronous operation.
   768  	// If the operation has not completed it will return an error.
   769  	Result func(DeploymentsClient) (DeploymentExtended, error)
   770  }
   771  
   772  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   773  func (future *DeploymentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
   774  	var azFuture azure.Future
   775  	if err := json.Unmarshal(body, &azFuture); err != nil {
   776  		return err
   777  	}
   778  	future.FutureAPI = &azFuture
   779  	future.Result = future.result
   780  	return nil
   781  }
   782  
   783  // result is the default implementation for DeploymentsCreateOrUpdateFuture.Result.
   784  func (future *DeploymentsCreateOrUpdateFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
   785  	var done bool
   786  	done, err = future.DoneWithContext(context.Background(), client)
   787  	if err != nil {
   788  		err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
   789  		return
   790  	}
   791  	if !done {
   792  		de.Response.Response = future.Response()
   793  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsCreateOrUpdateFuture")
   794  		return
   795  	}
   796  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   797  	if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
   798  		de, err = client.CreateOrUpdateResponder(de.Response.Response)
   799  		if err != nil {
   800  			err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateFuture", "Result", de.Response.Response, "Failure responding to request")
   801  		}
   802  	}
   803  	return
   804  }
   805  
   806  // DeploymentsDeleteAtManagementGroupScopeFuture an abstraction for monitoring and retrieving the results
   807  // of a long-running operation.
   808  type DeploymentsDeleteAtManagementGroupScopeFuture struct {
   809  	azure.FutureAPI
   810  	// Result returns the result of the asynchronous operation.
   811  	// If the operation has not completed it will return an error.
   812  	Result func(DeploymentsClient) (autorest.Response, error)
   813  }
   814  
   815  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   816  func (future *DeploymentsDeleteAtManagementGroupScopeFuture) UnmarshalJSON(body []byte) error {
   817  	var azFuture azure.Future
   818  	if err := json.Unmarshal(body, &azFuture); err != nil {
   819  		return err
   820  	}
   821  	future.FutureAPI = &azFuture
   822  	future.Result = future.result
   823  	return nil
   824  }
   825  
   826  // result is the default implementation for DeploymentsDeleteAtManagementGroupScopeFuture.Result.
   827  func (future *DeploymentsDeleteAtManagementGroupScopeFuture) result(client DeploymentsClient) (ar autorest.Response, err error) {
   828  	var done bool
   829  	done, err = future.DoneWithContext(context.Background(), client)
   830  	if err != nil {
   831  		err = autorest.NewErrorWithError(err, "features.DeploymentsDeleteAtManagementGroupScopeFuture", "Result", future.Response(), "Polling failure")
   832  		return
   833  	}
   834  	if !done {
   835  		ar.Response = future.Response()
   836  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsDeleteAtManagementGroupScopeFuture")
   837  		return
   838  	}
   839  	ar.Response = future.Response()
   840  	return
   841  }
   842  
   843  // DeploymentsDeleteAtScopeFuture an abstraction for monitoring and retrieving the results of a
   844  // long-running operation.
   845  type DeploymentsDeleteAtScopeFuture struct {
   846  	azure.FutureAPI
   847  	// Result returns the result of the asynchronous operation.
   848  	// If the operation has not completed it will return an error.
   849  	Result func(DeploymentsClient) (autorest.Response, error)
   850  }
   851  
   852  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   853  func (future *DeploymentsDeleteAtScopeFuture) UnmarshalJSON(body []byte) error {
   854  	var azFuture azure.Future
   855  	if err := json.Unmarshal(body, &azFuture); err != nil {
   856  		return err
   857  	}
   858  	future.FutureAPI = &azFuture
   859  	future.Result = future.result
   860  	return nil
   861  }
   862  
   863  // result is the default implementation for DeploymentsDeleteAtScopeFuture.Result.
   864  func (future *DeploymentsDeleteAtScopeFuture) result(client DeploymentsClient) (ar autorest.Response, err error) {
   865  	var done bool
   866  	done, err = future.DoneWithContext(context.Background(), client)
   867  	if err != nil {
   868  		err = autorest.NewErrorWithError(err, "features.DeploymentsDeleteAtScopeFuture", "Result", future.Response(), "Polling failure")
   869  		return
   870  	}
   871  	if !done {
   872  		ar.Response = future.Response()
   873  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsDeleteAtScopeFuture")
   874  		return
   875  	}
   876  	ar.Response = future.Response()
   877  	return
   878  }
   879  
   880  // DeploymentsDeleteAtSubscriptionScopeFuture an abstraction for monitoring and retrieving the results of a
   881  // long-running operation.
   882  type DeploymentsDeleteAtSubscriptionScopeFuture struct {
   883  	azure.FutureAPI
   884  	// Result returns the result of the asynchronous operation.
   885  	// If the operation has not completed it will return an error.
   886  	Result func(DeploymentsClient) (autorest.Response, error)
   887  }
   888  
   889  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   890  func (future *DeploymentsDeleteAtSubscriptionScopeFuture) UnmarshalJSON(body []byte) error {
   891  	var azFuture azure.Future
   892  	if err := json.Unmarshal(body, &azFuture); err != nil {
   893  		return err
   894  	}
   895  	future.FutureAPI = &azFuture
   896  	future.Result = future.result
   897  	return nil
   898  }
   899  
   900  // result is the default implementation for DeploymentsDeleteAtSubscriptionScopeFuture.Result.
   901  func (future *DeploymentsDeleteAtSubscriptionScopeFuture) result(client DeploymentsClient) (ar autorest.Response, err error) {
   902  	var done bool
   903  	done, err = future.DoneWithContext(context.Background(), client)
   904  	if err != nil {
   905  		err = autorest.NewErrorWithError(err, "features.DeploymentsDeleteAtSubscriptionScopeFuture", "Result", future.Response(), "Polling failure")
   906  		return
   907  	}
   908  	if !done {
   909  		ar.Response = future.Response()
   910  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsDeleteAtSubscriptionScopeFuture")
   911  		return
   912  	}
   913  	ar.Response = future.Response()
   914  	return
   915  }
   916  
   917  // DeploymentsDeleteAtTenantScopeFuture an abstraction for monitoring and retrieving the results of a
   918  // long-running operation.
   919  type DeploymentsDeleteAtTenantScopeFuture struct {
   920  	azure.FutureAPI
   921  	// Result returns the result of the asynchronous operation.
   922  	// If the operation has not completed it will return an error.
   923  	Result func(DeploymentsClient) (autorest.Response, error)
   924  }
   925  
   926  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   927  func (future *DeploymentsDeleteAtTenantScopeFuture) UnmarshalJSON(body []byte) error {
   928  	var azFuture azure.Future
   929  	if err := json.Unmarshal(body, &azFuture); err != nil {
   930  		return err
   931  	}
   932  	future.FutureAPI = &azFuture
   933  	future.Result = future.result
   934  	return nil
   935  }
   936  
   937  // result is the default implementation for DeploymentsDeleteAtTenantScopeFuture.Result.
   938  func (future *DeploymentsDeleteAtTenantScopeFuture) result(client DeploymentsClient) (ar autorest.Response, err error) {
   939  	var done bool
   940  	done, err = future.DoneWithContext(context.Background(), client)
   941  	if err != nil {
   942  		err = autorest.NewErrorWithError(err, "features.DeploymentsDeleteAtTenantScopeFuture", "Result", future.Response(), "Polling failure")
   943  		return
   944  	}
   945  	if !done {
   946  		ar.Response = future.Response()
   947  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsDeleteAtTenantScopeFuture")
   948  		return
   949  	}
   950  	ar.Response = future.Response()
   951  	return
   952  }
   953  
   954  // DeploymentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
   955  // operation.
   956  type DeploymentsDeleteFuture struct {
   957  	azure.FutureAPI
   958  	// Result returns the result of the asynchronous operation.
   959  	// If the operation has not completed it will return an error.
   960  	Result func(DeploymentsClient) (autorest.Response, error)
   961  }
   962  
   963  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   964  func (future *DeploymentsDeleteFuture) UnmarshalJSON(body []byte) error {
   965  	var azFuture azure.Future
   966  	if err := json.Unmarshal(body, &azFuture); err != nil {
   967  		return err
   968  	}
   969  	future.FutureAPI = &azFuture
   970  	future.Result = future.result
   971  	return nil
   972  }
   973  
   974  // result is the default implementation for DeploymentsDeleteFuture.Result.
   975  func (future *DeploymentsDeleteFuture) result(client DeploymentsClient) (ar autorest.Response, err error) {
   976  	var done bool
   977  	done, err = future.DoneWithContext(context.Background(), client)
   978  	if err != nil {
   979  		err = autorest.NewErrorWithError(err, "features.DeploymentsDeleteFuture", "Result", future.Response(), "Polling failure")
   980  		return
   981  	}
   982  	if !done {
   983  		ar.Response = future.Response()
   984  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsDeleteFuture")
   985  		return
   986  	}
   987  	ar.Response = future.Response()
   988  	return
   989  }
   990  
   991  // DeploymentsWhatIfAtSubscriptionScopeFuture an abstraction for monitoring and retrieving the results of a
   992  // long-running operation.
   993  type DeploymentsWhatIfAtSubscriptionScopeFuture struct {
   994  	azure.FutureAPI
   995  	// Result returns the result of the asynchronous operation.
   996  	// If the operation has not completed it will return an error.
   997  	Result func(DeploymentsClient) (WhatIfOperationResult, error)
   998  }
   999  
  1000  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1001  func (future *DeploymentsWhatIfAtSubscriptionScopeFuture) UnmarshalJSON(body []byte) error {
  1002  	var azFuture azure.Future
  1003  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1004  		return err
  1005  	}
  1006  	future.FutureAPI = &azFuture
  1007  	future.Result = future.result
  1008  	return nil
  1009  }
  1010  
  1011  // result is the default implementation for DeploymentsWhatIfAtSubscriptionScopeFuture.Result.
  1012  func (future *DeploymentsWhatIfAtSubscriptionScopeFuture) result(client DeploymentsClient) (wior WhatIfOperationResult, err error) {
  1013  	var done bool
  1014  	done, err = future.DoneWithContext(context.Background(), client)
  1015  	if err != nil {
  1016  		err = autorest.NewErrorWithError(err, "features.DeploymentsWhatIfAtSubscriptionScopeFuture", "Result", future.Response(), "Polling failure")
  1017  		return
  1018  	}
  1019  	if !done {
  1020  		wior.Response.Response = future.Response()
  1021  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsWhatIfAtSubscriptionScopeFuture")
  1022  		return
  1023  	}
  1024  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1025  	if wior.Response.Response, err = future.GetResult(sender); err == nil && wior.Response.Response.StatusCode != http.StatusNoContent {
  1026  		wior, err = client.WhatIfAtSubscriptionScopeResponder(wior.Response.Response)
  1027  		if err != nil {
  1028  			err = autorest.NewErrorWithError(err, "features.DeploymentsWhatIfAtSubscriptionScopeFuture", "Result", wior.Response.Response, "Failure responding to request")
  1029  		}
  1030  	}
  1031  	return
  1032  }
  1033  
  1034  // DeploymentsWhatIfFuture an abstraction for monitoring and retrieving the results of a long-running
  1035  // operation.
  1036  type DeploymentsWhatIfFuture struct {
  1037  	azure.FutureAPI
  1038  	// Result returns the result of the asynchronous operation.
  1039  	// If the operation has not completed it will return an error.
  1040  	Result func(DeploymentsClient) (WhatIfOperationResult, error)
  1041  }
  1042  
  1043  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1044  func (future *DeploymentsWhatIfFuture) UnmarshalJSON(body []byte) error {
  1045  	var azFuture azure.Future
  1046  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1047  		return err
  1048  	}
  1049  	future.FutureAPI = &azFuture
  1050  	future.Result = future.result
  1051  	return nil
  1052  }
  1053  
  1054  // result is the default implementation for DeploymentsWhatIfFuture.Result.
  1055  func (future *DeploymentsWhatIfFuture) result(client DeploymentsClient) (wior WhatIfOperationResult, err error) {
  1056  	var done bool
  1057  	done, err = future.DoneWithContext(context.Background(), client)
  1058  	if err != nil {
  1059  		err = autorest.NewErrorWithError(err, "features.DeploymentsWhatIfFuture", "Result", future.Response(), "Polling failure")
  1060  		return
  1061  	}
  1062  	if !done {
  1063  		wior.Response.Response = future.Response()
  1064  		err = azure.NewAsyncOpIncompleteError("features.DeploymentsWhatIfFuture")
  1065  		return
  1066  	}
  1067  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1068  	if wior.Response.Response, err = future.GetResult(sender); err == nil && wior.Response.Response.StatusCode != http.StatusNoContent {
  1069  		wior, err = client.WhatIfResponder(wior.Response.Response)
  1070  		if err != nil {
  1071  			err = autorest.NewErrorWithError(err, "features.DeploymentsWhatIfFuture", "Result", wior.Response.Response, "Failure responding to request")
  1072  		}
  1073  	}
  1074  	return
  1075  }
  1076  
  1077  // DeploymentValidateResult information from validate template deployment response.
  1078  type DeploymentValidateResult struct {
  1079  	autorest.Response `json:"-"`
  1080  	// Error - The deployment validation error.
  1081  	Error *ErrorResponse `json:"error,omitempty"`
  1082  	// Properties - The template deployment properties.
  1083  	Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
  1084  }
  1085  
  1086  // DeploymentWhatIf deployment What-if operation parameters.
  1087  type DeploymentWhatIf struct {
  1088  	// Location - The location to store the deployment data.
  1089  	Location *string `json:"location,omitempty"`
  1090  	// Properties - The deployment properties.
  1091  	Properties *DeploymentWhatIfProperties `json:"properties,omitempty"`
  1092  }
  1093  
  1094  // DeploymentWhatIfProperties deployment What-if properties.
  1095  type DeploymentWhatIfProperties struct {
  1096  	// WhatIfSettings - Optional What-If operation settings.
  1097  	WhatIfSettings *DeploymentWhatIfSettings `json:"whatIfSettings,omitempty"`
  1098  	// Template - The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both.
  1099  	Template interface{} `json:"template,omitempty"`
  1100  	// TemplateLink - The URI of the template. Use either the templateLink property or the template property, but not both.
  1101  	TemplateLink *TemplateLink `json:"templateLink,omitempty"`
  1102  	// Parameters - Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string.
  1103  	Parameters interface{} `json:"parameters,omitempty"`
  1104  	// ParametersLink - The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both.
  1105  	ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
  1106  	// Mode - The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. Possible values include: 'Incremental', 'Complete'
  1107  	Mode DeploymentMode `json:"mode,omitempty"`
  1108  	// DebugSetting - The debug setting of the deployment.
  1109  	DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
  1110  	// OnErrorDeployment - The deployment on error behavior.
  1111  	OnErrorDeployment *OnErrorDeployment `json:"onErrorDeployment,omitempty"`
  1112  }
  1113  
  1114  // DeploymentWhatIfSettings deployment What-If operation settings.
  1115  type DeploymentWhatIfSettings struct {
  1116  	// ResultFormat - The format of the What-If results. Possible values include: 'ResourceIDOnly', 'FullResourcePayloads'
  1117  	ResultFormat WhatIfResultFormat `json:"resultFormat,omitempty"`
  1118  }
  1119  
  1120  // ErrorAdditionalInfo the resource management error additional info.
  1121  type ErrorAdditionalInfo struct {
  1122  	// Type - READ-ONLY; The additional info type.
  1123  	Type *string `json:"type,omitempty"`
  1124  	// Info - READ-ONLY; The additional info.
  1125  	Info interface{} `json:"info,omitempty"`
  1126  }
  1127  
  1128  // MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
  1129  func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
  1130  	objectMap := make(map[string]interface{})
  1131  	return json.Marshal(objectMap)
  1132  }
  1133  
  1134  // ErrorResponse common error response for all Azure Resource Manager APIs to return error details for
  1135  // failed operations. (This also follows the OData error response format.)
  1136  type ErrorResponse struct {
  1137  	// Code - READ-ONLY; The error code.
  1138  	Code *string `json:"code,omitempty"`
  1139  	// Message - READ-ONLY; The error message.
  1140  	Message *string `json:"message,omitempty"`
  1141  	// Target - READ-ONLY; The error target.
  1142  	Target *string `json:"target,omitempty"`
  1143  	// Details - READ-ONLY; The error details.
  1144  	Details *[]ErrorResponse `json:"details,omitempty"`
  1145  	// AdditionalInfo - READ-ONLY; The error additional info.
  1146  	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
  1147  }
  1148  
  1149  // MarshalJSON is the custom marshaler for ErrorResponse.
  1150  func (er ErrorResponse) MarshalJSON() ([]byte, error) {
  1151  	objectMap := make(map[string]interface{})
  1152  	return json.Marshal(objectMap)
  1153  }
  1154  
  1155  // ExportTemplateRequest export resource group template request parameters.
  1156  type ExportTemplateRequest struct {
  1157  	// Resources - The IDs of the resources to filter the export by. To export all resources, supply an array with single entry '*'.
  1158  	Resources *[]string `json:"resources,omitempty"`
  1159  	// Options - The export template options. A CSV-formatted list containing zero or more of the following: 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', 'SkipAllParameterization'
  1160  	Options *string `json:"options,omitempty"`
  1161  }
  1162  
  1163  // GenericResource resource information.
  1164  type GenericResource struct {
  1165  	autorest.Response `json:"-"`
  1166  	// Plan - The plan of the resource.
  1167  	Plan *Plan `json:"plan,omitempty"`
  1168  	// Properties - The resource properties.
  1169  	Properties interface{} `json:"properties,omitempty"`
  1170  	// Kind - The kind of the resource.
  1171  	Kind *string `json:"kind,omitempty"`
  1172  	// ManagedBy - ID of the resource that manages this resource.
  1173  	ManagedBy *string `json:"managedBy,omitempty"`
  1174  	// Sku - The SKU of the resource.
  1175  	Sku *Sku `json:"sku,omitempty"`
  1176  	// Identity - The identity of the resource.
  1177  	Identity *Identity `json:"identity,omitempty"`
  1178  	// ID - READ-ONLY; Resource ID
  1179  	ID *string `json:"id,omitempty"`
  1180  	// Name - READ-ONLY; Resource name
  1181  	Name *string `json:"name,omitempty"`
  1182  	// Type - READ-ONLY; Resource type
  1183  	Type *string `json:"type,omitempty"`
  1184  	// Location - Resource location
  1185  	Location *string `json:"location,omitempty"`
  1186  	// Tags - Resource tags
  1187  	Tags map[string]*string `json:"tags"`
  1188  }
  1189  
  1190  // MarshalJSON is the custom marshaler for GenericResource.
  1191  func (gr GenericResource) MarshalJSON() ([]byte, error) {
  1192  	objectMap := make(map[string]interface{})
  1193  	if gr.Plan != nil {
  1194  		objectMap["plan"] = gr.Plan
  1195  	}
  1196  	if gr.Properties != nil {
  1197  		objectMap["properties"] = gr.Properties
  1198  	}
  1199  	if gr.Kind != nil {
  1200  		objectMap["kind"] = gr.Kind
  1201  	}
  1202  	if gr.ManagedBy != nil {
  1203  		objectMap["managedBy"] = gr.ManagedBy
  1204  	}
  1205  	if gr.Sku != nil {
  1206  		objectMap["sku"] = gr.Sku
  1207  	}
  1208  	if gr.Identity != nil {
  1209  		objectMap["identity"] = gr.Identity
  1210  	}
  1211  	if gr.Location != nil {
  1212  		objectMap["location"] = gr.Location
  1213  	}
  1214  	if gr.Tags != nil {
  1215  		objectMap["tags"] = gr.Tags
  1216  	}
  1217  	return json.Marshal(objectMap)
  1218  }
  1219  
  1220  // GenericResourceExpanded resource information.
  1221  type GenericResourceExpanded struct {
  1222  	// CreatedTime - READ-ONLY; The created time of the resource. This is only present if requested via the $expand query parameter.
  1223  	CreatedTime *date.Time `json:"createdTime,omitempty"`
  1224  	// ChangedTime - READ-ONLY; The changed time of the resource. This is only present if requested via the $expand query parameter.
  1225  	ChangedTime *date.Time `json:"changedTime,omitempty"`
  1226  	// ProvisioningState - READ-ONLY; The provisioning state of the resource. This is only present if requested via the $expand query parameter.
  1227  	ProvisioningState *string `json:"provisioningState,omitempty"`
  1228  	// Plan - The plan of the resource.
  1229  	Plan *Plan `json:"plan,omitempty"`
  1230  	// Properties - The resource properties.
  1231  	Properties interface{} `json:"properties,omitempty"`
  1232  	// Kind - The kind of the resource.
  1233  	Kind *string `json:"kind,omitempty"`
  1234  	// ManagedBy - ID of the resource that manages this resource.
  1235  	ManagedBy *string `json:"managedBy,omitempty"`
  1236  	// Sku - The SKU of the resource.
  1237  	Sku *Sku `json:"sku,omitempty"`
  1238  	// Identity - The identity of the resource.
  1239  	Identity *Identity `json:"identity,omitempty"`
  1240  	// ID - READ-ONLY; Resource ID
  1241  	ID *string `json:"id,omitempty"`
  1242  	// Name - READ-ONLY; Resource name
  1243  	Name *string `json:"name,omitempty"`
  1244  	// Type - READ-ONLY; Resource type
  1245  	Type *string `json:"type,omitempty"`
  1246  	// Location - Resource location
  1247  	Location *string `json:"location,omitempty"`
  1248  	// Tags - Resource tags
  1249  	Tags map[string]*string `json:"tags"`
  1250  }
  1251  
  1252  // MarshalJSON is the custom marshaler for GenericResourceExpanded.
  1253  func (gre GenericResourceExpanded) MarshalJSON() ([]byte, error) {
  1254  	objectMap := make(map[string]interface{})
  1255  	if gre.Plan != nil {
  1256  		objectMap["plan"] = gre.Plan
  1257  	}
  1258  	if gre.Properties != nil {
  1259  		objectMap["properties"] = gre.Properties
  1260  	}
  1261  	if gre.Kind != nil {
  1262  		objectMap["kind"] = gre.Kind
  1263  	}
  1264  	if gre.ManagedBy != nil {
  1265  		objectMap["managedBy"] = gre.ManagedBy
  1266  	}
  1267  	if gre.Sku != nil {
  1268  		objectMap["sku"] = gre.Sku
  1269  	}
  1270  	if gre.Identity != nil {
  1271  		objectMap["identity"] = gre.Identity
  1272  	}
  1273  	if gre.Location != nil {
  1274  		objectMap["location"] = gre.Location
  1275  	}
  1276  	if gre.Tags != nil {
  1277  		objectMap["tags"] = gre.Tags
  1278  	}
  1279  	return json.Marshal(objectMap)
  1280  }
  1281  
  1282  // GenericResourceFilter resource filter.
  1283  type GenericResourceFilter struct {
  1284  	// ResourceType - The resource type.
  1285  	ResourceType *string `json:"resourceType,omitempty"`
  1286  	// Tagname - The tag name.
  1287  	Tagname *string `json:"tagname,omitempty"`
  1288  	// Tagvalue - The tag value.
  1289  	Tagvalue *string `json:"tagvalue,omitempty"`
  1290  }
  1291  
  1292  // HTTPMessage HTTP message.
  1293  type HTTPMessage struct {
  1294  	// Content - HTTP message content.
  1295  	Content interface{} `json:"content,omitempty"`
  1296  }
  1297  
  1298  // Identity identity for the resource.
  1299  type Identity struct {
  1300  	// PrincipalID - READ-ONLY; The principal ID of resource identity.
  1301  	PrincipalID *string `json:"principalId,omitempty"`
  1302  	// TenantID - READ-ONLY; The tenant ID of resource.
  1303  	TenantID *string `json:"tenantId,omitempty"`
  1304  	// Type - The identity type. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned', 'None'
  1305  	Type ResourceIdentityType `json:"type,omitempty"`
  1306  	// UserAssignedIdentities - The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
  1307  	UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"`
  1308  }
  1309  
  1310  // MarshalJSON is the custom marshaler for Identity.
  1311  func (i Identity) MarshalJSON() ([]byte, error) {
  1312  	objectMap := make(map[string]interface{})
  1313  	if i.Type != "" {
  1314  		objectMap["type"] = i.Type
  1315  	}
  1316  	if i.UserAssignedIdentities != nil {
  1317  		objectMap["userAssignedIdentities"] = i.UserAssignedIdentities
  1318  	}
  1319  	return json.Marshal(objectMap)
  1320  }
  1321  
  1322  // IdentityUserAssignedIdentitiesValue ...
  1323  type IdentityUserAssignedIdentitiesValue struct {
  1324  	// PrincipalID - READ-ONLY; The principal id of user assigned identity.
  1325  	PrincipalID *string `json:"principalId,omitempty"`
  1326  	// ClientID - READ-ONLY; The client id of user assigned identity.
  1327  	ClientID *string `json:"clientId,omitempty"`
  1328  }
  1329  
  1330  // MarshalJSON is the custom marshaler for IdentityUserAssignedIdentitiesValue.
  1331  func (iAiv IdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) {
  1332  	objectMap := make(map[string]interface{})
  1333  	return json.Marshal(objectMap)
  1334  }
  1335  
  1336  // OnErrorDeployment deployment on error behavior.
  1337  type OnErrorDeployment struct {
  1338  	// Type - The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. Possible values include: 'LastSuccessful', 'SpecificDeployment'
  1339  	Type OnErrorDeploymentType `json:"type,omitempty"`
  1340  	// DeploymentName - The deployment to be used on error case.
  1341  	DeploymentName *string `json:"deploymentName,omitempty"`
  1342  }
  1343  
  1344  // OnErrorDeploymentExtended deployment on error behavior with additional details.
  1345  type OnErrorDeploymentExtended struct {
  1346  	// ProvisioningState - READ-ONLY; The state of the provisioning for the on error deployment.
  1347  	ProvisioningState *string `json:"provisioningState,omitempty"`
  1348  	// Type - The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. Possible values include: 'LastSuccessful', 'SpecificDeployment'
  1349  	Type OnErrorDeploymentType `json:"type,omitempty"`
  1350  	// DeploymentName - The deployment to be used on error case.
  1351  	DeploymentName *string `json:"deploymentName,omitempty"`
  1352  }
  1353  
  1354  // MarshalJSON is the custom marshaler for OnErrorDeploymentExtended.
  1355  func (oede OnErrorDeploymentExtended) MarshalJSON() ([]byte, error) {
  1356  	objectMap := make(map[string]interface{})
  1357  	if oede.Type != "" {
  1358  		objectMap["type"] = oede.Type
  1359  	}
  1360  	if oede.DeploymentName != nil {
  1361  		objectMap["deploymentName"] = oede.DeploymentName
  1362  	}
  1363  	return json.Marshal(objectMap)
  1364  }
  1365  
  1366  // Operation microsoft.Resources operation
  1367  type Operation struct {
  1368  	// Name - Operation name: {provider}/{resource}/{operation}
  1369  	Name *string `json:"name,omitempty"`
  1370  	// Display - The object that represents the operation.
  1371  	Display *OperationDisplay `json:"display,omitempty"`
  1372  }
  1373  
  1374  // OperationDisplay the object that represents the operation.
  1375  type OperationDisplay struct {
  1376  	// Provider - Service provider: Microsoft.Resources
  1377  	Provider *string `json:"provider,omitempty"`
  1378  	// Resource - Resource on which the operation is performed: Profile, endpoint, etc.
  1379  	Resource *string `json:"resource,omitempty"`
  1380  	// Operation - Operation type: Read, write, delete, etc.
  1381  	Operation *string `json:"operation,omitempty"`
  1382  	// Description - Description of the operation.
  1383  	Description *string `json:"description,omitempty"`
  1384  }
  1385  
  1386  // OperationListResult result of the request to list Microsoft.Resources operations. It contains a list of
  1387  // operations and a URL link to get the next set of results.
  1388  type OperationListResult struct {
  1389  	autorest.Response `json:"-"`
  1390  	// Value - List of Microsoft.Resources operations.
  1391  	Value *[]Operation `json:"value,omitempty"`
  1392  	// NextLink - URL to get the next set of operation list results if there are any.
  1393  	NextLink *string `json:"nextLink,omitempty"`
  1394  }
  1395  
  1396  // OperationListResultIterator provides access to a complete listing of Operation values.
  1397  type OperationListResultIterator struct {
  1398  	i    int
  1399  	page OperationListResultPage
  1400  }
  1401  
  1402  // NextWithContext advances to the next value.  If there was an error making
  1403  // the request the iterator does not advance and the error is returned.
  1404  func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1405  	if tracing.IsEnabled() {
  1406  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
  1407  		defer func() {
  1408  			sc := -1
  1409  			if iter.Response().Response.Response != nil {
  1410  				sc = iter.Response().Response.Response.StatusCode
  1411  			}
  1412  			tracing.EndSpan(ctx, sc, err)
  1413  		}()
  1414  	}
  1415  	iter.i++
  1416  	if iter.i < len(iter.page.Values()) {
  1417  		return nil
  1418  	}
  1419  	err = iter.page.NextWithContext(ctx)
  1420  	if err != nil {
  1421  		iter.i--
  1422  		return err
  1423  	}
  1424  	iter.i = 0
  1425  	return nil
  1426  }
  1427  
  1428  // Next advances to the next value.  If there was an error making
  1429  // the request the iterator does not advance and the error is returned.
  1430  // Deprecated: Use NextWithContext() instead.
  1431  func (iter *OperationListResultIterator) Next() error {
  1432  	return iter.NextWithContext(context.Background())
  1433  }
  1434  
  1435  // NotDone returns true if the enumeration should be started or is not yet complete.
  1436  func (iter OperationListResultIterator) NotDone() bool {
  1437  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1438  }
  1439  
  1440  // Response returns the raw server response from the last page request.
  1441  func (iter OperationListResultIterator) Response() OperationListResult {
  1442  	return iter.page.Response()
  1443  }
  1444  
  1445  // Value returns the current value or a zero-initialized value if the
  1446  // iterator has advanced beyond the end of the collection.
  1447  func (iter OperationListResultIterator) Value() Operation {
  1448  	if !iter.page.NotDone() {
  1449  		return Operation{}
  1450  	}
  1451  	return iter.page.Values()[iter.i]
  1452  }
  1453  
  1454  // Creates a new instance of the OperationListResultIterator type.
  1455  func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
  1456  	return OperationListResultIterator{page: page}
  1457  }
  1458  
  1459  // IsEmpty returns true if the ListResult contains no values.
  1460  func (olr OperationListResult) IsEmpty() bool {
  1461  	return olr.Value == nil || len(*olr.Value) == 0
  1462  }
  1463  
  1464  // hasNextLink returns true if the NextLink is not empty.
  1465  func (olr OperationListResult) hasNextLink() bool {
  1466  	return olr.NextLink != nil && len(*olr.NextLink) != 0
  1467  }
  1468  
  1469  // operationListResultPreparer prepares a request to retrieve the next set of results.
  1470  // It returns nil if no more results exist.
  1471  func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
  1472  	if !olr.hasNextLink() {
  1473  		return nil, nil
  1474  	}
  1475  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1476  		autorest.AsJSON(),
  1477  		autorest.AsGet(),
  1478  		autorest.WithBaseURL(to.String(olr.NextLink)))
  1479  }
  1480  
  1481  // OperationListResultPage contains a page of Operation values.
  1482  type OperationListResultPage struct {
  1483  	fn  func(context.Context, OperationListResult) (OperationListResult, error)
  1484  	olr OperationListResult
  1485  }
  1486  
  1487  // NextWithContext advances to the next page of values.  If there was an error making
  1488  // the request the page does not advance and the error is returned.
  1489  func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
  1490  	if tracing.IsEnabled() {
  1491  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
  1492  		defer func() {
  1493  			sc := -1
  1494  			if page.Response().Response.Response != nil {
  1495  				sc = page.Response().Response.Response.StatusCode
  1496  			}
  1497  			tracing.EndSpan(ctx, sc, err)
  1498  		}()
  1499  	}
  1500  	for {
  1501  		next, err := page.fn(ctx, page.olr)
  1502  		if err != nil {
  1503  			return err
  1504  		}
  1505  		page.olr = next
  1506  		if !next.hasNextLink() || !next.IsEmpty() {
  1507  			break
  1508  		}
  1509  	}
  1510  	return nil
  1511  }
  1512  
  1513  // Next advances to the next page of values.  If there was an error making
  1514  // the request the page does not advance and the error is returned.
  1515  // Deprecated: Use NextWithContext() instead.
  1516  func (page *OperationListResultPage) Next() error {
  1517  	return page.NextWithContext(context.Background())
  1518  }
  1519  
  1520  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1521  func (page OperationListResultPage) NotDone() bool {
  1522  	return !page.olr.IsEmpty()
  1523  }
  1524  
  1525  // Response returns the raw server response from the last page request.
  1526  func (page OperationListResultPage) Response() OperationListResult {
  1527  	return page.olr
  1528  }
  1529  
  1530  // Values returns the slice of values for the current page or nil if there are no values.
  1531  func (page OperationListResultPage) Values() []Operation {
  1532  	if page.olr.IsEmpty() {
  1533  		return nil
  1534  	}
  1535  	return *page.olr.Value
  1536  }
  1537  
  1538  // Creates a new instance of the OperationListResultPage type.
  1539  func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
  1540  	return OperationListResultPage{
  1541  		fn:  getNextPage,
  1542  		olr: cur,
  1543  	}
  1544  }
  1545  
  1546  // ParametersLink entity representing the reference to the deployment parameters.
  1547  type ParametersLink struct {
  1548  	// URI - The URI of the parameters file.
  1549  	URI *string `json:"uri,omitempty"`
  1550  	// ContentVersion - If included, must match the ContentVersion in the template.
  1551  	ContentVersion *string `json:"contentVersion,omitempty"`
  1552  }
  1553  
  1554  // Plan plan for the resource.
  1555  type Plan struct {
  1556  	// Name - The plan ID.
  1557  	Name *string `json:"name,omitempty"`
  1558  	// Publisher - The publisher ID.
  1559  	Publisher *string `json:"publisher,omitempty"`
  1560  	// Product - The offer ID.
  1561  	Product *string `json:"product,omitempty"`
  1562  	// PromotionCode - The promotion code.
  1563  	PromotionCode *string `json:"promotionCode,omitempty"`
  1564  	// Version - The plan's version.
  1565  	Version *string `json:"version,omitempty"`
  1566  }
  1567  
  1568  // Provider resource provider information.
  1569  type Provider struct {
  1570  	autorest.Response `json:"-"`
  1571  	// ID - READ-ONLY; The provider ID.
  1572  	ID *string `json:"id,omitempty"`
  1573  	// Namespace - The namespace of the resource provider.
  1574  	Namespace *string `json:"namespace,omitempty"`
  1575  	// RegistrationState - READ-ONLY; The registration state of the resource provider.
  1576  	RegistrationState *string `json:"registrationState,omitempty"`
  1577  	// RegistrationPolicy - READ-ONLY; The registration policy of the resource provider.
  1578  	RegistrationPolicy *string `json:"registrationPolicy,omitempty"`
  1579  	// ResourceTypes - READ-ONLY; The collection of provider resource types.
  1580  	ResourceTypes *[]ProviderResourceType `json:"resourceTypes,omitempty"`
  1581  }
  1582  
  1583  // MarshalJSON is the custom marshaler for Provider.
  1584  func (p Provider) MarshalJSON() ([]byte, error) {
  1585  	objectMap := make(map[string]interface{})
  1586  	if p.Namespace != nil {
  1587  		objectMap["namespace"] = p.Namespace
  1588  	}
  1589  	return json.Marshal(objectMap)
  1590  }
  1591  
  1592  // ProviderListResult list of resource providers.
  1593  type ProviderListResult struct {
  1594  	autorest.Response `json:"-"`
  1595  	// Value - An array of resource providers.
  1596  	Value *[]Provider `json:"value,omitempty"`
  1597  	// NextLink - READ-ONLY; The URL to use for getting the next set of results.
  1598  	NextLink *string `json:"nextLink,omitempty"`
  1599  }
  1600  
  1601  // MarshalJSON is the custom marshaler for ProviderListResult.
  1602  func (plr ProviderListResult) MarshalJSON() ([]byte, error) {
  1603  	objectMap := make(map[string]interface{})
  1604  	if plr.Value != nil {
  1605  		objectMap["value"] = plr.Value
  1606  	}
  1607  	return json.Marshal(objectMap)
  1608  }
  1609  
  1610  // ProviderListResultIterator provides access to a complete listing of Provider values.
  1611  type ProviderListResultIterator struct {
  1612  	i    int
  1613  	page ProviderListResultPage
  1614  }
  1615  
  1616  // NextWithContext advances to the next value.  If there was an error making
  1617  // the request the iterator does not advance and the error is returned.
  1618  func (iter *ProviderListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1619  	if tracing.IsEnabled() {
  1620  		ctx = tracing.StartSpan(ctx, fqdn+"/ProviderListResultIterator.NextWithContext")
  1621  		defer func() {
  1622  			sc := -1
  1623  			if iter.Response().Response.Response != nil {
  1624  				sc = iter.Response().Response.Response.StatusCode
  1625  			}
  1626  			tracing.EndSpan(ctx, sc, err)
  1627  		}()
  1628  	}
  1629  	iter.i++
  1630  	if iter.i < len(iter.page.Values()) {
  1631  		return nil
  1632  	}
  1633  	err = iter.page.NextWithContext(ctx)
  1634  	if err != nil {
  1635  		iter.i--
  1636  		return err
  1637  	}
  1638  	iter.i = 0
  1639  	return nil
  1640  }
  1641  
  1642  // Next advances to the next value.  If there was an error making
  1643  // the request the iterator does not advance and the error is returned.
  1644  // Deprecated: Use NextWithContext() instead.
  1645  func (iter *ProviderListResultIterator) Next() error {
  1646  	return iter.NextWithContext(context.Background())
  1647  }
  1648  
  1649  // NotDone returns true if the enumeration should be started or is not yet complete.
  1650  func (iter ProviderListResultIterator) NotDone() bool {
  1651  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1652  }
  1653  
  1654  // Response returns the raw server response from the last page request.
  1655  func (iter ProviderListResultIterator) Response() ProviderListResult {
  1656  	return iter.page.Response()
  1657  }
  1658  
  1659  // Value returns the current value or a zero-initialized value if the
  1660  // iterator has advanced beyond the end of the collection.
  1661  func (iter ProviderListResultIterator) Value() Provider {
  1662  	if !iter.page.NotDone() {
  1663  		return Provider{}
  1664  	}
  1665  	return iter.page.Values()[iter.i]
  1666  }
  1667  
  1668  // Creates a new instance of the ProviderListResultIterator type.
  1669  func NewProviderListResultIterator(page ProviderListResultPage) ProviderListResultIterator {
  1670  	return ProviderListResultIterator{page: page}
  1671  }
  1672  
  1673  // IsEmpty returns true if the ListResult contains no values.
  1674  func (plr ProviderListResult) IsEmpty() bool {
  1675  	return plr.Value == nil || len(*plr.Value) == 0
  1676  }
  1677  
  1678  // hasNextLink returns true if the NextLink is not empty.
  1679  func (plr ProviderListResult) hasNextLink() bool {
  1680  	return plr.NextLink != nil && len(*plr.NextLink) != 0
  1681  }
  1682  
  1683  // providerListResultPreparer prepares a request to retrieve the next set of results.
  1684  // It returns nil if no more results exist.
  1685  func (plr ProviderListResult) providerListResultPreparer(ctx context.Context) (*http.Request, error) {
  1686  	if !plr.hasNextLink() {
  1687  		return nil, nil
  1688  	}
  1689  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1690  		autorest.AsJSON(),
  1691  		autorest.AsGet(),
  1692  		autorest.WithBaseURL(to.String(plr.NextLink)))
  1693  }
  1694  
  1695  // ProviderListResultPage contains a page of Provider values.
  1696  type ProviderListResultPage struct {
  1697  	fn  func(context.Context, ProviderListResult) (ProviderListResult, error)
  1698  	plr ProviderListResult
  1699  }
  1700  
  1701  // NextWithContext advances to the next page of values.  If there was an error making
  1702  // the request the page does not advance and the error is returned.
  1703  func (page *ProviderListResultPage) NextWithContext(ctx context.Context) (err error) {
  1704  	if tracing.IsEnabled() {
  1705  		ctx = tracing.StartSpan(ctx, fqdn+"/ProviderListResultPage.NextWithContext")
  1706  		defer func() {
  1707  			sc := -1
  1708  			if page.Response().Response.Response != nil {
  1709  				sc = page.Response().Response.Response.StatusCode
  1710  			}
  1711  			tracing.EndSpan(ctx, sc, err)
  1712  		}()
  1713  	}
  1714  	for {
  1715  		next, err := page.fn(ctx, page.plr)
  1716  		if err != nil {
  1717  			return err
  1718  		}
  1719  		page.plr = next
  1720  		if !next.hasNextLink() || !next.IsEmpty() {
  1721  			break
  1722  		}
  1723  	}
  1724  	return nil
  1725  }
  1726  
  1727  // Next advances to the next page of values.  If there was an error making
  1728  // the request the page does not advance and the error is returned.
  1729  // Deprecated: Use NextWithContext() instead.
  1730  func (page *ProviderListResultPage) Next() error {
  1731  	return page.NextWithContext(context.Background())
  1732  }
  1733  
  1734  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1735  func (page ProviderListResultPage) NotDone() bool {
  1736  	return !page.plr.IsEmpty()
  1737  }
  1738  
  1739  // Response returns the raw server response from the last page request.
  1740  func (page ProviderListResultPage) Response() ProviderListResult {
  1741  	return page.plr
  1742  }
  1743  
  1744  // Values returns the slice of values for the current page or nil if there are no values.
  1745  func (page ProviderListResultPage) Values() []Provider {
  1746  	if page.plr.IsEmpty() {
  1747  		return nil
  1748  	}
  1749  	return *page.plr.Value
  1750  }
  1751  
  1752  // Creates a new instance of the ProviderListResultPage type.
  1753  func NewProviderListResultPage(cur ProviderListResult, getNextPage func(context.Context, ProviderListResult) (ProviderListResult, error)) ProviderListResultPage {
  1754  	return ProviderListResultPage{
  1755  		fn:  getNextPage,
  1756  		plr: cur,
  1757  	}
  1758  }
  1759  
  1760  // ProviderResourceType resource type managed by the resource provider.
  1761  type ProviderResourceType struct {
  1762  	// ResourceType - The resource type.
  1763  	ResourceType *string `json:"resourceType,omitempty"`
  1764  	// Locations - The collection of locations where this resource type can be created.
  1765  	Locations *[]string `json:"locations,omitempty"`
  1766  	// Aliases - The aliases that are supported by this resource type.
  1767  	Aliases *[]AliasType `json:"aliases,omitempty"`
  1768  	// APIVersions - The API version.
  1769  	APIVersions *[]string `json:"apiVersions,omitempty"`
  1770  	// Capabilities - The additional capabilities offered by this resource type.
  1771  	Capabilities *string `json:"capabilities,omitempty"`
  1772  	// Properties - The properties.
  1773  	Properties map[string]*string `json:"properties"`
  1774  }
  1775  
  1776  // MarshalJSON is the custom marshaler for ProviderResourceType.
  1777  func (prt ProviderResourceType) MarshalJSON() ([]byte, error) {
  1778  	objectMap := make(map[string]interface{})
  1779  	if prt.ResourceType != nil {
  1780  		objectMap["resourceType"] = prt.ResourceType
  1781  	}
  1782  	if prt.Locations != nil {
  1783  		objectMap["locations"] = prt.Locations
  1784  	}
  1785  	if prt.Aliases != nil {
  1786  		objectMap["aliases"] = prt.Aliases
  1787  	}
  1788  	if prt.APIVersions != nil {
  1789  		objectMap["apiVersions"] = prt.APIVersions
  1790  	}
  1791  	if prt.Capabilities != nil {
  1792  		objectMap["capabilities"] = prt.Capabilities
  1793  	}
  1794  	if prt.Properties != nil {
  1795  		objectMap["properties"] = prt.Properties
  1796  	}
  1797  	return json.Marshal(objectMap)
  1798  }
  1799  
  1800  // Resource specified resource.
  1801  type Resource struct {
  1802  	// ID - READ-ONLY; Resource ID
  1803  	ID *string `json:"id,omitempty"`
  1804  	// Name - READ-ONLY; Resource name
  1805  	Name *string `json:"name,omitempty"`
  1806  	// Type - READ-ONLY; Resource type
  1807  	Type *string `json:"type,omitempty"`
  1808  	// Location - Resource location
  1809  	Location *string `json:"location,omitempty"`
  1810  	// Tags - Resource tags
  1811  	Tags map[string]*string `json:"tags"`
  1812  }
  1813  
  1814  // MarshalJSON is the custom marshaler for Resource.
  1815  func (r Resource) MarshalJSON() ([]byte, error) {
  1816  	objectMap := make(map[string]interface{})
  1817  	if r.Location != nil {
  1818  		objectMap["location"] = r.Location
  1819  	}
  1820  	if r.Tags != nil {
  1821  		objectMap["tags"] = r.Tags
  1822  	}
  1823  	return json.Marshal(objectMap)
  1824  }
  1825  
  1826  // ResourceGroup resource group information.
  1827  type ResourceGroup struct {
  1828  	autorest.Response `json:"-"`
  1829  	// ID - READ-ONLY; The ID of the resource group.
  1830  	ID *string `json:"id,omitempty"`
  1831  	// Name - READ-ONLY; The name of the resource group.
  1832  	Name *string `json:"name,omitempty"`
  1833  	// Type - READ-ONLY; The type of the resource group.
  1834  	Type *string `json:"type,omitempty"`
  1835  	// Properties - The resource group properties.
  1836  	Properties *ResourceGroupProperties `json:"properties,omitempty"`
  1837  	// Location - The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
  1838  	Location *string `json:"location,omitempty"`
  1839  	// ManagedBy - The ID of the resource that manages this resource group.
  1840  	ManagedBy *string `json:"managedBy,omitempty"`
  1841  	// Tags - The tags attached to the resource group.
  1842  	Tags map[string]*string `json:"tags"`
  1843  }
  1844  
  1845  // MarshalJSON is the custom marshaler for ResourceGroup.
  1846  func (rg ResourceGroup) MarshalJSON() ([]byte, error) {
  1847  	objectMap := make(map[string]interface{})
  1848  	if rg.Properties != nil {
  1849  		objectMap["properties"] = rg.Properties
  1850  	}
  1851  	if rg.Location != nil {
  1852  		objectMap["location"] = rg.Location
  1853  	}
  1854  	if rg.ManagedBy != nil {
  1855  		objectMap["managedBy"] = rg.ManagedBy
  1856  	}
  1857  	if rg.Tags != nil {
  1858  		objectMap["tags"] = rg.Tags
  1859  	}
  1860  	return json.Marshal(objectMap)
  1861  }
  1862  
  1863  // ResourceGroupExportResult resource group export result.
  1864  type ResourceGroupExportResult struct {
  1865  	autorest.Response `json:"-"`
  1866  	// Template - The template content.
  1867  	Template interface{} `json:"template,omitempty"`
  1868  	// Error - The template export error.
  1869  	Error *ErrorResponse `json:"error,omitempty"`
  1870  }
  1871  
  1872  // ResourceGroupFilter resource group filter.
  1873  type ResourceGroupFilter struct {
  1874  	// TagName - The tag name.
  1875  	TagName *string `json:"tagName,omitempty"`
  1876  	// TagValue - The tag value.
  1877  	TagValue *string `json:"tagValue,omitempty"`
  1878  }
  1879  
  1880  // ResourceGroupListResult list of resource groups.
  1881  type ResourceGroupListResult struct {
  1882  	autorest.Response `json:"-"`
  1883  	// Value - An array of resource groups.
  1884  	Value *[]ResourceGroup `json:"value,omitempty"`
  1885  	// NextLink - READ-ONLY; The URL to use for getting the next set of results.
  1886  	NextLink *string `json:"nextLink,omitempty"`
  1887  }
  1888  
  1889  // MarshalJSON is the custom marshaler for ResourceGroupListResult.
  1890  func (rglr ResourceGroupListResult) MarshalJSON() ([]byte, error) {
  1891  	objectMap := make(map[string]interface{})
  1892  	if rglr.Value != nil {
  1893  		objectMap["value"] = rglr.Value
  1894  	}
  1895  	return json.Marshal(objectMap)
  1896  }
  1897  
  1898  // ResourceGroupListResultIterator provides access to a complete listing of ResourceGroup values.
  1899  type ResourceGroupListResultIterator struct {
  1900  	i    int
  1901  	page ResourceGroupListResultPage
  1902  }
  1903  
  1904  // NextWithContext advances to the next value.  If there was an error making
  1905  // the request the iterator does not advance and the error is returned.
  1906  func (iter *ResourceGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1907  	if tracing.IsEnabled() {
  1908  		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGroupListResultIterator.NextWithContext")
  1909  		defer func() {
  1910  			sc := -1
  1911  			if iter.Response().Response.Response != nil {
  1912  				sc = iter.Response().Response.Response.StatusCode
  1913  			}
  1914  			tracing.EndSpan(ctx, sc, err)
  1915  		}()
  1916  	}
  1917  	iter.i++
  1918  	if iter.i < len(iter.page.Values()) {
  1919  		return nil
  1920  	}
  1921  	err = iter.page.NextWithContext(ctx)
  1922  	if err != nil {
  1923  		iter.i--
  1924  		return err
  1925  	}
  1926  	iter.i = 0
  1927  	return nil
  1928  }
  1929  
  1930  // Next advances to the next value.  If there was an error making
  1931  // the request the iterator does not advance and the error is returned.
  1932  // Deprecated: Use NextWithContext() instead.
  1933  func (iter *ResourceGroupListResultIterator) Next() error {
  1934  	return iter.NextWithContext(context.Background())
  1935  }
  1936  
  1937  // NotDone returns true if the enumeration should be started or is not yet complete.
  1938  func (iter ResourceGroupListResultIterator) NotDone() bool {
  1939  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1940  }
  1941  
  1942  // Response returns the raw server response from the last page request.
  1943  func (iter ResourceGroupListResultIterator) Response() ResourceGroupListResult {
  1944  	return iter.page.Response()
  1945  }
  1946  
  1947  // Value returns the current value or a zero-initialized value if the
  1948  // iterator has advanced beyond the end of the collection.
  1949  func (iter ResourceGroupListResultIterator) Value() ResourceGroup {
  1950  	if !iter.page.NotDone() {
  1951  		return ResourceGroup{}
  1952  	}
  1953  	return iter.page.Values()[iter.i]
  1954  }
  1955  
  1956  // Creates a new instance of the ResourceGroupListResultIterator type.
  1957  func NewResourceGroupListResultIterator(page ResourceGroupListResultPage) ResourceGroupListResultIterator {
  1958  	return ResourceGroupListResultIterator{page: page}
  1959  }
  1960  
  1961  // IsEmpty returns true if the ListResult contains no values.
  1962  func (rglr ResourceGroupListResult) IsEmpty() bool {
  1963  	return rglr.Value == nil || len(*rglr.Value) == 0
  1964  }
  1965  
  1966  // hasNextLink returns true if the NextLink is not empty.
  1967  func (rglr ResourceGroupListResult) hasNextLink() bool {
  1968  	return rglr.NextLink != nil && len(*rglr.NextLink) != 0
  1969  }
  1970  
  1971  // resourceGroupListResultPreparer prepares a request to retrieve the next set of results.
  1972  // It returns nil if no more results exist.
  1973  func (rglr ResourceGroupListResult) resourceGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
  1974  	if !rglr.hasNextLink() {
  1975  		return nil, nil
  1976  	}
  1977  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1978  		autorest.AsJSON(),
  1979  		autorest.AsGet(),
  1980  		autorest.WithBaseURL(to.String(rglr.NextLink)))
  1981  }
  1982  
  1983  // ResourceGroupListResultPage contains a page of ResourceGroup values.
  1984  type ResourceGroupListResultPage struct {
  1985  	fn   func(context.Context, ResourceGroupListResult) (ResourceGroupListResult, error)
  1986  	rglr ResourceGroupListResult
  1987  }
  1988  
  1989  // NextWithContext advances to the next page of values.  If there was an error making
  1990  // the request the page does not advance and the error is returned.
  1991  func (page *ResourceGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
  1992  	if tracing.IsEnabled() {
  1993  		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGroupListResultPage.NextWithContext")
  1994  		defer func() {
  1995  			sc := -1
  1996  			if page.Response().Response.Response != nil {
  1997  				sc = page.Response().Response.Response.StatusCode
  1998  			}
  1999  			tracing.EndSpan(ctx, sc, err)
  2000  		}()
  2001  	}
  2002  	for {
  2003  		next, err := page.fn(ctx, page.rglr)
  2004  		if err != nil {
  2005  			return err
  2006  		}
  2007  		page.rglr = next
  2008  		if !next.hasNextLink() || !next.IsEmpty() {
  2009  			break
  2010  		}
  2011  	}
  2012  	return nil
  2013  }
  2014  
  2015  // Next advances to the next page of values.  If there was an error making
  2016  // the request the page does not advance and the error is returned.
  2017  // Deprecated: Use NextWithContext() instead.
  2018  func (page *ResourceGroupListResultPage) Next() error {
  2019  	return page.NextWithContext(context.Background())
  2020  }
  2021  
  2022  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2023  func (page ResourceGroupListResultPage) NotDone() bool {
  2024  	return !page.rglr.IsEmpty()
  2025  }
  2026  
  2027  // Response returns the raw server response from the last page request.
  2028  func (page ResourceGroupListResultPage) Response() ResourceGroupListResult {
  2029  	return page.rglr
  2030  }
  2031  
  2032  // Values returns the slice of values for the current page or nil if there are no values.
  2033  func (page ResourceGroupListResultPage) Values() []ResourceGroup {
  2034  	if page.rglr.IsEmpty() {
  2035  		return nil
  2036  	}
  2037  	return *page.rglr.Value
  2038  }
  2039  
  2040  // Creates a new instance of the ResourceGroupListResultPage type.
  2041  func NewResourceGroupListResultPage(cur ResourceGroupListResult, getNextPage func(context.Context, ResourceGroupListResult) (ResourceGroupListResult, error)) ResourceGroupListResultPage {
  2042  	return ResourceGroupListResultPage{
  2043  		fn:   getNextPage,
  2044  		rglr: cur,
  2045  	}
  2046  }
  2047  
  2048  // ResourceGroupPatchable resource group information.
  2049  type ResourceGroupPatchable struct {
  2050  	// Name - The name of the resource group.
  2051  	Name *string `json:"name,omitempty"`
  2052  	// Properties - The resource group properties.
  2053  	Properties *ResourceGroupProperties `json:"properties,omitempty"`
  2054  	// ManagedBy - The ID of the resource that manages this resource group.
  2055  	ManagedBy *string `json:"managedBy,omitempty"`
  2056  	// Tags - The tags attached to the resource group.
  2057  	Tags map[string]*string `json:"tags"`
  2058  }
  2059  
  2060  // MarshalJSON is the custom marshaler for ResourceGroupPatchable.
  2061  func (rgp ResourceGroupPatchable) MarshalJSON() ([]byte, error) {
  2062  	objectMap := make(map[string]interface{})
  2063  	if rgp.Name != nil {
  2064  		objectMap["name"] = rgp.Name
  2065  	}
  2066  	if rgp.Properties != nil {
  2067  		objectMap["properties"] = rgp.Properties
  2068  	}
  2069  	if rgp.ManagedBy != nil {
  2070  		objectMap["managedBy"] = rgp.ManagedBy
  2071  	}
  2072  	if rgp.Tags != nil {
  2073  		objectMap["tags"] = rgp.Tags
  2074  	}
  2075  	return json.Marshal(objectMap)
  2076  }
  2077  
  2078  // ResourceGroupProperties the resource group properties.
  2079  type ResourceGroupProperties struct {
  2080  	// ProvisioningState - READ-ONLY; The provisioning state.
  2081  	ProvisioningState *string `json:"provisioningState,omitempty"`
  2082  }
  2083  
  2084  // MarshalJSON is the custom marshaler for ResourceGroupProperties.
  2085  func (rgp ResourceGroupProperties) MarshalJSON() ([]byte, error) {
  2086  	objectMap := make(map[string]interface{})
  2087  	return json.Marshal(objectMap)
  2088  }
  2089  
  2090  // ResourceGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  2091  // operation.
  2092  type ResourceGroupsDeleteFuture struct {
  2093  	azure.FutureAPI
  2094  	// Result returns the result of the asynchronous operation.
  2095  	// If the operation has not completed it will return an error.
  2096  	Result func(ResourceGroupsClient) (autorest.Response, error)
  2097  }
  2098  
  2099  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2100  func (future *ResourceGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
  2101  	var azFuture azure.Future
  2102  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2103  		return err
  2104  	}
  2105  	future.FutureAPI = &azFuture
  2106  	future.Result = future.result
  2107  	return nil
  2108  }
  2109  
  2110  // result is the default implementation for ResourceGroupsDeleteFuture.Result.
  2111  func (future *ResourceGroupsDeleteFuture) result(client ResourceGroupsClient) (ar autorest.Response, err error) {
  2112  	var done bool
  2113  	done, err = future.DoneWithContext(context.Background(), client)
  2114  	if err != nil {
  2115  		err = autorest.NewErrorWithError(err, "features.ResourceGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
  2116  		return
  2117  	}
  2118  	if !done {
  2119  		ar.Response = future.Response()
  2120  		err = azure.NewAsyncOpIncompleteError("features.ResourceGroupsDeleteFuture")
  2121  		return
  2122  	}
  2123  	ar.Response = future.Response()
  2124  	return
  2125  }
  2126  
  2127  // ResourceListResult list of resource groups.
  2128  type ResourceListResult struct {
  2129  	autorest.Response `json:"-"`
  2130  	// Value - An array of resources.
  2131  	Value *[]GenericResourceExpanded `json:"value,omitempty"`
  2132  	// NextLink - READ-ONLY; The URL to use for getting the next set of results.
  2133  	NextLink *string `json:"nextLink,omitempty"`
  2134  }
  2135  
  2136  // MarshalJSON is the custom marshaler for ResourceListResult.
  2137  func (rlr ResourceListResult) MarshalJSON() ([]byte, error) {
  2138  	objectMap := make(map[string]interface{})
  2139  	if rlr.Value != nil {
  2140  		objectMap["value"] = rlr.Value
  2141  	}
  2142  	return json.Marshal(objectMap)
  2143  }
  2144  
  2145  // ResourceListResultIterator provides access to a complete listing of GenericResourceExpanded values.
  2146  type ResourceListResultIterator struct {
  2147  	i    int
  2148  	page ResourceListResultPage
  2149  }
  2150  
  2151  // NextWithContext advances to the next value.  If there was an error making
  2152  // the request the iterator does not advance and the error is returned.
  2153  func (iter *ResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
  2154  	if tracing.IsEnabled() {
  2155  		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceListResultIterator.NextWithContext")
  2156  		defer func() {
  2157  			sc := -1
  2158  			if iter.Response().Response.Response != nil {
  2159  				sc = iter.Response().Response.Response.StatusCode
  2160  			}
  2161  			tracing.EndSpan(ctx, sc, err)
  2162  		}()
  2163  	}
  2164  	iter.i++
  2165  	if iter.i < len(iter.page.Values()) {
  2166  		return nil
  2167  	}
  2168  	err = iter.page.NextWithContext(ctx)
  2169  	if err != nil {
  2170  		iter.i--
  2171  		return err
  2172  	}
  2173  	iter.i = 0
  2174  	return nil
  2175  }
  2176  
  2177  // Next advances to the next value.  If there was an error making
  2178  // the request the iterator does not advance and the error is returned.
  2179  // Deprecated: Use NextWithContext() instead.
  2180  func (iter *ResourceListResultIterator) Next() error {
  2181  	return iter.NextWithContext(context.Background())
  2182  }
  2183  
  2184  // NotDone returns true if the enumeration should be started or is not yet complete.
  2185  func (iter ResourceListResultIterator) NotDone() bool {
  2186  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2187  }
  2188  
  2189  // Response returns the raw server response from the last page request.
  2190  func (iter ResourceListResultIterator) Response() ResourceListResult {
  2191  	return iter.page.Response()
  2192  }
  2193  
  2194  // Value returns the current value or a zero-initialized value if the
  2195  // iterator has advanced beyond the end of the collection.
  2196  func (iter ResourceListResultIterator) Value() GenericResourceExpanded {
  2197  	if !iter.page.NotDone() {
  2198  		return GenericResourceExpanded{}
  2199  	}
  2200  	return iter.page.Values()[iter.i]
  2201  }
  2202  
  2203  // Creates a new instance of the ResourceListResultIterator type.
  2204  func NewResourceListResultIterator(page ResourceListResultPage) ResourceListResultIterator {
  2205  	return ResourceListResultIterator{page: page}
  2206  }
  2207  
  2208  // IsEmpty returns true if the ListResult contains no values.
  2209  func (rlr ResourceListResult) IsEmpty() bool {
  2210  	return rlr.Value == nil || len(*rlr.Value) == 0
  2211  }
  2212  
  2213  // hasNextLink returns true if the NextLink is not empty.
  2214  func (rlr ResourceListResult) hasNextLink() bool {
  2215  	return rlr.NextLink != nil && len(*rlr.NextLink) != 0
  2216  }
  2217  
  2218  // resourceListResultPreparer prepares a request to retrieve the next set of results.
  2219  // It returns nil if no more results exist.
  2220  func (rlr ResourceListResult) resourceListResultPreparer(ctx context.Context) (*http.Request, error) {
  2221  	if !rlr.hasNextLink() {
  2222  		return nil, nil
  2223  	}
  2224  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2225  		autorest.AsJSON(),
  2226  		autorest.AsGet(),
  2227  		autorest.WithBaseURL(to.String(rlr.NextLink)))
  2228  }
  2229  
  2230  // ResourceListResultPage contains a page of GenericResourceExpanded values.
  2231  type ResourceListResultPage struct {
  2232  	fn  func(context.Context, ResourceListResult) (ResourceListResult, error)
  2233  	rlr ResourceListResult
  2234  }
  2235  
  2236  // NextWithContext advances to the next page of values.  If there was an error making
  2237  // the request the page does not advance and the error is returned.
  2238  func (page *ResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
  2239  	if tracing.IsEnabled() {
  2240  		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceListResultPage.NextWithContext")
  2241  		defer func() {
  2242  			sc := -1
  2243  			if page.Response().Response.Response != nil {
  2244  				sc = page.Response().Response.Response.StatusCode
  2245  			}
  2246  			tracing.EndSpan(ctx, sc, err)
  2247  		}()
  2248  	}
  2249  	for {
  2250  		next, err := page.fn(ctx, page.rlr)
  2251  		if err != nil {
  2252  			return err
  2253  		}
  2254  		page.rlr = next
  2255  		if !next.hasNextLink() || !next.IsEmpty() {
  2256  			break
  2257  		}
  2258  	}
  2259  	return nil
  2260  }
  2261  
  2262  // Next advances to the next page of values.  If there was an error making
  2263  // the request the page does not advance and the error is returned.
  2264  // Deprecated: Use NextWithContext() instead.
  2265  func (page *ResourceListResultPage) Next() error {
  2266  	return page.NextWithContext(context.Background())
  2267  }
  2268  
  2269  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2270  func (page ResourceListResultPage) NotDone() bool {
  2271  	return !page.rlr.IsEmpty()
  2272  }
  2273  
  2274  // Response returns the raw server response from the last page request.
  2275  func (page ResourceListResultPage) Response() ResourceListResult {
  2276  	return page.rlr
  2277  }
  2278  
  2279  // Values returns the slice of values for the current page or nil if there are no values.
  2280  func (page ResourceListResultPage) Values() []GenericResourceExpanded {
  2281  	if page.rlr.IsEmpty() {
  2282  		return nil
  2283  	}
  2284  	return *page.rlr.Value
  2285  }
  2286  
  2287  // Creates a new instance of the ResourceListResultPage type.
  2288  func NewResourceListResultPage(cur ResourceListResult, getNextPage func(context.Context, ResourceListResult) (ResourceListResult, error)) ResourceListResultPage {
  2289  	return ResourceListResultPage{
  2290  		fn:  getNextPage,
  2291  		rlr: cur,
  2292  	}
  2293  }
  2294  
  2295  // ResourceProviderOperationDisplayProperties resource provider operation's display properties.
  2296  type ResourceProviderOperationDisplayProperties struct {
  2297  	// Publisher - Operation description.
  2298  	Publisher *string `json:"publisher,omitempty"`
  2299  	// Provider - Operation provider.
  2300  	Provider *string `json:"provider,omitempty"`
  2301  	// Resource - Operation resource.
  2302  	Resource *string `json:"resource,omitempty"`
  2303  	// Operation - Resource provider operation.
  2304  	Operation *string `json:"operation,omitempty"`
  2305  	// Description - Operation description.
  2306  	Description *string `json:"description,omitempty"`
  2307  }
  2308  
  2309  // ResourcesCreateOrUpdateByIDFuture an abstraction for monitoring and retrieving the results of a
  2310  // long-running operation.
  2311  type ResourcesCreateOrUpdateByIDFuture struct {
  2312  	azure.FutureAPI
  2313  	// Result returns the result of the asynchronous operation.
  2314  	// If the operation has not completed it will return an error.
  2315  	Result func(ResourcesClient) (GenericResource, error)
  2316  }
  2317  
  2318  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2319  func (future *ResourcesCreateOrUpdateByIDFuture) UnmarshalJSON(body []byte) error {
  2320  	var azFuture azure.Future
  2321  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2322  		return err
  2323  	}
  2324  	future.FutureAPI = &azFuture
  2325  	future.Result = future.result
  2326  	return nil
  2327  }
  2328  
  2329  // result is the default implementation for ResourcesCreateOrUpdateByIDFuture.Result.
  2330  func (future *ResourcesCreateOrUpdateByIDFuture) result(client ResourcesClient) (gr GenericResource, err error) {
  2331  	var done bool
  2332  	done, err = future.DoneWithContext(context.Background(), client)
  2333  	if err != nil {
  2334  		err = autorest.NewErrorWithError(err, "features.ResourcesCreateOrUpdateByIDFuture", "Result", future.Response(), "Polling failure")
  2335  		return
  2336  	}
  2337  	if !done {
  2338  		gr.Response.Response = future.Response()
  2339  		err = azure.NewAsyncOpIncompleteError("features.ResourcesCreateOrUpdateByIDFuture")
  2340  		return
  2341  	}
  2342  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2343  	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
  2344  		gr, err = client.CreateOrUpdateByIDResponder(gr.Response.Response)
  2345  		if err != nil {
  2346  			err = autorest.NewErrorWithError(err, "features.ResourcesCreateOrUpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
  2347  		}
  2348  	}
  2349  	return
  2350  }
  2351  
  2352  // ResourcesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
  2353  // operation.
  2354  type ResourcesCreateOrUpdateFuture struct {
  2355  	azure.FutureAPI
  2356  	// Result returns the result of the asynchronous operation.
  2357  	// If the operation has not completed it will return an error.
  2358  	Result func(ResourcesClient) (GenericResource, error)
  2359  }
  2360  
  2361  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2362  func (future *ResourcesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  2363  	var azFuture azure.Future
  2364  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2365  		return err
  2366  	}
  2367  	future.FutureAPI = &azFuture
  2368  	future.Result = future.result
  2369  	return nil
  2370  }
  2371  
  2372  // result is the default implementation for ResourcesCreateOrUpdateFuture.Result.
  2373  func (future *ResourcesCreateOrUpdateFuture) result(client ResourcesClient) (gr GenericResource, err error) {
  2374  	var done bool
  2375  	done, err = future.DoneWithContext(context.Background(), client)
  2376  	if err != nil {
  2377  		err = autorest.NewErrorWithError(err, "features.ResourcesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  2378  		return
  2379  	}
  2380  	if !done {
  2381  		gr.Response.Response = future.Response()
  2382  		err = azure.NewAsyncOpIncompleteError("features.ResourcesCreateOrUpdateFuture")
  2383  		return
  2384  	}
  2385  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2386  	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
  2387  		gr, err = client.CreateOrUpdateResponder(gr.Response.Response)
  2388  		if err != nil {
  2389  			err = autorest.NewErrorWithError(err, "features.ResourcesCreateOrUpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
  2390  		}
  2391  	}
  2392  	return
  2393  }
  2394  
  2395  // ResourcesDeleteByIDFuture an abstraction for monitoring and retrieving the results of a long-running
  2396  // operation.
  2397  type ResourcesDeleteByIDFuture struct {
  2398  	azure.FutureAPI
  2399  	// Result returns the result of the asynchronous operation.
  2400  	// If the operation has not completed it will return an error.
  2401  	Result func(ResourcesClient) (autorest.Response, error)
  2402  }
  2403  
  2404  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2405  func (future *ResourcesDeleteByIDFuture) UnmarshalJSON(body []byte) error {
  2406  	var azFuture azure.Future
  2407  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2408  		return err
  2409  	}
  2410  	future.FutureAPI = &azFuture
  2411  	future.Result = future.result
  2412  	return nil
  2413  }
  2414  
  2415  // result is the default implementation for ResourcesDeleteByIDFuture.Result.
  2416  func (future *ResourcesDeleteByIDFuture) result(client ResourcesClient) (ar autorest.Response, err error) {
  2417  	var done bool
  2418  	done, err = future.DoneWithContext(context.Background(), client)
  2419  	if err != nil {
  2420  		err = autorest.NewErrorWithError(err, "features.ResourcesDeleteByIDFuture", "Result", future.Response(), "Polling failure")
  2421  		return
  2422  	}
  2423  	if !done {
  2424  		ar.Response = future.Response()
  2425  		err = azure.NewAsyncOpIncompleteError("features.ResourcesDeleteByIDFuture")
  2426  		return
  2427  	}
  2428  	ar.Response = future.Response()
  2429  	return
  2430  }
  2431  
  2432  // ResourcesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  2433  // operation.
  2434  type ResourcesDeleteFuture struct {
  2435  	azure.FutureAPI
  2436  	// Result returns the result of the asynchronous operation.
  2437  	// If the operation has not completed it will return an error.
  2438  	Result func(ResourcesClient) (autorest.Response, error)
  2439  }
  2440  
  2441  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2442  func (future *ResourcesDeleteFuture) UnmarshalJSON(body []byte) error {
  2443  	var azFuture azure.Future
  2444  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2445  		return err
  2446  	}
  2447  	future.FutureAPI = &azFuture
  2448  	future.Result = future.result
  2449  	return nil
  2450  }
  2451  
  2452  // result is the default implementation for ResourcesDeleteFuture.Result.
  2453  func (future *ResourcesDeleteFuture) result(client ResourcesClient) (ar autorest.Response, err error) {
  2454  	var done bool
  2455  	done, err = future.DoneWithContext(context.Background(), client)
  2456  	if err != nil {
  2457  		err = autorest.NewErrorWithError(err, "features.ResourcesDeleteFuture", "Result", future.Response(), "Polling failure")
  2458  		return
  2459  	}
  2460  	if !done {
  2461  		ar.Response = future.Response()
  2462  		err = azure.NewAsyncOpIncompleteError("features.ResourcesDeleteFuture")
  2463  		return
  2464  	}
  2465  	ar.Response = future.Response()
  2466  	return
  2467  }
  2468  
  2469  // ResourcesMoveInfo parameters of move resources.
  2470  type ResourcesMoveInfo struct {
  2471  	// Resources - The IDs of the resources.
  2472  	Resources *[]string `json:"resources,omitempty"`
  2473  	// TargetResourceGroup - The target resource group.
  2474  	TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
  2475  }
  2476  
  2477  // ResourcesMoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running
  2478  // operation.
  2479  type ResourcesMoveResourcesFuture struct {
  2480  	azure.FutureAPI
  2481  	// Result returns the result of the asynchronous operation.
  2482  	// If the operation has not completed it will return an error.
  2483  	Result func(ResourcesClient) (autorest.Response, error)
  2484  }
  2485  
  2486  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2487  func (future *ResourcesMoveResourcesFuture) UnmarshalJSON(body []byte) error {
  2488  	var azFuture azure.Future
  2489  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2490  		return err
  2491  	}
  2492  	future.FutureAPI = &azFuture
  2493  	future.Result = future.result
  2494  	return nil
  2495  }
  2496  
  2497  // result is the default implementation for ResourcesMoveResourcesFuture.Result.
  2498  func (future *ResourcesMoveResourcesFuture) result(client ResourcesClient) (ar autorest.Response, err error) {
  2499  	var done bool
  2500  	done, err = future.DoneWithContext(context.Background(), client)
  2501  	if err != nil {
  2502  		err = autorest.NewErrorWithError(err, "features.ResourcesMoveResourcesFuture", "Result", future.Response(), "Polling failure")
  2503  		return
  2504  	}
  2505  	if !done {
  2506  		ar.Response = future.Response()
  2507  		err = azure.NewAsyncOpIncompleteError("features.ResourcesMoveResourcesFuture")
  2508  		return
  2509  	}
  2510  	ar.Response = future.Response()
  2511  	return
  2512  }
  2513  
  2514  // ResourcesUpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running
  2515  // operation.
  2516  type ResourcesUpdateByIDFuture struct {
  2517  	azure.FutureAPI
  2518  	// Result returns the result of the asynchronous operation.
  2519  	// If the operation has not completed it will return an error.
  2520  	Result func(ResourcesClient) (GenericResource, error)
  2521  }
  2522  
  2523  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2524  func (future *ResourcesUpdateByIDFuture) UnmarshalJSON(body []byte) error {
  2525  	var azFuture azure.Future
  2526  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2527  		return err
  2528  	}
  2529  	future.FutureAPI = &azFuture
  2530  	future.Result = future.result
  2531  	return nil
  2532  }
  2533  
  2534  // result is the default implementation for ResourcesUpdateByIDFuture.Result.
  2535  func (future *ResourcesUpdateByIDFuture) result(client ResourcesClient) (gr GenericResource, err error) {
  2536  	var done bool
  2537  	done, err = future.DoneWithContext(context.Background(), client)
  2538  	if err != nil {
  2539  		err = autorest.NewErrorWithError(err, "features.ResourcesUpdateByIDFuture", "Result", future.Response(), "Polling failure")
  2540  		return
  2541  	}
  2542  	if !done {
  2543  		gr.Response.Response = future.Response()
  2544  		err = azure.NewAsyncOpIncompleteError("features.ResourcesUpdateByIDFuture")
  2545  		return
  2546  	}
  2547  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2548  	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
  2549  		gr, err = client.UpdateByIDResponder(gr.Response.Response)
  2550  		if err != nil {
  2551  			err = autorest.NewErrorWithError(err, "features.ResourcesUpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
  2552  		}
  2553  	}
  2554  	return
  2555  }
  2556  
  2557  // ResourcesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
  2558  // operation.
  2559  type ResourcesUpdateFuture struct {
  2560  	azure.FutureAPI
  2561  	// Result returns the result of the asynchronous operation.
  2562  	// If the operation has not completed it will return an error.
  2563  	Result func(ResourcesClient) (GenericResource, error)
  2564  }
  2565  
  2566  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2567  func (future *ResourcesUpdateFuture) UnmarshalJSON(body []byte) error {
  2568  	var azFuture azure.Future
  2569  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2570  		return err
  2571  	}
  2572  	future.FutureAPI = &azFuture
  2573  	future.Result = future.result
  2574  	return nil
  2575  }
  2576  
  2577  // result is the default implementation for ResourcesUpdateFuture.Result.
  2578  func (future *ResourcesUpdateFuture) result(client ResourcesClient) (gr GenericResource, err error) {
  2579  	var done bool
  2580  	done, err = future.DoneWithContext(context.Background(), client)
  2581  	if err != nil {
  2582  		err = autorest.NewErrorWithError(err, "features.ResourcesUpdateFuture", "Result", future.Response(), "Polling failure")
  2583  		return
  2584  	}
  2585  	if !done {
  2586  		gr.Response.Response = future.Response()
  2587  		err = azure.NewAsyncOpIncompleteError("features.ResourcesUpdateFuture")
  2588  		return
  2589  	}
  2590  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2591  	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
  2592  		gr, err = client.UpdateResponder(gr.Response.Response)
  2593  		if err != nil {
  2594  			err = autorest.NewErrorWithError(err, "features.ResourcesUpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
  2595  		}
  2596  	}
  2597  	return
  2598  }
  2599  
  2600  // ResourcesValidateMoveResourcesFuture an abstraction for monitoring and retrieving the results of a
  2601  // long-running operation.
  2602  type ResourcesValidateMoveResourcesFuture struct {
  2603  	azure.FutureAPI
  2604  	// Result returns the result of the asynchronous operation.
  2605  	// If the operation has not completed it will return an error.
  2606  	Result func(ResourcesClient) (autorest.Response, error)
  2607  }
  2608  
  2609  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2610  func (future *ResourcesValidateMoveResourcesFuture) UnmarshalJSON(body []byte) error {
  2611  	var azFuture azure.Future
  2612  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2613  		return err
  2614  	}
  2615  	future.FutureAPI = &azFuture
  2616  	future.Result = future.result
  2617  	return nil
  2618  }
  2619  
  2620  // result is the default implementation for ResourcesValidateMoveResourcesFuture.Result.
  2621  func (future *ResourcesValidateMoveResourcesFuture) result(client ResourcesClient) (ar autorest.Response, err error) {
  2622  	var done bool
  2623  	done, err = future.DoneWithContext(context.Background(), client)
  2624  	if err != nil {
  2625  		err = autorest.NewErrorWithError(err, "features.ResourcesValidateMoveResourcesFuture", "Result", future.Response(), "Polling failure")
  2626  		return
  2627  	}
  2628  	if !done {
  2629  		ar.Response = future.Response()
  2630  		err = azure.NewAsyncOpIncompleteError("features.ResourcesValidateMoveResourcesFuture")
  2631  		return
  2632  	}
  2633  	ar.Response = future.Response()
  2634  	return
  2635  }
  2636  
  2637  // Sku SKU for the resource.
  2638  type Sku struct {
  2639  	// Name - The SKU name.
  2640  	Name *string `json:"name,omitempty"`
  2641  	// Tier - The SKU tier.
  2642  	Tier *string `json:"tier,omitempty"`
  2643  	// Size - The SKU size.
  2644  	Size *string `json:"size,omitempty"`
  2645  	// Family - The SKU family.
  2646  	Family *string `json:"family,omitempty"`
  2647  	// Model - The SKU model.
  2648  	Model *string `json:"model,omitempty"`
  2649  	// Capacity - The SKU capacity.
  2650  	Capacity *int32 `json:"capacity,omitempty"`
  2651  }
  2652  
  2653  // SubResource sub-resource.
  2654  type SubResource struct {
  2655  	// ID - Resource ID
  2656  	ID *string `json:"id,omitempty"`
  2657  }
  2658  
  2659  // TagCount tag count.
  2660  type TagCount struct {
  2661  	// Type - Type of count.
  2662  	Type *string `json:"type,omitempty"`
  2663  	// Value - Value of count.
  2664  	Value *int32 `json:"value,omitempty"`
  2665  }
  2666  
  2667  // TagDetails tag details.
  2668  type TagDetails struct {
  2669  	autorest.Response `json:"-"`
  2670  	// ID - READ-ONLY; The tag ID.
  2671  	ID *string `json:"id,omitempty"`
  2672  	// TagName - The tag name.
  2673  	TagName *string `json:"tagName,omitempty"`
  2674  	// Count - The total number of resources that use the resource tag. When a tag is initially created and has no associated resources, the value is 0.
  2675  	Count *TagCount `json:"count,omitempty"`
  2676  	// Values - The list of tag values.
  2677  	Values *[]TagValue `json:"values,omitempty"`
  2678  }
  2679  
  2680  // MarshalJSON is the custom marshaler for TagDetails.
  2681  func (td TagDetails) MarshalJSON() ([]byte, error) {
  2682  	objectMap := make(map[string]interface{})
  2683  	if td.TagName != nil {
  2684  		objectMap["tagName"] = td.TagName
  2685  	}
  2686  	if td.Count != nil {
  2687  		objectMap["count"] = td.Count
  2688  	}
  2689  	if td.Values != nil {
  2690  		objectMap["values"] = td.Values
  2691  	}
  2692  	return json.Marshal(objectMap)
  2693  }
  2694  
  2695  // TagsListResult list of subscription tags.
  2696  type TagsListResult struct {
  2697  	autorest.Response `json:"-"`
  2698  	// Value - An array of tags.
  2699  	Value *[]TagDetails `json:"value,omitempty"`
  2700  	// NextLink - READ-ONLY; The URL to use for getting the next set of results.
  2701  	NextLink *string `json:"nextLink,omitempty"`
  2702  }
  2703  
  2704  // MarshalJSON is the custom marshaler for TagsListResult.
  2705  func (tlr TagsListResult) MarshalJSON() ([]byte, error) {
  2706  	objectMap := make(map[string]interface{})
  2707  	if tlr.Value != nil {
  2708  		objectMap["value"] = tlr.Value
  2709  	}
  2710  	return json.Marshal(objectMap)
  2711  }
  2712  
  2713  // TagsListResultIterator provides access to a complete listing of TagDetails values.
  2714  type TagsListResultIterator struct {
  2715  	i    int
  2716  	page TagsListResultPage
  2717  }
  2718  
  2719  // NextWithContext advances to the next value.  If there was an error making
  2720  // the request the iterator does not advance and the error is returned.
  2721  func (iter *TagsListResultIterator) NextWithContext(ctx context.Context) (err error) {
  2722  	if tracing.IsEnabled() {
  2723  		ctx = tracing.StartSpan(ctx, fqdn+"/TagsListResultIterator.NextWithContext")
  2724  		defer func() {
  2725  			sc := -1
  2726  			if iter.Response().Response.Response != nil {
  2727  				sc = iter.Response().Response.Response.StatusCode
  2728  			}
  2729  			tracing.EndSpan(ctx, sc, err)
  2730  		}()
  2731  	}
  2732  	iter.i++
  2733  	if iter.i < len(iter.page.Values()) {
  2734  		return nil
  2735  	}
  2736  	err = iter.page.NextWithContext(ctx)
  2737  	if err != nil {
  2738  		iter.i--
  2739  		return err
  2740  	}
  2741  	iter.i = 0
  2742  	return nil
  2743  }
  2744  
  2745  // Next advances to the next value.  If there was an error making
  2746  // the request the iterator does not advance and the error is returned.
  2747  // Deprecated: Use NextWithContext() instead.
  2748  func (iter *TagsListResultIterator) Next() error {
  2749  	return iter.NextWithContext(context.Background())
  2750  }
  2751  
  2752  // NotDone returns true if the enumeration should be started or is not yet complete.
  2753  func (iter TagsListResultIterator) NotDone() bool {
  2754  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2755  }
  2756  
  2757  // Response returns the raw server response from the last page request.
  2758  func (iter TagsListResultIterator) Response() TagsListResult {
  2759  	return iter.page.Response()
  2760  }
  2761  
  2762  // Value returns the current value or a zero-initialized value if the
  2763  // iterator has advanced beyond the end of the collection.
  2764  func (iter TagsListResultIterator) Value() TagDetails {
  2765  	if !iter.page.NotDone() {
  2766  		return TagDetails{}
  2767  	}
  2768  	return iter.page.Values()[iter.i]
  2769  }
  2770  
  2771  // Creates a new instance of the TagsListResultIterator type.
  2772  func NewTagsListResultIterator(page TagsListResultPage) TagsListResultIterator {
  2773  	return TagsListResultIterator{page: page}
  2774  }
  2775  
  2776  // IsEmpty returns true if the ListResult contains no values.
  2777  func (tlr TagsListResult) IsEmpty() bool {
  2778  	return tlr.Value == nil || len(*tlr.Value) == 0
  2779  }
  2780  
  2781  // hasNextLink returns true if the NextLink is not empty.
  2782  func (tlr TagsListResult) hasNextLink() bool {
  2783  	return tlr.NextLink != nil && len(*tlr.NextLink) != 0
  2784  }
  2785  
  2786  // tagsListResultPreparer prepares a request to retrieve the next set of results.
  2787  // It returns nil if no more results exist.
  2788  func (tlr TagsListResult) tagsListResultPreparer(ctx context.Context) (*http.Request, error) {
  2789  	if !tlr.hasNextLink() {
  2790  		return nil, nil
  2791  	}
  2792  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2793  		autorest.AsJSON(),
  2794  		autorest.AsGet(),
  2795  		autorest.WithBaseURL(to.String(tlr.NextLink)))
  2796  }
  2797  
  2798  // TagsListResultPage contains a page of TagDetails values.
  2799  type TagsListResultPage struct {
  2800  	fn  func(context.Context, TagsListResult) (TagsListResult, error)
  2801  	tlr TagsListResult
  2802  }
  2803  
  2804  // NextWithContext advances to the next page of values.  If there was an error making
  2805  // the request the page does not advance and the error is returned.
  2806  func (page *TagsListResultPage) NextWithContext(ctx context.Context) (err error) {
  2807  	if tracing.IsEnabled() {
  2808  		ctx = tracing.StartSpan(ctx, fqdn+"/TagsListResultPage.NextWithContext")
  2809  		defer func() {
  2810  			sc := -1
  2811  			if page.Response().Response.Response != nil {
  2812  				sc = page.Response().Response.Response.StatusCode
  2813  			}
  2814  			tracing.EndSpan(ctx, sc, err)
  2815  		}()
  2816  	}
  2817  	for {
  2818  		next, err := page.fn(ctx, page.tlr)
  2819  		if err != nil {
  2820  			return err
  2821  		}
  2822  		page.tlr = next
  2823  		if !next.hasNextLink() || !next.IsEmpty() {
  2824  			break
  2825  		}
  2826  	}
  2827  	return nil
  2828  }
  2829  
  2830  // Next advances to the next page of values.  If there was an error making
  2831  // the request the page does not advance and the error is returned.
  2832  // Deprecated: Use NextWithContext() instead.
  2833  func (page *TagsListResultPage) Next() error {
  2834  	return page.NextWithContext(context.Background())
  2835  }
  2836  
  2837  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2838  func (page TagsListResultPage) NotDone() bool {
  2839  	return !page.tlr.IsEmpty()
  2840  }
  2841  
  2842  // Response returns the raw server response from the last page request.
  2843  func (page TagsListResultPage) Response() TagsListResult {
  2844  	return page.tlr
  2845  }
  2846  
  2847  // Values returns the slice of values for the current page or nil if there are no values.
  2848  func (page TagsListResultPage) Values() []TagDetails {
  2849  	if page.tlr.IsEmpty() {
  2850  		return nil
  2851  	}
  2852  	return *page.tlr.Value
  2853  }
  2854  
  2855  // Creates a new instance of the TagsListResultPage type.
  2856  func NewTagsListResultPage(cur TagsListResult, getNextPage func(context.Context, TagsListResult) (TagsListResult, error)) TagsListResultPage {
  2857  	return TagsListResultPage{
  2858  		fn:  getNextPage,
  2859  		tlr: cur,
  2860  	}
  2861  }
  2862  
  2863  // TagValue tag information.
  2864  type TagValue struct {
  2865  	autorest.Response `json:"-"`
  2866  	// ID - READ-ONLY; The tag ID.
  2867  	ID *string `json:"id,omitempty"`
  2868  	// TagValue - The tag value.
  2869  	TagValue *string `json:"tagValue,omitempty"`
  2870  	// Count - The tag value count.
  2871  	Count *TagCount `json:"count,omitempty"`
  2872  }
  2873  
  2874  // MarshalJSON is the custom marshaler for TagValue.
  2875  func (tv TagValue) MarshalJSON() ([]byte, error) {
  2876  	objectMap := make(map[string]interface{})
  2877  	if tv.TagValue != nil {
  2878  		objectMap["tagValue"] = tv.TagValue
  2879  	}
  2880  	if tv.Count != nil {
  2881  		objectMap["count"] = tv.Count
  2882  	}
  2883  	return json.Marshal(objectMap)
  2884  }
  2885  
  2886  // TargetResource target resource.
  2887  type TargetResource struct {
  2888  	// ID - The ID of the resource.
  2889  	ID *string `json:"id,omitempty"`
  2890  	// ResourceName - The name of the resource.
  2891  	ResourceName *string `json:"resourceName,omitempty"`
  2892  	// ResourceType - The type of the resource.
  2893  	ResourceType *string `json:"resourceType,omitempty"`
  2894  }
  2895  
  2896  // TemplateHashResult result of the request to calculate template hash. It contains a string of minified
  2897  // template and its hash.
  2898  type TemplateHashResult struct {
  2899  	autorest.Response `json:"-"`
  2900  	// MinifiedTemplate - The minified template string.
  2901  	MinifiedTemplate *string `json:"minifiedTemplate,omitempty"`
  2902  	// TemplateHash - The template hash.
  2903  	TemplateHash *string `json:"templateHash,omitempty"`
  2904  }
  2905  
  2906  // TemplateLink entity representing the reference to the template.
  2907  type TemplateLink struct {
  2908  	// URI - The URI of the template to deploy.
  2909  	URI *string `json:"uri,omitempty"`
  2910  	// ContentVersion - If included, must match the ContentVersion in the template.
  2911  	ContentVersion *string `json:"contentVersion,omitempty"`
  2912  }
  2913  
  2914  // WhatIfChange information about a single resource change predicted by What-If operation.
  2915  type WhatIfChange struct {
  2916  	// ResourceID - Resource ID
  2917  	ResourceID *string `json:"resourceId,omitempty"`
  2918  	// ChangeType - Type of change that will be made to the resource when the deployment is executed. Possible values include: 'Create', 'Delete', 'Ignore', 'Deploy', 'NoChange', 'Modify'
  2919  	ChangeType ChangeType `json:"changeType,omitempty"`
  2920  	// Before - The snapshot of the resource before the deployment is executed.
  2921  	Before interface{} `json:"before,omitempty"`
  2922  	// After - The predicted snapshot of the resource after the deployment is executed.
  2923  	After interface{} `json:"after,omitempty"`
  2924  	// Delta - The predicted changes to resource properties.
  2925  	Delta *[]WhatIfPropertyChange `json:"delta,omitempty"`
  2926  }
  2927  
  2928  // WhatIfOperationProperties deployment operation properties.
  2929  type WhatIfOperationProperties struct {
  2930  	// Changes - List of resource changes predicted by What-If operation.
  2931  	Changes *[]WhatIfChange `json:"changes,omitempty"`
  2932  }
  2933  
  2934  // WhatIfOperationResult result of the What-If operation. Contains a list of predicted changes and a URL
  2935  // link to get to the next set of results.
  2936  type WhatIfOperationResult struct {
  2937  	autorest.Response `json:"-"`
  2938  	// Status - Status of the What-If operation.
  2939  	Status *string `json:"status,omitempty"`
  2940  	// WhatIfOperationProperties - What-If operation properties.
  2941  	*WhatIfOperationProperties `json:"properties,omitempty"`
  2942  	// Error - Error when What-If operation fails.
  2943  	Error *ErrorResponse `json:"error,omitempty"`
  2944  }
  2945  
  2946  // MarshalJSON is the custom marshaler for WhatIfOperationResult.
  2947  func (wior WhatIfOperationResult) MarshalJSON() ([]byte, error) {
  2948  	objectMap := make(map[string]interface{})
  2949  	if wior.Status != nil {
  2950  		objectMap["status"] = wior.Status
  2951  	}
  2952  	if wior.WhatIfOperationProperties != nil {
  2953  		objectMap["properties"] = wior.WhatIfOperationProperties
  2954  	}
  2955  	if wior.Error != nil {
  2956  		objectMap["error"] = wior.Error
  2957  	}
  2958  	return json.Marshal(objectMap)
  2959  }
  2960  
  2961  // UnmarshalJSON is the custom unmarshaler for WhatIfOperationResult struct.
  2962  func (wior *WhatIfOperationResult) UnmarshalJSON(body []byte) error {
  2963  	var m map[string]*json.RawMessage
  2964  	err := json.Unmarshal(body, &m)
  2965  	if err != nil {
  2966  		return err
  2967  	}
  2968  	for k, v := range m {
  2969  		switch k {
  2970  		case "status":
  2971  			if v != nil {
  2972  				var status string
  2973  				err = json.Unmarshal(*v, &status)
  2974  				if err != nil {
  2975  					return err
  2976  				}
  2977  				wior.Status = &status
  2978  			}
  2979  		case "properties":
  2980  			if v != nil {
  2981  				var whatIfOperationProperties WhatIfOperationProperties
  2982  				err = json.Unmarshal(*v, &whatIfOperationProperties)
  2983  				if err != nil {
  2984  					return err
  2985  				}
  2986  				wior.WhatIfOperationProperties = &whatIfOperationProperties
  2987  			}
  2988  		case "error":
  2989  			if v != nil {
  2990  				var errorVar ErrorResponse
  2991  				err = json.Unmarshal(*v, &errorVar)
  2992  				if err != nil {
  2993  					return err
  2994  				}
  2995  				wior.Error = &errorVar
  2996  			}
  2997  		}
  2998  	}
  2999  
  3000  	return nil
  3001  }
  3002  
  3003  // WhatIfPropertyChange the predicted change to the resource property.
  3004  type WhatIfPropertyChange struct {
  3005  	// Path - The path of the property.
  3006  	Path *string `json:"path,omitempty"`
  3007  	// PropertyChangeType - The type of property change. Possible values include: 'PropertyChangeTypeCreate', 'PropertyChangeTypeDelete', 'PropertyChangeTypeModify', 'PropertyChangeTypeArray'
  3008  	PropertyChangeType PropertyChangeType `json:"propertyChangeType,omitempty"`
  3009  	// Before - The value of the property before the deployment is executed.
  3010  	Before interface{} `json:"before,omitempty"`
  3011  	// After - The value of the property after the deployment is executed.
  3012  	After interface{} `json:"after,omitempty"`
  3013  	// Children - Nested property changes.
  3014  	Children *[]WhatIfPropertyChange `json:"children,omitempty"`
  3015  }
  3016  

View as plain text