...

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

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

View as plain text