...

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

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

View as plain text