...

Source file src/github.com/Azure/azure-sdk-for-go/services/solutions/mgmt/2018-03-01/managedapplications/models.go

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

     1  package managedapplications
     2  
     3  // Copyright (c) Microsoft Corporation. All rights reserved.
     4  // Licensed under the MIT License. See License.txt in the project root for license information.
     5  //
     6  // Code generated by Microsoft (R) AutoRest Code Generator.
     7  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
     8  
     9  import (
    10  	"context"
    11  	"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/solutions/mgmt/2018-03-01/managedapplications"
    22  
    23  // Application information about managed application.
    24  type Application struct {
    25  	autorest.Response `json:"-"`
    26  	// ApplicationProperties - The managed application properties.
    27  	*ApplicationProperties `json:"properties,omitempty"`
    28  	// Plan - The plan information.
    29  	Plan *Plan `json:"plan,omitempty"`
    30  	// Kind - The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog.
    31  	Kind *string `json:"kind,omitempty"`
    32  	// Identity - The identity of the resource.
    33  	Identity *Identity `json:"identity,omitempty"`
    34  	// ManagedBy - ID of the resource that manages this resource.
    35  	ManagedBy *string `json:"managedBy,omitempty"`
    36  	// Sku - The SKU of the resource.
    37  	Sku *Sku `json:"sku,omitempty"`
    38  	// ID - READ-ONLY; Resource ID
    39  	ID *string `json:"id,omitempty"`
    40  	// Name - READ-ONLY; Resource name
    41  	Name *string `json:"name,omitempty"`
    42  	// Type - READ-ONLY; Resource type
    43  	Type *string `json:"type,omitempty"`
    44  	// Location - Resource location
    45  	Location *string `json:"location,omitempty"`
    46  	// Tags - Resource tags
    47  	Tags map[string]*string `json:"tags"`
    48  }
    49  
    50  // MarshalJSON is the custom marshaler for Application.
    51  func (a Application) MarshalJSON() ([]byte, error) {
    52  	objectMap := make(map[string]interface{})
    53  	if a.ApplicationProperties != nil {
    54  		objectMap["properties"] = a.ApplicationProperties
    55  	}
    56  	if a.Plan != nil {
    57  		objectMap["plan"] = a.Plan
    58  	}
    59  	if a.Kind != nil {
    60  		objectMap["kind"] = a.Kind
    61  	}
    62  	if a.Identity != nil {
    63  		objectMap["identity"] = a.Identity
    64  	}
    65  	if a.ManagedBy != nil {
    66  		objectMap["managedBy"] = a.ManagedBy
    67  	}
    68  	if a.Sku != nil {
    69  		objectMap["sku"] = a.Sku
    70  	}
    71  	if a.Location != nil {
    72  		objectMap["location"] = a.Location
    73  	}
    74  	if a.Tags != nil {
    75  		objectMap["tags"] = a.Tags
    76  	}
    77  	return json.Marshal(objectMap)
    78  }
    79  
    80  // UnmarshalJSON is the custom unmarshaler for Application struct.
    81  func (a *Application) UnmarshalJSON(body []byte) error {
    82  	var m map[string]*json.RawMessage
    83  	err := json.Unmarshal(body, &m)
    84  	if err != nil {
    85  		return err
    86  	}
    87  	for k, v := range m {
    88  		switch k {
    89  		case "properties":
    90  			if v != nil {
    91  				var applicationProperties ApplicationProperties
    92  				err = json.Unmarshal(*v, &applicationProperties)
    93  				if err != nil {
    94  					return err
    95  				}
    96  				a.ApplicationProperties = &applicationProperties
    97  			}
    98  		case "plan":
    99  			if v != nil {
   100  				var plan Plan
   101  				err = json.Unmarshal(*v, &plan)
   102  				if err != nil {
   103  					return err
   104  				}
   105  				a.Plan = &plan
   106  			}
   107  		case "kind":
   108  			if v != nil {
   109  				var kind string
   110  				err = json.Unmarshal(*v, &kind)
   111  				if err != nil {
   112  					return err
   113  				}
   114  				a.Kind = &kind
   115  			}
   116  		case "identity":
   117  			if v != nil {
   118  				var identity Identity
   119  				err = json.Unmarshal(*v, &identity)
   120  				if err != nil {
   121  					return err
   122  				}
   123  				a.Identity = &identity
   124  			}
   125  		case "managedBy":
   126  			if v != nil {
   127  				var managedBy string
   128  				err = json.Unmarshal(*v, &managedBy)
   129  				if err != nil {
   130  					return err
   131  				}
   132  				a.ManagedBy = &managedBy
   133  			}
   134  		case "sku":
   135  			if v != nil {
   136  				var sku Sku
   137  				err = json.Unmarshal(*v, &sku)
   138  				if err != nil {
   139  					return err
   140  				}
   141  				a.Sku = &sku
   142  			}
   143  		case "id":
   144  			if v != nil {
   145  				var ID string
   146  				err = json.Unmarshal(*v, &ID)
   147  				if err != nil {
   148  					return err
   149  				}
   150  				a.ID = &ID
   151  			}
   152  		case "name":
   153  			if v != nil {
   154  				var name string
   155  				err = json.Unmarshal(*v, &name)
   156  				if err != nil {
   157  					return err
   158  				}
   159  				a.Name = &name
   160  			}
   161  		case "type":
   162  			if v != nil {
   163  				var typeVar string
   164  				err = json.Unmarshal(*v, &typeVar)
   165  				if err != nil {
   166  					return err
   167  				}
   168  				a.Type = &typeVar
   169  			}
   170  		case "location":
   171  			if v != nil {
   172  				var location string
   173  				err = json.Unmarshal(*v, &location)
   174  				if err != nil {
   175  					return err
   176  				}
   177  				a.Location = &location
   178  			}
   179  		case "tags":
   180  			if v != nil {
   181  				var tags map[string]*string
   182  				err = json.Unmarshal(*v, &tags)
   183  				if err != nil {
   184  					return err
   185  				}
   186  				a.Tags = tags
   187  			}
   188  		}
   189  	}
   190  
   191  	return nil
   192  }
   193  
   194  // ApplicationArtifact managed application artifact.
   195  type ApplicationArtifact struct {
   196  	// Name - The managed application artifact name. Possible values include: 'NotSpecified', 'ViewDefinition', 'Authorizations', 'CustomRoleDefinition'
   197  	Name ApplicationArtifactName `json:"name,omitempty"`
   198  	// URI - The managed application artifact blob uri.
   199  	URI *string `json:"uri,omitempty"`
   200  	// Type - The managed application artifact type. Possible values include: 'ApplicationArtifactTypeNotSpecified', 'ApplicationArtifactTypeTemplate', 'ApplicationArtifactTypeCustom'
   201  	Type ApplicationArtifactType `json:"type,omitempty"`
   202  }
   203  
   204  // ApplicationAuthorization the managed application provider authorization.
   205  type ApplicationAuthorization struct {
   206  	// PrincipalID - The provider's principal identifier. This is the identity that the provider will use to call ARM to manage the managed application resources.
   207  	PrincipalID *string `json:"principalId,omitempty"`
   208  	// RoleDefinitionID - The provider's role definition identifier. This role will define all the permissions that the provider must have on the managed application's container resource group. This role definition cannot have permission to delete the resource group.
   209  	RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
   210  }
   211  
   212  // ApplicationBillingDetailsDefinition managed application billing details definition.
   213  type ApplicationBillingDetailsDefinition struct {
   214  	// ResourceUsageID - The managed application resource usage Id.
   215  	ResourceUsageID *string `json:"resourceUsageId,omitempty"`
   216  }
   217  
   218  // ApplicationClientDetails the application client details to track the entity creating/updating the
   219  // managed app resource.
   220  type ApplicationClientDetails struct {
   221  	// Oid - The client Oid.
   222  	Oid *string `json:"oid,omitempty"`
   223  	// Puid - The client Puid
   224  	Puid *string `json:"puid,omitempty"`
   225  	// ApplicationID - The client application Id.
   226  	ApplicationID *string `json:"applicationId,omitempty"`
   227  }
   228  
   229  // ApplicationDefinition information about managed application definition.
   230  type ApplicationDefinition struct {
   231  	autorest.Response `json:"-"`
   232  	// ApplicationDefinitionProperties - The managed application definition properties.
   233  	*ApplicationDefinitionProperties `json:"properties,omitempty"`
   234  	// ManagedBy - ID of the resource that manages this resource.
   235  	ManagedBy *string `json:"managedBy,omitempty"`
   236  	// Sku - The SKU of the resource.
   237  	Sku *Sku `json:"sku,omitempty"`
   238  	// ID - READ-ONLY; Resource ID
   239  	ID *string `json:"id,omitempty"`
   240  	// Name - READ-ONLY; Resource name
   241  	Name *string `json:"name,omitempty"`
   242  	// Type - READ-ONLY; Resource type
   243  	Type *string `json:"type,omitempty"`
   244  	// Location - Resource location
   245  	Location *string `json:"location,omitempty"`
   246  	// Tags - Resource tags
   247  	Tags map[string]*string `json:"tags"`
   248  }
   249  
   250  // MarshalJSON is the custom marshaler for ApplicationDefinition.
   251  func (ad ApplicationDefinition) MarshalJSON() ([]byte, error) {
   252  	objectMap := make(map[string]interface{})
   253  	if ad.ApplicationDefinitionProperties != nil {
   254  		objectMap["properties"] = ad.ApplicationDefinitionProperties
   255  	}
   256  	if ad.ManagedBy != nil {
   257  		objectMap["managedBy"] = ad.ManagedBy
   258  	}
   259  	if ad.Sku != nil {
   260  		objectMap["sku"] = ad.Sku
   261  	}
   262  	if ad.Location != nil {
   263  		objectMap["location"] = ad.Location
   264  	}
   265  	if ad.Tags != nil {
   266  		objectMap["tags"] = ad.Tags
   267  	}
   268  	return json.Marshal(objectMap)
   269  }
   270  
   271  // UnmarshalJSON is the custom unmarshaler for ApplicationDefinition struct.
   272  func (ad *ApplicationDefinition) UnmarshalJSON(body []byte) error {
   273  	var m map[string]*json.RawMessage
   274  	err := json.Unmarshal(body, &m)
   275  	if err != nil {
   276  		return err
   277  	}
   278  	for k, v := range m {
   279  		switch k {
   280  		case "properties":
   281  			if v != nil {
   282  				var applicationDefinitionProperties ApplicationDefinitionProperties
   283  				err = json.Unmarshal(*v, &applicationDefinitionProperties)
   284  				if err != nil {
   285  					return err
   286  				}
   287  				ad.ApplicationDefinitionProperties = &applicationDefinitionProperties
   288  			}
   289  		case "managedBy":
   290  			if v != nil {
   291  				var managedBy string
   292  				err = json.Unmarshal(*v, &managedBy)
   293  				if err != nil {
   294  					return err
   295  				}
   296  				ad.ManagedBy = &managedBy
   297  			}
   298  		case "sku":
   299  			if v != nil {
   300  				var sku Sku
   301  				err = json.Unmarshal(*v, &sku)
   302  				if err != nil {
   303  					return err
   304  				}
   305  				ad.Sku = &sku
   306  			}
   307  		case "id":
   308  			if v != nil {
   309  				var ID string
   310  				err = json.Unmarshal(*v, &ID)
   311  				if err != nil {
   312  					return err
   313  				}
   314  				ad.ID = &ID
   315  			}
   316  		case "name":
   317  			if v != nil {
   318  				var name string
   319  				err = json.Unmarshal(*v, &name)
   320  				if err != nil {
   321  					return err
   322  				}
   323  				ad.Name = &name
   324  			}
   325  		case "type":
   326  			if v != nil {
   327  				var typeVar string
   328  				err = json.Unmarshal(*v, &typeVar)
   329  				if err != nil {
   330  					return err
   331  				}
   332  				ad.Type = &typeVar
   333  			}
   334  		case "location":
   335  			if v != nil {
   336  				var location string
   337  				err = json.Unmarshal(*v, &location)
   338  				if err != nil {
   339  					return err
   340  				}
   341  				ad.Location = &location
   342  			}
   343  		case "tags":
   344  			if v != nil {
   345  				var tags map[string]*string
   346  				err = json.Unmarshal(*v, &tags)
   347  				if err != nil {
   348  					return err
   349  				}
   350  				ad.Tags = tags
   351  			}
   352  		}
   353  	}
   354  
   355  	return nil
   356  }
   357  
   358  // ApplicationDefinitionArtifact application definition artifact.
   359  type ApplicationDefinitionArtifact struct {
   360  	// Name - The managed application definition artifact name. Possible values include: 'ApplicationDefinitionArtifactNameNotSpecified', 'ApplicationDefinitionArtifactNameApplicationResourceTemplate', 'ApplicationDefinitionArtifactNameCreateUIDefinition', 'ApplicationDefinitionArtifactNameMainTemplateParameters'
   361  	Name ApplicationDefinitionArtifactName `json:"name,omitempty"`
   362  	// URI - The managed application definition artifact blob uri.
   363  	URI *string `json:"uri,omitempty"`
   364  	// Type - The managed application definition artifact type. Possible values include: 'ApplicationArtifactTypeNotSpecified', 'ApplicationArtifactTypeTemplate', 'ApplicationArtifactTypeCustom'
   365  	Type ApplicationArtifactType `json:"type,omitempty"`
   366  }
   367  
   368  // ApplicationDefinitionListResult list of managed application definitions.
   369  type ApplicationDefinitionListResult struct {
   370  	autorest.Response `json:"-"`
   371  	// Value - The array of managed application definitions.
   372  	Value *[]ApplicationDefinition `json:"value,omitempty"`
   373  	// NextLink - The URL to use for getting the next set of results.
   374  	NextLink *string `json:"nextLink,omitempty"`
   375  }
   376  
   377  // ApplicationDefinitionListResultIterator provides access to a complete listing of ApplicationDefinition
   378  // values.
   379  type ApplicationDefinitionListResultIterator struct {
   380  	i    int
   381  	page ApplicationDefinitionListResultPage
   382  }
   383  
   384  // NextWithContext advances to the next value.  If there was an error making
   385  // the request the iterator does not advance and the error is returned.
   386  func (iter *ApplicationDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) {
   387  	if tracing.IsEnabled() {
   388  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationDefinitionListResultIterator.NextWithContext")
   389  		defer func() {
   390  			sc := -1
   391  			if iter.Response().Response.Response != nil {
   392  				sc = iter.Response().Response.Response.StatusCode
   393  			}
   394  			tracing.EndSpan(ctx, sc, err)
   395  		}()
   396  	}
   397  	iter.i++
   398  	if iter.i < len(iter.page.Values()) {
   399  		return nil
   400  	}
   401  	err = iter.page.NextWithContext(ctx)
   402  	if err != nil {
   403  		iter.i--
   404  		return err
   405  	}
   406  	iter.i = 0
   407  	return nil
   408  }
   409  
   410  // Next advances to the next value.  If there was an error making
   411  // the request the iterator does not advance and the error is returned.
   412  // Deprecated: Use NextWithContext() instead.
   413  func (iter *ApplicationDefinitionListResultIterator) Next() error {
   414  	return iter.NextWithContext(context.Background())
   415  }
   416  
   417  // NotDone returns true if the enumeration should be started or is not yet complete.
   418  func (iter ApplicationDefinitionListResultIterator) NotDone() bool {
   419  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   420  }
   421  
   422  // Response returns the raw server response from the last page request.
   423  func (iter ApplicationDefinitionListResultIterator) Response() ApplicationDefinitionListResult {
   424  	return iter.page.Response()
   425  }
   426  
   427  // Value returns the current value or a zero-initialized value if the
   428  // iterator has advanced beyond the end of the collection.
   429  func (iter ApplicationDefinitionListResultIterator) Value() ApplicationDefinition {
   430  	if !iter.page.NotDone() {
   431  		return ApplicationDefinition{}
   432  	}
   433  	return iter.page.Values()[iter.i]
   434  }
   435  
   436  // Creates a new instance of the ApplicationDefinitionListResultIterator type.
   437  func NewApplicationDefinitionListResultIterator(page ApplicationDefinitionListResultPage) ApplicationDefinitionListResultIterator {
   438  	return ApplicationDefinitionListResultIterator{page: page}
   439  }
   440  
   441  // IsEmpty returns true if the ListResult contains no values.
   442  func (adlr ApplicationDefinitionListResult) IsEmpty() bool {
   443  	return adlr.Value == nil || len(*adlr.Value) == 0
   444  }
   445  
   446  // hasNextLink returns true if the NextLink is not empty.
   447  func (adlr ApplicationDefinitionListResult) hasNextLink() bool {
   448  	return adlr.NextLink != nil && len(*adlr.NextLink) != 0
   449  }
   450  
   451  // applicationDefinitionListResultPreparer prepares a request to retrieve the next set of results.
   452  // It returns nil if no more results exist.
   453  func (adlr ApplicationDefinitionListResult) applicationDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) {
   454  	if !adlr.hasNextLink() {
   455  		return nil, nil
   456  	}
   457  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   458  		autorest.AsJSON(),
   459  		autorest.AsGet(),
   460  		autorest.WithBaseURL(to.String(adlr.NextLink)))
   461  }
   462  
   463  // ApplicationDefinitionListResultPage contains a page of ApplicationDefinition values.
   464  type ApplicationDefinitionListResultPage struct {
   465  	fn   func(context.Context, ApplicationDefinitionListResult) (ApplicationDefinitionListResult, error)
   466  	adlr ApplicationDefinitionListResult
   467  }
   468  
   469  // NextWithContext advances to the next page of values.  If there was an error making
   470  // the request the page does not advance and the error is returned.
   471  func (page *ApplicationDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) {
   472  	if tracing.IsEnabled() {
   473  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationDefinitionListResultPage.NextWithContext")
   474  		defer func() {
   475  			sc := -1
   476  			if page.Response().Response.Response != nil {
   477  				sc = page.Response().Response.Response.StatusCode
   478  			}
   479  			tracing.EndSpan(ctx, sc, err)
   480  		}()
   481  	}
   482  	for {
   483  		next, err := page.fn(ctx, page.adlr)
   484  		if err != nil {
   485  			return err
   486  		}
   487  		page.adlr = next
   488  		if !next.hasNextLink() || !next.IsEmpty() {
   489  			break
   490  		}
   491  	}
   492  	return nil
   493  }
   494  
   495  // Next advances to the next page of values.  If there was an error making
   496  // the request the page does not advance and the error is returned.
   497  // Deprecated: Use NextWithContext() instead.
   498  func (page *ApplicationDefinitionListResultPage) Next() error {
   499  	return page.NextWithContext(context.Background())
   500  }
   501  
   502  // NotDone returns true if the page enumeration should be started or is not yet complete.
   503  func (page ApplicationDefinitionListResultPage) NotDone() bool {
   504  	return !page.adlr.IsEmpty()
   505  }
   506  
   507  // Response returns the raw server response from the last page request.
   508  func (page ApplicationDefinitionListResultPage) Response() ApplicationDefinitionListResult {
   509  	return page.adlr
   510  }
   511  
   512  // Values returns the slice of values for the current page or nil if there are no values.
   513  func (page ApplicationDefinitionListResultPage) Values() []ApplicationDefinition {
   514  	if page.adlr.IsEmpty() {
   515  		return nil
   516  	}
   517  	return *page.adlr.Value
   518  }
   519  
   520  // Creates a new instance of the ApplicationDefinitionListResultPage type.
   521  func NewApplicationDefinitionListResultPage(cur ApplicationDefinitionListResult, getNextPage func(context.Context, ApplicationDefinitionListResult) (ApplicationDefinitionListResult, error)) ApplicationDefinitionListResultPage {
   522  	return ApplicationDefinitionListResultPage{
   523  		fn:   getNextPage,
   524  		adlr: cur,
   525  	}
   526  }
   527  
   528  // ApplicationDefinitionPatchable information about an application definition request.
   529  type ApplicationDefinitionPatchable struct {
   530  	// Tags - Application definition tags
   531  	Tags map[string]*string `json:"tags"`
   532  }
   533  
   534  // MarshalJSON is the custom marshaler for ApplicationDefinitionPatchable.
   535  func (adp ApplicationDefinitionPatchable) MarshalJSON() ([]byte, error) {
   536  	objectMap := make(map[string]interface{})
   537  	if adp.Tags != nil {
   538  		objectMap["tags"] = adp.Tags
   539  	}
   540  	return json.Marshal(objectMap)
   541  }
   542  
   543  // ApplicationDefinitionProperties the managed application definition properties.
   544  type ApplicationDefinitionProperties struct {
   545  	// LockLevel - The managed application lock level. Possible values include: 'CanNotDelete', 'ReadOnly', 'None'
   546  	LockLevel ApplicationLockLevel `json:"lockLevel,omitempty"`
   547  	// DisplayName - The managed application definition display name.
   548  	DisplayName *string `json:"displayName,omitempty"`
   549  	// IsEnabled - A value indicating whether the package is enabled or not.
   550  	IsEnabled *bool `json:"isEnabled,omitempty"`
   551  	// Authorizations - The managed application provider authorizations.
   552  	Authorizations *[]ApplicationAuthorization `json:"authorizations,omitempty"`
   553  	// Artifacts - The collection of managed application artifacts. The portal will use the files specified as artifacts to construct the user experience of creating a managed application from a managed application definition.
   554  	Artifacts *[]ApplicationDefinitionArtifact `json:"artifacts,omitempty"`
   555  	// Description - The managed application definition description.
   556  	Description *string `json:"description,omitempty"`
   557  	// PackageFileURI - The managed application definition package file Uri. Use this element
   558  	PackageFileURI *string `json:"packageFileUri,omitempty"`
   559  	// MainTemplate - The inline main template json which has resources to be provisioned. It can be a JObject or well-formed JSON string.
   560  	MainTemplate interface{} `json:"mainTemplate,omitempty"`
   561  	// CreateUIDefinition - The createUiDefinition json for the backing template with Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string.
   562  	CreateUIDefinition interface{} `json:"createUiDefinition,omitempty"`
   563  	// Policies - The managed application provider policies.
   564  	Policies *[]ApplicationPolicy `json:"policies,omitempty"`
   565  }
   566  
   567  // ApplicationJitAccessPolicy managed application Jit access policy.
   568  type ApplicationJitAccessPolicy struct {
   569  	// JitAccessEnabled - Whether the JIT access is enabled.
   570  	JitAccessEnabled *bool `json:"jitAccessEnabled,omitempty"`
   571  	// JitApprovalMode - JIT approval mode. Possible values include: 'JitApprovalModeNotSpecified', 'JitApprovalModeAutoApprove', 'JitApprovalModeManualApprove'
   572  	JitApprovalMode JitApprovalMode `json:"jitApprovalMode,omitempty"`
   573  	// JitApprovers - The JIT approvers
   574  	JitApprovers *[]JitApproverDefinition `json:"jitApprovers,omitempty"`
   575  	// MaximumJitAccessDuration - The maximum duration JIT access is granted. This is an ISO8601 time period value.
   576  	MaximumJitAccessDuration *string `json:"maximumJitAccessDuration,omitempty"`
   577  }
   578  
   579  // ApplicationListResult list of managed applications.
   580  type ApplicationListResult struct {
   581  	autorest.Response `json:"-"`
   582  	// Value - The array of managed applications.
   583  	Value *[]Application `json:"value,omitempty"`
   584  	// NextLink - The URL to use for getting the next set of results.
   585  	NextLink *string `json:"nextLink,omitempty"`
   586  }
   587  
   588  // ApplicationListResultIterator provides access to a complete listing of Application values.
   589  type ApplicationListResultIterator struct {
   590  	i    int
   591  	page ApplicationListResultPage
   592  }
   593  
   594  // NextWithContext advances to the next value.  If there was an error making
   595  // the request the iterator does not advance and the error is returned.
   596  func (iter *ApplicationListResultIterator) NextWithContext(ctx context.Context) (err error) {
   597  	if tracing.IsEnabled() {
   598  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListResultIterator.NextWithContext")
   599  		defer func() {
   600  			sc := -1
   601  			if iter.Response().Response.Response != nil {
   602  				sc = iter.Response().Response.Response.StatusCode
   603  			}
   604  			tracing.EndSpan(ctx, sc, err)
   605  		}()
   606  	}
   607  	iter.i++
   608  	if iter.i < len(iter.page.Values()) {
   609  		return nil
   610  	}
   611  	err = iter.page.NextWithContext(ctx)
   612  	if err != nil {
   613  		iter.i--
   614  		return err
   615  	}
   616  	iter.i = 0
   617  	return nil
   618  }
   619  
   620  // Next advances to the next value.  If there was an error making
   621  // the request the iterator does not advance and the error is returned.
   622  // Deprecated: Use NextWithContext() instead.
   623  func (iter *ApplicationListResultIterator) Next() error {
   624  	return iter.NextWithContext(context.Background())
   625  }
   626  
   627  // NotDone returns true if the enumeration should be started or is not yet complete.
   628  func (iter ApplicationListResultIterator) NotDone() bool {
   629  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   630  }
   631  
   632  // Response returns the raw server response from the last page request.
   633  func (iter ApplicationListResultIterator) Response() ApplicationListResult {
   634  	return iter.page.Response()
   635  }
   636  
   637  // Value returns the current value or a zero-initialized value if the
   638  // iterator has advanced beyond the end of the collection.
   639  func (iter ApplicationListResultIterator) Value() Application {
   640  	if !iter.page.NotDone() {
   641  		return Application{}
   642  	}
   643  	return iter.page.Values()[iter.i]
   644  }
   645  
   646  // Creates a new instance of the ApplicationListResultIterator type.
   647  func NewApplicationListResultIterator(page ApplicationListResultPage) ApplicationListResultIterator {
   648  	return ApplicationListResultIterator{page: page}
   649  }
   650  
   651  // IsEmpty returns true if the ListResult contains no values.
   652  func (alr ApplicationListResult) IsEmpty() bool {
   653  	return alr.Value == nil || len(*alr.Value) == 0
   654  }
   655  
   656  // hasNextLink returns true if the NextLink is not empty.
   657  func (alr ApplicationListResult) hasNextLink() bool {
   658  	return alr.NextLink != nil && len(*alr.NextLink) != 0
   659  }
   660  
   661  // applicationListResultPreparer prepares a request to retrieve the next set of results.
   662  // It returns nil if no more results exist.
   663  func (alr ApplicationListResult) applicationListResultPreparer(ctx context.Context) (*http.Request, error) {
   664  	if !alr.hasNextLink() {
   665  		return nil, nil
   666  	}
   667  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   668  		autorest.AsJSON(),
   669  		autorest.AsGet(),
   670  		autorest.WithBaseURL(to.String(alr.NextLink)))
   671  }
   672  
   673  // ApplicationListResultPage contains a page of Application values.
   674  type ApplicationListResultPage struct {
   675  	fn  func(context.Context, ApplicationListResult) (ApplicationListResult, error)
   676  	alr ApplicationListResult
   677  }
   678  
   679  // NextWithContext advances to the next page of values.  If there was an error making
   680  // the request the page does not advance and the error is returned.
   681  func (page *ApplicationListResultPage) NextWithContext(ctx context.Context) (err error) {
   682  	if tracing.IsEnabled() {
   683  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListResultPage.NextWithContext")
   684  		defer func() {
   685  			sc := -1
   686  			if page.Response().Response.Response != nil {
   687  				sc = page.Response().Response.Response.StatusCode
   688  			}
   689  			tracing.EndSpan(ctx, sc, err)
   690  		}()
   691  	}
   692  	for {
   693  		next, err := page.fn(ctx, page.alr)
   694  		if err != nil {
   695  			return err
   696  		}
   697  		page.alr = next
   698  		if !next.hasNextLink() || !next.IsEmpty() {
   699  			break
   700  		}
   701  	}
   702  	return nil
   703  }
   704  
   705  // Next advances to the next page of values.  If there was an error making
   706  // the request the page does not advance and the error is returned.
   707  // Deprecated: Use NextWithContext() instead.
   708  func (page *ApplicationListResultPage) Next() error {
   709  	return page.NextWithContext(context.Background())
   710  }
   711  
   712  // NotDone returns true if the page enumeration should be started or is not yet complete.
   713  func (page ApplicationListResultPage) NotDone() bool {
   714  	return !page.alr.IsEmpty()
   715  }
   716  
   717  // Response returns the raw server response from the last page request.
   718  func (page ApplicationListResultPage) Response() ApplicationListResult {
   719  	return page.alr
   720  }
   721  
   722  // Values returns the slice of values for the current page or nil if there are no values.
   723  func (page ApplicationListResultPage) Values() []Application {
   724  	if page.alr.IsEmpty() {
   725  		return nil
   726  	}
   727  	return *page.alr.Value
   728  }
   729  
   730  // Creates a new instance of the ApplicationListResultPage type.
   731  func NewApplicationListResultPage(cur ApplicationListResult, getNextPage func(context.Context, ApplicationListResult) (ApplicationListResult, error)) ApplicationListResultPage {
   732  	return ApplicationListResultPage{
   733  		fn:  getNextPage,
   734  		alr: cur,
   735  	}
   736  }
   737  
   738  // ApplicationPackageContact the application package contact information.
   739  type ApplicationPackageContact struct {
   740  	// ContactName - The contact name.
   741  	ContactName *string `json:"contactName,omitempty"`
   742  	// Email - The contact email.
   743  	Email *string `json:"email,omitempty"`
   744  	// Phone - The contact phone number.
   745  	Phone *string `json:"phone,omitempty"`
   746  }
   747  
   748  // ApplicationPackageSupportUrls the appliance package support URLs.
   749  type ApplicationPackageSupportUrls struct {
   750  	// PublicAzure - The public azure support URL.
   751  	PublicAzure *string `json:"publicAzure,omitempty"`
   752  	// GovernmentCloud - The government cloud support URL.
   753  	GovernmentCloud *string `json:"governmentCloud,omitempty"`
   754  }
   755  
   756  // ApplicationPatchable information about managed application.
   757  type ApplicationPatchable struct {
   758  	autorest.Response `json:"-"`
   759  	// ApplicationProperties - The managed application properties.
   760  	*ApplicationProperties `json:"properties,omitempty"`
   761  	// Plan - The plan information.
   762  	Plan *PlanPatchable `json:"plan,omitempty"`
   763  	// Kind - The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog.
   764  	Kind *string `json:"kind,omitempty"`
   765  	// Identity - The identity of the resource.
   766  	Identity *Identity `json:"identity,omitempty"`
   767  	// ManagedBy - ID of the resource that manages this resource.
   768  	ManagedBy *string `json:"managedBy,omitempty"`
   769  	// Sku - The SKU of the resource.
   770  	Sku *Sku `json:"sku,omitempty"`
   771  	// ID - READ-ONLY; Resource ID
   772  	ID *string `json:"id,omitempty"`
   773  	// Name - READ-ONLY; Resource name
   774  	Name *string `json:"name,omitempty"`
   775  	// Type - READ-ONLY; Resource type
   776  	Type *string `json:"type,omitempty"`
   777  	// Location - Resource location
   778  	Location *string `json:"location,omitempty"`
   779  	// Tags - Resource tags
   780  	Tags map[string]*string `json:"tags"`
   781  }
   782  
   783  // MarshalJSON is the custom marshaler for ApplicationPatchable.
   784  func (ap ApplicationPatchable) MarshalJSON() ([]byte, error) {
   785  	objectMap := make(map[string]interface{})
   786  	if ap.ApplicationProperties != nil {
   787  		objectMap["properties"] = ap.ApplicationProperties
   788  	}
   789  	if ap.Plan != nil {
   790  		objectMap["plan"] = ap.Plan
   791  	}
   792  	if ap.Kind != nil {
   793  		objectMap["kind"] = ap.Kind
   794  	}
   795  	if ap.Identity != nil {
   796  		objectMap["identity"] = ap.Identity
   797  	}
   798  	if ap.ManagedBy != nil {
   799  		objectMap["managedBy"] = ap.ManagedBy
   800  	}
   801  	if ap.Sku != nil {
   802  		objectMap["sku"] = ap.Sku
   803  	}
   804  	if ap.Location != nil {
   805  		objectMap["location"] = ap.Location
   806  	}
   807  	if ap.Tags != nil {
   808  		objectMap["tags"] = ap.Tags
   809  	}
   810  	return json.Marshal(objectMap)
   811  }
   812  
   813  // UnmarshalJSON is the custom unmarshaler for ApplicationPatchable struct.
   814  func (ap *ApplicationPatchable) UnmarshalJSON(body []byte) error {
   815  	var m map[string]*json.RawMessage
   816  	err := json.Unmarshal(body, &m)
   817  	if err != nil {
   818  		return err
   819  	}
   820  	for k, v := range m {
   821  		switch k {
   822  		case "properties":
   823  			if v != nil {
   824  				var applicationProperties ApplicationProperties
   825  				err = json.Unmarshal(*v, &applicationProperties)
   826  				if err != nil {
   827  					return err
   828  				}
   829  				ap.ApplicationProperties = &applicationProperties
   830  			}
   831  		case "plan":
   832  			if v != nil {
   833  				var plan PlanPatchable
   834  				err = json.Unmarshal(*v, &plan)
   835  				if err != nil {
   836  					return err
   837  				}
   838  				ap.Plan = &plan
   839  			}
   840  		case "kind":
   841  			if v != nil {
   842  				var kind string
   843  				err = json.Unmarshal(*v, &kind)
   844  				if err != nil {
   845  					return err
   846  				}
   847  				ap.Kind = &kind
   848  			}
   849  		case "identity":
   850  			if v != nil {
   851  				var identity Identity
   852  				err = json.Unmarshal(*v, &identity)
   853  				if err != nil {
   854  					return err
   855  				}
   856  				ap.Identity = &identity
   857  			}
   858  		case "managedBy":
   859  			if v != nil {
   860  				var managedBy string
   861  				err = json.Unmarshal(*v, &managedBy)
   862  				if err != nil {
   863  					return err
   864  				}
   865  				ap.ManagedBy = &managedBy
   866  			}
   867  		case "sku":
   868  			if v != nil {
   869  				var sku Sku
   870  				err = json.Unmarshal(*v, &sku)
   871  				if err != nil {
   872  					return err
   873  				}
   874  				ap.Sku = &sku
   875  			}
   876  		case "id":
   877  			if v != nil {
   878  				var ID string
   879  				err = json.Unmarshal(*v, &ID)
   880  				if err != nil {
   881  					return err
   882  				}
   883  				ap.ID = &ID
   884  			}
   885  		case "name":
   886  			if v != nil {
   887  				var name string
   888  				err = json.Unmarshal(*v, &name)
   889  				if err != nil {
   890  					return err
   891  				}
   892  				ap.Name = &name
   893  			}
   894  		case "type":
   895  			if v != nil {
   896  				var typeVar string
   897  				err = json.Unmarshal(*v, &typeVar)
   898  				if err != nil {
   899  					return err
   900  				}
   901  				ap.Type = &typeVar
   902  			}
   903  		case "location":
   904  			if v != nil {
   905  				var location string
   906  				err = json.Unmarshal(*v, &location)
   907  				if err != nil {
   908  					return err
   909  				}
   910  				ap.Location = &location
   911  			}
   912  		case "tags":
   913  			if v != nil {
   914  				var tags map[string]*string
   915  				err = json.Unmarshal(*v, &tags)
   916  				if err != nil {
   917  					return err
   918  				}
   919  				ap.Tags = tags
   920  			}
   921  		}
   922  	}
   923  
   924  	return nil
   925  }
   926  
   927  // ApplicationPolicy managed application policy.
   928  type ApplicationPolicy struct {
   929  	// Name - The policy name
   930  	Name *string `json:"name,omitempty"`
   931  	// PolicyDefinitionID - The policy definition Id.
   932  	PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"`
   933  	// Parameters - The policy parameters.
   934  	Parameters *string `json:"parameters,omitempty"`
   935  }
   936  
   937  // ApplicationProperties the managed application properties.
   938  type ApplicationProperties struct {
   939  	// ManagedResourceGroupID - The managed resource group Id.
   940  	ManagedResourceGroupID *string `json:"managedResourceGroupId,omitempty"`
   941  	// ApplicationDefinitionID - The fully qualified path of managed application definition Id.
   942  	ApplicationDefinitionID *string `json:"applicationDefinitionId,omitempty"`
   943  	// PublisherPackageID - The publisher package Id.
   944  	PublisherPackageID *string `json:"publisherPackageId,omitempty"`
   945  	// Parameters - Name and value pairs that define the managed application parameters. It can be a JObject or a well formed JSON string.
   946  	Parameters interface{} `json:"parameters,omitempty"`
   947  	// Outputs - READ-ONLY; Name and value pairs that define the managed application outputs.
   948  	Outputs interface{} `json:"outputs,omitempty"`
   949  	// ProvisioningState - READ-ONLY; The managed application provisioning state. Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateReady', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating'
   950  	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
   951  	// BillingDetails - READ-ONLY; The managed application billing details.
   952  	BillingDetails *ApplicationBillingDetailsDefinition `json:"billingDetails,omitempty"`
   953  	// JitAccessPolicy - The managed application Jit access policy.
   954  	JitAccessPolicy *ApplicationJitAccessPolicy `json:"jitAccessPolicy,omitempty"`
   955  	// PublisherTenantID - READ-ONLY; The publisher tenant Id.
   956  	PublisherTenantID *string `json:"publisherTenantId,omitempty"`
   957  	// Authorizations - READ-ONLY; The  read-only authorizations property that is retrieved from the application package.
   958  	Authorizations *[]ApplicationAuthorization `json:"authorizations,omitempty"`
   959  	// CustomerSupport - READ-ONLY; The read-only customer support property that is retrieved from the application package.
   960  	CustomerSupport *ApplicationPackageContact `json:"customerSupport,omitempty"`
   961  	// SupportUrls - READ-ONLY; The read-only support URLs property that is retrieved from the application package.
   962  	SupportUrls *ApplicationPackageSupportUrls `json:"supportUrls,omitempty"`
   963  	// Artifacts - READ-ONLY; The collection of managed application artifacts.
   964  	Artifacts *[]ApplicationArtifact `json:"artifacts,omitempty"`
   965  	// CreatedBy - READ-ONLY; The client entity that created the JIT request.
   966  	CreatedBy *ApplicationClientDetails `json:"createdBy,omitempty"`
   967  	// UpdatedBy - READ-ONLY; The client entity that last updated the JIT request.
   968  	UpdatedBy *ApplicationClientDetails `json:"updatedBy,omitempty"`
   969  }
   970  
   971  // MarshalJSON is the custom marshaler for ApplicationProperties.
   972  func (ap ApplicationProperties) MarshalJSON() ([]byte, error) {
   973  	objectMap := make(map[string]interface{})
   974  	if ap.ManagedResourceGroupID != nil {
   975  		objectMap["managedResourceGroupId"] = ap.ManagedResourceGroupID
   976  	}
   977  	if ap.ApplicationDefinitionID != nil {
   978  		objectMap["applicationDefinitionId"] = ap.ApplicationDefinitionID
   979  	}
   980  	if ap.PublisherPackageID != nil {
   981  		objectMap["publisherPackageId"] = ap.PublisherPackageID
   982  	}
   983  	if ap.Parameters != nil {
   984  		objectMap["parameters"] = ap.Parameters
   985  	}
   986  	if ap.JitAccessPolicy != nil {
   987  		objectMap["jitAccessPolicy"] = ap.JitAccessPolicy
   988  	}
   989  	return json.Marshal(objectMap)
   990  }
   991  
   992  // ApplicationPropertiesPatchable the managed application properties.
   993  type ApplicationPropertiesPatchable struct {
   994  	// ManagedResourceGroupID - The managed resource group Id.
   995  	ManagedResourceGroupID *string `json:"managedResourceGroupId,omitempty"`
   996  	// ApplicationDefinitionID - The fully qualified path of managed application definition Id.
   997  	ApplicationDefinitionID *string `json:"applicationDefinitionId,omitempty"`
   998  	// Parameters - Name and value pairs that define the managed application parameters. It can be a JObject or a well formed JSON string.
   999  	Parameters interface{} `json:"parameters,omitempty"`
  1000  	// Outputs - READ-ONLY; Name and value pairs that define the managed application outputs.
  1001  	Outputs interface{} `json:"outputs,omitempty"`
  1002  	// ProvisioningState - READ-ONLY; The managed application provisioning state. Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateReady', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating'
  1003  	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
  1004  }
  1005  
  1006  // MarshalJSON is the custom marshaler for ApplicationPropertiesPatchable.
  1007  func (app ApplicationPropertiesPatchable) MarshalJSON() ([]byte, error) {
  1008  	objectMap := make(map[string]interface{})
  1009  	if app.ManagedResourceGroupID != nil {
  1010  		objectMap["managedResourceGroupId"] = app.ManagedResourceGroupID
  1011  	}
  1012  	if app.ApplicationDefinitionID != nil {
  1013  		objectMap["applicationDefinitionId"] = app.ApplicationDefinitionID
  1014  	}
  1015  	if app.Parameters != nil {
  1016  		objectMap["parameters"] = app.Parameters
  1017  	}
  1018  	return json.Marshal(objectMap)
  1019  }
  1020  
  1021  // ApplicationsCreateOrUpdateByIDFuture an abstraction for monitoring and retrieving the results of a
  1022  // long-running operation.
  1023  type ApplicationsCreateOrUpdateByIDFuture struct {
  1024  	azure.FutureAPI
  1025  	// Result returns the result of the asynchronous operation.
  1026  	// If the operation has not completed it will return an error.
  1027  	Result func(ApplicationsClient) (Application, error)
  1028  }
  1029  
  1030  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1031  func (future *ApplicationsCreateOrUpdateByIDFuture) UnmarshalJSON(body []byte) error {
  1032  	var azFuture azure.Future
  1033  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1034  		return err
  1035  	}
  1036  	future.FutureAPI = &azFuture
  1037  	future.Result = future.result
  1038  	return nil
  1039  }
  1040  
  1041  // result is the default implementation for ApplicationsCreateOrUpdateByIDFuture.Result.
  1042  func (future *ApplicationsCreateOrUpdateByIDFuture) result(client ApplicationsClient) (a Application, err error) {
  1043  	var done bool
  1044  	done, err = future.DoneWithContext(context.Background(), client)
  1045  	if err != nil {
  1046  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateByIDFuture", "Result", future.Response(), "Polling failure")
  1047  		return
  1048  	}
  1049  	if !done {
  1050  		a.Response.Response = future.Response()
  1051  		err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsCreateOrUpdateByIDFuture")
  1052  		return
  1053  	}
  1054  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1055  	if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
  1056  		a, err = client.CreateOrUpdateByIDResponder(a.Response.Response)
  1057  		if err != nil {
  1058  			err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateByIDFuture", "Result", a.Response.Response, "Failure responding to request")
  1059  		}
  1060  	}
  1061  	return
  1062  }
  1063  
  1064  // ApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  1065  // long-running operation.
  1066  type ApplicationsCreateOrUpdateFuture struct {
  1067  	azure.FutureAPI
  1068  	// Result returns the result of the asynchronous operation.
  1069  	// If the operation has not completed it will return an error.
  1070  	Result func(ApplicationsClient) (Application, error)
  1071  }
  1072  
  1073  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1074  func (future *ApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  1075  	var azFuture azure.Future
  1076  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1077  		return err
  1078  	}
  1079  	future.FutureAPI = &azFuture
  1080  	future.Result = future.result
  1081  	return nil
  1082  }
  1083  
  1084  // result is the default implementation for ApplicationsCreateOrUpdateFuture.Result.
  1085  func (future *ApplicationsCreateOrUpdateFuture) result(client ApplicationsClient) (a Application, err error) {
  1086  	var done bool
  1087  	done, err = future.DoneWithContext(context.Background(), client)
  1088  	if err != nil {
  1089  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  1090  		return
  1091  	}
  1092  	if !done {
  1093  		a.Response.Response = future.Response()
  1094  		err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsCreateOrUpdateFuture")
  1095  		return
  1096  	}
  1097  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1098  	if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
  1099  		a, err = client.CreateOrUpdateResponder(a.Response.Response)
  1100  		if err != nil {
  1101  			err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateFuture", "Result", a.Response.Response, "Failure responding to request")
  1102  		}
  1103  	}
  1104  	return
  1105  }
  1106  
  1107  // ApplicationsDeleteByIDFuture an abstraction for monitoring and retrieving the results of a long-running
  1108  // operation.
  1109  type ApplicationsDeleteByIDFuture struct {
  1110  	azure.FutureAPI
  1111  	// Result returns the result of the asynchronous operation.
  1112  	// If the operation has not completed it will return an error.
  1113  	Result func(ApplicationsClient) (autorest.Response, error)
  1114  }
  1115  
  1116  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1117  func (future *ApplicationsDeleteByIDFuture) UnmarshalJSON(body []byte) error {
  1118  	var azFuture azure.Future
  1119  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1120  		return err
  1121  	}
  1122  	future.FutureAPI = &azFuture
  1123  	future.Result = future.result
  1124  	return nil
  1125  }
  1126  
  1127  // result is the default implementation for ApplicationsDeleteByIDFuture.Result.
  1128  func (future *ApplicationsDeleteByIDFuture) result(client ApplicationsClient) (ar autorest.Response, err error) {
  1129  	var done bool
  1130  	done, err = future.DoneWithContext(context.Background(), client)
  1131  	if err != nil {
  1132  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsDeleteByIDFuture", "Result", future.Response(), "Polling failure")
  1133  		return
  1134  	}
  1135  	if !done {
  1136  		ar.Response = future.Response()
  1137  		err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsDeleteByIDFuture")
  1138  		return
  1139  	}
  1140  	ar.Response = future.Response()
  1141  	return
  1142  }
  1143  
  1144  // ApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  1145  // operation.
  1146  type ApplicationsDeleteFuture struct {
  1147  	azure.FutureAPI
  1148  	// Result returns the result of the asynchronous operation.
  1149  	// If the operation has not completed it will return an error.
  1150  	Result func(ApplicationsClient) (autorest.Response, error)
  1151  }
  1152  
  1153  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1154  func (future *ApplicationsDeleteFuture) UnmarshalJSON(body []byte) error {
  1155  	var azFuture azure.Future
  1156  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1157  		return err
  1158  	}
  1159  	future.FutureAPI = &azFuture
  1160  	future.Result = future.result
  1161  	return nil
  1162  }
  1163  
  1164  // result is the default implementation for ApplicationsDeleteFuture.Result.
  1165  func (future *ApplicationsDeleteFuture) result(client ApplicationsClient) (ar autorest.Response, err error) {
  1166  	var done bool
  1167  	done, err = future.DoneWithContext(context.Background(), client)
  1168  	if err != nil {
  1169  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsDeleteFuture", "Result", future.Response(), "Polling failure")
  1170  		return
  1171  	}
  1172  	if !done {
  1173  		ar.Response = future.Response()
  1174  		err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsDeleteFuture")
  1175  		return
  1176  	}
  1177  	ar.Response = future.Response()
  1178  	return
  1179  }
  1180  
  1181  // ApplicationsRefreshPermissionsFuture an abstraction for monitoring and retrieving the results of a
  1182  // long-running operation.
  1183  type ApplicationsRefreshPermissionsFuture struct {
  1184  	azure.FutureAPI
  1185  	// Result returns the result of the asynchronous operation.
  1186  	// If the operation has not completed it will return an error.
  1187  	Result func(ApplicationsClient) (autorest.Response, error)
  1188  }
  1189  
  1190  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1191  func (future *ApplicationsRefreshPermissionsFuture) UnmarshalJSON(body []byte) error {
  1192  	var azFuture azure.Future
  1193  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1194  		return err
  1195  	}
  1196  	future.FutureAPI = &azFuture
  1197  	future.Result = future.result
  1198  	return nil
  1199  }
  1200  
  1201  // result is the default implementation for ApplicationsRefreshPermissionsFuture.Result.
  1202  func (future *ApplicationsRefreshPermissionsFuture) result(client ApplicationsClient) (ar autorest.Response, err error) {
  1203  	var done bool
  1204  	done, err = future.DoneWithContext(context.Background(), client)
  1205  	if err != nil {
  1206  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsRefreshPermissionsFuture", "Result", future.Response(), "Polling failure")
  1207  		return
  1208  	}
  1209  	if !done {
  1210  		ar.Response = future.Response()
  1211  		err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsRefreshPermissionsFuture")
  1212  		return
  1213  	}
  1214  	ar.Response = future.Response()
  1215  	return
  1216  }
  1217  
  1218  // ApplicationsUpdateAccessFuture an abstraction for monitoring and retrieving the results of a
  1219  // long-running operation.
  1220  type ApplicationsUpdateAccessFuture struct {
  1221  	azure.FutureAPI
  1222  	// Result returns the result of the asynchronous operation.
  1223  	// If the operation has not completed it will return an error.
  1224  	Result func(ApplicationsClient) (UpdateAccessDefinition, error)
  1225  }
  1226  
  1227  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1228  func (future *ApplicationsUpdateAccessFuture) UnmarshalJSON(body []byte) error {
  1229  	var azFuture azure.Future
  1230  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1231  		return err
  1232  	}
  1233  	future.FutureAPI = &azFuture
  1234  	future.Result = future.result
  1235  	return nil
  1236  }
  1237  
  1238  // result is the default implementation for ApplicationsUpdateAccessFuture.Result.
  1239  func (future *ApplicationsUpdateAccessFuture) result(client ApplicationsClient) (uad UpdateAccessDefinition, err error) {
  1240  	var done bool
  1241  	done, err = future.DoneWithContext(context.Background(), client)
  1242  	if err != nil {
  1243  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateAccessFuture", "Result", future.Response(), "Polling failure")
  1244  		return
  1245  	}
  1246  	if !done {
  1247  		uad.Response.Response = future.Response()
  1248  		err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsUpdateAccessFuture")
  1249  		return
  1250  	}
  1251  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1252  	if uad.Response.Response, err = future.GetResult(sender); err == nil && uad.Response.Response.StatusCode != http.StatusNoContent {
  1253  		uad, err = client.UpdateAccessResponder(uad.Response.Response)
  1254  		if err != nil {
  1255  			err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateAccessFuture", "Result", uad.Response.Response, "Failure responding to request")
  1256  		}
  1257  	}
  1258  	return
  1259  }
  1260  
  1261  // ApplicationsUpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running
  1262  // operation.
  1263  type ApplicationsUpdateByIDFuture struct {
  1264  	azure.FutureAPI
  1265  	// Result returns the result of the asynchronous operation.
  1266  	// If the operation has not completed it will return an error.
  1267  	Result func(ApplicationsClient) (ApplicationPatchable, error)
  1268  }
  1269  
  1270  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1271  func (future *ApplicationsUpdateByIDFuture) UnmarshalJSON(body []byte) error {
  1272  	var azFuture azure.Future
  1273  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1274  		return err
  1275  	}
  1276  	future.FutureAPI = &azFuture
  1277  	future.Result = future.result
  1278  	return nil
  1279  }
  1280  
  1281  // result is the default implementation for ApplicationsUpdateByIDFuture.Result.
  1282  func (future *ApplicationsUpdateByIDFuture) result(client ApplicationsClient) (ap ApplicationPatchable, err error) {
  1283  	var done bool
  1284  	done, err = future.DoneWithContext(context.Background(), client)
  1285  	if err != nil {
  1286  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateByIDFuture", "Result", future.Response(), "Polling failure")
  1287  		return
  1288  	}
  1289  	if !done {
  1290  		ap.Response.Response = future.Response()
  1291  		err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsUpdateByIDFuture")
  1292  		return
  1293  	}
  1294  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1295  	if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
  1296  		ap, err = client.UpdateByIDResponder(ap.Response.Response)
  1297  		if err != nil {
  1298  			err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateByIDFuture", "Result", ap.Response.Response, "Failure responding to request")
  1299  		}
  1300  	}
  1301  	return
  1302  }
  1303  
  1304  // ApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
  1305  // operation.
  1306  type ApplicationsUpdateFuture struct {
  1307  	azure.FutureAPI
  1308  	// Result returns the result of the asynchronous operation.
  1309  	// If the operation has not completed it will return an error.
  1310  	Result func(ApplicationsClient) (ApplicationPatchable, error)
  1311  }
  1312  
  1313  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1314  func (future *ApplicationsUpdateFuture) UnmarshalJSON(body []byte) error {
  1315  	var azFuture azure.Future
  1316  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1317  		return err
  1318  	}
  1319  	future.FutureAPI = &azFuture
  1320  	future.Result = future.result
  1321  	return nil
  1322  }
  1323  
  1324  // result is the default implementation for ApplicationsUpdateFuture.Result.
  1325  func (future *ApplicationsUpdateFuture) result(client ApplicationsClient) (ap ApplicationPatchable, err error) {
  1326  	var done bool
  1327  	done, err = future.DoneWithContext(context.Background(), client)
  1328  	if err != nil {
  1329  		err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateFuture", "Result", future.Response(), "Polling failure")
  1330  		return
  1331  	}
  1332  	if !done {
  1333  		ap.Response.Response = future.Response()
  1334  		err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsUpdateFuture")
  1335  		return
  1336  	}
  1337  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1338  	if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
  1339  		ap, err = client.UpdateResponder(ap.Response.Response)
  1340  		if err != nil {
  1341  			err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateFuture", "Result", ap.Response.Response, "Failure responding to request")
  1342  		}
  1343  	}
  1344  	return
  1345  }
  1346  
  1347  // ErrorAdditionalInfo the resource management error additional info.
  1348  type ErrorAdditionalInfo struct {
  1349  	// Type - READ-ONLY; The additional info type.
  1350  	Type *string `json:"type,omitempty"`
  1351  	// Info - READ-ONLY; The additional info.
  1352  	Info interface{} `json:"info,omitempty"`
  1353  }
  1354  
  1355  // MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
  1356  func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
  1357  	objectMap := make(map[string]interface{})
  1358  	return json.Marshal(objectMap)
  1359  }
  1360  
  1361  // ErrorDetail the error detail.
  1362  type ErrorDetail struct {
  1363  	// Code - READ-ONLY; The error code.
  1364  	Code *string `json:"code,omitempty"`
  1365  	// Message - READ-ONLY; The error message.
  1366  	Message *string `json:"message,omitempty"`
  1367  	// Target - READ-ONLY; The error target.
  1368  	Target *string `json:"target,omitempty"`
  1369  	// Details - READ-ONLY; The error details.
  1370  	Details *[]ErrorDetail `json:"details,omitempty"`
  1371  	// AdditionalInfo - READ-ONLY; The error additional info.
  1372  	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
  1373  }
  1374  
  1375  // MarshalJSON is the custom marshaler for ErrorDetail.
  1376  func (ed ErrorDetail) MarshalJSON() ([]byte, error) {
  1377  	objectMap := make(map[string]interface{})
  1378  	return json.Marshal(objectMap)
  1379  }
  1380  
  1381  // ErrorResponse common error response for all Azure Resource Manager APIs to return error details for
  1382  // failed operations. (This also follows the OData error response format.).
  1383  type ErrorResponse struct {
  1384  	// Error - The error object.
  1385  	Error *ErrorDetail `json:"error,omitempty"`
  1386  }
  1387  
  1388  // GenericResource resource information.
  1389  type GenericResource struct {
  1390  	// ManagedBy - ID of the resource that manages this resource.
  1391  	ManagedBy *string `json:"managedBy,omitempty"`
  1392  	// Sku - The SKU of the resource.
  1393  	Sku *Sku `json:"sku,omitempty"`
  1394  	// ID - READ-ONLY; Resource ID
  1395  	ID *string `json:"id,omitempty"`
  1396  	// Name - READ-ONLY; Resource name
  1397  	Name *string `json:"name,omitempty"`
  1398  	// Type - READ-ONLY; Resource type
  1399  	Type *string `json:"type,omitempty"`
  1400  	// Location - Resource location
  1401  	Location *string `json:"location,omitempty"`
  1402  	// Tags - Resource tags
  1403  	Tags map[string]*string `json:"tags"`
  1404  }
  1405  
  1406  // MarshalJSON is the custom marshaler for GenericResource.
  1407  func (gr GenericResource) MarshalJSON() ([]byte, error) {
  1408  	objectMap := make(map[string]interface{})
  1409  	if gr.ManagedBy != nil {
  1410  		objectMap["managedBy"] = gr.ManagedBy
  1411  	}
  1412  	if gr.Sku != nil {
  1413  		objectMap["sku"] = gr.Sku
  1414  	}
  1415  	if gr.Location != nil {
  1416  		objectMap["location"] = gr.Location
  1417  	}
  1418  	if gr.Tags != nil {
  1419  		objectMap["tags"] = gr.Tags
  1420  	}
  1421  	return json.Marshal(objectMap)
  1422  }
  1423  
  1424  // Identity identity for the resource.
  1425  type Identity struct {
  1426  	// PrincipalID - READ-ONLY; The principal ID of resource identity.
  1427  	PrincipalID *string `json:"principalId,omitempty"`
  1428  	// TenantID - READ-ONLY; The tenant ID of resource.
  1429  	TenantID *string `json:"tenantId,omitempty"`
  1430  	// Type - The identity type. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone'
  1431  	Type ResourceIdentityType `json:"type,omitempty"`
  1432  	// UserAssignedIdentities - The list of user identities associated with the resource. The user identity dictionary key references will be resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
  1433  	UserAssignedIdentities map[string]*UserAssignedResourceIdentity `json:"userAssignedIdentities"`
  1434  }
  1435  
  1436  // MarshalJSON is the custom marshaler for Identity.
  1437  func (i Identity) MarshalJSON() ([]byte, error) {
  1438  	objectMap := make(map[string]interface{})
  1439  	if i.Type != "" {
  1440  		objectMap["type"] = i.Type
  1441  	}
  1442  	if i.UserAssignedIdentities != nil {
  1443  		objectMap["userAssignedIdentities"] = i.UserAssignedIdentities
  1444  	}
  1445  	return json.Marshal(objectMap)
  1446  }
  1447  
  1448  // JitApproverDefinition JIT approver definition.
  1449  type JitApproverDefinition struct {
  1450  	// ID - The approver service principal Id.
  1451  	ID *string `json:"id,omitempty"`
  1452  	// Type - The approver type. Possible values include: 'User', 'Group'
  1453  	Type JitApproverType `json:"type,omitempty"`
  1454  	// DisplayName - The approver display name.
  1455  	DisplayName *string `json:"displayName,omitempty"`
  1456  }
  1457  
  1458  // JitAuthorizationPolicies the JIT authorization policies.
  1459  type JitAuthorizationPolicies struct {
  1460  	// PrincipalID - The the principal id that will be granted JIT access.
  1461  	PrincipalID *string `json:"principalId,omitempty"`
  1462  	// RoleDefinitionID - The role definition id that will be granted to the Principal.
  1463  	RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
  1464  }
  1465  
  1466  // JitRequestDefinition information about JIT request definition.
  1467  type JitRequestDefinition struct {
  1468  	autorest.Response `json:"-"`
  1469  	// JitRequestProperties - The JIT request properties.
  1470  	*JitRequestProperties `json:"properties,omitempty"`
  1471  	// ID - READ-ONLY; Resource ID
  1472  	ID *string `json:"id,omitempty"`
  1473  	// Name - READ-ONLY; Resource name
  1474  	Name *string `json:"name,omitempty"`
  1475  	// Type - READ-ONLY; Resource type
  1476  	Type *string `json:"type,omitempty"`
  1477  	// Location - Resource location
  1478  	Location *string `json:"location,omitempty"`
  1479  	// Tags - Resource tags
  1480  	Tags map[string]*string `json:"tags"`
  1481  }
  1482  
  1483  // MarshalJSON is the custom marshaler for JitRequestDefinition.
  1484  func (jrd JitRequestDefinition) MarshalJSON() ([]byte, error) {
  1485  	objectMap := make(map[string]interface{})
  1486  	if jrd.JitRequestProperties != nil {
  1487  		objectMap["properties"] = jrd.JitRequestProperties
  1488  	}
  1489  	if jrd.Location != nil {
  1490  		objectMap["location"] = jrd.Location
  1491  	}
  1492  	if jrd.Tags != nil {
  1493  		objectMap["tags"] = jrd.Tags
  1494  	}
  1495  	return json.Marshal(objectMap)
  1496  }
  1497  
  1498  // UnmarshalJSON is the custom unmarshaler for JitRequestDefinition struct.
  1499  func (jrd *JitRequestDefinition) UnmarshalJSON(body []byte) error {
  1500  	var m map[string]*json.RawMessage
  1501  	err := json.Unmarshal(body, &m)
  1502  	if err != nil {
  1503  		return err
  1504  	}
  1505  	for k, v := range m {
  1506  		switch k {
  1507  		case "properties":
  1508  			if v != nil {
  1509  				var jitRequestProperties JitRequestProperties
  1510  				err = json.Unmarshal(*v, &jitRequestProperties)
  1511  				if err != nil {
  1512  					return err
  1513  				}
  1514  				jrd.JitRequestProperties = &jitRequestProperties
  1515  			}
  1516  		case "id":
  1517  			if v != nil {
  1518  				var ID string
  1519  				err = json.Unmarshal(*v, &ID)
  1520  				if err != nil {
  1521  					return err
  1522  				}
  1523  				jrd.ID = &ID
  1524  			}
  1525  		case "name":
  1526  			if v != nil {
  1527  				var name string
  1528  				err = json.Unmarshal(*v, &name)
  1529  				if err != nil {
  1530  					return err
  1531  				}
  1532  				jrd.Name = &name
  1533  			}
  1534  		case "type":
  1535  			if v != nil {
  1536  				var typeVar string
  1537  				err = json.Unmarshal(*v, &typeVar)
  1538  				if err != nil {
  1539  					return err
  1540  				}
  1541  				jrd.Type = &typeVar
  1542  			}
  1543  		case "location":
  1544  			if v != nil {
  1545  				var location string
  1546  				err = json.Unmarshal(*v, &location)
  1547  				if err != nil {
  1548  					return err
  1549  				}
  1550  				jrd.Location = &location
  1551  			}
  1552  		case "tags":
  1553  			if v != nil {
  1554  				var tags map[string]*string
  1555  				err = json.Unmarshal(*v, &tags)
  1556  				if err != nil {
  1557  					return err
  1558  				}
  1559  				jrd.Tags = tags
  1560  			}
  1561  		}
  1562  	}
  1563  
  1564  	return nil
  1565  }
  1566  
  1567  // JitRequestDefinitionListResult list of JIT requests.
  1568  type JitRequestDefinitionListResult struct {
  1569  	autorest.Response `json:"-"`
  1570  	// Value - The array of Jit request definition.
  1571  	Value *[]JitRequestDefinition `json:"value,omitempty"`
  1572  	// NextLink - The URL to use for getting the next set of results.
  1573  	NextLink *string `json:"nextLink,omitempty"`
  1574  }
  1575  
  1576  // JitRequestMetadata the JIT request metadata.
  1577  type JitRequestMetadata struct {
  1578  	// OriginRequestID - The origin request id.
  1579  	OriginRequestID *string `json:"originRequestId,omitempty"`
  1580  	// RequestorID - The requestor id.
  1581  	RequestorID *string `json:"requestorId,omitempty"`
  1582  	// TenantDisplayName - The publisher's tenant name.
  1583  	TenantDisplayName *string `json:"tenantDisplayName,omitempty"`
  1584  	// SubjectDisplayName - The subject display name.
  1585  	SubjectDisplayName *string `json:"subjectDisplayName,omitempty"`
  1586  }
  1587  
  1588  // JitRequestPatchable information about JIT request.
  1589  type JitRequestPatchable struct {
  1590  	// Tags - Jit request tags
  1591  	Tags map[string]*string `json:"tags"`
  1592  }
  1593  
  1594  // MarshalJSON is the custom marshaler for JitRequestPatchable.
  1595  func (jrp JitRequestPatchable) MarshalJSON() ([]byte, error) {
  1596  	objectMap := make(map[string]interface{})
  1597  	if jrp.Tags != nil {
  1598  		objectMap["tags"] = jrp.Tags
  1599  	}
  1600  	return json.Marshal(objectMap)
  1601  }
  1602  
  1603  // JitRequestProperties information about JIT request properties
  1604  type JitRequestProperties struct {
  1605  	// ApplicationResourceID - The parent application id.
  1606  	ApplicationResourceID *string `json:"applicationResourceId,omitempty"`
  1607  	// PublisherTenantID - READ-ONLY; The publisher tenant id.
  1608  	PublisherTenantID *string `json:"publisherTenantId,omitempty"`
  1609  	// JitAuthorizationPolicies - The JIT authorization policies.
  1610  	JitAuthorizationPolicies *[]JitAuthorizationPolicies `json:"jitAuthorizationPolicies,omitempty"`
  1611  	// JitSchedulingPolicy - The JIT request properties.
  1612  	JitSchedulingPolicy *JitSchedulingPolicy `json:"jitSchedulingPolicy,omitempty"`
  1613  	// ProvisioningState - READ-ONLY; The JIT request provisioning state. Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateReady', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating'
  1614  	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
  1615  	// JitRequestState - READ-ONLY; The JIT request state. Possible values include: 'JitRequestStateNotSpecified', 'JitRequestStatePending', 'JitRequestStateApproved', 'JitRequestStateDenied', 'JitRequestStateFailed', 'JitRequestStateCanceled', 'JitRequestStateExpired', 'JitRequestStateTimeout'
  1616  	JitRequestState JitRequestState `json:"jitRequestState,omitempty"`
  1617  	// CreatedBy - READ-ONLY; The client entity that created the JIT request.
  1618  	CreatedBy *ApplicationClientDetails `json:"createdBy,omitempty"`
  1619  	// UpdatedBy - READ-ONLY; The client entity that last updated the JIT request.
  1620  	UpdatedBy *ApplicationClientDetails `json:"updatedBy,omitempty"`
  1621  }
  1622  
  1623  // MarshalJSON is the custom marshaler for JitRequestProperties.
  1624  func (jrp JitRequestProperties) MarshalJSON() ([]byte, error) {
  1625  	objectMap := make(map[string]interface{})
  1626  	if jrp.ApplicationResourceID != nil {
  1627  		objectMap["applicationResourceId"] = jrp.ApplicationResourceID
  1628  	}
  1629  	if jrp.JitAuthorizationPolicies != nil {
  1630  		objectMap["jitAuthorizationPolicies"] = jrp.JitAuthorizationPolicies
  1631  	}
  1632  	if jrp.JitSchedulingPolicy != nil {
  1633  		objectMap["jitSchedulingPolicy"] = jrp.JitSchedulingPolicy
  1634  	}
  1635  	return json.Marshal(objectMap)
  1636  }
  1637  
  1638  // JitRequestsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  1639  // long-running operation.
  1640  type JitRequestsCreateOrUpdateFuture struct {
  1641  	azure.FutureAPI
  1642  	// Result returns the result of the asynchronous operation.
  1643  	// If the operation has not completed it will return an error.
  1644  	Result func(JitRequestsClient) (JitRequestDefinition, error)
  1645  }
  1646  
  1647  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1648  func (future *JitRequestsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  1649  	var azFuture azure.Future
  1650  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1651  		return err
  1652  	}
  1653  	future.FutureAPI = &azFuture
  1654  	future.Result = future.result
  1655  	return nil
  1656  }
  1657  
  1658  // result is the default implementation for JitRequestsCreateOrUpdateFuture.Result.
  1659  func (future *JitRequestsCreateOrUpdateFuture) result(client JitRequestsClient) (jrd JitRequestDefinition, err error) {
  1660  	var done bool
  1661  	done, err = future.DoneWithContext(context.Background(), client)
  1662  	if err != nil {
  1663  		err = autorest.NewErrorWithError(err, "managedapplications.JitRequestsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  1664  		return
  1665  	}
  1666  	if !done {
  1667  		jrd.Response.Response = future.Response()
  1668  		err = azure.NewAsyncOpIncompleteError("managedapplications.JitRequestsCreateOrUpdateFuture")
  1669  		return
  1670  	}
  1671  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1672  	if jrd.Response.Response, err = future.GetResult(sender); err == nil && jrd.Response.Response.StatusCode != http.StatusNoContent {
  1673  		jrd, err = client.CreateOrUpdateResponder(jrd.Response.Response)
  1674  		if err != nil {
  1675  			err = autorest.NewErrorWithError(err, "managedapplications.JitRequestsCreateOrUpdateFuture", "Result", jrd.Response.Response, "Failure responding to request")
  1676  		}
  1677  	}
  1678  	return
  1679  }
  1680  
  1681  // JitSchedulingPolicy the JIT scheduling policies.
  1682  type JitSchedulingPolicy struct {
  1683  	// Type - The type of JIT schedule. Possible values include: 'JitSchedulingTypeNotSpecified', 'JitSchedulingTypeOnce', 'JitSchedulingTypeRecurring'
  1684  	Type     JitSchedulingType `json:"type,omitempty"`
  1685  	Duration *string           `json:"duration,omitempty"`
  1686  	// StartTime - The start time of the request.
  1687  	StartTime *date.Time `json:"startTime,omitempty"`
  1688  }
  1689  
  1690  // ListTokenRequest list token request body.
  1691  type ListTokenRequest struct {
  1692  	// AuthorizationAudience - The authorization audience.
  1693  	AuthorizationAudience *string `json:"authorizationAudience,omitempty"`
  1694  	// UserAssignedIdentities - The user assigned identities.
  1695  	UserAssignedIdentities *[]string `json:"userAssignedIdentities,omitempty"`
  1696  }
  1697  
  1698  // ManagedIdentityToken the managed identity token for the managed app resource.
  1699  type ManagedIdentityToken struct {
  1700  	// AccessToken - The requested access token.
  1701  	AccessToken *string `json:"accessToken,omitempty"`
  1702  	// ExpiresIn - The number of seconds the access token will be valid.
  1703  	ExpiresIn *string `json:"expiresIn,omitempty"`
  1704  	// ExpiresOn - The timespan when the access token expires. This is represented as the number of seconds from epoch.
  1705  	ExpiresOn *string `json:"expiresOn,omitempty"`
  1706  	// NotBefore - The timespan when the access token takes effect. This is represented as the number of seconds from epoch.
  1707  	NotBefore *string `json:"notBefore,omitempty"`
  1708  	// AuthorizationAudience - The aud (audience) the access token was request for. This is the same as what was provided in the listTokens request.
  1709  	AuthorizationAudience *string `json:"authorizationAudience,omitempty"`
  1710  	// ResourceID - The Azure resource ID for the issued token. This is either the managed application ID or the user-assigned identity ID.
  1711  	ResourceID *string `json:"resourceId,omitempty"`
  1712  	// TokenType - The type of the token.
  1713  	TokenType *string `json:"tokenType,omitempty"`
  1714  }
  1715  
  1716  // ManagedIdentityTokenResult the array of managed identity tokens.
  1717  type ManagedIdentityTokenResult struct {
  1718  	autorest.Response `json:"-"`
  1719  	// Value - The array of managed identity tokens.
  1720  	Value *[]ManagedIdentityToken `json:"value,omitempty"`
  1721  }
  1722  
  1723  // Operation microsoft.Solutions operation
  1724  type Operation struct {
  1725  	// Name - Operation name: {provider}/{resource}/{operation}
  1726  	Name *string `json:"name,omitempty"`
  1727  	// Display - The object that represents the operation.
  1728  	Display *OperationDisplay `json:"display,omitempty"`
  1729  }
  1730  
  1731  // OperationDisplay the object that represents the operation.
  1732  type OperationDisplay struct {
  1733  	// Provider - Service provider: Microsoft.Solutions
  1734  	Provider *string `json:"provider,omitempty"`
  1735  	// Resource - Resource on which the operation is performed: Application, JitRequest, etc.
  1736  	Resource *string `json:"resource,omitempty"`
  1737  	// Operation - Operation type: Read, write, delete, etc.
  1738  	Operation *string `json:"operation,omitempty"`
  1739  }
  1740  
  1741  // OperationListResult a list of REST API operations supported by an Azure Resource Provider. It contains
  1742  // an URL link to get the next set of results.
  1743  type OperationListResult struct {
  1744  	autorest.Response `json:"-"`
  1745  	// Value - READ-ONLY; List of operations supported by the resource provider
  1746  	Value *[]Operation `json:"value,omitempty"`
  1747  	// NextLink - READ-ONLY; URL to get the next set of operation list results (if there are any).
  1748  	NextLink *string `json:"nextLink,omitempty"`
  1749  }
  1750  
  1751  // MarshalJSON is the custom marshaler for OperationListResult.
  1752  func (olr OperationListResult) MarshalJSON() ([]byte, error) {
  1753  	objectMap := make(map[string]interface{})
  1754  	return json.Marshal(objectMap)
  1755  }
  1756  
  1757  // OperationListResultIterator provides access to a complete listing of Operation values.
  1758  type OperationListResultIterator struct {
  1759  	i    int
  1760  	page OperationListResultPage
  1761  }
  1762  
  1763  // NextWithContext advances to the next value.  If there was an error making
  1764  // the request the iterator does not advance and the error is returned.
  1765  func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1766  	if tracing.IsEnabled() {
  1767  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
  1768  		defer func() {
  1769  			sc := -1
  1770  			if iter.Response().Response.Response != nil {
  1771  				sc = iter.Response().Response.Response.StatusCode
  1772  			}
  1773  			tracing.EndSpan(ctx, sc, err)
  1774  		}()
  1775  	}
  1776  	iter.i++
  1777  	if iter.i < len(iter.page.Values()) {
  1778  		return nil
  1779  	}
  1780  	err = iter.page.NextWithContext(ctx)
  1781  	if err != nil {
  1782  		iter.i--
  1783  		return err
  1784  	}
  1785  	iter.i = 0
  1786  	return nil
  1787  }
  1788  
  1789  // Next advances to the next value.  If there was an error making
  1790  // the request the iterator does not advance and the error is returned.
  1791  // Deprecated: Use NextWithContext() instead.
  1792  func (iter *OperationListResultIterator) Next() error {
  1793  	return iter.NextWithContext(context.Background())
  1794  }
  1795  
  1796  // NotDone returns true if the enumeration should be started or is not yet complete.
  1797  func (iter OperationListResultIterator) NotDone() bool {
  1798  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1799  }
  1800  
  1801  // Response returns the raw server response from the last page request.
  1802  func (iter OperationListResultIterator) Response() OperationListResult {
  1803  	return iter.page.Response()
  1804  }
  1805  
  1806  // Value returns the current value or a zero-initialized value if the
  1807  // iterator has advanced beyond the end of the collection.
  1808  func (iter OperationListResultIterator) Value() Operation {
  1809  	if !iter.page.NotDone() {
  1810  		return Operation{}
  1811  	}
  1812  	return iter.page.Values()[iter.i]
  1813  }
  1814  
  1815  // Creates a new instance of the OperationListResultIterator type.
  1816  func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
  1817  	return OperationListResultIterator{page: page}
  1818  }
  1819  
  1820  // IsEmpty returns true if the ListResult contains no values.
  1821  func (olr OperationListResult) IsEmpty() bool {
  1822  	return olr.Value == nil || len(*olr.Value) == 0
  1823  }
  1824  
  1825  // hasNextLink returns true if the NextLink is not empty.
  1826  func (olr OperationListResult) hasNextLink() bool {
  1827  	return olr.NextLink != nil && len(*olr.NextLink) != 0
  1828  }
  1829  
  1830  // operationListResultPreparer prepares a request to retrieve the next set of results.
  1831  // It returns nil if no more results exist.
  1832  func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
  1833  	if !olr.hasNextLink() {
  1834  		return nil, nil
  1835  	}
  1836  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1837  		autorest.AsJSON(),
  1838  		autorest.AsGet(),
  1839  		autorest.WithBaseURL(to.String(olr.NextLink)))
  1840  }
  1841  
  1842  // OperationListResultPage contains a page of Operation values.
  1843  type OperationListResultPage struct {
  1844  	fn  func(context.Context, OperationListResult) (OperationListResult, error)
  1845  	olr OperationListResult
  1846  }
  1847  
  1848  // NextWithContext advances to the next page of values.  If there was an error making
  1849  // the request the page does not advance and the error is returned.
  1850  func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
  1851  	if tracing.IsEnabled() {
  1852  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
  1853  		defer func() {
  1854  			sc := -1
  1855  			if page.Response().Response.Response != nil {
  1856  				sc = page.Response().Response.Response.StatusCode
  1857  			}
  1858  			tracing.EndSpan(ctx, sc, err)
  1859  		}()
  1860  	}
  1861  	for {
  1862  		next, err := page.fn(ctx, page.olr)
  1863  		if err != nil {
  1864  			return err
  1865  		}
  1866  		page.olr = next
  1867  		if !next.hasNextLink() || !next.IsEmpty() {
  1868  			break
  1869  		}
  1870  	}
  1871  	return nil
  1872  }
  1873  
  1874  // Next advances to the next page of values.  If there was an error making
  1875  // the request the page does not advance and the error is returned.
  1876  // Deprecated: Use NextWithContext() instead.
  1877  func (page *OperationListResultPage) Next() error {
  1878  	return page.NextWithContext(context.Background())
  1879  }
  1880  
  1881  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1882  func (page OperationListResultPage) NotDone() bool {
  1883  	return !page.olr.IsEmpty()
  1884  }
  1885  
  1886  // Response returns the raw server response from the last page request.
  1887  func (page OperationListResultPage) Response() OperationListResult {
  1888  	return page.olr
  1889  }
  1890  
  1891  // Values returns the slice of values for the current page or nil if there are no values.
  1892  func (page OperationListResultPage) Values() []Operation {
  1893  	if page.olr.IsEmpty() {
  1894  		return nil
  1895  	}
  1896  	return *page.olr.Value
  1897  }
  1898  
  1899  // Creates a new instance of the OperationListResultPage type.
  1900  func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
  1901  	return OperationListResultPage{
  1902  		fn:  getNextPage,
  1903  		olr: cur,
  1904  	}
  1905  }
  1906  
  1907  // Plan plan for the managed application.
  1908  type Plan struct {
  1909  	// Name - The plan name.
  1910  	Name *string `json:"name,omitempty"`
  1911  	// Publisher - The publisher ID.
  1912  	Publisher *string `json:"publisher,omitempty"`
  1913  	// Product - The product code.
  1914  	Product *string `json:"product,omitempty"`
  1915  	// PromotionCode - The promotion code.
  1916  	PromotionCode *string `json:"promotionCode,omitempty"`
  1917  	// Version - The plan's version.
  1918  	Version *string `json:"version,omitempty"`
  1919  }
  1920  
  1921  // PlanPatchable plan for the managed application.
  1922  type PlanPatchable struct {
  1923  	// Name - The plan name.
  1924  	Name *string `json:"name,omitempty"`
  1925  	// Publisher - The publisher ID.
  1926  	Publisher *string `json:"publisher,omitempty"`
  1927  	// Product - The product code.
  1928  	Product *string `json:"product,omitempty"`
  1929  	// PromotionCode - The promotion code.
  1930  	PromotionCode *string `json:"promotionCode,omitempty"`
  1931  	// Version - The plan's version.
  1932  	Version *string `json:"version,omitempty"`
  1933  }
  1934  
  1935  // Resource resource information.
  1936  type Resource struct {
  1937  	// ID - READ-ONLY; Resource ID
  1938  	ID *string `json:"id,omitempty"`
  1939  	// Name - READ-ONLY; Resource name
  1940  	Name *string `json:"name,omitempty"`
  1941  	// Type - READ-ONLY; Resource type
  1942  	Type *string `json:"type,omitempty"`
  1943  	// Location - Resource location
  1944  	Location *string `json:"location,omitempty"`
  1945  	// Tags - Resource tags
  1946  	Tags map[string]*string `json:"tags"`
  1947  }
  1948  
  1949  // MarshalJSON is the custom marshaler for Resource.
  1950  func (r Resource) MarshalJSON() ([]byte, error) {
  1951  	objectMap := make(map[string]interface{})
  1952  	if r.Location != nil {
  1953  		objectMap["location"] = r.Location
  1954  	}
  1955  	if r.Tags != nil {
  1956  		objectMap["tags"] = r.Tags
  1957  	}
  1958  	return json.Marshal(objectMap)
  1959  }
  1960  
  1961  // Sku SKU for the resource.
  1962  type Sku struct {
  1963  	// Name - The SKU name.
  1964  	Name *string `json:"name,omitempty"`
  1965  	// Tier - The SKU tier.
  1966  	Tier *string `json:"tier,omitempty"`
  1967  	// Size - The SKU size.
  1968  	Size *string `json:"size,omitempty"`
  1969  	// Family - The SKU family.
  1970  	Family *string `json:"family,omitempty"`
  1971  	// Model - The SKU model.
  1972  	Model *string `json:"model,omitempty"`
  1973  	// Capacity - The SKU capacity.
  1974  	Capacity *int32 `json:"capacity,omitempty"`
  1975  }
  1976  
  1977  // UpdateAccessDefinition update access request definition.
  1978  type UpdateAccessDefinition struct {
  1979  	autorest.Response `json:"-"`
  1980  	// Approver - The approver name.
  1981  	Approver *string `json:"approver,omitempty"`
  1982  	// Metadata - The JIT request metadata.
  1983  	Metadata *JitRequestMetadata `json:"metadata,omitempty"`
  1984  	// Status - The JIT status. Possible values include: 'StatusNotSpecified', 'StatusElevate', 'StatusRemove'
  1985  	Status Status `json:"status,omitempty"`
  1986  	// SubStatus - The JIT status. Possible values include: 'SubstatusNotSpecified', 'SubstatusApproved', 'SubstatusDenied', 'SubstatusFailed', 'SubstatusExpired', 'SubstatusTimeout'
  1987  	SubStatus Substatus `json:"subStatus,omitempty"`
  1988  }
  1989  
  1990  // UserAssignedResourceIdentity represents the user assigned identity that is contained within the
  1991  // UserAssignedIdentities dictionary on ResourceIdentity
  1992  type UserAssignedResourceIdentity struct {
  1993  	// PrincipalID - READ-ONLY; The principal id of user assigned identity.
  1994  	PrincipalID *string `json:"principalId,omitempty"`
  1995  	// TenantID - READ-ONLY; The tenant id of user assigned identity.
  1996  	TenantID *string `json:"tenantId,omitempty"`
  1997  }
  1998  
  1999  // MarshalJSON is the custom marshaler for UserAssignedResourceIdentity.
  2000  func (uari UserAssignedResourceIdentity) MarshalJSON() ([]byte, error) {
  2001  	objectMap := make(map[string]interface{})
  2002  	return json.Marshal(objectMap)
  2003  }
  2004  

View as plain text