...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/solutions/mgmt/2020-08-21-preview/managedapplications/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/solutions/mgmt/2020-08-21-preview/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/preview/solutions/mgmt/2020-08-21-preview/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  // ErrorAdditionalInfo the resource management error additional info.
  1351  type ErrorAdditionalInfo struct {
  1352  	// Type - READ-ONLY; The additional info type.
  1353  	Type *string `json:"type,omitempty"`
  1354  	// Info - READ-ONLY; The additional info.
  1355  	Info interface{} `json:"info,omitempty"`
  1356  }
  1357  
  1358  // MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
  1359  func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
  1360  	objectMap := make(map[string]interface{})
  1361  	return json.Marshal(objectMap)
  1362  }
  1363  
  1364  // ErrorDetail the error detail.
  1365  type ErrorDetail struct {
  1366  	// Code - READ-ONLY; The error code.
  1367  	Code *string `json:"code,omitempty"`
  1368  	// Message - READ-ONLY; The error message.
  1369  	Message *string `json:"message,omitempty"`
  1370  	// Target - READ-ONLY; The error target.
  1371  	Target *string `json:"target,omitempty"`
  1372  	// Details - READ-ONLY; The error details.
  1373  	Details *[]ErrorDetail `json:"details,omitempty"`
  1374  	// AdditionalInfo - READ-ONLY; The error additional info.
  1375  	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
  1376  }
  1377  
  1378  // MarshalJSON is the custom marshaler for ErrorDetail.
  1379  func (ed ErrorDetail) MarshalJSON() ([]byte, error) {
  1380  	objectMap := make(map[string]interface{})
  1381  	return json.Marshal(objectMap)
  1382  }
  1383  
  1384  // ErrorResponse common error response for all Azure Resource Manager APIs to return error details for
  1385  // failed operations. (This also follows the OData error response format.).
  1386  type ErrorResponse struct {
  1387  	// Error - The error object.
  1388  	Error *ErrorDetail `json:"error,omitempty"`
  1389  }
  1390  
  1391  // GenericResource resource information.
  1392  type GenericResource struct {
  1393  	// ManagedBy - ID of the resource that manages this resource.
  1394  	ManagedBy *string `json:"managedBy,omitempty"`
  1395  	// Sku - The SKU of the resource.
  1396  	Sku *Sku `json:"sku,omitempty"`
  1397  	// ID - READ-ONLY; Resource ID
  1398  	ID *string `json:"id,omitempty"`
  1399  	// Name - READ-ONLY; Resource name
  1400  	Name *string `json:"name,omitempty"`
  1401  	// Type - READ-ONLY; Resource type
  1402  	Type *string `json:"type,omitempty"`
  1403  	// Location - Resource location
  1404  	Location *string `json:"location,omitempty"`
  1405  	// Tags - Resource tags
  1406  	Tags map[string]*string `json:"tags"`
  1407  }
  1408  
  1409  // MarshalJSON is the custom marshaler for GenericResource.
  1410  func (gr GenericResource) MarshalJSON() ([]byte, error) {
  1411  	objectMap := make(map[string]interface{})
  1412  	if gr.ManagedBy != nil {
  1413  		objectMap["managedBy"] = gr.ManagedBy
  1414  	}
  1415  	if gr.Sku != nil {
  1416  		objectMap["sku"] = gr.Sku
  1417  	}
  1418  	if gr.Location != nil {
  1419  		objectMap["location"] = gr.Location
  1420  	}
  1421  	if gr.Tags != nil {
  1422  		objectMap["tags"] = gr.Tags
  1423  	}
  1424  	return json.Marshal(objectMap)
  1425  }
  1426  
  1427  // Identity identity for the resource.
  1428  type Identity struct {
  1429  	// PrincipalID - READ-ONLY; The principal ID of resource identity.
  1430  	PrincipalID *string `json:"principalId,omitempty"`
  1431  	// TenantID - READ-ONLY; The tenant ID of resource.
  1432  	TenantID *string `json:"tenantId,omitempty"`
  1433  	// Type - The identity type. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone'
  1434  	Type ResourceIdentityType `json:"type,omitempty"`
  1435  	// 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}'.
  1436  	UserAssignedIdentities map[string]*UserAssignedResourceIdentity `json:"userAssignedIdentities"`
  1437  }
  1438  
  1439  // MarshalJSON is the custom marshaler for Identity.
  1440  func (i Identity) MarshalJSON() ([]byte, error) {
  1441  	objectMap := make(map[string]interface{})
  1442  	if i.Type != "" {
  1443  		objectMap["type"] = i.Type
  1444  	}
  1445  	if i.UserAssignedIdentities != nil {
  1446  		objectMap["userAssignedIdentities"] = i.UserAssignedIdentities
  1447  	}
  1448  	return json.Marshal(objectMap)
  1449  }
  1450  
  1451  // JitApproverDefinition JIT approver definition.
  1452  type JitApproverDefinition struct {
  1453  	// ID - The approver service principal Id.
  1454  	ID *string `json:"id,omitempty"`
  1455  	// Type - The approver type. Possible values include: 'User', 'Group'
  1456  	Type JitApproverType `json:"type,omitempty"`
  1457  	// DisplayName - The approver display name.
  1458  	DisplayName *string `json:"displayName,omitempty"`
  1459  }
  1460  
  1461  // JitAuthorizationPolicies the JIT authorization policies.
  1462  type JitAuthorizationPolicies struct {
  1463  	// PrincipalID - The the principal id that will be granted JIT access.
  1464  	PrincipalID *string `json:"principalId,omitempty"`
  1465  	// RoleDefinitionID - The role definition id that will be granted to the Principal.
  1466  	RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
  1467  }
  1468  
  1469  // JitRequestDefinition information about JIT request definition.
  1470  type JitRequestDefinition struct {
  1471  	autorest.Response `json:"-"`
  1472  	// JitRequestProperties - The JIT request properties.
  1473  	*JitRequestProperties `json:"properties,omitempty"`
  1474  	// ID - READ-ONLY; Resource ID
  1475  	ID *string `json:"id,omitempty"`
  1476  	// Name - READ-ONLY; Resource name
  1477  	Name *string `json:"name,omitempty"`
  1478  	// Type - READ-ONLY; Resource type
  1479  	Type *string `json:"type,omitempty"`
  1480  	// Location - Resource location
  1481  	Location *string `json:"location,omitempty"`
  1482  	// Tags - Resource tags
  1483  	Tags map[string]*string `json:"tags"`
  1484  }
  1485  
  1486  // MarshalJSON is the custom marshaler for JitRequestDefinition.
  1487  func (jrd JitRequestDefinition) MarshalJSON() ([]byte, error) {
  1488  	objectMap := make(map[string]interface{})
  1489  	if jrd.JitRequestProperties != nil {
  1490  		objectMap["properties"] = jrd.JitRequestProperties
  1491  	}
  1492  	if jrd.Location != nil {
  1493  		objectMap["location"] = jrd.Location
  1494  	}
  1495  	if jrd.Tags != nil {
  1496  		objectMap["tags"] = jrd.Tags
  1497  	}
  1498  	return json.Marshal(objectMap)
  1499  }
  1500  
  1501  // UnmarshalJSON is the custom unmarshaler for JitRequestDefinition struct.
  1502  func (jrd *JitRequestDefinition) UnmarshalJSON(body []byte) error {
  1503  	var m map[string]*json.RawMessage
  1504  	err := json.Unmarshal(body, &m)
  1505  	if err != nil {
  1506  		return err
  1507  	}
  1508  	for k, v := range m {
  1509  		switch k {
  1510  		case "properties":
  1511  			if v != nil {
  1512  				var jitRequestProperties JitRequestProperties
  1513  				err = json.Unmarshal(*v, &jitRequestProperties)
  1514  				if err != nil {
  1515  					return err
  1516  				}
  1517  				jrd.JitRequestProperties = &jitRequestProperties
  1518  			}
  1519  		case "id":
  1520  			if v != nil {
  1521  				var ID string
  1522  				err = json.Unmarshal(*v, &ID)
  1523  				if err != nil {
  1524  					return err
  1525  				}
  1526  				jrd.ID = &ID
  1527  			}
  1528  		case "name":
  1529  			if v != nil {
  1530  				var name string
  1531  				err = json.Unmarshal(*v, &name)
  1532  				if err != nil {
  1533  					return err
  1534  				}
  1535  				jrd.Name = &name
  1536  			}
  1537  		case "type":
  1538  			if v != nil {
  1539  				var typeVar string
  1540  				err = json.Unmarshal(*v, &typeVar)
  1541  				if err != nil {
  1542  					return err
  1543  				}
  1544  				jrd.Type = &typeVar
  1545  			}
  1546  		case "location":
  1547  			if v != nil {
  1548  				var location string
  1549  				err = json.Unmarshal(*v, &location)
  1550  				if err != nil {
  1551  					return err
  1552  				}
  1553  				jrd.Location = &location
  1554  			}
  1555  		case "tags":
  1556  			if v != nil {
  1557  				var tags map[string]*string
  1558  				err = json.Unmarshal(*v, &tags)
  1559  				if err != nil {
  1560  					return err
  1561  				}
  1562  				jrd.Tags = tags
  1563  			}
  1564  		}
  1565  	}
  1566  
  1567  	return nil
  1568  }
  1569  
  1570  // JitRequestDefinitionListResult list of JIT requests.
  1571  type JitRequestDefinitionListResult struct {
  1572  	autorest.Response `json:"-"`
  1573  	// Value - The array of Jit request definition.
  1574  	Value *[]JitRequestDefinition `json:"value,omitempty"`
  1575  	// NextLink - The URL to use for getting the next set of results.
  1576  	NextLink *string `json:"nextLink,omitempty"`
  1577  }
  1578  
  1579  // JitRequestMetadata the JIT request metadata.
  1580  type JitRequestMetadata struct {
  1581  	// OriginRequestID - The origin request id.
  1582  	OriginRequestID *string `json:"originRequestId,omitempty"`
  1583  	// RequestorID - The requestor id.
  1584  	RequestorID *string `json:"requestorId,omitempty"`
  1585  	// TenantDisplayName - The publisher's tenant name.
  1586  	TenantDisplayName *string `json:"tenantDisplayName,omitempty"`
  1587  	// SubjectDisplayName - The subject display name.
  1588  	SubjectDisplayName *string `json:"subjectDisplayName,omitempty"`
  1589  }
  1590  
  1591  // JitRequestPatchable information about JIT request.
  1592  type JitRequestPatchable struct {
  1593  	// Tags - Jit request tags
  1594  	Tags map[string]*string `json:"tags"`
  1595  }
  1596  
  1597  // MarshalJSON is the custom marshaler for JitRequestPatchable.
  1598  func (jrp JitRequestPatchable) MarshalJSON() ([]byte, error) {
  1599  	objectMap := make(map[string]interface{})
  1600  	if jrp.Tags != nil {
  1601  		objectMap["tags"] = jrp.Tags
  1602  	}
  1603  	return json.Marshal(objectMap)
  1604  }
  1605  
  1606  // JitRequestProperties information about JIT request properties
  1607  type JitRequestProperties struct {
  1608  	// ApplicationResourceID - The parent application id.
  1609  	ApplicationResourceID *string `json:"applicationResourceId,omitempty"`
  1610  	// PublisherTenantID - READ-ONLY; The publisher tenant id.
  1611  	PublisherTenantID *string `json:"publisherTenantId,omitempty"`
  1612  	// JitAuthorizationPolicies - The JIT authorization policies.
  1613  	JitAuthorizationPolicies *[]JitAuthorizationPolicies `json:"jitAuthorizationPolicies,omitempty"`
  1614  	// JitSchedulingPolicy - The JIT request properties.
  1615  	JitSchedulingPolicy *JitSchedulingPolicy `json:"jitSchedulingPolicy,omitempty"`
  1616  	// ProvisioningState - READ-ONLY; The JIT request provisioning state. Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateReady', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating'
  1617  	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
  1618  	// JitRequestState - READ-ONLY; The JIT request state. Possible values include: 'JitRequestStateNotSpecified', 'JitRequestStatePending', 'JitRequestStateApproved', 'JitRequestStateDenied', 'JitRequestStateFailed', 'JitRequestStateCanceled', 'JitRequestStateExpired', 'JitRequestStateTimeout'
  1619  	JitRequestState JitRequestState `json:"jitRequestState,omitempty"`
  1620  	// CreatedBy - READ-ONLY; The client entity that created the JIT request.
  1621  	CreatedBy *ApplicationClientDetails `json:"createdBy,omitempty"`
  1622  	// UpdatedBy - READ-ONLY; The client entity that last updated the JIT request.
  1623  	UpdatedBy *ApplicationClientDetails `json:"updatedBy,omitempty"`
  1624  }
  1625  
  1626  // MarshalJSON is the custom marshaler for JitRequestProperties.
  1627  func (jrp JitRequestProperties) MarshalJSON() ([]byte, error) {
  1628  	objectMap := make(map[string]interface{})
  1629  	if jrp.ApplicationResourceID != nil {
  1630  		objectMap["applicationResourceId"] = jrp.ApplicationResourceID
  1631  	}
  1632  	if jrp.JitAuthorizationPolicies != nil {
  1633  		objectMap["jitAuthorizationPolicies"] = jrp.JitAuthorizationPolicies
  1634  	}
  1635  	if jrp.JitSchedulingPolicy != nil {
  1636  		objectMap["jitSchedulingPolicy"] = jrp.JitSchedulingPolicy
  1637  	}
  1638  	return json.Marshal(objectMap)
  1639  }
  1640  
  1641  // JitRequestsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  1642  // long-running operation.
  1643  type JitRequestsCreateOrUpdateFuture struct {
  1644  	azure.FutureAPI
  1645  	// Result returns the result of the asynchronous operation.
  1646  	// If the operation has not completed it will return an error.
  1647  	Result func(JitRequestsClient) (JitRequestDefinition, error)
  1648  }
  1649  
  1650  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1651  func (future *JitRequestsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  1652  	var azFuture azure.Future
  1653  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1654  		return err
  1655  	}
  1656  	future.FutureAPI = &azFuture
  1657  	future.Result = future.result
  1658  	return nil
  1659  }
  1660  
  1661  // result is the default implementation for JitRequestsCreateOrUpdateFuture.Result.
  1662  func (future *JitRequestsCreateOrUpdateFuture) result(client JitRequestsClient) (jrd JitRequestDefinition, err error) {
  1663  	var done bool
  1664  	done, err = future.DoneWithContext(context.Background(), client)
  1665  	if err != nil {
  1666  		err = autorest.NewErrorWithError(err, "managedapplications.JitRequestsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  1667  		return
  1668  	}
  1669  	if !done {
  1670  		jrd.Response.Response = future.Response()
  1671  		err = azure.NewAsyncOpIncompleteError("managedapplications.JitRequestsCreateOrUpdateFuture")
  1672  		return
  1673  	}
  1674  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1675  	if jrd.Response.Response, err = future.GetResult(sender); err == nil && jrd.Response.Response.StatusCode != http.StatusNoContent {
  1676  		jrd, err = client.CreateOrUpdateResponder(jrd.Response.Response)
  1677  		if err != nil {
  1678  			err = autorest.NewErrorWithError(err, "managedapplications.JitRequestsCreateOrUpdateFuture", "Result", jrd.Response.Response, "Failure responding to request")
  1679  		}
  1680  	}
  1681  	return
  1682  }
  1683  
  1684  // JitSchedulingPolicy the JIT scheduling policies.
  1685  type JitSchedulingPolicy struct {
  1686  	// Type - The type of JIT schedule. Possible values include: 'JitSchedulingTypeNotSpecified', 'JitSchedulingTypeOnce', 'JitSchedulingTypeRecurring'
  1687  	Type     JitSchedulingType `json:"type,omitempty"`
  1688  	Duration *string           `json:"duration,omitempty"`
  1689  	// StartTime - The start time of the request.
  1690  	StartTime *date.Time `json:"startTime,omitempty"`
  1691  }
  1692  
  1693  // ListTokenRequest list token request body.
  1694  type ListTokenRequest struct {
  1695  	// AuthorizationAudience - The authorization audience.
  1696  	AuthorizationAudience *string `json:"authorizationAudience,omitempty"`
  1697  	// UserAssignedIdentities - The user assigned identities.
  1698  	UserAssignedIdentities *[]string `json:"userAssignedIdentities,omitempty"`
  1699  }
  1700  
  1701  // ManagedIdentityToken the managed identity token for the managed app resource.
  1702  type ManagedIdentityToken struct {
  1703  	// AccessToken - The requested access token.
  1704  	AccessToken *string `json:"accessToken,omitempty"`
  1705  	// ExpiresIn - The number of seconds the access token will be valid.
  1706  	ExpiresIn *string `json:"expiresIn,omitempty"`
  1707  	// ExpiresOn - The timespan when the access token expires. This is represented as the number of seconds from epoch.
  1708  	ExpiresOn *string `json:"expiresOn,omitempty"`
  1709  	// NotBefore - The timespan when the access token takes effect. This is represented as the number of seconds from epoch.
  1710  	NotBefore *string `json:"notBefore,omitempty"`
  1711  	// AuthorizationAudience - The aud (audience) the access token was request for. This is the same as what was provided in the listTokens request.
  1712  	AuthorizationAudience *string `json:"authorizationAudience,omitempty"`
  1713  	// ResourceID - The Azure resource ID for the issued token. This is either the managed application ID or the user-assigned identity ID.
  1714  	ResourceID *string `json:"resourceId,omitempty"`
  1715  	// TokenType - The type of the token.
  1716  	TokenType *string `json:"tokenType,omitempty"`
  1717  }
  1718  
  1719  // ManagedIdentityTokenResult the array of managed identity tokens.
  1720  type ManagedIdentityTokenResult struct {
  1721  	autorest.Response `json:"-"`
  1722  	// Value - The array of managed identity tokens.
  1723  	Value *[]ManagedIdentityToken `json:"value,omitempty"`
  1724  }
  1725  
  1726  // Operation microsoft.Solutions operation
  1727  type Operation struct {
  1728  	// Name - Operation name: {provider}/{resource}/{operation}
  1729  	Name *string `json:"name,omitempty"`
  1730  	// IsDataAction - Indicates whether the operation is a data action
  1731  	IsDataAction *bool `json:"isDataAction,omitempty"`
  1732  	// Display - The object that represents the operation.
  1733  	Display *OperationDisplay `json:"display,omitempty"`
  1734  }
  1735  
  1736  // OperationDisplay the object that represents the operation.
  1737  type OperationDisplay struct {
  1738  	// Provider - Service provider: Microsoft.Solutions
  1739  	Provider *string `json:"provider,omitempty"`
  1740  	// Resource - Resource on which the operation is performed: Application, JitRequest, etc.
  1741  	Resource *string `json:"resource,omitempty"`
  1742  	// Operation - Operation type: Read, write, delete, etc.
  1743  	Operation *string `json:"operation,omitempty"`
  1744  	// Description - READ-ONLY; Localized friendly description for the operation
  1745  	Description *string `json:"description,omitempty"`
  1746  }
  1747  
  1748  // MarshalJSON is the custom marshaler for OperationDisplay.
  1749  func (o OperationDisplay) MarshalJSON() ([]byte, error) {
  1750  	objectMap := make(map[string]interface{})
  1751  	if o.Provider != nil {
  1752  		objectMap["provider"] = o.Provider
  1753  	}
  1754  	if o.Resource != nil {
  1755  		objectMap["resource"] = o.Resource
  1756  	}
  1757  	if o.Operation != nil {
  1758  		objectMap["operation"] = o.Operation
  1759  	}
  1760  	return json.Marshal(objectMap)
  1761  }
  1762  
  1763  // OperationListResult result of the request to list Microsoft.Solutions operations. It contains a list of
  1764  // operations and a URL link to get the next set of results.
  1765  type OperationListResult struct {
  1766  	autorest.Response `json:"-"`
  1767  	// Value - List of Microsoft.Solutions operations.
  1768  	Value *[]Operation `json:"value,omitempty"`
  1769  	// NextLink - URL to get the next set of operation list results if there are any.
  1770  	NextLink *string `json:"nextLink,omitempty"`
  1771  }
  1772  
  1773  // OperationListResultIterator provides access to a complete listing of Operation values.
  1774  type OperationListResultIterator struct {
  1775  	i    int
  1776  	page OperationListResultPage
  1777  }
  1778  
  1779  // NextWithContext advances to the next value.  If there was an error making
  1780  // the request the iterator does not advance and the error is returned.
  1781  func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1782  	if tracing.IsEnabled() {
  1783  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
  1784  		defer func() {
  1785  			sc := -1
  1786  			if iter.Response().Response.Response != nil {
  1787  				sc = iter.Response().Response.Response.StatusCode
  1788  			}
  1789  			tracing.EndSpan(ctx, sc, err)
  1790  		}()
  1791  	}
  1792  	iter.i++
  1793  	if iter.i < len(iter.page.Values()) {
  1794  		return nil
  1795  	}
  1796  	err = iter.page.NextWithContext(ctx)
  1797  	if err != nil {
  1798  		iter.i--
  1799  		return err
  1800  	}
  1801  	iter.i = 0
  1802  	return nil
  1803  }
  1804  
  1805  // Next advances to the next value.  If there was an error making
  1806  // the request the iterator does not advance and the error is returned.
  1807  // Deprecated: Use NextWithContext() instead.
  1808  func (iter *OperationListResultIterator) Next() error {
  1809  	return iter.NextWithContext(context.Background())
  1810  }
  1811  
  1812  // NotDone returns true if the enumeration should be started or is not yet complete.
  1813  func (iter OperationListResultIterator) NotDone() bool {
  1814  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1815  }
  1816  
  1817  // Response returns the raw server response from the last page request.
  1818  func (iter OperationListResultIterator) Response() OperationListResult {
  1819  	return iter.page.Response()
  1820  }
  1821  
  1822  // Value returns the current value or a zero-initialized value if the
  1823  // iterator has advanced beyond the end of the collection.
  1824  func (iter OperationListResultIterator) Value() Operation {
  1825  	if !iter.page.NotDone() {
  1826  		return Operation{}
  1827  	}
  1828  	return iter.page.Values()[iter.i]
  1829  }
  1830  
  1831  // Creates a new instance of the OperationListResultIterator type.
  1832  func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
  1833  	return OperationListResultIterator{page: page}
  1834  }
  1835  
  1836  // IsEmpty returns true if the ListResult contains no values.
  1837  func (olr OperationListResult) IsEmpty() bool {
  1838  	return olr.Value == nil || len(*olr.Value) == 0
  1839  }
  1840  
  1841  // hasNextLink returns true if the NextLink is not empty.
  1842  func (olr OperationListResult) hasNextLink() bool {
  1843  	return olr.NextLink != nil && len(*olr.NextLink) != 0
  1844  }
  1845  
  1846  // operationListResultPreparer prepares a request to retrieve the next set of results.
  1847  // It returns nil if no more results exist.
  1848  func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
  1849  	if !olr.hasNextLink() {
  1850  		return nil, nil
  1851  	}
  1852  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1853  		autorest.AsJSON(),
  1854  		autorest.AsGet(),
  1855  		autorest.WithBaseURL(to.String(olr.NextLink)))
  1856  }
  1857  
  1858  // OperationListResultPage contains a page of Operation values.
  1859  type OperationListResultPage struct {
  1860  	fn  func(context.Context, OperationListResult) (OperationListResult, error)
  1861  	olr OperationListResult
  1862  }
  1863  
  1864  // NextWithContext advances to the next page of values.  If there was an error making
  1865  // the request the page does not advance and the error is returned.
  1866  func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
  1867  	if tracing.IsEnabled() {
  1868  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
  1869  		defer func() {
  1870  			sc := -1
  1871  			if page.Response().Response.Response != nil {
  1872  				sc = page.Response().Response.Response.StatusCode
  1873  			}
  1874  			tracing.EndSpan(ctx, sc, err)
  1875  		}()
  1876  	}
  1877  	for {
  1878  		next, err := page.fn(ctx, page.olr)
  1879  		if err != nil {
  1880  			return err
  1881  		}
  1882  		page.olr = next
  1883  		if !next.hasNextLink() || !next.IsEmpty() {
  1884  			break
  1885  		}
  1886  	}
  1887  	return nil
  1888  }
  1889  
  1890  // Next advances to the next page of values.  If there was an error making
  1891  // the request the page does not advance and the error is returned.
  1892  // Deprecated: Use NextWithContext() instead.
  1893  func (page *OperationListResultPage) Next() error {
  1894  	return page.NextWithContext(context.Background())
  1895  }
  1896  
  1897  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1898  func (page OperationListResultPage) NotDone() bool {
  1899  	return !page.olr.IsEmpty()
  1900  }
  1901  
  1902  // Response returns the raw server response from the last page request.
  1903  func (page OperationListResultPage) Response() OperationListResult {
  1904  	return page.olr
  1905  }
  1906  
  1907  // Values returns the slice of values for the current page or nil if there are no values.
  1908  func (page OperationListResultPage) Values() []Operation {
  1909  	if page.olr.IsEmpty() {
  1910  		return nil
  1911  	}
  1912  	return *page.olr.Value
  1913  }
  1914  
  1915  // Creates a new instance of the OperationListResultPage type.
  1916  func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
  1917  	return OperationListResultPage{
  1918  		fn:  getNextPage,
  1919  		olr: cur,
  1920  	}
  1921  }
  1922  
  1923  // Plan plan for the managed application.
  1924  type Plan struct {
  1925  	// Name - The plan name.
  1926  	Name *string `json:"name,omitempty"`
  1927  	// Publisher - The publisher ID.
  1928  	Publisher *string `json:"publisher,omitempty"`
  1929  	// Product - The product code.
  1930  	Product *string `json:"product,omitempty"`
  1931  	// PromotionCode - The promotion code.
  1932  	PromotionCode *string `json:"promotionCode,omitempty"`
  1933  	// Version - The plan's version.
  1934  	Version *string `json:"version,omitempty"`
  1935  }
  1936  
  1937  // PlanPatchable plan for the managed application.
  1938  type PlanPatchable struct {
  1939  	// Name - The plan name.
  1940  	Name *string `json:"name,omitempty"`
  1941  	// Publisher - The publisher ID.
  1942  	Publisher *string `json:"publisher,omitempty"`
  1943  	// Product - The product code.
  1944  	Product *string `json:"product,omitempty"`
  1945  	// PromotionCode - The promotion code.
  1946  	PromotionCode *string `json:"promotionCode,omitempty"`
  1947  	// Version - The plan's version.
  1948  	Version *string `json:"version,omitempty"`
  1949  }
  1950  
  1951  // Resource resource information.
  1952  type Resource struct {
  1953  	// ID - READ-ONLY; Resource ID
  1954  	ID *string `json:"id,omitempty"`
  1955  	// Name - READ-ONLY; Resource name
  1956  	Name *string `json:"name,omitempty"`
  1957  	// Type - READ-ONLY; Resource type
  1958  	Type *string `json:"type,omitempty"`
  1959  	// Location - Resource location
  1960  	Location *string `json:"location,omitempty"`
  1961  	// Tags - Resource tags
  1962  	Tags map[string]*string `json:"tags"`
  1963  }
  1964  
  1965  // MarshalJSON is the custom marshaler for Resource.
  1966  func (r Resource) MarshalJSON() ([]byte, error) {
  1967  	objectMap := make(map[string]interface{})
  1968  	if r.Location != nil {
  1969  		objectMap["location"] = r.Location
  1970  	}
  1971  	if r.Tags != nil {
  1972  		objectMap["tags"] = r.Tags
  1973  	}
  1974  	return json.Marshal(objectMap)
  1975  }
  1976  
  1977  // Sku SKU for the resource.
  1978  type Sku struct {
  1979  	// Name - The SKU name.
  1980  	Name *string `json:"name,omitempty"`
  1981  	// Tier - The SKU tier.
  1982  	Tier *string `json:"tier,omitempty"`
  1983  	// Size - The SKU size.
  1984  	Size *string `json:"size,omitempty"`
  1985  	// Family - The SKU family.
  1986  	Family *string `json:"family,omitempty"`
  1987  	// Model - The SKU model.
  1988  	Model *string `json:"model,omitempty"`
  1989  	// Capacity - The SKU capacity.
  1990  	Capacity *int32 `json:"capacity,omitempty"`
  1991  }
  1992  
  1993  // UpdateAccessDefinition update access request definition.
  1994  type UpdateAccessDefinition struct {
  1995  	autorest.Response `json:"-"`
  1996  	// Approver - The approver name.
  1997  	Approver *string `json:"approver,omitempty"`
  1998  	// Metadata - The JIT request metadata.
  1999  	Metadata *JitRequestMetadata `json:"metadata,omitempty"`
  2000  	// Status - The JIT status. Possible values include: 'StatusNotSpecified', 'StatusElevate', 'StatusRemove'
  2001  	Status Status `json:"status,omitempty"`
  2002  	// SubStatus - The JIT status. Possible values include: 'SubstatusNotSpecified', 'SubstatusApproved', 'SubstatusDenied', 'SubstatusFailed', 'SubstatusExpired', 'SubstatusTimeout'
  2003  	SubStatus Substatus `json:"subStatus,omitempty"`
  2004  }
  2005  
  2006  // UserAssignedResourceIdentity represents the user assigned identity that is contained within the
  2007  // UserAssignedIdentities dictionary on ResourceIdentity
  2008  type UserAssignedResourceIdentity struct {
  2009  	// PrincipalID - READ-ONLY; The principal id of user assigned identity.
  2010  	PrincipalID *string `json:"principalId,omitempty"`
  2011  	// TenantID - READ-ONLY; The tenant id of user assigned identity.
  2012  	TenantID *string `json:"tenantId,omitempty"`
  2013  }
  2014  
  2015  // MarshalJSON is the custom marshaler for UserAssignedResourceIdentity.
  2016  func (uari UserAssignedResourceIdentity) MarshalJSON() ([]byte, error) {
  2017  	objectMap := make(map[string]interface{})
  2018  	return json.Marshal(objectMap)
  2019  }
  2020  

View as plain text