...

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

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

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

View as plain text