...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/appinsights/mgmt/2022-01-11-preview/insights/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/appinsights/mgmt/2022-01-11-preview/insights

     1  package insights
     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/date"
    14  	"github.com/Azure/go-autorest/autorest/to"
    15  	"github.com/Azure/go-autorest/tracing"
    16  	"github.com/gofrs/uuid"
    17  	"net/http"
    18  )
    19  
    20  // The package's fully qualified name.
    21  const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/appinsights/mgmt/2022-01-11-preview/insights"
    22  
    23  // Annotation annotation associated with an application insights resource.
    24  type Annotation struct {
    25  	// AnnotationName - Name of annotation
    26  	AnnotationName *string `json:"AnnotationName,omitempty"`
    27  	// Category - Category of annotation, free form
    28  	Category *string `json:"Category,omitempty"`
    29  	// EventTime - Time when event occurred
    30  	EventTime *date.Time `json:"EventTime,omitempty"`
    31  	// ID - Unique Id for annotation
    32  	ID *string `json:"Id,omitempty"`
    33  	// Properties - Serialized JSON object for detailed properties
    34  	Properties *string `json:"Properties,omitempty"`
    35  	// RelatedAnnotation - Related parent annotation if any
    36  	RelatedAnnotation *string `json:"RelatedAnnotation,omitempty"`
    37  }
    38  
    39  // AnnotationError error associated with trying to create annotation with Id that already exist
    40  type AnnotationError struct {
    41  	// Code - Error detail code and explanation
    42  	Code *string `json:"code,omitempty"`
    43  	// Message - Error message
    44  	Message    *string     `json:"message,omitempty"`
    45  	Innererror *InnerError `json:"innererror,omitempty"`
    46  }
    47  
    48  // AnnotationsListResult annotations list result.
    49  type AnnotationsListResult struct {
    50  	autorest.Response `json:"-"`
    51  	// Value - READ-ONLY; An array of annotations.
    52  	Value *[]Annotation `json:"value,omitempty"`
    53  }
    54  
    55  // MarshalJSON is the custom marshaler for AnnotationsListResult.
    56  func (alr AnnotationsListResult) MarshalJSON() ([]byte, error) {
    57  	objectMap := make(map[string]interface{})
    58  	return json.Marshal(objectMap)
    59  }
    60  
    61  // APIKeyRequest an Application Insights component API Key creation request definition.
    62  type APIKeyRequest struct {
    63  	// Name - The name of the API Key.
    64  	Name *string `json:"name,omitempty"`
    65  	// LinkedReadProperties - The read access rights of this API Key.
    66  	LinkedReadProperties *[]string `json:"linkedReadProperties,omitempty"`
    67  	// LinkedWriteProperties - The write access rights of this API Key.
    68  	LinkedWriteProperties *[]string `json:"linkedWriteProperties,omitempty"`
    69  }
    70  
    71  // ApplicationInsightsComponent an Application Insights component definition.
    72  type ApplicationInsightsComponent struct {
    73  	autorest.Response `json:"-"`
    74  	// Kind - The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone.
    75  	Kind *string `json:"kind,omitempty"`
    76  	// Etag - Resource etag
    77  	Etag *string `json:"etag,omitempty"`
    78  	// ApplicationInsightsComponentProperties - Properties that define an Application Insights component resource.
    79  	*ApplicationInsightsComponentProperties `json:"properties,omitempty"`
    80  	// ID - READ-ONLY; Azure resource Id
    81  	ID *string `json:"id,omitempty"`
    82  	// Name - READ-ONLY; Azure resource name
    83  	Name *string `json:"name,omitempty"`
    84  	// Type - READ-ONLY; Azure resource type
    85  	Type *string `json:"type,omitempty"`
    86  	// Location - Resource location
    87  	Location *string `json:"location,omitempty"`
    88  	// Tags - Resource tags
    89  	Tags map[string]*string `json:"tags"`
    90  }
    91  
    92  // MarshalJSON is the custom marshaler for ApplicationInsightsComponent.
    93  func (aic ApplicationInsightsComponent) MarshalJSON() ([]byte, error) {
    94  	objectMap := make(map[string]interface{})
    95  	if aic.Kind != nil {
    96  		objectMap["kind"] = aic.Kind
    97  	}
    98  	if aic.Etag != nil {
    99  		objectMap["etag"] = aic.Etag
   100  	}
   101  	if aic.ApplicationInsightsComponentProperties != nil {
   102  		objectMap["properties"] = aic.ApplicationInsightsComponentProperties
   103  	}
   104  	if aic.Location != nil {
   105  		objectMap["location"] = aic.Location
   106  	}
   107  	if aic.Tags != nil {
   108  		objectMap["tags"] = aic.Tags
   109  	}
   110  	return json.Marshal(objectMap)
   111  }
   112  
   113  // UnmarshalJSON is the custom unmarshaler for ApplicationInsightsComponent struct.
   114  func (aic *ApplicationInsightsComponent) UnmarshalJSON(body []byte) error {
   115  	var m map[string]*json.RawMessage
   116  	err := json.Unmarshal(body, &m)
   117  	if err != nil {
   118  		return err
   119  	}
   120  	for k, v := range m {
   121  		switch k {
   122  		case "kind":
   123  			if v != nil {
   124  				var kind string
   125  				err = json.Unmarshal(*v, &kind)
   126  				if err != nil {
   127  					return err
   128  				}
   129  				aic.Kind = &kind
   130  			}
   131  		case "etag":
   132  			if v != nil {
   133  				var etag string
   134  				err = json.Unmarshal(*v, &etag)
   135  				if err != nil {
   136  					return err
   137  				}
   138  				aic.Etag = &etag
   139  			}
   140  		case "properties":
   141  			if v != nil {
   142  				var applicationInsightsComponentProperties ApplicationInsightsComponentProperties
   143  				err = json.Unmarshal(*v, &applicationInsightsComponentProperties)
   144  				if err != nil {
   145  					return err
   146  				}
   147  				aic.ApplicationInsightsComponentProperties = &applicationInsightsComponentProperties
   148  			}
   149  		case "id":
   150  			if v != nil {
   151  				var ID string
   152  				err = json.Unmarshal(*v, &ID)
   153  				if err != nil {
   154  					return err
   155  				}
   156  				aic.ID = &ID
   157  			}
   158  		case "name":
   159  			if v != nil {
   160  				var name string
   161  				err = json.Unmarshal(*v, &name)
   162  				if err != nil {
   163  					return err
   164  				}
   165  				aic.Name = &name
   166  			}
   167  		case "type":
   168  			if v != nil {
   169  				var typeVar string
   170  				err = json.Unmarshal(*v, &typeVar)
   171  				if err != nil {
   172  					return err
   173  				}
   174  				aic.Type = &typeVar
   175  			}
   176  		case "location":
   177  			if v != nil {
   178  				var location string
   179  				err = json.Unmarshal(*v, &location)
   180  				if err != nil {
   181  					return err
   182  				}
   183  				aic.Location = &location
   184  			}
   185  		case "tags":
   186  			if v != nil {
   187  				var tags map[string]*string
   188  				err = json.Unmarshal(*v, &tags)
   189  				if err != nil {
   190  					return err
   191  				}
   192  				aic.Tags = tags
   193  			}
   194  		}
   195  	}
   196  
   197  	return nil
   198  }
   199  
   200  // ApplicationInsightsComponentAnalyticsItem properties that define an Analytics item that is associated to
   201  // an Application Insights component.
   202  type ApplicationInsightsComponentAnalyticsItem struct {
   203  	autorest.Response `json:"-"`
   204  	// ID - Internally assigned unique id of the item definition.
   205  	ID *string `json:"Id,omitempty"`
   206  	// Name - The user-defined name of the item.
   207  	Name *string `json:"Name,omitempty"`
   208  	// Content - The content of this item
   209  	Content *string `json:"Content,omitempty"`
   210  	// Version - READ-ONLY; This instance's version of the data model. This can change as new features are added.
   211  	Version *string `json:"Version,omitempty"`
   212  	// Scope - Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'ItemScopeShared', 'ItemScopeUser'
   213  	Scope ItemScope `json:"Scope,omitempty"`
   214  	// Type - Enum indicating the type of the Analytics item. Possible values include: 'ItemTypeNone', 'ItemTypeQuery', 'ItemTypeRecent', 'ItemTypeFunction'
   215  	Type ItemType `json:"Type,omitempty"`
   216  	// TimeCreated - READ-ONLY; Date and time in UTC when this item was created.
   217  	TimeCreated *string `json:"TimeCreated,omitempty"`
   218  	// TimeModified - READ-ONLY; Date and time in UTC of the last modification that was made to this item.
   219  	TimeModified *string                                              `json:"TimeModified,omitempty"`
   220  	Properties   *ApplicationInsightsComponentAnalyticsItemProperties `json:"Properties,omitempty"`
   221  }
   222  
   223  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentAnalyticsItem.
   224  func (aicai ApplicationInsightsComponentAnalyticsItem) MarshalJSON() ([]byte, error) {
   225  	objectMap := make(map[string]interface{})
   226  	if aicai.ID != nil {
   227  		objectMap["Id"] = aicai.ID
   228  	}
   229  	if aicai.Name != nil {
   230  		objectMap["Name"] = aicai.Name
   231  	}
   232  	if aicai.Content != nil {
   233  		objectMap["Content"] = aicai.Content
   234  	}
   235  	if aicai.Scope != "" {
   236  		objectMap["Scope"] = aicai.Scope
   237  	}
   238  	if aicai.Type != "" {
   239  		objectMap["Type"] = aicai.Type
   240  	}
   241  	if aicai.Properties != nil {
   242  		objectMap["Properties"] = aicai.Properties
   243  	}
   244  	return json.Marshal(objectMap)
   245  }
   246  
   247  // ApplicationInsightsComponentAnalyticsItemProperties a set of properties that can be defined in the
   248  // context of a specific item type. Each type may have its own properties.
   249  type ApplicationInsightsComponentAnalyticsItemProperties struct {
   250  	// FunctionAlias - A function alias, used when the type of the item is Function
   251  	FunctionAlias *string `json:"functionAlias,omitempty"`
   252  }
   253  
   254  // ApplicationInsightsComponentAPIKey properties that define an API key of an Application Insights
   255  // Component.
   256  type ApplicationInsightsComponentAPIKey struct {
   257  	autorest.Response `json:"-"`
   258  	// ID - READ-ONLY; The unique ID of the API key inside an Application Insights component. It is auto generated when the API key is created.
   259  	ID *string `json:"id,omitempty"`
   260  	// APIKey - READ-ONLY; The API key value. It will be only return once when the API Key was created.
   261  	APIKey *string `json:"apiKey,omitempty"`
   262  	// CreatedDate - The create date of this API key.
   263  	CreatedDate *string `json:"createdDate,omitempty"`
   264  	// Name - The name of the API key.
   265  	Name *string `json:"name,omitempty"`
   266  	// LinkedReadProperties - The read access rights of this API Key.
   267  	LinkedReadProperties *[]string `json:"linkedReadProperties,omitempty"`
   268  	// LinkedWriteProperties - The write access rights of this API Key.
   269  	LinkedWriteProperties *[]string `json:"linkedWriteProperties,omitempty"`
   270  }
   271  
   272  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentAPIKey.
   273  func (aicak ApplicationInsightsComponentAPIKey) MarshalJSON() ([]byte, error) {
   274  	objectMap := make(map[string]interface{})
   275  	if aicak.CreatedDate != nil {
   276  		objectMap["createdDate"] = aicak.CreatedDate
   277  	}
   278  	if aicak.Name != nil {
   279  		objectMap["name"] = aicak.Name
   280  	}
   281  	if aicak.LinkedReadProperties != nil {
   282  		objectMap["linkedReadProperties"] = aicak.LinkedReadProperties
   283  	}
   284  	if aicak.LinkedWriteProperties != nil {
   285  		objectMap["linkedWriteProperties"] = aicak.LinkedWriteProperties
   286  	}
   287  	return json.Marshal(objectMap)
   288  }
   289  
   290  // ApplicationInsightsComponentAPIKeyListResult describes the list of API Keys of an Application Insights
   291  // Component.
   292  type ApplicationInsightsComponentAPIKeyListResult struct {
   293  	autorest.Response `json:"-"`
   294  	// Value - List of API Key definitions.
   295  	Value *[]ApplicationInsightsComponentAPIKey `json:"value,omitempty"`
   296  }
   297  
   298  // ApplicationInsightsComponentAvailableFeatures an Application Insights component available features.
   299  type ApplicationInsightsComponentAvailableFeatures struct {
   300  	autorest.Response `json:"-"`
   301  	// Result - READ-ONLY; A list of Application Insights component feature.
   302  	Result *[]ApplicationInsightsComponentFeature `json:"Result,omitempty"`
   303  }
   304  
   305  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentAvailableFeatures.
   306  func (aicaf ApplicationInsightsComponentAvailableFeatures) MarshalJSON() ([]byte, error) {
   307  	objectMap := make(map[string]interface{})
   308  	return json.Marshal(objectMap)
   309  }
   310  
   311  // ApplicationInsightsComponentBillingFeatures an Application Insights component billing features
   312  type ApplicationInsightsComponentBillingFeatures struct {
   313  	autorest.Response `json:"-"`
   314  	// DataVolumeCap - An Application Insights component daily data volume cap
   315  	DataVolumeCap *ApplicationInsightsComponentDataVolumeCap `json:"DataVolumeCap,omitempty"`
   316  	// CurrentBillingFeatures - Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'.
   317  	CurrentBillingFeatures *[]string `json:"CurrentBillingFeatures,omitempty"`
   318  }
   319  
   320  // ApplicationInsightsComponentDataVolumeCap an Application Insights component daily data volume cap
   321  type ApplicationInsightsComponentDataVolumeCap struct {
   322  	// Cap - Daily data volume cap in GB.
   323  	Cap *float64 `json:"Cap,omitempty"`
   324  	// ResetTime - READ-ONLY; Daily data volume cap UTC reset hour.
   325  	ResetTime *int32 `json:"ResetTime,omitempty"`
   326  	// WarningThreshold - Reserved, not used for now.
   327  	WarningThreshold *int32 `json:"WarningThreshold,omitempty"`
   328  	// StopSendNotificationWhenHitThreshold - Reserved, not used for now.
   329  	StopSendNotificationWhenHitThreshold *bool `json:"StopSendNotificationWhenHitThreshold,omitempty"`
   330  	// StopSendNotificationWhenHitCap - Do not send a notification email when the daily data volume cap is met.
   331  	StopSendNotificationWhenHitCap *bool `json:"StopSendNotificationWhenHitCap,omitempty"`
   332  	// MaxHistoryCap - READ-ONLY; Maximum daily data volume cap that the user can set for this component.
   333  	MaxHistoryCap *float64 `json:"MaxHistoryCap,omitempty"`
   334  }
   335  
   336  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentDataVolumeCap.
   337  func (aicdvc ApplicationInsightsComponentDataVolumeCap) MarshalJSON() ([]byte, error) {
   338  	objectMap := make(map[string]interface{})
   339  	if aicdvc.Cap != nil {
   340  		objectMap["Cap"] = aicdvc.Cap
   341  	}
   342  	if aicdvc.WarningThreshold != nil {
   343  		objectMap["WarningThreshold"] = aicdvc.WarningThreshold
   344  	}
   345  	if aicdvc.StopSendNotificationWhenHitThreshold != nil {
   346  		objectMap["StopSendNotificationWhenHitThreshold"] = aicdvc.StopSendNotificationWhenHitThreshold
   347  	}
   348  	if aicdvc.StopSendNotificationWhenHitCap != nil {
   349  		objectMap["StopSendNotificationWhenHitCap"] = aicdvc.StopSendNotificationWhenHitCap
   350  	}
   351  	return json.Marshal(objectMap)
   352  }
   353  
   354  // ApplicationInsightsComponentExportConfiguration properties that define a Continuous Export
   355  // configuration.
   356  type ApplicationInsightsComponentExportConfiguration struct {
   357  	autorest.Response `json:"-"`
   358  	// ExportID - READ-ONLY; The unique ID of the export configuration inside an Application Insights component. It is auto generated when the Continuous Export configuration is created.
   359  	ExportID *string `json:"ExportId,omitempty"`
   360  	// InstrumentationKey - READ-ONLY; The instrumentation key of the Application Insights component.
   361  	InstrumentationKey *string `json:"InstrumentationKey,omitempty"`
   362  	// RecordTypes - This comma separated list of document types that will be exported. The possible values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'.
   363  	RecordTypes *string `json:"RecordTypes,omitempty"`
   364  	// ApplicationName - READ-ONLY; The name of the Application Insights component.
   365  	ApplicationName *string `json:"ApplicationName,omitempty"`
   366  	// SubscriptionID - READ-ONLY; The subscription of the Application Insights component.
   367  	SubscriptionID *string `json:"SubscriptionId,omitempty"`
   368  	// ResourceGroup - READ-ONLY; The resource group of the Application Insights component.
   369  	ResourceGroup *string `json:"ResourceGroup,omitempty"`
   370  	// DestinationStorageSubscriptionID - READ-ONLY; The destination storage account subscription ID.
   371  	DestinationStorageSubscriptionID *string `json:"DestinationStorageSubscriptionId,omitempty"`
   372  	// DestinationStorageLocationID - READ-ONLY; The destination account location ID.
   373  	DestinationStorageLocationID *string `json:"DestinationStorageLocationId,omitempty"`
   374  	// DestinationAccountID - READ-ONLY; The name of destination account.
   375  	DestinationAccountID *string `json:"DestinationAccountId,omitempty"`
   376  	// DestinationType - READ-ONLY; The destination type.
   377  	DestinationType *string `json:"DestinationType,omitempty"`
   378  	// IsUserEnabled - READ-ONLY; This will be 'true' if the Continuous Export configuration is enabled, otherwise it will be 'false'.
   379  	IsUserEnabled *string `json:"IsUserEnabled,omitempty"`
   380  	// LastUserUpdate - READ-ONLY; Last time the Continuous Export configuration was updated.
   381  	LastUserUpdate *string `json:"LastUserUpdate,omitempty"`
   382  	// NotificationQueueEnabled - Deprecated
   383  	NotificationQueueEnabled *string `json:"NotificationQueueEnabled,omitempty"`
   384  	// ExportStatus - READ-ONLY; This indicates current Continuous Export configuration status. The possible values are 'Preparing', 'Success', 'Failure'.
   385  	ExportStatus *string `json:"ExportStatus,omitempty"`
   386  	// LastSuccessTime - READ-ONLY; The last time data was successfully delivered to the destination storage container for this Continuous Export configuration.
   387  	LastSuccessTime *string `json:"LastSuccessTime,omitempty"`
   388  	// LastGapTime - READ-ONLY; The last time the Continuous Export configuration started failing.
   389  	LastGapTime *string `json:"LastGapTime,omitempty"`
   390  	// PermanentErrorReason - READ-ONLY; This is the reason the Continuous Export configuration started failing. It can be 'AzureStorageNotFound' or 'AzureStorageAccessDenied'.
   391  	PermanentErrorReason *string `json:"PermanentErrorReason,omitempty"`
   392  	// StorageName - READ-ONLY; The name of the destination storage account.
   393  	StorageName *string `json:"StorageName,omitempty"`
   394  	// ContainerName - READ-ONLY; The name of the destination storage container.
   395  	ContainerName *string `json:"ContainerName,omitempty"`
   396  }
   397  
   398  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentExportConfiguration.
   399  func (aicec ApplicationInsightsComponentExportConfiguration) MarshalJSON() ([]byte, error) {
   400  	objectMap := make(map[string]interface{})
   401  	if aicec.RecordTypes != nil {
   402  		objectMap["RecordTypes"] = aicec.RecordTypes
   403  	}
   404  	if aicec.NotificationQueueEnabled != nil {
   405  		objectMap["NotificationQueueEnabled"] = aicec.NotificationQueueEnabled
   406  	}
   407  	return json.Marshal(objectMap)
   408  }
   409  
   410  // ApplicationInsightsComponentExportRequest an Application Insights component Continuous Export
   411  // configuration request definition.
   412  type ApplicationInsightsComponentExportRequest struct {
   413  	// RecordTypes - The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'.
   414  	RecordTypes *string `json:"RecordTypes,omitempty"`
   415  	// DestinationType - The Continuous Export destination type. This has to be 'Blob'.
   416  	DestinationType *string `json:"DestinationType,omitempty"`
   417  	// DestinationAddress - The SAS URL for the destination storage container. It must grant write permission.
   418  	DestinationAddress *string `json:"DestinationAddress,omitempty"`
   419  	// IsEnabled - Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'.
   420  	IsEnabled *string `json:"IsEnabled,omitempty"`
   421  	// NotificationQueueEnabled - Deprecated
   422  	NotificationQueueEnabled *string `json:"NotificationQueueEnabled,omitempty"`
   423  	// NotificationQueueURI - Deprecated
   424  	NotificationQueueURI *string `json:"NotificationQueueUri,omitempty"`
   425  	// DestinationStorageSubscriptionID - The subscription ID of the destination storage container.
   426  	DestinationStorageSubscriptionID *string `json:"DestinationStorageSubscriptionId,omitempty"`
   427  	// DestinationStorageLocationID - The location ID of the destination storage container.
   428  	DestinationStorageLocationID *string `json:"DestinationStorageLocationId,omitempty"`
   429  	// DestinationAccountID - The name of destination storage account.
   430  	DestinationAccountID *string `json:"DestinationAccountId,omitempty"`
   431  }
   432  
   433  // ApplicationInsightsComponentFavorite properties that define a favorite that is associated to an
   434  // Application Insights component.
   435  type ApplicationInsightsComponentFavorite struct {
   436  	autorest.Response `json:"-"`
   437  	// Name - The user-defined name of the favorite.
   438  	Name *string `json:"Name,omitempty"`
   439  	// Config - Configuration of this particular favorite, which are driven by the Azure portal UX. Configuration data is a string containing valid JSON
   440  	Config *string `json:"Config,omitempty"`
   441  	// Version - This instance's version of the data model. This can change as new features are added that can be marked favorite. Current examples include MetricsExplorer (ME) and Search.
   442  	Version *string `json:"Version,omitempty"`
   443  	// FavoriteID - READ-ONLY; Internally assigned unique id of the favorite definition.
   444  	FavoriteID *string `json:"FavoriteId,omitempty"`
   445  	// FavoriteType - Enum indicating if this favorite definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'FavoriteTypeShared', 'FavoriteTypeUser'
   446  	FavoriteType FavoriteType `json:"FavoriteType,omitempty"`
   447  	// SourceType - The source of the favorite definition.
   448  	SourceType *string `json:"SourceType,omitempty"`
   449  	// TimeModified - READ-ONLY; Date and time in UTC of the last modification that was made to this favorite definition.
   450  	TimeModified *string `json:"TimeModified,omitempty"`
   451  	// Tags - A list of 0 or more tags that are associated with this favorite definition
   452  	Tags *[]string `json:"Tags,omitempty"`
   453  	// Category - Favorite category, as defined by the user at creation time.
   454  	Category *string `json:"Category,omitempty"`
   455  	// IsGeneratedFromTemplate - Flag denoting wether or not this favorite was generated from a template.
   456  	IsGeneratedFromTemplate *bool `json:"IsGeneratedFromTemplate,omitempty"`
   457  	// UserID - READ-ONLY; Unique user id of the specific user that owns this favorite.
   458  	UserID *string `json:"UserId,omitempty"`
   459  }
   460  
   461  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentFavorite.
   462  func (aicf ApplicationInsightsComponentFavorite) MarshalJSON() ([]byte, error) {
   463  	objectMap := make(map[string]interface{})
   464  	if aicf.Name != nil {
   465  		objectMap["Name"] = aicf.Name
   466  	}
   467  	if aicf.Config != nil {
   468  		objectMap["Config"] = aicf.Config
   469  	}
   470  	if aicf.Version != nil {
   471  		objectMap["Version"] = aicf.Version
   472  	}
   473  	if aicf.FavoriteType != "" {
   474  		objectMap["FavoriteType"] = aicf.FavoriteType
   475  	}
   476  	if aicf.SourceType != nil {
   477  		objectMap["SourceType"] = aicf.SourceType
   478  	}
   479  	if aicf.Tags != nil {
   480  		objectMap["Tags"] = aicf.Tags
   481  	}
   482  	if aicf.Category != nil {
   483  		objectMap["Category"] = aicf.Category
   484  	}
   485  	if aicf.IsGeneratedFromTemplate != nil {
   486  		objectMap["IsGeneratedFromTemplate"] = aicf.IsGeneratedFromTemplate
   487  	}
   488  	return json.Marshal(objectMap)
   489  }
   490  
   491  // ApplicationInsightsComponentFeature an Application Insights component daily data volume cap status
   492  type ApplicationInsightsComponentFeature struct {
   493  	// FeatureName - READ-ONLY; The pricing feature name.
   494  	FeatureName *string `json:"FeatureName,omitempty"`
   495  	// MeterID - READ-ONLY; The meter id used for the feature.
   496  	MeterID *string `json:"MeterId,omitempty"`
   497  	// MeterRateFrequency - READ-ONLY; The meter rate for the feature's meter.
   498  	MeterRateFrequency *string `json:"MeterRateFrequency,omitempty"`
   499  	// ResouceID - READ-ONLY; Reserved, not used now.
   500  	ResouceID *string `json:"ResouceId,omitempty"`
   501  	// IsHidden - READ-ONLY; Reserved, not used now.
   502  	IsHidden *bool `json:"IsHidden,omitempty"`
   503  	// Capabilities - READ-ONLY; A list of Application Insights component feature capability.
   504  	Capabilities *[]ApplicationInsightsComponentFeatureCapability `json:"Capabilities,omitempty"`
   505  	// Title - READ-ONLY; Display name of the feature.
   506  	Title *string `json:"Title,omitempty"`
   507  	// IsMainFeature - READ-ONLY; Whether can apply addon feature on to it.
   508  	IsMainFeature *bool `json:"IsMainFeature,omitempty"`
   509  	// SupportedAddonFeatures - READ-ONLY; The add on features on main feature.
   510  	SupportedAddonFeatures *string `json:"SupportedAddonFeatures,omitempty"`
   511  }
   512  
   513  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentFeature.
   514  func (aicf ApplicationInsightsComponentFeature) MarshalJSON() ([]byte, error) {
   515  	objectMap := make(map[string]interface{})
   516  	return json.Marshal(objectMap)
   517  }
   518  
   519  // ApplicationInsightsComponentFeatureCapabilities an Application Insights component feature capabilities
   520  type ApplicationInsightsComponentFeatureCapabilities struct {
   521  	autorest.Response `json:"-"`
   522  	// SupportExportData - READ-ONLY; Whether allow to use continuous export feature.
   523  	SupportExportData *bool `json:"SupportExportData,omitempty"`
   524  	// BurstThrottlePolicy - READ-ONLY; Reserved, not used now.
   525  	BurstThrottlePolicy *string `json:"BurstThrottlePolicy,omitempty"`
   526  	// MetadataClass - READ-ONLY; Reserved, not used now.
   527  	MetadataClass *string `json:"MetadataClass,omitempty"`
   528  	// LiveStreamMetrics - READ-ONLY; Reserved, not used now.
   529  	LiveStreamMetrics *bool `json:"LiveStreamMetrics,omitempty"`
   530  	// ApplicationMap - READ-ONLY; Reserved, not used now.
   531  	ApplicationMap *bool `json:"ApplicationMap,omitempty"`
   532  	// WorkItemIntegration - READ-ONLY; Whether allow to use work item integration feature.
   533  	WorkItemIntegration *bool `json:"WorkItemIntegration,omitempty"`
   534  	// PowerBIIntegration - READ-ONLY; Reserved, not used now.
   535  	PowerBIIntegration *bool `json:"PowerBIIntegration,omitempty"`
   536  	// OpenSchema - READ-ONLY; Reserved, not used now.
   537  	OpenSchema *bool `json:"OpenSchema,omitempty"`
   538  	// ProactiveDetection - READ-ONLY; Reserved, not used now.
   539  	ProactiveDetection *bool `json:"ProactiveDetection,omitempty"`
   540  	// AnalyticsIntegration - READ-ONLY; Reserved, not used now.
   541  	AnalyticsIntegration *bool `json:"AnalyticsIntegration,omitempty"`
   542  	// MultipleStepWebTest - READ-ONLY; Whether allow to use multiple steps web test feature.
   543  	MultipleStepWebTest *bool `json:"MultipleStepWebTest,omitempty"`
   544  	// APIAccessLevel - READ-ONLY; Reserved, not used now.
   545  	APIAccessLevel *string `json:"ApiAccessLevel,omitempty"`
   546  	// TrackingType - READ-ONLY; The application insights component used tracking type.
   547  	TrackingType *string `json:"TrackingType,omitempty"`
   548  	// DailyCap - READ-ONLY; Daily data volume cap in GB.
   549  	DailyCap *float64 `json:"DailyCap,omitempty"`
   550  	// DailyCapResetTime - READ-ONLY; Daily data volume cap UTC reset hour.
   551  	DailyCapResetTime *float64 `json:"DailyCapResetTime,omitempty"`
   552  	// ThrottleRate - READ-ONLY; Reserved, not used now.
   553  	ThrottleRate *float64 `json:"ThrottleRate,omitempty"`
   554  }
   555  
   556  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentFeatureCapabilities.
   557  func (aicfc ApplicationInsightsComponentFeatureCapabilities) MarshalJSON() ([]byte, error) {
   558  	objectMap := make(map[string]interface{})
   559  	return json.Marshal(objectMap)
   560  }
   561  
   562  // ApplicationInsightsComponentFeatureCapability an Application Insights component feature capability
   563  type ApplicationInsightsComponentFeatureCapability struct {
   564  	// Name - READ-ONLY; The name of the capability.
   565  	Name *string `json:"Name,omitempty"`
   566  	// Description - READ-ONLY; The description of the capability.
   567  	Description *string `json:"Description,omitempty"`
   568  	// Value - READ-ONLY; The value of the capability.
   569  	Value *string `json:"Value,omitempty"`
   570  	// Unit - READ-ONLY; The unit of the capability.
   571  	Unit *string `json:"Unit,omitempty"`
   572  	// MeterID - READ-ONLY; The meter used for the capability.
   573  	MeterID *string `json:"MeterId,omitempty"`
   574  	// MeterRateFrequency - READ-ONLY; The meter rate of the meter.
   575  	MeterRateFrequency *string `json:"MeterRateFrequency,omitempty"`
   576  }
   577  
   578  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentFeatureCapability.
   579  func (aicfc ApplicationInsightsComponentFeatureCapability) MarshalJSON() ([]byte, error) {
   580  	objectMap := make(map[string]interface{})
   581  	return json.Marshal(objectMap)
   582  }
   583  
   584  // ApplicationInsightsComponentListResult describes the list of Application Insights Resources.
   585  type ApplicationInsightsComponentListResult struct {
   586  	autorest.Response `json:"-"`
   587  	// Value - List of Application Insights component definitions.
   588  	Value *[]ApplicationInsightsComponent `json:"value,omitempty"`
   589  	// NextLink - The URI to get the next set of Application Insights component definitions if too many components where returned in the result set.
   590  	NextLink *string `json:"nextLink,omitempty"`
   591  }
   592  
   593  // ApplicationInsightsComponentListResultIterator provides access to a complete listing of
   594  // ApplicationInsightsComponent values.
   595  type ApplicationInsightsComponentListResultIterator struct {
   596  	i    int
   597  	page ApplicationInsightsComponentListResultPage
   598  }
   599  
   600  // NextWithContext advances to the next value.  If there was an error making
   601  // the request the iterator does not advance and the error is returned.
   602  func (iter *ApplicationInsightsComponentListResultIterator) NextWithContext(ctx context.Context) (err error) {
   603  	if tracing.IsEnabled() {
   604  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationInsightsComponentListResultIterator.NextWithContext")
   605  		defer func() {
   606  			sc := -1
   607  			if iter.Response().Response.Response != nil {
   608  				sc = iter.Response().Response.Response.StatusCode
   609  			}
   610  			tracing.EndSpan(ctx, sc, err)
   611  		}()
   612  	}
   613  	iter.i++
   614  	if iter.i < len(iter.page.Values()) {
   615  		return nil
   616  	}
   617  	err = iter.page.NextWithContext(ctx)
   618  	if err != nil {
   619  		iter.i--
   620  		return err
   621  	}
   622  	iter.i = 0
   623  	return nil
   624  }
   625  
   626  // Next advances to the next value.  If there was an error making
   627  // the request the iterator does not advance and the error is returned.
   628  // Deprecated: Use NextWithContext() instead.
   629  func (iter *ApplicationInsightsComponentListResultIterator) Next() error {
   630  	return iter.NextWithContext(context.Background())
   631  }
   632  
   633  // NotDone returns true if the enumeration should be started or is not yet complete.
   634  func (iter ApplicationInsightsComponentListResultIterator) NotDone() bool {
   635  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   636  }
   637  
   638  // Response returns the raw server response from the last page request.
   639  func (iter ApplicationInsightsComponentListResultIterator) Response() ApplicationInsightsComponentListResult {
   640  	return iter.page.Response()
   641  }
   642  
   643  // Value returns the current value or a zero-initialized value if the
   644  // iterator has advanced beyond the end of the collection.
   645  func (iter ApplicationInsightsComponentListResultIterator) Value() ApplicationInsightsComponent {
   646  	if !iter.page.NotDone() {
   647  		return ApplicationInsightsComponent{}
   648  	}
   649  	return iter.page.Values()[iter.i]
   650  }
   651  
   652  // Creates a new instance of the ApplicationInsightsComponentListResultIterator type.
   653  func NewApplicationInsightsComponentListResultIterator(page ApplicationInsightsComponentListResultPage) ApplicationInsightsComponentListResultIterator {
   654  	return ApplicationInsightsComponentListResultIterator{page: page}
   655  }
   656  
   657  // IsEmpty returns true if the ListResult contains no values.
   658  func (aiclr ApplicationInsightsComponentListResult) IsEmpty() bool {
   659  	return aiclr.Value == nil || len(*aiclr.Value) == 0
   660  }
   661  
   662  // hasNextLink returns true if the NextLink is not empty.
   663  func (aiclr ApplicationInsightsComponentListResult) hasNextLink() bool {
   664  	return aiclr.NextLink != nil && len(*aiclr.NextLink) != 0
   665  }
   666  
   667  // applicationInsightsComponentListResultPreparer prepares a request to retrieve the next set of results.
   668  // It returns nil if no more results exist.
   669  func (aiclr ApplicationInsightsComponentListResult) applicationInsightsComponentListResultPreparer(ctx context.Context) (*http.Request, error) {
   670  	if !aiclr.hasNextLink() {
   671  		return nil, nil
   672  	}
   673  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   674  		autorest.AsJSON(),
   675  		autorest.AsGet(),
   676  		autorest.WithBaseURL(to.String(aiclr.NextLink)))
   677  }
   678  
   679  // ApplicationInsightsComponentListResultPage contains a page of ApplicationInsightsComponent values.
   680  type ApplicationInsightsComponentListResultPage struct {
   681  	fn    func(context.Context, ApplicationInsightsComponentListResult) (ApplicationInsightsComponentListResult, error)
   682  	aiclr ApplicationInsightsComponentListResult
   683  }
   684  
   685  // NextWithContext advances to the next page of values.  If there was an error making
   686  // the request the page does not advance and the error is returned.
   687  func (page *ApplicationInsightsComponentListResultPage) NextWithContext(ctx context.Context) (err error) {
   688  	if tracing.IsEnabled() {
   689  		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationInsightsComponentListResultPage.NextWithContext")
   690  		defer func() {
   691  			sc := -1
   692  			if page.Response().Response.Response != nil {
   693  				sc = page.Response().Response.Response.StatusCode
   694  			}
   695  			tracing.EndSpan(ctx, sc, err)
   696  		}()
   697  	}
   698  	for {
   699  		next, err := page.fn(ctx, page.aiclr)
   700  		if err != nil {
   701  			return err
   702  		}
   703  		page.aiclr = next
   704  		if !next.hasNextLink() || !next.IsEmpty() {
   705  			break
   706  		}
   707  	}
   708  	return nil
   709  }
   710  
   711  // Next advances to the next page of values.  If there was an error making
   712  // the request the page does not advance and the error is returned.
   713  // Deprecated: Use NextWithContext() instead.
   714  func (page *ApplicationInsightsComponentListResultPage) Next() error {
   715  	return page.NextWithContext(context.Background())
   716  }
   717  
   718  // NotDone returns true if the page enumeration should be started or is not yet complete.
   719  func (page ApplicationInsightsComponentListResultPage) NotDone() bool {
   720  	return !page.aiclr.IsEmpty()
   721  }
   722  
   723  // Response returns the raw server response from the last page request.
   724  func (page ApplicationInsightsComponentListResultPage) Response() ApplicationInsightsComponentListResult {
   725  	return page.aiclr
   726  }
   727  
   728  // Values returns the slice of values for the current page or nil if there are no values.
   729  func (page ApplicationInsightsComponentListResultPage) Values() []ApplicationInsightsComponent {
   730  	if page.aiclr.IsEmpty() {
   731  		return nil
   732  	}
   733  	return *page.aiclr.Value
   734  }
   735  
   736  // Creates a new instance of the ApplicationInsightsComponentListResultPage type.
   737  func NewApplicationInsightsComponentListResultPage(cur ApplicationInsightsComponentListResult, getNextPage func(context.Context, ApplicationInsightsComponentListResult) (ApplicationInsightsComponentListResult, error)) ApplicationInsightsComponentListResultPage {
   738  	return ApplicationInsightsComponentListResultPage{
   739  		fn:    getNextPage,
   740  		aiclr: cur,
   741  	}
   742  }
   743  
   744  // ApplicationInsightsComponentProactiveDetectionConfiguration properties that define a ProactiveDetection
   745  // configuration.
   746  type ApplicationInsightsComponentProactiveDetectionConfiguration struct {
   747  	autorest.Response `json:"-"`
   748  	// Name - The rule name
   749  	Name *string `json:"Name,omitempty"`
   750  	// Enabled - A flag that indicates whether this rule is enabled by the user
   751  	Enabled *bool `json:"Enabled,omitempty"`
   752  	// SendEmailsToSubscriptionOwners - A flag that indicated whether notifications on this rule should be sent to subscription owners
   753  	SendEmailsToSubscriptionOwners *bool `json:"SendEmailsToSubscriptionOwners,omitempty"`
   754  	// CustomEmails - Custom email addresses for this rule notifications
   755  	CustomEmails *[]string `json:"CustomEmails,omitempty"`
   756  	// LastUpdatedTime - The last time this rule was updated
   757  	LastUpdatedTime *string `json:"LastUpdatedTime,omitempty"`
   758  	// RuleDefinitions - Static definitions of the ProactiveDetection configuration rule (same values for all components).
   759  	RuleDefinitions *ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions `json:"RuleDefinitions,omitempty"`
   760  }
   761  
   762  // ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions static definitions of the
   763  // ProactiveDetection configuration rule (same values for all components).
   764  type ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions struct {
   765  	// Name - The rule name
   766  	Name *string `json:"Name,omitempty"`
   767  	// DisplayName - The rule name as it is displayed in UI
   768  	DisplayName *string `json:"DisplayName,omitempty"`
   769  	// Description - The rule description
   770  	Description *string `json:"Description,omitempty"`
   771  	// HelpURL - URL which displays additional info about the proactive detection rule
   772  	HelpURL *string `json:"HelpUrl,omitempty"`
   773  	// IsHidden - A flag indicating whether the rule is hidden (from the UI)
   774  	IsHidden *bool `json:"IsHidden,omitempty"`
   775  	// IsEnabledByDefault - A flag indicating whether the rule is enabled by default
   776  	IsEnabledByDefault *bool `json:"IsEnabledByDefault,omitempty"`
   777  	// IsInPreview - A flag indicating whether the rule is in preview
   778  	IsInPreview *bool `json:"IsInPreview,omitempty"`
   779  	// SupportsEmailNotifications - A flag indicating whether email notifications are supported for detections for this rule
   780  	SupportsEmailNotifications *bool `json:"SupportsEmailNotifications,omitempty"`
   781  }
   782  
   783  // ApplicationInsightsComponentProperties properties that define an Application Insights component
   784  // resource.
   785  type ApplicationInsightsComponentProperties struct {
   786  	// ApplicationID - READ-ONLY; The unique ID of your application. This field mirrors the 'Name' field and cannot be changed.
   787  	ApplicationID *string `json:"ApplicationId,omitempty"`
   788  	// AppID - READ-ONLY; Application Insights Unique ID for your Application.
   789  	AppID *string `json:"AppId,omitempty"`
   790  	// Name - READ-ONLY; Application name.
   791  	Name *string `json:"Name,omitempty"`
   792  	// ApplicationType - Type of application being monitored. Possible values include: 'ApplicationTypeWeb', 'ApplicationTypeOther'
   793  	ApplicationType ApplicationType `json:"Application_Type,omitempty"`
   794  	// FlowType - Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API. Possible values include: 'FlowTypeBluefield'
   795  	FlowType FlowType `json:"Flow_Type,omitempty"`
   796  	// RequestSource - Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. Possible values include: 'RequestSourceRest'
   797  	RequestSource RequestSource `json:"Request_Source,omitempty"`
   798  	// InstrumentationKey - READ-ONLY; Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application Insights component.
   799  	InstrumentationKey *string `json:"InstrumentationKey,omitempty"`
   800  	// CreationDate - READ-ONLY; Creation Date for the Application Insights component, in ISO 8601 format.
   801  	CreationDate *date.Time `json:"CreationDate,omitempty"`
   802  	// TenantID - READ-ONLY; Azure Tenant Id.
   803  	TenantID *string `json:"TenantId,omitempty"`
   804  	// HockeyAppID - The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp.
   805  	HockeyAppID *string `json:"HockeyAppId,omitempty"`
   806  	// HockeyAppToken - READ-ONLY; Token used to authenticate communications with between Application Insights and HockeyApp.
   807  	HockeyAppToken *string `json:"HockeyAppToken,omitempty"`
   808  	// ProvisioningState - READ-ONLY; Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.
   809  	ProvisioningState *string `json:"provisioningState,omitempty"`
   810  	// SamplingPercentage - Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry.
   811  	SamplingPercentage *float64 `json:"SamplingPercentage,omitempty"`
   812  	// ConnectionString - READ-ONLY; Application Insights component connection string.
   813  	ConnectionString *string `json:"ConnectionString,omitempty"`
   814  	// RetentionInDays - Retention period in days.
   815  	RetentionInDays *int32 `json:"RetentionInDays,omitempty"`
   816  	// DisableIPMasking - Disable IP masking.
   817  	DisableIPMasking *bool `json:"DisableIpMasking,omitempty"`
   818  	// ImmediatePurgeDataOn30Days - Purge data immediately after 30 days.
   819  	ImmediatePurgeDataOn30Days *bool `json:"ImmediatePurgeDataOn30Days,omitempty"`
   820  	// WorkspaceResourceID - Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an application with this API version. Applications from older versions will not have this property.
   821  	WorkspaceResourceID *string `json:"WorkspaceResourceId,omitempty"`
   822  	// LaMigrationDate - READ-ONLY; The date which the component got migrated to LA, in ISO 8601 format.
   823  	LaMigrationDate *date.Time `json:"LaMigrationDate,omitempty"`
   824  	// PrivateLinkScopedResources - READ-ONLY; List of linked private link scope resources.
   825  	PrivateLinkScopedResources *[]PrivateLinkScopedResource `json:"PrivateLinkScopedResources,omitempty"`
   826  	// PublicNetworkAccessForIngestion - The network access type for accessing Application Insights ingestion. Possible values include: 'PublicNetworkAccessTypeEnabled', 'PublicNetworkAccessTypeDisabled'
   827  	PublicNetworkAccessForIngestion PublicNetworkAccessType `json:"publicNetworkAccessForIngestion,omitempty"`
   828  	// PublicNetworkAccessForQuery - The network access type for accessing Application Insights query. Possible values include: 'PublicNetworkAccessTypeEnabled', 'PublicNetworkAccessTypeDisabled'
   829  	PublicNetworkAccessForQuery PublicNetworkAccessType `json:"publicNetworkAccessForQuery,omitempty"`
   830  	// IngestionMode - Indicates the flow of the ingestion. Possible values include: 'IngestionModeApplicationInsights', 'IngestionModeApplicationInsightsWithDiagnosticSettings', 'IngestionModeLogAnalytics'
   831  	IngestionMode IngestionMode `json:"IngestionMode,omitempty"`
   832  	// DisableLocalAuth - Disable Non-AAD based Auth.
   833  	DisableLocalAuth *bool `json:"DisableLocalAuth,omitempty"`
   834  	// ForceCustomerStorageForProfiler - Force users to create their own storage account for profiler and debugger.
   835  	ForceCustomerStorageForProfiler *bool `json:"ForceCustomerStorageForProfiler,omitempty"`
   836  }
   837  
   838  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentProperties.
   839  func (aicp ApplicationInsightsComponentProperties) MarshalJSON() ([]byte, error) {
   840  	objectMap := make(map[string]interface{})
   841  	if aicp.ApplicationType != "" {
   842  		objectMap["Application_Type"] = aicp.ApplicationType
   843  	}
   844  	if aicp.FlowType != "" {
   845  		objectMap["Flow_Type"] = aicp.FlowType
   846  	}
   847  	if aicp.RequestSource != "" {
   848  		objectMap["Request_Source"] = aicp.RequestSource
   849  	}
   850  	if aicp.HockeyAppID != nil {
   851  		objectMap["HockeyAppId"] = aicp.HockeyAppID
   852  	}
   853  	if aicp.SamplingPercentage != nil {
   854  		objectMap["SamplingPercentage"] = aicp.SamplingPercentage
   855  	}
   856  	if aicp.RetentionInDays != nil {
   857  		objectMap["RetentionInDays"] = aicp.RetentionInDays
   858  	}
   859  	if aicp.DisableIPMasking != nil {
   860  		objectMap["DisableIpMasking"] = aicp.DisableIPMasking
   861  	}
   862  	if aicp.ImmediatePurgeDataOn30Days != nil {
   863  		objectMap["ImmediatePurgeDataOn30Days"] = aicp.ImmediatePurgeDataOn30Days
   864  	}
   865  	if aicp.WorkspaceResourceID != nil {
   866  		objectMap["WorkspaceResourceId"] = aicp.WorkspaceResourceID
   867  	}
   868  	if aicp.PublicNetworkAccessForIngestion != "" {
   869  		objectMap["publicNetworkAccessForIngestion"] = aicp.PublicNetworkAccessForIngestion
   870  	}
   871  	if aicp.PublicNetworkAccessForQuery != "" {
   872  		objectMap["publicNetworkAccessForQuery"] = aicp.PublicNetworkAccessForQuery
   873  	}
   874  	if aicp.IngestionMode != "" {
   875  		objectMap["IngestionMode"] = aicp.IngestionMode
   876  	}
   877  	if aicp.DisableLocalAuth != nil {
   878  		objectMap["DisableLocalAuth"] = aicp.DisableLocalAuth
   879  	}
   880  	if aicp.ForceCustomerStorageForProfiler != nil {
   881  		objectMap["ForceCustomerStorageForProfiler"] = aicp.ForceCustomerStorageForProfiler
   882  	}
   883  	return json.Marshal(objectMap)
   884  }
   885  
   886  // ApplicationInsightsComponentQuotaStatus an Application Insights component daily data volume cap status
   887  type ApplicationInsightsComponentQuotaStatus struct {
   888  	autorest.Response `json:"-"`
   889  	// AppID - READ-ONLY; The Application ID for the Application Insights component.
   890  	AppID *string `json:"AppId,omitempty"`
   891  	// ShouldBeThrottled - READ-ONLY; The daily data volume cap is met, and data ingestion will be stopped.
   892  	ShouldBeThrottled *bool `json:"ShouldBeThrottled,omitempty"`
   893  	// ExpirationTime - READ-ONLY; Date and time when the daily data volume cap will be reset, and data ingestion will resume.
   894  	ExpirationTime *string `json:"ExpirationTime,omitempty"`
   895  }
   896  
   897  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentQuotaStatus.
   898  func (aicqs ApplicationInsightsComponentQuotaStatus) MarshalJSON() ([]byte, error) {
   899  	objectMap := make(map[string]interface{})
   900  	return json.Marshal(objectMap)
   901  }
   902  
   903  // ApplicationInsightsComponentWebTestLocation properties that define a web test location available to an
   904  // Application Insights Component.
   905  type ApplicationInsightsComponentWebTestLocation struct {
   906  	// DisplayName - READ-ONLY; The display name of the web test location.
   907  	DisplayName *string `json:"DisplayName,omitempty"`
   908  	// Tag - READ-ONLY; Internally defined geographic location tag.
   909  	Tag *string `json:"Tag,omitempty"`
   910  }
   911  
   912  // MarshalJSON is the custom marshaler for ApplicationInsightsComponentWebTestLocation.
   913  func (aicwtl ApplicationInsightsComponentWebTestLocation) MarshalJSON() ([]byte, error) {
   914  	objectMap := make(map[string]interface{})
   915  	return json.Marshal(objectMap)
   916  }
   917  
   918  // ApplicationInsightsWebTestLocationsListResult describes the list of web test locations available to an
   919  // Application Insights Component.
   920  type ApplicationInsightsWebTestLocationsListResult struct {
   921  	autorest.Response `json:"-"`
   922  	// Value - List of web test locations.
   923  	Value *[]ApplicationInsightsComponentWebTestLocation `json:"value,omitempty"`
   924  }
   925  
   926  // AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
   927  type AzureEntityResource struct {
   928  	// Etag - READ-ONLY; Resource Etag.
   929  	Etag *string `json:"etag,omitempty"`
   930  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   931  	ID *string `json:"id,omitempty"`
   932  	// Name - READ-ONLY; The name of the resource
   933  	Name *string `json:"name,omitempty"`
   934  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   935  	Type *string `json:"type,omitempty"`
   936  }
   937  
   938  // MarshalJSON is the custom marshaler for AzureEntityResource.
   939  func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
   940  	objectMap := make(map[string]interface{})
   941  	return json.Marshal(objectMap)
   942  }
   943  
   944  // ComponentLinkedStorageAccounts an Application Insights component linked storage accounts
   945  type ComponentLinkedStorageAccounts struct {
   946  	autorest.Response `json:"-"`
   947  	// LinkedStorageAccountsProperties - The properties of the linked storage accounts.
   948  	*LinkedStorageAccountsProperties `json:"properties,omitempty"`
   949  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   950  	ID *string `json:"id,omitempty"`
   951  	// Name - READ-ONLY; The name of the resource
   952  	Name *string `json:"name,omitempty"`
   953  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   954  	Type *string `json:"type,omitempty"`
   955  }
   956  
   957  // MarshalJSON is the custom marshaler for ComponentLinkedStorageAccounts.
   958  func (clsa ComponentLinkedStorageAccounts) MarshalJSON() ([]byte, error) {
   959  	objectMap := make(map[string]interface{})
   960  	if clsa.LinkedStorageAccountsProperties != nil {
   961  		objectMap["properties"] = clsa.LinkedStorageAccountsProperties
   962  	}
   963  	return json.Marshal(objectMap)
   964  }
   965  
   966  // UnmarshalJSON is the custom unmarshaler for ComponentLinkedStorageAccounts struct.
   967  func (clsa *ComponentLinkedStorageAccounts) UnmarshalJSON(body []byte) error {
   968  	var m map[string]*json.RawMessage
   969  	err := json.Unmarshal(body, &m)
   970  	if err != nil {
   971  		return err
   972  	}
   973  	for k, v := range m {
   974  		switch k {
   975  		case "properties":
   976  			if v != nil {
   977  				var linkedStorageAccountsProperties LinkedStorageAccountsProperties
   978  				err = json.Unmarshal(*v, &linkedStorageAccountsProperties)
   979  				if err != nil {
   980  					return err
   981  				}
   982  				clsa.LinkedStorageAccountsProperties = &linkedStorageAccountsProperties
   983  			}
   984  		case "id":
   985  			if v != nil {
   986  				var ID string
   987  				err = json.Unmarshal(*v, &ID)
   988  				if err != nil {
   989  					return err
   990  				}
   991  				clsa.ID = &ID
   992  			}
   993  		case "name":
   994  			if v != nil {
   995  				var name string
   996  				err = json.Unmarshal(*v, &name)
   997  				if err != nil {
   998  					return err
   999  				}
  1000  				clsa.Name = &name
  1001  			}
  1002  		case "type":
  1003  			if v != nil {
  1004  				var typeVar string
  1005  				err = json.Unmarshal(*v, &typeVar)
  1006  				if err != nil {
  1007  					return err
  1008  				}
  1009  				clsa.Type = &typeVar
  1010  			}
  1011  		}
  1012  	}
  1013  
  1014  	return nil
  1015  }
  1016  
  1017  // ComponentLinkedStorageAccountsPatch an Application Insights component linked storage accounts patch
  1018  type ComponentLinkedStorageAccountsPatch struct {
  1019  	// LinkedStorageAccountsProperties - The properties of the linked storage accounts.
  1020  	*LinkedStorageAccountsProperties `json:"properties,omitempty"`
  1021  }
  1022  
  1023  // MarshalJSON is the custom marshaler for ComponentLinkedStorageAccountsPatch.
  1024  func (clsap ComponentLinkedStorageAccountsPatch) MarshalJSON() ([]byte, error) {
  1025  	objectMap := make(map[string]interface{})
  1026  	if clsap.LinkedStorageAccountsProperties != nil {
  1027  		objectMap["properties"] = clsap.LinkedStorageAccountsProperties
  1028  	}
  1029  	return json.Marshal(objectMap)
  1030  }
  1031  
  1032  // UnmarshalJSON is the custom unmarshaler for ComponentLinkedStorageAccountsPatch struct.
  1033  func (clsap *ComponentLinkedStorageAccountsPatch) UnmarshalJSON(body []byte) error {
  1034  	var m map[string]*json.RawMessage
  1035  	err := json.Unmarshal(body, &m)
  1036  	if err != nil {
  1037  		return err
  1038  	}
  1039  	for k, v := range m {
  1040  		switch k {
  1041  		case "properties":
  1042  			if v != nil {
  1043  				var linkedStorageAccountsProperties LinkedStorageAccountsProperties
  1044  				err = json.Unmarshal(*v, &linkedStorageAccountsProperties)
  1045  				if err != nil {
  1046  					return err
  1047  				}
  1048  				clsap.LinkedStorageAccountsProperties = &linkedStorageAccountsProperties
  1049  			}
  1050  		}
  1051  	}
  1052  
  1053  	return nil
  1054  }
  1055  
  1056  // ComponentPurgeBody describes the body of a purge request for an App Insights component
  1057  type ComponentPurgeBody struct {
  1058  	// Table - Table from which to purge data.
  1059  	Table *string `json:"table,omitempty"`
  1060  	// Filters - The set of columns and filters (queries) to run over them to purge the resulting data.
  1061  	Filters *[]ComponentPurgeBodyFilters `json:"filters,omitempty"`
  1062  }
  1063  
  1064  // ComponentPurgeBodyFilters user-defined filters to return data which will be purged from the table.
  1065  type ComponentPurgeBodyFilters struct {
  1066  	// Column - The column of the table over which the given query should run
  1067  	Column *string `json:"column,omitempty"`
  1068  	// Operator - A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query.
  1069  	Operator *string `json:"operator,omitempty"`
  1070  	// Value - the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values.
  1071  	Value interface{} `json:"value,omitempty"`
  1072  	// Key - When filtering over custom dimensions, this key will be used as the name of the custom dimension.
  1073  	Key *string `json:"key,omitempty"`
  1074  }
  1075  
  1076  // ComponentPurgeResponse response containing operationId for a specific purge action.
  1077  type ComponentPurgeResponse struct {
  1078  	autorest.Response `json:"-"`
  1079  	// OperationID - Id to use when querying for status for a particular purge operation.
  1080  	OperationID *string `json:"operationId,omitempty"`
  1081  }
  1082  
  1083  // ComponentPurgeStatusResponse response containing status for a specific purge operation.
  1084  type ComponentPurgeStatusResponse struct {
  1085  	autorest.Response `json:"-"`
  1086  	// Status - Status of the operation represented by the requested Id. Possible values include: 'PurgeStatePending', 'PurgeStateCompleted'
  1087  	Status PurgeState `json:"status,omitempty"`
  1088  }
  1089  
  1090  // ComponentsResource an azure resource object
  1091  type ComponentsResource struct {
  1092  	// ID - READ-ONLY; Azure resource Id
  1093  	ID *string `json:"id,omitempty"`
  1094  	// Name - READ-ONLY; Azure resource name
  1095  	Name *string `json:"name,omitempty"`
  1096  	// Type - READ-ONLY; Azure resource type
  1097  	Type *string `json:"type,omitempty"`
  1098  	// Location - Resource location
  1099  	Location *string `json:"location,omitempty"`
  1100  	// Tags - Resource tags
  1101  	Tags map[string]*string `json:"tags"`
  1102  }
  1103  
  1104  // MarshalJSON is the custom marshaler for ComponentsResource.
  1105  func (cr ComponentsResource) MarshalJSON() ([]byte, error) {
  1106  	objectMap := make(map[string]interface{})
  1107  	if cr.Location != nil {
  1108  		objectMap["location"] = cr.Location
  1109  	}
  1110  	if cr.Tags != nil {
  1111  		objectMap["tags"] = cr.Tags
  1112  	}
  1113  	return json.Marshal(objectMap)
  1114  }
  1115  
  1116  // ErrorDefinition error definition.
  1117  type ErrorDefinition struct {
  1118  	// Code - READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code.
  1119  	Code *string `json:"code,omitempty"`
  1120  	// Message - READ-ONLY; Description of the error.
  1121  	Message *string `json:"message,omitempty"`
  1122  	// Innererror - READ-ONLY; Internal error details.
  1123  	Innererror interface{} `json:"innererror,omitempty"`
  1124  }
  1125  
  1126  // MarshalJSON is the custom marshaler for ErrorDefinition.
  1127  func (ed ErrorDefinition) MarshalJSON() ([]byte, error) {
  1128  	objectMap := make(map[string]interface{})
  1129  	return json.Marshal(objectMap)
  1130  }
  1131  
  1132  // ErrorResponse error response indicates Insights service is not able to process the incoming request. The
  1133  // reason is provided in the error message.
  1134  type ErrorResponse struct {
  1135  	// Code - Error code.
  1136  	Code *string `json:"code,omitempty"`
  1137  	// Message - Error message indicating why the operation failed.
  1138  	Message *string `json:"message,omitempty"`
  1139  }
  1140  
  1141  // ErrorResponseComponents ...
  1142  type ErrorResponseComponents struct {
  1143  	// Error - Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message.
  1144  	Error *ErrorResponseComponentsError `json:"error,omitempty"`
  1145  }
  1146  
  1147  // ErrorResponseComponentsError error response indicates Insights service is not able to process the
  1148  // incoming request. The reason is provided in the error message.
  1149  type ErrorResponseComponentsError struct {
  1150  	// Code - READ-ONLY; Error code.
  1151  	Code *string `json:"code,omitempty"`
  1152  	// Message - READ-ONLY; Error message indicating why the operation failed.
  1153  	Message *string `json:"message,omitempty"`
  1154  }
  1155  
  1156  // MarshalJSON is the custom marshaler for ErrorResponseComponentsError.
  1157  func (erc ErrorResponseComponentsError) MarshalJSON() ([]byte, error) {
  1158  	objectMap := make(map[string]interface{})
  1159  	return json.Marshal(objectMap)
  1160  }
  1161  
  1162  // ErrorResponseLinkedStorage ...
  1163  type ErrorResponseLinkedStorage struct {
  1164  	// Error - Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message.
  1165  	Error *ErrorResponseLinkedStorageError `json:"error,omitempty"`
  1166  }
  1167  
  1168  // ErrorResponseLinkedStorageError error response indicates Insights service is not able to process the
  1169  // incoming request. The reason is provided in the error message.
  1170  type ErrorResponseLinkedStorageError struct {
  1171  	// Code - READ-ONLY; Error code.
  1172  	Code *string `json:"code,omitempty"`
  1173  	// Message - READ-ONLY; Error message indicating why the operation failed.
  1174  	Message *string `json:"message,omitempty"`
  1175  }
  1176  
  1177  // MarshalJSON is the custom marshaler for ErrorResponseLinkedStorageError.
  1178  func (erls ErrorResponseLinkedStorageError) MarshalJSON() ([]byte, error) {
  1179  	objectMap := make(map[string]interface{})
  1180  	return json.Marshal(objectMap)
  1181  }
  1182  
  1183  // InnerError inner error
  1184  type InnerError struct {
  1185  	// Diagnosticcontext - Provides correlation for request
  1186  	Diagnosticcontext *string `json:"diagnosticcontext,omitempty"`
  1187  	// Time - Request time
  1188  	Time *date.Time `json:"time,omitempty"`
  1189  }
  1190  
  1191  // InnerErrorTrace error details
  1192  type InnerErrorTrace struct {
  1193  	// Trace - READ-ONLY; detailed error trace
  1194  	Trace *[]string `json:"trace,omitempty"`
  1195  }
  1196  
  1197  // MarshalJSON is the custom marshaler for InnerErrorTrace.
  1198  func (iet InnerErrorTrace) MarshalJSON() ([]byte, error) {
  1199  	objectMap := make(map[string]interface{})
  1200  	return json.Marshal(objectMap)
  1201  }
  1202  
  1203  // LinkedStorageAccountsProperties an Application Insights component linked storage account
  1204  type LinkedStorageAccountsProperties struct {
  1205  	// LinkedStorageAccount - Linked storage account resource ID
  1206  	LinkedStorageAccount *string `json:"linkedStorageAccount,omitempty"`
  1207  }
  1208  
  1209  // ListAnnotation ...
  1210  type ListAnnotation struct {
  1211  	autorest.Response `json:"-"`
  1212  	Value             *[]Annotation `json:"value,omitempty"`
  1213  }
  1214  
  1215  // ListApplicationInsightsComponentAnalyticsItem ...
  1216  type ListApplicationInsightsComponentAnalyticsItem struct {
  1217  	autorest.Response `json:"-"`
  1218  	Value             *[]ApplicationInsightsComponentAnalyticsItem `json:"value,omitempty"`
  1219  }
  1220  
  1221  // ListApplicationInsightsComponentExportConfiguration ...
  1222  type ListApplicationInsightsComponentExportConfiguration struct {
  1223  	autorest.Response `json:"-"`
  1224  	Value             *[]ApplicationInsightsComponentExportConfiguration `json:"value,omitempty"`
  1225  }
  1226  
  1227  // ListApplicationInsightsComponentFavorite ...
  1228  type ListApplicationInsightsComponentFavorite struct {
  1229  	autorest.Response `json:"-"`
  1230  	Value             *[]ApplicationInsightsComponentFavorite `json:"value,omitempty"`
  1231  }
  1232  
  1233  // ListApplicationInsightsComponentProactiveDetectionConfiguration ...
  1234  type ListApplicationInsightsComponentProactiveDetectionConfiguration struct {
  1235  	autorest.Response `json:"-"`
  1236  	Value             *[]ApplicationInsightsComponentProactiveDetectionConfiguration `json:"value,omitempty"`
  1237  }
  1238  
  1239  // LiveTokenResponse the response to a live token query.
  1240  type LiveTokenResponse struct {
  1241  	autorest.Response `json:"-"`
  1242  	// LiveToken - READ-ONLY; JWT token for accessing live metrics stream data.
  1243  	LiveToken *string `json:"liveToken,omitempty"`
  1244  }
  1245  
  1246  // MarshalJSON is the custom marshaler for LiveTokenResponse.
  1247  func (ltr LiveTokenResponse) MarshalJSON() ([]byte, error) {
  1248  	objectMap := make(map[string]interface{})
  1249  	return json.Marshal(objectMap)
  1250  }
  1251  
  1252  // ManagedServiceIdentity managed service identity (system assigned and/or user assigned identities)
  1253  type ManagedServiceIdentity struct {
  1254  	// PrincipalID - READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.
  1255  	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
  1256  	// TenantID - READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.
  1257  	TenantID *uuid.UUID `json:"tenantId,omitempty"`
  1258  	// Type - Possible values include: 'ManagedServiceIdentityTypeNone', 'ManagedServiceIdentityTypeSystemAssigned', 'ManagedServiceIdentityTypeUserAssigned', 'ManagedServiceIdentityTypeSystemAssignedUserAssigned'
  1259  	Type                   ManagedServiceIdentityType       `json:"type,omitempty"`
  1260  	UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities"`
  1261  }
  1262  
  1263  // MarshalJSON is the custom marshaler for ManagedServiceIdentity.
  1264  func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) {
  1265  	objectMap := make(map[string]interface{})
  1266  	if msi.Type != "" {
  1267  		objectMap["type"] = msi.Type
  1268  	}
  1269  	if msi.UserAssignedIdentities != nil {
  1270  		objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities
  1271  	}
  1272  	return json.Marshal(objectMap)
  1273  }
  1274  
  1275  // MyWorkbook an Application Insights private workbook definition.
  1276  type MyWorkbook struct {
  1277  	autorest.Response `json:"-"`
  1278  	// Kind - The kind of workbook. Choices are user and shared. Possible values include: 'KindUser', 'KindShared'
  1279  	Kind Kind `json:"kind,omitempty"`
  1280  	// MyWorkbookProperties - Metadata describing a workbook for an Azure resource.
  1281  	*MyWorkbookProperties `json:"properties,omitempty"`
  1282  	// SystemData - READ-ONLY
  1283  	SystemData *SystemData `json:"systemData,omitempty"`
  1284  	// Identity - Identity used for BYOS
  1285  	Identity *MyWorkbookManagedIdentity `json:"identity,omitempty"`
  1286  	// ID - Azure resource Id
  1287  	ID *string `json:"id,omitempty"`
  1288  	// Name - Azure resource name
  1289  	Name *string `json:"name,omitempty"`
  1290  	// Type - Azure resource type
  1291  	Type *string `json:"type,omitempty"`
  1292  	// Location - Resource location
  1293  	Location *string `json:"location,omitempty"`
  1294  	// Tags - Resource tags
  1295  	Tags map[string]*string `json:"tags"`
  1296  	// Etag - Resource etag
  1297  	Etag map[string]*string `json:"etag"`
  1298  }
  1299  
  1300  // MarshalJSON is the custom marshaler for MyWorkbook.
  1301  func (mw MyWorkbook) MarshalJSON() ([]byte, error) {
  1302  	objectMap := make(map[string]interface{})
  1303  	if mw.Kind != "" {
  1304  		objectMap["kind"] = mw.Kind
  1305  	}
  1306  	if mw.MyWorkbookProperties != nil {
  1307  		objectMap["properties"] = mw.MyWorkbookProperties
  1308  	}
  1309  	if mw.Identity != nil {
  1310  		objectMap["identity"] = mw.Identity
  1311  	}
  1312  	if mw.ID != nil {
  1313  		objectMap["id"] = mw.ID
  1314  	}
  1315  	if mw.Name != nil {
  1316  		objectMap["name"] = mw.Name
  1317  	}
  1318  	if mw.Type != nil {
  1319  		objectMap["type"] = mw.Type
  1320  	}
  1321  	if mw.Location != nil {
  1322  		objectMap["location"] = mw.Location
  1323  	}
  1324  	if mw.Tags != nil {
  1325  		objectMap["tags"] = mw.Tags
  1326  	}
  1327  	if mw.Etag != nil {
  1328  		objectMap["etag"] = mw.Etag
  1329  	}
  1330  	return json.Marshal(objectMap)
  1331  }
  1332  
  1333  // UnmarshalJSON is the custom unmarshaler for MyWorkbook struct.
  1334  func (mw *MyWorkbook) UnmarshalJSON(body []byte) error {
  1335  	var m map[string]*json.RawMessage
  1336  	err := json.Unmarshal(body, &m)
  1337  	if err != nil {
  1338  		return err
  1339  	}
  1340  	for k, v := range m {
  1341  		switch k {
  1342  		case "kind":
  1343  			if v != nil {
  1344  				var kind Kind
  1345  				err = json.Unmarshal(*v, &kind)
  1346  				if err != nil {
  1347  					return err
  1348  				}
  1349  				mw.Kind = kind
  1350  			}
  1351  		case "properties":
  1352  			if v != nil {
  1353  				var myWorkbookProperties MyWorkbookProperties
  1354  				err = json.Unmarshal(*v, &myWorkbookProperties)
  1355  				if err != nil {
  1356  					return err
  1357  				}
  1358  				mw.MyWorkbookProperties = &myWorkbookProperties
  1359  			}
  1360  		case "systemData":
  1361  			if v != nil {
  1362  				var systemData SystemData
  1363  				err = json.Unmarshal(*v, &systemData)
  1364  				if err != nil {
  1365  					return err
  1366  				}
  1367  				mw.SystemData = &systemData
  1368  			}
  1369  		case "identity":
  1370  			if v != nil {
  1371  				var identity MyWorkbookManagedIdentity
  1372  				err = json.Unmarshal(*v, &identity)
  1373  				if err != nil {
  1374  					return err
  1375  				}
  1376  				mw.Identity = &identity
  1377  			}
  1378  		case "id":
  1379  			if v != nil {
  1380  				var ID string
  1381  				err = json.Unmarshal(*v, &ID)
  1382  				if err != nil {
  1383  					return err
  1384  				}
  1385  				mw.ID = &ID
  1386  			}
  1387  		case "name":
  1388  			if v != nil {
  1389  				var name string
  1390  				err = json.Unmarshal(*v, &name)
  1391  				if err != nil {
  1392  					return err
  1393  				}
  1394  				mw.Name = &name
  1395  			}
  1396  		case "type":
  1397  			if v != nil {
  1398  				var typeVar string
  1399  				err = json.Unmarshal(*v, &typeVar)
  1400  				if err != nil {
  1401  					return err
  1402  				}
  1403  				mw.Type = &typeVar
  1404  			}
  1405  		case "location":
  1406  			if v != nil {
  1407  				var location string
  1408  				err = json.Unmarshal(*v, &location)
  1409  				if err != nil {
  1410  					return err
  1411  				}
  1412  				mw.Location = &location
  1413  			}
  1414  		case "tags":
  1415  			if v != nil {
  1416  				var tags map[string]*string
  1417  				err = json.Unmarshal(*v, &tags)
  1418  				if err != nil {
  1419  					return err
  1420  				}
  1421  				mw.Tags = tags
  1422  			}
  1423  		case "etag":
  1424  			if v != nil {
  1425  				var etag map[string]*string
  1426  				err = json.Unmarshal(*v, &etag)
  1427  				if err != nil {
  1428  					return err
  1429  				}
  1430  				mw.Etag = etag
  1431  			}
  1432  		}
  1433  	}
  1434  
  1435  	return nil
  1436  }
  1437  
  1438  // MyWorkbookError error response.
  1439  type MyWorkbookError struct {
  1440  	// Error - The error details.
  1441  	Error *ErrorDefinition `json:"error,omitempty"`
  1442  }
  1443  
  1444  // MyWorkbookManagedIdentity customer Managed Identity
  1445  type MyWorkbookManagedIdentity struct {
  1446  	UserAssignedIdentities *MyWorkbookUserAssignedIdentities `json:"userAssignedIdentities,omitempty"`
  1447  	// Type - The identity type. Possible values include: 'TypeUserAssigned', 'TypeNone'
  1448  	Type Type `json:"type,omitempty"`
  1449  }
  1450  
  1451  // MyWorkbookProperties properties that contain a private workbook.
  1452  type MyWorkbookProperties struct {
  1453  	// DisplayName - The user-defined name of the private workbook.
  1454  	DisplayName *string `json:"displayName,omitempty"`
  1455  	// SerializedData - Configuration of this particular private workbook. Configuration data is a string containing valid JSON
  1456  	SerializedData *string `json:"serializedData,omitempty"`
  1457  	// Version - This instance's version of the data model. This can change as new features are added that can be marked private workbook.
  1458  	Version *string `json:"version,omitempty"`
  1459  	// TimeModified - READ-ONLY; Date and time in UTC of the last modification that was made to this private workbook definition.
  1460  	TimeModified *string `json:"timeModified,omitempty"`
  1461  	// Category - Workbook category, as defined by the user at creation time.
  1462  	Category *string `json:"category,omitempty"`
  1463  	// Tags - A list of 0 or more tags that are associated with this private workbook definition
  1464  	Tags *[]string `json:"tags,omitempty"`
  1465  	// UserID - READ-ONLY; Unique user id of the specific user that owns this private workbook.
  1466  	UserID *string `json:"userId,omitempty"`
  1467  	// SourceID - Optional resourceId for a source resource.
  1468  	SourceID *string `json:"sourceId,omitempty"`
  1469  	// StorageURI - BYOS Storage Account URI
  1470  	StorageURI *string `json:"storageUri,omitempty"`
  1471  }
  1472  
  1473  // MarshalJSON is the custom marshaler for MyWorkbookProperties.
  1474  func (mwp MyWorkbookProperties) MarshalJSON() ([]byte, error) {
  1475  	objectMap := make(map[string]interface{})
  1476  	if mwp.DisplayName != nil {
  1477  		objectMap["displayName"] = mwp.DisplayName
  1478  	}
  1479  	if mwp.SerializedData != nil {
  1480  		objectMap["serializedData"] = mwp.SerializedData
  1481  	}
  1482  	if mwp.Version != nil {
  1483  		objectMap["version"] = mwp.Version
  1484  	}
  1485  	if mwp.Category != nil {
  1486  		objectMap["category"] = mwp.Category
  1487  	}
  1488  	if mwp.Tags != nil {
  1489  		objectMap["tags"] = mwp.Tags
  1490  	}
  1491  	if mwp.SourceID != nil {
  1492  		objectMap["sourceId"] = mwp.SourceID
  1493  	}
  1494  	if mwp.StorageURI != nil {
  1495  		objectMap["storageUri"] = mwp.StorageURI
  1496  	}
  1497  	return json.Marshal(objectMap)
  1498  }
  1499  
  1500  // MyWorkbookResource an azure resource object
  1501  type MyWorkbookResource struct {
  1502  	// Identity - Identity used for BYOS
  1503  	Identity *MyWorkbookManagedIdentity `json:"identity,omitempty"`
  1504  	// ID - Azure resource Id
  1505  	ID *string `json:"id,omitempty"`
  1506  	// Name - Azure resource name
  1507  	Name *string `json:"name,omitempty"`
  1508  	// Type - Azure resource type
  1509  	Type *string `json:"type,omitempty"`
  1510  	// Location - Resource location
  1511  	Location *string `json:"location,omitempty"`
  1512  	// Tags - Resource tags
  1513  	Tags map[string]*string `json:"tags"`
  1514  	// Etag - Resource etag
  1515  	Etag map[string]*string `json:"etag"`
  1516  }
  1517  
  1518  // MarshalJSON is the custom marshaler for MyWorkbookResource.
  1519  func (mwr MyWorkbookResource) MarshalJSON() ([]byte, error) {
  1520  	objectMap := make(map[string]interface{})
  1521  	if mwr.Identity != nil {
  1522  		objectMap["identity"] = mwr.Identity
  1523  	}
  1524  	if mwr.ID != nil {
  1525  		objectMap["id"] = mwr.ID
  1526  	}
  1527  	if mwr.Name != nil {
  1528  		objectMap["name"] = mwr.Name
  1529  	}
  1530  	if mwr.Type != nil {
  1531  		objectMap["type"] = mwr.Type
  1532  	}
  1533  	if mwr.Location != nil {
  1534  		objectMap["location"] = mwr.Location
  1535  	}
  1536  	if mwr.Tags != nil {
  1537  		objectMap["tags"] = mwr.Tags
  1538  	}
  1539  	if mwr.Etag != nil {
  1540  		objectMap["etag"] = mwr.Etag
  1541  	}
  1542  	return json.Marshal(objectMap)
  1543  }
  1544  
  1545  // MyWorkbooksListResult workbook list result.
  1546  type MyWorkbooksListResult struct {
  1547  	autorest.Response `json:"-"`
  1548  	// Value - READ-ONLY; An array of private workbooks.
  1549  	Value    *[]MyWorkbook `json:"value,omitempty"`
  1550  	NextLink *string       `json:"nextLink,omitempty"`
  1551  }
  1552  
  1553  // MarshalJSON is the custom marshaler for MyWorkbooksListResult.
  1554  func (mwlr MyWorkbooksListResult) MarshalJSON() ([]byte, error) {
  1555  	objectMap := make(map[string]interface{})
  1556  	if mwlr.NextLink != nil {
  1557  		objectMap["nextLink"] = mwlr.NextLink
  1558  	}
  1559  	return json.Marshal(objectMap)
  1560  }
  1561  
  1562  // MyWorkbooksListResultIterator provides access to a complete listing of MyWorkbook values.
  1563  type MyWorkbooksListResultIterator struct {
  1564  	i    int
  1565  	page MyWorkbooksListResultPage
  1566  }
  1567  
  1568  // NextWithContext advances to the next value.  If there was an error making
  1569  // the request the iterator does not advance and the error is returned.
  1570  func (iter *MyWorkbooksListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1571  	if tracing.IsEnabled() {
  1572  		ctx = tracing.StartSpan(ctx, fqdn+"/MyWorkbooksListResultIterator.NextWithContext")
  1573  		defer func() {
  1574  			sc := -1
  1575  			if iter.Response().Response.Response != nil {
  1576  				sc = iter.Response().Response.Response.StatusCode
  1577  			}
  1578  			tracing.EndSpan(ctx, sc, err)
  1579  		}()
  1580  	}
  1581  	iter.i++
  1582  	if iter.i < len(iter.page.Values()) {
  1583  		return nil
  1584  	}
  1585  	err = iter.page.NextWithContext(ctx)
  1586  	if err != nil {
  1587  		iter.i--
  1588  		return err
  1589  	}
  1590  	iter.i = 0
  1591  	return nil
  1592  }
  1593  
  1594  // Next advances to the next value.  If there was an error making
  1595  // the request the iterator does not advance and the error is returned.
  1596  // Deprecated: Use NextWithContext() instead.
  1597  func (iter *MyWorkbooksListResultIterator) Next() error {
  1598  	return iter.NextWithContext(context.Background())
  1599  }
  1600  
  1601  // NotDone returns true if the enumeration should be started or is not yet complete.
  1602  func (iter MyWorkbooksListResultIterator) NotDone() bool {
  1603  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1604  }
  1605  
  1606  // Response returns the raw server response from the last page request.
  1607  func (iter MyWorkbooksListResultIterator) Response() MyWorkbooksListResult {
  1608  	return iter.page.Response()
  1609  }
  1610  
  1611  // Value returns the current value or a zero-initialized value if the
  1612  // iterator has advanced beyond the end of the collection.
  1613  func (iter MyWorkbooksListResultIterator) Value() MyWorkbook {
  1614  	if !iter.page.NotDone() {
  1615  		return MyWorkbook{}
  1616  	}
  1617  	return iter.page.Values()[iter.i]
  1618  }
  1619  
  1620  // Creates a new instance of the MyWorkbooksListResultIterator type.
  1621  func NewMyWorkbooksListResultIterator(page MyWorkbooksListResultPage) MyWorkbooksListResultIterator {
  1622  	return MyWorkbooksListResultIterator{page: page}
  1623  }
  1624  
  1625  // IsEmpty returns true if the ListResult contains no values.
  1626  func (mwlr MyWorkbooksListResult) IsEmpty() bool {
  1627  	return mwlr.Value == nil || len(*mwlr.Value) == 0
  1628  }
  1629  
  1630  // hasNextLink returns true if the NextLink is not empty.
  1631  func (mwlr MyWorkbooksListResult) hasNextLink() bool {
  1632  	return mwlr.NextLink != nil && len(*mwlr.NextLink) != 0
  1633  }
  1634  
  1635  // myWorkbooksListResultPreparer prepares a request to retrieve the next set of results.
  1636  // It returns nil if no more results exist.
  1637  func (mwlr MyWorkbooksListResult) myWorkbooksListResultPreparer(ctx context.Context) (*http.Request, error) {
  1638  	if !mwlr.hasNextLink() {
  1639  		return nil, nil
  1640  	}
  1641  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1642  		autorest.AsJSON(),
  1643  		autorest.AsGet(),
  1644  		autorest.WithBaseURL(to.String(mwlr.NextLink)))
  1645  }
  1646  
  1647  // MyWorkbooksListResultPage contains a page of MyWorkbook values.
  1648  type MyWorkbooksListResultPage struct {
  1649  	fn   func(context.Context, MyWorkbooksListResult) (MyWorkbooksListResult, error)
  1650  	mwlr MyWorkbooksListResult
  1651  }
  1652  
  1653  // NextWithContext advances to the next page of values.  If there was an error making
  1654  // the request the page does not advance and the error is returned.
  1655  func (page *MyWorkbooksListResultPage) NextWithContext(ctx context.Context) (err error) {
  1656  	if tracing.IsEnabled() {
  1657  		ctx = tracing.StartSpan(ctx, fqdn+"/MyWorkbooksListResultPage.NextWithContext")
  1658  		defer func() {
  1659  			sc := -1
  1660  			if page.Response().Response.Response != nil {
  1661  				sc = page.Response().Response.Response.StatusCode
  1662  			}
  1663  			tracing.EndSpan(ctx, sc, err)
  1664  		}()
  1665  	}
  1666  	for {
  1667  		next, err := page.fn(ctx, page.mwlr)
  1668  		if err != nil {
  1669  			return err
  1670  		}
  1671  		page.mwlr = next
  1672  		if !next.hasNextLink() || !next.IsEmpty() {
  1673  			break
  1674  		}
  1675  	}
  1676  	return nil
  1677  }
  1678  
  1679  // Next advances to the next page of values.  If there was an error making
  1680  // the request the page does not advance and the error is returned.
  1681  // Deprecated: Use NextWithContext() instead.
  1682  func (page *MyWorkbooksListResultPage) Next() error {
  1683  	return page.NextWithContext(context.Background())
  1684  }
  1685  
  1686  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1687  func (page MyWorkbooksListResultPage) NotDone() bool {
  1688  	return !page.mwlr.IsEmpty()
  1689  }
  1690  
  1691  // Response returns the raw server response from the last page request.
  1692  func (page MyWorkbooksListResultPage) Response() MyWorkbooksListResult {
  1693  	return page.mwlr
  1694  }
  1695  
  1696  // Values returns the slice of values for the current page or nil if there are no values.
  1697  func (page MyWorkbooksListResultPage) Values() []MyWorkbook {
  1698  	if page.mwlr.IsEmpty() {
  1699  		return nil
  1700  	}
  1701  	return *page.mwlr.Value
  1702  }
  1703  
  1704  // Creates a new instance of the MyWorkbooksListResultPage type.
  1705  func NewMyWorkbooksListResultPage(cur MyWorkbooksListResult, getNextPage func(context.Context, MyWorkbooksListResult) (MyWorkbooksListResult, error)) MyWorkbooksListResultPage {
  1706  	return MyWorkbooksListResultPage{
  1707  		fn:   getNextPage,
  1708  		mwlr: cur,
  1709  	}
  1710  }
  1711  
  1712  // MyWorkbookUserAssignedIdentities customer Managed Identity
  1713  type MyWorkbookUserAssignedIdentities struct {
  1714  	// PrincipalID - READ-ONLY; The principal ID of resource identity.
  1715  	PrincipalID *string `json:"principalId,omitempty"`
  1716  	// TenantID - READ-ONLY; The tenant ID of resource.
  1717  	TenantID *string `json:"tenantId,omitempty"`
  1718  }
  1719  
  1720  // MarshalJSON is the custom marshaler for MyWorkbookUserAssignedIdentities.
  1721  func (mwuai MyWorkbookUserAssignedIdentities) MarshalJSON() ([]byte, error) {
  1722  	objectMap := make(map[string]interface{})
  1723  	return json.Marshal(objectMap)
  1724  }
  1725  
  1726  // Operation CDN REST API operation
  1727  type Operation struct {
  1728  	// Name - Operation name: {provider}/{resource}/{operation}
  1729  	Name *string `json:"name,omitempty"`
  1730  	// Display - The object that represents the operation.
  1731  	Display *OperationDisplay `json:"display,omitempty"`
  1732  }
  1733  
  1734  // OperationDisplay the object that represents the operation.
  1735  type OperationDisplay struct {
  1736  	// Provider - Service provider: Microsoft.Cdn
  1737  	Provider *string `json:"provider,omitempty"`
  1738  	// Resource - Resource on which the operation is performed: Profile, endpoint, etc.
  1739  	Resource *string `json:"resource,omitempty"`
  1740  	// Operation - Operation type: Read, write, delete, etc.
  1741  	Operation *string `json:"operation,omitempty"`
  1742  }
  1743  
  1744  // OperationInfo information about an operation
  1745  type OperationInfo struct {
  1746  	// Provider - Name of the provider
  1747  	Provider *string `json:"provider,omitempty"`
  1748  	// Resource - Name of the resource type
  1749  	Resource *string `json:"resource,omitempty"`
  1750  	// Operation - Name of the operation
  1751  	Operation *string `json:"operation,omitempty"`
  1752  	// Description - Description of the operation
  1753  	Description *string `json:"description,omitempty"`
  1754  }
  1755  
  1756  // OperationListResult result of the request to list CDN operations. It contains a list of operations and a
  1757  // URL link to get the next set of results.
  1758  type OperationListResult struct {
  1759  	autorest.Response `json:"-"`
  1760  	// Value - List of CDN operations supported by the CDN resource provider.
  1761  	Value *[]Operation `json:"value,omitempty"`
  1762  	// NextLink - URL to get the next set of operation list results if there are any.
  1763  	NextLink *string `json:"nextLink,omitempty"`
  1764  }
  1765  
  1766  // OperationListResultIterator provides access to a complete listing of Operation values.
  1767  type OperationListResultIterator struct {
  1768  	i    int
  1769  	page OperationListResultPage
  1770  }
  1771  
  1772  // NextWithContext advances to the next value.  If there was an error making
  1773  // the request the iterator does not advance and the error is returned.
  1774  func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1775  	if tracing.IsEnabled() {
  1776  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
  1777  		defer func() {
  1778  			sc := -1
  1779  			if iter.Response().Response.Response != nil {
  1780  				sc = iter.Response().Response.Response.StatusCode
  1781  			}
  1782  			tracing.EndSpan(ctx, sc, err)
  1783  		}()
  1784  	}
  1785  	iter.i++
  1786  	if iter.i < len(iter.page.Values()) {
  1787  		return nil
  1788  	}
  1789  	err = iter.page.NextWithContext(ctx)
  1790  	if err != nil {
  1791  		iter.i--
  1792  		return err
  1793  	}
  1794  	iter.i = 0
  1795  	return nil
  1796  }
  1797  
  1798  // Next advances to the next value.  If there was an error making
  1799  // the request the iterator does not advance and the error is returned.
  1800  // Deprecated: Use NextWithContext() instead.
  1801  func (iter *OperationListResultIterator) Next() error {
  1802  	return iter.NextWithContext(context.Background())
  1803  }
  1804  
  1805  // NotDone returns true if the enumeration should be started or is not yet complete.
  1806  func (iter OperationListResultIterator) NotDone() bool {
  1807  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1808  }
  1809  
  1810  // Response returns the raw server response from the last page request.
  1811  func (iter OperationListResultIterator) Response() OperationListResult {
  1812  	return iter.page.Response()
  1813  }
  1814  
  1815  // Value returns the current value or a zero-initialized value if the
  1816  // iterator has advanced beyond the end of the collection.
  1817  func (iter OperationListResultIterator) Value() Operation {
  1818  	if !iter.page.NotDone() {
  1819  		return Operation{}
  1820  	}
  1821  	return iter.page.Values()[iter.i]
  1822  }
  1823  
  1824  // Creates a new instance of the OperationListResultIterator type.
  1825  func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
  1826  	return OperationListResultIterator{page: page}
  1827  }
  1828  
  1829  // IsEmpty returns true if the ListResult contains no values.
  1830  func (olr OperationListResult) IsEmpty() bool {
  1831  	return olr.Value == nil || len(*olr.Value) == 0
  1832  }
  1833  
  1834  // hasNextLink returns true if the NextLink is not empty.
  1835  func (olr OperationListResult) hasNextLink() bool {
  1836  	return olr.NextLink != nil && len(*olr.NextLink) != 0
  1837  }
  1838  
  1839  // operationListResultPreparer prepares a request to retrieve the next set of results.
  1840  // It returns nil if no more results exist.
  1841  func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
  1842  	if !olr.hasNextLink() {
  1843  		return nil, nil
  1844  	}
  1845  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1846  		autorest.AsJSON(),
  1847  		autorest.AsGet(),
  1848  		autorest.WithBaseURL(to.String(olr.NextLink)))
  1849  }
  1850  
  1851  // OperationListResultPage contains a page of Operation values.
  1852  type OperationListResultPage struct {
  1853  	fn  func(context.Context, OperationListResult) (OperationListResult, error)
  1854  	olr OperationListResult
  1855  }
  1856  
  1857  // NextWithContext advances to the next page of values.  If there was an error making
  1858  // the request the page does not advance and the error is returned.
  1859  func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
  1860  	if tracing.IsEnabled() {
  1861  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
  1862  		defer func() {
  1863  			sc := -1
  1864  			if page.Response().Response.Response != nil {
  1865  				sc = page.Response().Response.Response.StatusCode
  1866  			}
  1867  			tracing.EndSpan(ctx, sc, err)
  1868  		}()
  1869  	}
  1870  	for {
  1871  		next, err := page.fn(ctx, page.olr)
  1872  		if err != nil {
  1873  			return err
  1874  		}
  1875  		page.olr = next
  1876  		if !next.hasNextLink() || !next.IsEmpty() {
  1877  			break
  1878  		}
  1879  	}
  1880  	return nil
  1881  }
  1882  
  1883  // Next advances to the next page of values.  If there was an error making
  1884  // the request the page does not advance and the error is returned.
  1885  // Deprecated: Use NextWithContext() instead.
  1886  func (page *OperationListResultPage) Next() error {
  1887  	return page.NextWithContext(context.Background())
  1888  }
  1889  
  1890  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1891  func (page OperationListResultPage) NotDone() bool {
  1892  	return !page.olr.IsEmpty()
  1893  }
  1894  
  1895  // Response returns the raw server response from the last page request.
  1896  func (page OperationListResultPage) Response() OperationListResult {
  1897  	return page.olr
  1898  }
  1899  
  1900  // Values returns the slice of values for the current page or nil if there are no values.
  1901  func (page OperationListResultPage) Values() []Operation {
  1902  	if page.olr.IsEmpty() {
  1903  		return nil
  1904  	}
  1905  	return *page.olr.Value
  1906  }
  1907  
  1908  // Creates a new instance of the OperationListResultPage type.
  1909  func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
  1910  	return OperationListResultPage{
  1911  		fn:  getNextPage,
  1912  		olr: cur,
  1913  	}
  1914  }
  1915  
  1916  // OperationLive represents an operation returned by the GetOperations request
  1917  type OperationLive struct {
  1918  	// Name - Name of the operation
  1919  	Name *string `json:"name,omitempty"`
  1920  	// IsDataAction - Indicates whether the operation is a data action
  1921  	IsDataAction *bool `json:"isDataAction,omitempty"`
  1922  	// Display - Display name of the operation
  1923  	Display *OperationInfo `json:"display,omitempty"`
  1924  	// Origin - Origin of the operation
  1925  	Origin *string `json:"origin,omitempty"`
  1926  	// Properties - Properties of the operation
  1927  	Properties interface{} `json:"properties,omitempty"`
  1928  }
  1929  
  1930  // OperationsListResult result of the List Operations operation
  1931  type OperationsListResult struct {
  1932  	// Value - A collection of operations
  1933  	Value *[]OperationLive `json:"value,omitempty"`
  1934  	// NextLink - URL to get the next set of operation list results if there are any.
  1935  	NextLink *string `json:"nextLink,omitempty"`
  1936  }
  1937  
  1938  // PrivateLinkScopedResource the private link scope resource reference.
  1939  type PrivateLinkScopedResource struct {
  1940  	// ResourceID - The full resource Id of the private link scope resource.
  1941  	ResourceID *string `json:"ResourceId,omitempty"`
  1942  	// ScopeID - The private link scope unique Identifier.
  1943  	ScopeID *string `json:"ScopeId,omitempty"`
  1944  }
  1945  
  1946  // ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
  1947  // have tags and a location
  1948  type ProxyResource struct {
  1949  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1950  	ID *string `json:"id,omitempty"`
  1951  	// Name - READ-ONLY; The name of the resource
  1952  	Name *string `json:"name,omitempty"`
  1953  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1954  	Type *string `json:"type,omitempty"`
  1955  }
  1956  
  1957  // MarshalJSON is the custom marshaler for ProxyResource.
  1958  func (pr ProxyResource) MarshalJSON() ([]byte, error) {
  1959  	objectMap := make(map[string]interface{})
  1960  	return json.Marshal(objectMap)
  1961  }
  1962  
  1963  // Resource common fields that are returned in the response for all Azure Resource Manager resources
  1964  type Resource struct {
  1965  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1966  	ID *string `json:"id,omitempty"`
  1967  	// Name - READ-ONLY; The name of the resource
  1968  	Name *string `json:"name,omitempty"`
  1969  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1970  	Type *string `json:"type,omitempty"`
  1971  }
  1972  
  1973  // MarshalJSON is the custom marshaler for Resource.
  1974  func (r Resource) MarshalJSON() ([]byte, error) {
  1975  	objectMap := make(map[string]interface{})
  1976  	return json.Marshal(objectMap)
  1977  }
  1978  
  1979  // SystemData metadata pertaining to creation and last modification of the resource.
  1980  type SystemData struct {
  1981  	// CreatedBy - The identity that created the resource.
  1982  	CreatedBy *string `json:"createdBy,omitempty"`
  1983  	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  1984  	CreatedByType CreatedByType `json:"createdByType,omitempty"`
  1985  	// CreatedAt - The timestamp of resource creation (UTC).
  1986  	CreatedAt *date.Time `json:"createdAt,omitempty"`
  1987  	// LastModifiedBy - The identity that last modified the resource.
  1988  	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
  1989  	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  1990  	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
  1991  	// LastModifiedAt - The timestamp of resource last modification (UTC)
  1992  	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
  1993  }
  1994  
  1995  // TagsResource a container holding only the Tags for a resource, allowing the user to update the tags on a
  1996  // WebTest instance.
  1997  type TagsResource struct {
  1998  	// Tags - Resource tags
  1999  	Tags map[string]*string `json:"tags"`
  2000  }
  2001  
  2002  // MarshalJSON is the custom marshaler for TagsResource.
  2003  func (tr TagsResource) MarshalJSON() ([]byte, error) {
  2004  	objectMap := make(map[string]interface{})
  2005  	if tr.Tags != nil {
  2006  		objectMap["tags"] = tr.Tags
  2007  	}
  2008  	return json.Marshal(objectMap)
  2009  }
  2010  
  2011  // TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
  2012  // which has 'tags' and a 'location'
  2013  type TrackedResource struct {
  2014  	// Tags - Resource tags.
  2015  	Tags map[string]*string `json:"tags"`
  2016  	// Location - The geo-location where the resource lives
  2017  	Location *string `json:"location,omitempty"`
  2018  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  2019  	ID *string `json:"id,omitempty"`
  2020  	// Name - READ-ONLY; The name of the resource
  2021  	Name *string `json:"name,omitempty"`
  2022  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  2023  	Type *string `json:"type,omitempty"`
  2024  }
  2025  
  2026  // MarshalJSON is the custom marshaler for TrackedResource.
  2027  func (tr TrackedResource) MarshalJSON() ([]byte, error) {
  2028  	objectMap := make(map[string]interface{})
  2029  	if tr.Tags != nil {
  2030  		objectMap["tags"] = tr.Tags
  2031  	}
  2032  	if tr.Location != nil {
  2033  		objectMap["location"] = tr.Location
  2034  	}
  2035  	return json.Marshal(objectMap)
  2036  }
  2037  
  2038  // UserAssignedIdentity user assigned identity properties
  2039  type UserAssignedIdentity struct {
  2040  	// PrincipalID - READ-ONLY; The principal ID of the assigned identity.
  2041  	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
  2042  	// ClientID - READ-ONLY; The client ID of the assigned identity.
  2043  	ClientID *uuid.UUID `json:"clientId,omitempty"`
  2044  }
  2045  
  2046  // MarshalJSON is the custom marshaler for UserAssignedIdentity.
  2047  func (uai UserAssignedIdentity) MarshalJSON() ([]byte, error) {
  2048  	objectMap := make(map[string]interface{})
  2049  	return json.Marshal(objectMap)
  2050  }
  2051  
  2052  // WebTest an Application Insights web test definition.
  2053  type WebTest struct {
  2054  	autorest.Response `json:"-"`
  2055  	// Kind - The kind of web test that this web test watches. Choices are ping and multistep. Possible values include: 'WebTestKindPing', 'WebTestKindMultistep'
  2056  	Kind WebTestKind `json:"kind,omitempty"`
  2057  	// WebTestProperties - Metadata describing a web test for an Azure resource.
  2058  	*WebTestProperties `json:"properties,omitempty"`
  2059  	// ID - READ-ONLY; Azure resource Id
  2060  	ID *string `json:"id,omitempty"`
  2061  	// Name - READ-ONLY; Azure resource name
  2062  	Name *string `json:"name,omitempty"`
  2063  	// Type - READ-ONLY; Azure resource type
  2064  	Type *string `json:"type,omitempty"`
  2065  	// Location - Resource location
  2066  	Location *string `json:"location,omitempty"`
  2067  	// Tags - Resource tags
  2068  	Tags map[string]*string `json:"tags"`
  2069  }
  2070  
  2071  // MarshalJSON is the custom marshaler for WebTest.
  2072  func (wt WebTest) MarshalJSON() ([]byte, error) {
  2073  	objectMap := make(map[string]interface{})
  2074  	if wt.Kind != "" {
  2075  		objectMap["kind"] = wt.Kind
  2076  	}
  2077  	if wt.WebTestProperties != nil {
  2078  		objectMap["properties"] = wt.WebTestProperties
  2079  	}
  2080  	if wt.Location != nil {
  2081  		objectMap["location"] = wt.Location
  2082  	}
  2083  	if wt.Tags != nil {
  2084  		objectMap["tags"] = wt.Tags
  2085  	}
  2086  	return json.Marshal(objectMap)
  2087  }
  2088  
  2089  // UnmarshalJSON is the custom unmarshaler for WebTest struct.
  2090  func (wt *WebTest) UnmarshalJSON(body []byte) error {
  2091  	var m map[string]*json.RawMessage
  2092  	err := json.Unmarshal(body, &m)
  2093  	if err != nil {
  2094  		return err
  2095  	}
  2096  	for k, v := range m {
  2097  		switch k {
  2098  		case "kind":
  2099  			if v != nil {
  2100  				var kind WebTestKind
  2101  				err = json.Unmarshal(*v, &kind)
  2102  				if err != nil {
  2103  					return err
  2104  				}
  2105  				wt.Kind = kind
  2106  			}
  2107  		case "properties":
  2108  			if v != nil {
  2109  				var webTestProperties WebTestProperties
  2110  				err = json.Unmarshal(*v, &webTestProperties)
  2111  				if err != nil {
  2112  					return err
  2113  				}
  2114  				wt.WebTestProperties = &webTestProperties
  2115  			}
  2116  		case "id":
  2117  			if v != nil {
  2118  				var ID string
  2119  				err = json.Unmarshal(*v, &ID)
  2120  				if err != nil {
  2121  					return err
  2122  				}
  2123  				wt.ID = &ID
  2124  			}
  2125  		case "name":
  2126  			if v != nil {
  2127  				var name string
  2128  				err = json.Unmarshal(*v, &name)
  2129  				if err != nil {
  2130  					return err
  2131  				}
  2132  				wt.Name = &name
  2133  			}
  2134  		case "type":
  2135  			if v != nil {
  2136  				var typeVar string
  2137  				err = json.Unmarshal(*v, &typeVar)
  2138  				if err != nil {
  2139  					return err
  2140  				}
  2141  				wt.Type = &typeVar
  2142  			}
  2143  		case "location":
  2144  			if v != nil {
  2145  				var location string
  2146  				err = json.Unmarshal(*v, &location)
  2147  				if err != nil {
  2148  					return err
  2149  				}
  2150  				wt.Location = &location
  2151  			}
  2152  		case "tags":
  2153  			if v != nil {
  2154  				var tags map[string]*string
  2155  				err = json.Unmarshal(*v, &tags)
  2156  				if err != nil {
  2157  					return err
  2158  				}
  2159  				wt.Tags = tags
  2160  			}
  2161  		}
  2162  	}
  2163  
  2164  	return nil
  2165  }
  2166  
  2167  // WebTestGeolocation geo-physical location to run a web test from. You must specify one or more locations
  2168  // for the test to run from.
  2169  type WebTestGeolocation struct {
  2170  	// Location - Location ID for the webtest to run from.
  2171  	Location *string `json:"Id,omitempty"`
  2172  }
  2173  
  2174  // WebTestListResult a list of 0 or more Application Insights web test definitions.
  2175  type WebTestListResult struct {
  2176  	autorest.Response `json:"-"`
  2177  	// Value - Set of Application Insights web test definitions.
  2178  	Value *[]WebTest `json:"value,omitempty"`
  2179  	// NextLink - The link to get the next part of the returned list of web tests, should the return set be too large for a single request. May be null.
  2180  	NextLink *string `json:"nextLink,omitempty"`
  2181  }
  2182  
  2183  // WebTestListResultIterator provides access to a complete listing of WebTest values.
  2184  type WebTestListResultIterator struct {
  2185  	i    int
  2186  	page WebTestListResultPage
  2187  }
  2188  
  2189  // NextWithContext advances to the next value.  If there was an error making
  2190  // the request the iterator does not advance and the error is returned.
  2191  func (iter *WebTestListResultIterator) NextWithContext(ctx context.Context) (err error) {
  2192  	if tracing.IsEnabled() {
  2193  		ctx = tracing.StartSpan(ctx, fqdn+"/WebTestListResultIterator.NextWithContext")
  2194  		defer func() {
  2195  			sc := -1
  2196  			if iter.Response().Response.Response != nil {
  2197  				sc = iter.Response().Response.Response.StatusCode
  2198  			}
  2199  			tracing.EndSpan(ctx, sc, err)
  2200  		}()
  2201  	}
  2202  	iter.i++
  2203  	if iter.i < len(iter.page.Values()) {
  2204  		return nil
  2205  	}
  2206  	err = iter.page.NextWithContext(ctx)
  2207  	if err != nil {
  2208  		iter.i--
  2209  		return err
  2210  	}
  2211  	iter.i = 0
  2212  	return nil
  2213  }
  2214  
  2215  // Next advances to the next value.  If there was an error making
  2216  // the request the iterator does not advance and the error is returned.
  2217  // Deprecated: Use NextWithContext() instead.
  2218  func (iter *WebTestListResultIterator) Next() error {
  2219  	return iter.NextWithContext(context.Background())
  2220  }
  2221  
  2222  // NotDone returns true if the enumeration should be started or is not yet complete.
  2223  func (iter WebTestListResultIterator) NotDone() bool {
  2224  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2225  }
  2226  
  2227  // Response returns the raw server response from the last page request.
  2228  func (iter WebTestListResultIterator) Response() WebTestListResult {
  2229  	return iter.page.Response()
  2230  }
  2231  
  2232  // Value returns the current value or a zero-initialized value if the
  2233  // iterator has advanced beyond the end of the collection.
  2234  func (iter WebTestListResultIterator) Value() WebTest {
  2235  	if !iter.page.NotDone() {
  2236  		return WebTest{}
  2237  	}
  2238  	return iter.page.Values()[iter.i]
  2239  }
  2240  
  2241  // Creates a new instance of the WebTestListResultIterator type.
  2242  func NewWebTestListResultIterator(page WebTestListResultPage) WebTestListResultIterator {
  2243  	return WebTestListResultIterator{page: page}
  2244  }
  2245  
  2246  // IsEmpty returns true if the ListResult contains no values.
  2247  func (wtlr WebTestListResult) IsEmpty() bool {
  2248  	return wtlr.Value == nil || len(*wtlr.Value) == 0
  2249  }
  2250  
  2251  // hasNextLink returns true if the NextLink is not empty.
  2252  func (wtlr WebTestListResult) hasNextLink() bool {
  2253  	return wtlr.NextLink != nil && len(*wtlr.NextLink) != 0
  2254  }
  2255  
  2256  // webTestListResultPreparer prepares a request to retrieve the next set of results.
  2257  // It returns nil if no more results exist.
  2258  func (wtlr WebTestListResult) webTestListResultPreparer(ctx context.Context) (*http.Request, error) {
  2259  	if !wtlr.hasNextLink() {
  2260  		return nil, nil
  2261  	}
  2262  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2263  		autorest.AsJSON(),
  2264  		autorest.AsGet(),
  2265  		autorest.WithBaseURL(to.String(wtlr.NextLink)))
  2266  }
  2267  
  2268  // WebTestListResultPage contains a page of WebTest values.
  2269  type WebTestListResultPage struct {
  2270  	fn   func(context.Context, WebTestListResult) (WebTestListResult, error)
  2271  	wtlr WebTestListResult
  2272  }
  2273  
  2274  // NextWithContext advances to the next page of values.  If there was an error making
  2275  // the request the page does not advance and the error is returned.
  2276  func (page *WebTestListResultPage) NextWithContext(ctx context.Context) (err error) {
  2277  	if tracing.IsEnabled() {
  2278  		ctx = tracing.StartSpan(ctx, fqdn+"/WebTestListResultPage.NextWithContext")
  2279  		defer func() {
  2280  			sc := -1
  2281  			if page.Response().Response.Response != nil {
  2282  				sc = page.Response().Response.Response.StatusCode
  2283  			}
  2284  			tracing.EndSpan(ctx, sc, err)
  2285  		}()
  2286  	}
  2287  	for {
  2288  		next, err := page.fn(ctx, page.wtlr)
  2289  		if err != nil {
  2290  			return err
  2291  		}
  2292  		page.wtlr = next
  2293  		if !next.hasNextLink() || !next.IsEmpty() {
  2294  			break
  2295  		}
  2296  	}
  2297  	return nil
  2298  }
  2299  
  2300  // Next advances to the next page of values.  If there was an error making
  2301  // the request the page does not advance and the error is returned.
  2302  // Deprecated: Use NextWithContext() instead.
  2303  func (page *WebTestListResultPage) Next() error {
  2304  	return page.NextWithContext(context.Background())
  2305  }
  2306  
  2307  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2308  func (page WebTestListResultPage) NotDone() bool {
  2309  	return !page.wtlr.IsEmpty()
  2310  }
  2311  
  2312  // Response returns the raw server response from the last page request.
  2313  func (page WebTestListResultPage) Response() WebTestListResult {
  2314  	return page.wtlr
  2315  }
  2316  
  2317  // Values returns the slice of values for the current page or nil if there are no values.
  2318  func (page WebTestListResultPage) Values() []WebTest {
  2319  	if page.wtlr.IsEmpty() {
  2320  		return nil
  2321  	}
  2322  	return *page.wtlr.Value
  2323  }
  2324  
  2325  // Creates a new instance of the WebTestListResultPage type.
  2326  func NewWebTestListResultPage(cur WebTestListResult, getNextPage func(context.Context, WebTestListResult) (WebTestListResult, error)) WebTestListResultPage {
  2327  	return WebTestListResultPage{
  2328  		fn:   getNextPage,
  2329  		wtlr: cur,
  2330  	}
  2331  }
  2332  
  2333  // WebTestProperties metadata describing a web test for an Azure resource.
  2334  type WebTestProperties struct {
  2335  	// SyntheticMonitorID - Unique ID of this WebTest. This is typically the same value as the Name field.
  2336  	SyntheticMonitorID *string `json:"SyntheticMonitorId,omitempty"`
  2337  	// WebTestName - User defined name if this WebTest.
  2338  	WebTestName *string `json:"Name,omitempty"`
  2339  	// Description - Purpose/user defined descriptive test for this WebTest.
  2340  	Description *string `json:"Description,omitempty"`
  2341  	// Enabled - Is the test actively being monitored.
  2342  	Enabled *bool `json:"Enabled,omitempty"`
  2343  	// Frequency - Interval in seconds between test runs for this WebTest. Default value is 300.
  2344  	Frequency *int32 `json:"Frequency,omitempty"`
  2345  	// Timeout - Seconds until this WebTest will timeout and fail. Default value is 30.
  2346  	Timeout *int32 `json:"Timeout,omitempty"`
  2347  	// WebTestKind - The kind of web test this is, valid choices are ping and multistep. Possible values include: 'WebTestKindPing', 'WebTestKindMultistep'
  2348  	WebTestKind WebTestKind `json:"Kind,omitempty"`
  2349  	// RetryEnabled - Allow for retries should this WebTest fail.
  2350  	RetryEnabled *bool `json:"RetryEnabled,omitempty"`
  2351  	// Locations - A list of where to physically run the tests from to give global coverage for accessibility of your application.
  2352  	Locations *[]WebTestGeolocation `json:"Locations,omitempty"`
  2353  	// Configuration - An XML configuration specification for a WebTest.
  2354  	Configuration *WebTestPropertiesConfiguration `json:"Configuration,omitempty"`
  2355  	// ProvisioningState - READ-ONLY; Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.
  2356  	ProvisioningState *string `json:"provisioningState,omitempty"`
  2357  }
  2358  
  2359  // MarshalJSON is the custom marshaler for WebTestProperties.
  2360  func (wtp WebTestProperties) MarshalJSON() ([]byte, error) {
  2361  	objectMap := make(map[string]interface{})
  2362  	if wtp.SyntheticMonitorID != nil {
  2363  		objectMap["SyntheticMonitorId"] = wtp.SyntheticMonitorID
  2364  	}
  2365  	if wtp.WebTestName != nil {
  2366  		objectMap["Name"] = wtp.WebTestName
  2367  	}
  2368  	if wtp.Description != nil {
  2369  		objectMap["Description"] = wtp.Description
  2370  	}
  2371  	if wtp.Enabled != nil {
  2372  		objectMap["Enabled"] = wtp.Enabled
  2373  	}
  2374  	if wtp.Frequency != nil {
  2375  		objectMap["Frequency"] = wtp.Frequency
  2376  	}
  2377  	if wtp.Timeout != nil {
  2378  		objectMap["Timeout"] = wtp.Timeout
  2379  	}
  2380  	if wtp.WebTestKind != "" {
  2381  		objectMap["Kind"] = wtp.WebTestKind
  2382  	}
  2383  	if wtp.RetryEnabled != nil {
  2384  		objectMap["RetryEnabled"] = wtp.RetryEnabled
  2385  	}
  2386  	if wtp.Locations != nil {
  2387  		objectMap["Locations"] = wtp.Locations
  2388  	}
  2389  	if wtp.Configuration != nil {
  2390  		objectMap["Configuration"] = wtp.Configuration
  2391  	}
  2392  	return json.Marshal(objectMap)
  2393  }
  2394  
  2395  // WebTestPropertiesConfiguration an XML configuration specification for a WebTest.
  2396  type WebTestPropertiesConfiguration struct {
  2397  	// WebTest - The XML specification of a WebTest to run against an application.
  2398  	WebTest *string `json:"WebTest,omitempty"`
  2399  }
  2400  
  2401  // WebtestsResource an azure resource object
  2402  type WebtestsResource struct {
  2403  	// ID - READ-ONLY; Azure resource Id
  2404  	ID *string `json:"id,omitempty"`
  2405  	// Name - READ-ONLY; Azure resource name
  2406  	Name *string `json:"name,omitempty"`
  2407  	// Type - READ-ONLY; Azure resource type
  2408  	Type *string `json:"type,omitempty"`
  2409  	// Location - Resource location
  2410  	Location *string `json:"location,omitempty"`
  2411  	// Tags - Resource tags
  2412  	Tags map[string]*string `json:"tags"`
  2413  }
  2414  
  2415  // MarshalJSON is the custom marshaler for WebtestsResource.
  2416  func (wr WebtestsResource) MarshalJSON() ([]byte, error) {
  2417  	objectMap := make(map[string]interface{})
  2418  	if wr.Location != nil {
  2419  		objectMap["location"] = wr.Location
  2420  	}
  2421  	if wr.Tags != nil {
  2422  		objectMap["tags"] = wr.Tags
  2423  	}
  2424  	return json.Marshal(objectMap)
  2425  }
  2426  
  2427  // Workbook an Application Insights workbook definition.
  2428  type Workbook struct {
  2429  	autorest.Response `json:"-"`
  2430  	// WorkbookProperties - Metadata describing a workbook for an Azure resource.
  2431  	*WorkbookProperties `json:"properties,omitempty"`
  2432  	// SystemData - READ-ONLY
  2433  	SystemData *SystemData `json:"systemData,omitempty"`
  2434  	// Identity - Identity used for BYOS
  2435  	Identity *WorkbookResourceIdentity `json:"identity,omitempty"`
  2436  	// Kind - The kind of workbook. Choices are user and shared. Possible values include: 'KindUser', 'KindShared'
  2437  	Kind Kind `json:"kind,omitempty"`
  2438  	// Etag - Resource etag
  2439  	Etag map[string]*string `json:"etag"`
  2440  	// Tags - Resource tags.
  2441  	Tags map[string]*string `json:"tags"`
  2442  	// Location - The geo-location where the resource lives
  2443  	Location *string `json:"location,omitempty"`
  2444  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  2445  	ID *string `json:"id,omitempty"`
  2446  	// Name - READ-ONLY; The name of the resource
  2447  	Name *string `json:"name,omitempty"`
  2448  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  2449  	Type *string `json:"type,omitempty"`
  2450  }
  2451  
  2452  // MarshalJSON is the custom marshaler for Workbook.
  2453  func (w Workbook) MarshalJSON() ([]byte, error) {
  2454  	objectMap := make(map[string]interface{})
  2455  	if w.WorkbookProperties != nil {
  2456  		objectMap["properties"] = w.WorkbookProperties
  2457  	}
  2458  	if w.Identity != nil {
  2459  		objectMap["identity"] = w.Identity
  2460  	}
  2461  	if w.Kind != "" {
  2462  		objectMap["kind"] = w.Kind
  2463  	}
  2464  	if w.Etag != nil {
  2465  		objectMap["etag"] = w.Etag
  2466  	}
  2467  	if w.Tags != nil {
  2468  		objectMap["tags"] = w.Tags
  2469  	}
  2470  	if w.Location != nil {
  2471  		objectMap["location"] = w.Location
  2472  	}
  2473  	return json.Marshal(objectMap)
  2474  }
  2475  
  2476  // UnmarshalJSON is the custom unmarshaler for Workbook struct.
  2477  func (w *Workbook) UnmarshalJSON(body []byte) error {
  2478  	var m map[string]*json.RawMessage
  2479  	err := json.Unmarshal(body, &m)
  2480  	if err != nil {
  2481  		return err
  2482  	}
  2483  	for k, v := range m {
  2484  		switch k {
  2485  		case "properties":
  2486  			if v != nil {
  2487  				var workbookProperties WorkbookProperties
  2488  				err = json.Unmarshal(*v, &workbookProperties)
  2489  				if err != nil {
  2490  					return err
  2491  				}
  2492  				w.WorkbookProperties = &workbookProperties
  2493  			}
  2494  		case "systemData":
  2495  			if v != nil {
  2496  				var systemData SystemData
  2497  				err = json.Unmarshal(*v, &systemData)
  2498  				if err != nil {
  2499  					return err
  2500  				}
  2501  				w.SystemData = &systemData
  2502  			}
  2503  		case "identity":
  2504  			if v != nil {
  2505  				var identity WorkbookResourceIdentity
  2506  				err = json.Unmarshal(*v, &identity)
  2507  				if err != nil {
  2508  					return err
  2509  				}
  2510  				w.Identity = &identity
  2511  			}
  2512  		case "kind":
  2513  			if v != nil {
  2514  				var kind Kind
  2515  				err = json.Unmarshal(*v, &kind)
  2516  				if err != nil {
  2517  					return err
  2518  				}
  2519  				w.Kind = kind
  2520  			}
  2521  		case "etag":
  2522  			if v != nil {
  2523  				var etag map[string]*string
  2524  				err = json.Unmarshal(*v, &etag)
  2525  				if err != nil {
  2526  					return err
  2527  				}
  2528  				w.Etag = etag
  2529  			}
  2530  		case "tags":
  2531  			if v != nil {
  2532  				var tags map[string]*string
  2533  				err = json.Unmarshal(*v, &tags)
  2534  				if err != nil {
  2535  					return err
  2536  				}
  2537  				w.Tags = tags
  2538  			}
  2539  		case "location":
  2540  			if v != nil {
  2541  				var location string
  2542  				err = json.Unmarshal(*v, &location)
  2543  				if err != nil {
  2544  					return err
  2545  				}
  2546  				w.Location = &location
  2547  			}
  2548  		case "id":
  2549  			if v != nil {
  2550  				var ID string
  2551  				err = json.Unmarshal(*v, &ID)
  2552  				if err != nil {
  2553  					return err
  2554  				}
  2555  				w.ID = &ID
  2556  			}
  2557  		case "name":
  2558  			if v != nil {
  2559  				var name string
  2560  				err = json.Unmarshal(*v, &name)
  2561  				if err != nil {
  2562  					return err
  2563  				}
  2564  				w.Name = &name
  2565  			}
  2566  		case "type":
  2567  			if v != nil {
  2568  				var typeVar string
  2569  				err = json.Unmarshal(*v, &typeVar)
  2570  				if err != nil {
  2571  					return err
  2572  				}
  2573  				w.Type = &typeVar
  2574  			}
  2575  		}
  2576  	}
  2577  
  2578  	return nil
  2579  }
  2580  
  2581  // WorkbookError error response.
  2582  type WorkbookError struct {
  2583  	// Error - The error details.
  2584  	Error *WorkbookErrorDefinition `json:"error,omitempty"`
  2585  }
  2586  
  2587  // WorkbookErrorDefinition error definition.
  2588  type WorkbookErrorDefinition struct {
  2589  	// Code - READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code.
  2590  	Code *string `json:"code,omitempty"`
  2591  	// Message - READ-ONLY; Description of the error.
  2592  	Message *string `json:"message,omitempty"`
  2593  	// InnerError - READ-ONLY; Internal error details.
  2594  	InnerError interface{} `json:"innerError,omitempty"`
  2595  }
  2596  
  2597  // MarshalJSON is the custom marshaler for WorkbookErrorDefinition.
  2598  func (wed WorkbookErrorDefinition) MarshalJSON() ([]byte, error) {
  2599  	objectMap := make(map[string]interface{})
  2600  	return json.Marshal(objectMap)
  2601  }
  2602  
  2603  // WorkbookInnerErrorTrace error details
  2604  type WorkbookInnerErrorTrace struct {
  2605  	// Trace - READ-ONLY; detailed error trace
  2606  	Trace *[]string `json:"trace,omitempty"`
  2607  }
  2608  
  2609  // MarshalJSON is the custom marshaler for WorkbookInnerErrorTrace.
  2610  func (wiet WorkbookInnerErrorTrace) MarshalJSON() ([]byte, error) {
  2611  	objectMap := make(map[string]interface{})
  2612  	return json.Marshal(objectMap)
  2613  }
  2614  
  2615  // WorkbookProperties properties that contain a workbook.
  2616  type WorkbookProperties struct {
  2617  	// DisplayName - The user-defined name (display name) of the workbook.
  2618  	DisplayName *string `json:"displayName,omitempty"`
  2619  	// SerializedData - Configuration of this particular workbook. Configuration data is a string containing valid JSON
  2620  	SerializedData *string `json:"serializedData,omitempty"`
  2621  	// Version - Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData
  2622  	Version *string `json:"version,omitempty"`
  2623  	// TimeModified - READ-ONLY; Date and time in UTC of the last modification that was made to this workbook definition.
  2624  	TimeModified *date.Time `json:"timeModified,omitempty"`
  2625  	// Category - Workbook category, as defined by the user at creation time.
  2626  	Category *string `json:"category,omitempty"`
  2627  	// Tags - Being deprecated, please use the other tags field
  2628  	Tags *[]string `json:"tags,omitempty"`
  2629  	// UserID - READ-ONLY; Unique user id of the specific user that owns this workbook.
  2630  	UserID *string `json:"userId,omitempty"`
  2631  	// SourceID - ResourceId for a source resource.
  2632  	SourceID *string `json:"sourceId,omitempty"`
  2633  	// StorageURI - The resourceId to the storage account when bring your own storage is used
  2634  	StorageURI *string `json:"storageUri,omitempty"`
  2635  	// Description - The description of the workbook.
  2636  	Description *string `json:"description,omitempty"`
  2637  	// Revision - READ-ONLY; The unique revision id for this workbook definition
  2638  	Revision *string `json:"revision,omitempty"`
  2639  }
  2640  
  2641  // MarshalJSON is the custom marshaler for WorkbookProperties.
  2642  func (wp WorkbookProperties) MarshalJSON() ([]byte, error) {
  2643  	objectMap := make(map[string]interface{})
  2644  	if wp.DisplayName != nil {
  2645  		objectMap["displayName"] = wp.DisplayName
  2646  	}
  2647  	if wp.SerializedData != nil {
  2648  		objectMap["serializedData"] = wp.SerializedData
  2649  	}
  2650  	if wp.Version != nil {
  2651  		objectMap["version"] = wp.Version
  2652  	}
  2653  	if wp.Category != nil {
  2654  		objectMap["category"] = wp.Category
  2655  	}
  2656  	if wp.Tags != nil {
  2657  		objectMap["tags"] = wp.Tags
  2658  	}
  2659  	if wp.SourceID != nil {
  2660  		objectMap["sourceId"] = wp.SourceID
  2661  	}
  2662  	if wp.StorageURI != nil {
  2663  		objectMap["storageUri"] = wp.StorageURI
  2664  	}
  2665  	if wp.Description != nil {
  2666  		objectMap["description"] = wp.Description
  2667  	}
  2668  	return json.Marshal(objectMap)
  2669  }
  2670  
  2671  // WorkbookPropertiesUpdateParameters properties that contain a workbook for PATCH operation.
  2672  type WorkbookPropertiesUpdateParameters struct {
  2673  	// DisplayName - The user-defined name (display name) of the workbook.
  2674  	DisplayName *string `json:"displayName,omitempty"`
  2675  	// SerializedData - Configuration of this particular workbook. Configuration data is a string containing valid JSON
  2676  	SerializedData *string `json:"serializedData,omitempty"`
  2677  	// Category - Workbook category, as defined by the user at creation time.
  2678  	Category *string `json:"category,omitempty"`
  2679  	// Tags - A list of 0 or more tags that are associated with this workbook definition
  2680  	Tags *[]string `json:"tags,omitempty"`
  2681  	// Description - The description of the workbook.
  2682  	Description *string `json:"description,omitempty"`
  2683  	// Revision - The unique revision id for this workbook definition
  2684  	Revision *string `json:"revision,omitempty"`
  2685  }
  2686  
  2687  // WorkbookResource an azure resource object
  2688  type WorkbookResource struct {
  2689  	// Identity - Identity used for BYOS
  2690  	Identity *WorkbookResourceIdentity `json:"identity,omitempty"`
  2691  	// Kind - The kind of workbook. Choices are user and shared. Possible values include: 'KindUser', 'KindShared'
  2692  	Kind Kind `json:"kind,omitempty"`
  2693  	// Etag - Resource etag
  2694  	Etag map[string]*string `json:"etag"`
  2695  	// Tags - Resource tags.
  2696  	Tags map[string]*string `json:"tags"`
  2697  	// Location - The geo-location where the resource lives
  2698  	Location *string `json:"location,omitempty"`
  2699  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  2700  	ID *string `json:"id,omitempty"`
  2701  	// Name - READ-ONLY; The name of the resource
  2702  	Name *string `json:"name,omitempty"`
  2703  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  2704  	Type *string `json:"type,omitempty"`
  2705  }
  2706  
  2707  // MarshalJSON is the custom marshaler for WorkbookResource.
  2708  func (wr WorkbookResource) MarshalJSON() ([]byte, error) {
  2709  	objectMap := make(map[string]interface{})
  2710  	if wr.Identity != nil {
  2711  		objectMap["identity"] = wr.Identity
  2712  	}
  2713  	if wr.Kind != "" {
  2714  		objectMap["kind"] = wr.Kind
  2715  	}
  2716  	if wr.Etag != nil {
  2717  		objectMap["etag"] = wr.Etag
  2718  	}
  2719  	if wr.Tags != nil {
  2720  		objectMap["tags"] = wr.Tags
  2721  	}
  2722  	if wr.Location != nil {
  2723  		objectMap["location"] = wr.Location
  2724  	}
  2725  	return json.Marshal(objectMap)
  2726  }
  2727  
  2728  // WorkbookResourceIdentity identity used for BYOS
  2729  type WorkbookResourceIdentity struct {
  2730  	// PrincipalID - READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.
  2731  	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
  2732  	// TenantID - READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.
  2733  	TenantID *uuid.UUID `json:"tenantId,omitempty"`
  2734  	// Type - Possible values include: 'ManagedServiceIdentityTypeNone', 'ManagedServiceIdentityTypeSystemAssigned', 'ManagedServiceIdentityTypeUserAssigned', 'ManagedServiceIdentityTypeSystemAssignedUserAssigned'
  2735  	Type                   ManagedServiceIdentityType       `json:"type,omitempty"`
  2736  	UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities"`
  2737  }
  2738  
  2739  // MarshalJSON is the custom marshaler for WorkbookResourceIdentity.
  2740  func (wr WorkbookResourceIdentity) MarshalJSON() ([]byte, error) {
  2741  	objectMap := make(map[string]interface{})
  2742  	if wr.Type != "" {
  2743  		objectMap["type"] = wr.Type
  2744  	}
  2745  	if wr.UserAssignedIdentities != nil {
  2746  		objectMap["userAssignedIdentities"] = wr.UserAssignedIdentities
  2747  	}
  2748  	return json.Marshal(objectMap)
  2749  }
  2750  
  2751  // WorkbooksListResult workbook list result.
  2752  type WorkbooksListResult struct {
  2753  	autorest.Response `json:"-"`
  2754  	// Value - READ-ONLY; An array of workbooks.
  2755  	Value    *[]Workbook `json:"value,omitempty"`
  2756  	NextLink *string     `json:"nextLink,omitempty"`
  2757  }
  2758  
  2759  // MarshalJSON is the custom marshaler for WorkbooksListResult.
  2760  func (wlr WorkbooksListResult) MarshalJSON() ([]byte, error) {
  2761  	objectMap := make(map[string]interface{})
  2762  	if wlr.NextLink != nil {
  2763  		objectMap["nextLink"] = wlr.NextLink
  2764  	}
  2765  	return json.Marshal(objectMap)
  2766  }
  2767  
  2768  // WorkbooksListResultIterator provides access to a complete listing of Workbook values.
  2769  type WorkbooksListResultIterator struct {
  2770  	i    int
  2771  	page WorkbooksListResultPage
  2772  }
  2773  
  2774  // NextWithContext advances to the next value.  If there was an error making
  2775  // the request the iterator does not advance and the error is returned.
  2776  func (iter *WorkbooksListResultIterator) NextWithContext(ctx context.Context) (err error) {
  2777  	if tracing.IsEnabled() {
  2778  		ctx = tracing.StartSpan(ctx, fqdn+"/WorkbooksListResultIterator.NextWithContext")
  2779  		defer func() {
  2780  			sc := -1
  2781  			if iter.Response().Response.Response != nil {
  2782  				sc = iter.Response().Response.Response.StatusCode
  2783  			}
  2784  			tracing.EndSpan(ctx, sc, err)
  2785  		}()
  2786  	}
  2787  	iter.i++
  2788  	if iter.i < len(iter.page.Values()) {
  2789  		return nil
  2790  	}
  2791  	err = iter.page.NextWithContext(ctx)
  2792  	if err != nil {
  2793  		iter.i--
  2794  		return err
  2795  	}
  2796  	iter.i = 0
  2797  	return nil
  2798  }
  2799  
  2800  // Next advances to the next value.  If there was an error making
  2801  // the request the iterator does not advance and the error is returned.
  2802  // Deprecated: Use NextWithContext() instead.
  2803  func (iter *WorkbooksListResultIterator) Next() error {
  2804  	return iter.NextWithContext(context.Background())
  2805  }
  2806  
  2807  // NotDone returns true if the enumeration should be started or is not yet complete.
  2808  func (iter WorkbooksListResultIterator) NotDone() bool {
  2809  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2810  }
  2811  
  2812  // Response returns the raw server response from the last page request.
  2813  func (iter WorkbooksListResultIterator) Response() WorkbooksListResult {
  2814  	return iter.page.Response()
  2815  }
  2816  
  2817  // Value returns the current value or a zero-initialized value if the
  2818  // iterator has advanced beyond the end of the collection.
  2819  func (iter WorkbooksListResultIterator) Value() Workbook {
  2820  	if !iter.page.NotDone() {
  2821  		return Workbook{}
  2822  	}
  2823  	return iter.page.Values()[iter.i]
  2824  }
  2825  
  2826  // Creates a new instance of the WorkbooksListResultIterator type.
  2827  func NewWorkbooksListResultIterator(page WorkbooksListResultPage) WorkbooksListResultIterator {
  2828  	return WorkbooksListResultIterator{page: page}
  2829  }
  2830  
  2831  // IsEmpty returns true if the ListResult contains no values.
  2832  func (wlr WorkbooksListResult) IsEmpty() bool {
  2833  	return wlr.Value == nil || len(*wlr.Value) == 0
  2834  }
  2835  
  2836  // hasNextLink returns true if the NextLink is not empty.
  2837  func (wlr WorkbooksListResult) hasNextLink() bool {
  2838  	return wlr.NextLink != nil && len(*wlr.NextLink) != 0
  2839  }
  2840  
  2841  // workbooksListResultPreparer prepares a request to retrieve the next set of results.
  2842  // It returns nil if no more results exist.
  2843  func (wlr WorkbooksListResult) workbooksListResultPreparer(ctx context.Context) (*http.Request, error) {
  2844  	if !wlr.hasNextLink() {
  2845  		return nil, nil
  2846  	}
  2847  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2848  		autorest.AsJSON(),
  2849  		autorest.AsGet(),
  2850  		autorest.WithBaseURL(to.String(wlr.NextLink)))
  2851  }
  2852  
  2853  // WorkbooksListResultPage contains a page of Workbook values.
  2854  type WorkbooksListResultPage struct {
  2855  	fn  func(context.Context, WorkbooksListResult) (WorkbooksListResult, error)
  2856  	wlr WorkbooksListResult
  2857  }
  2858  
  2859  // NextWithContext advances to the next page of values.  If there was an error making
  2860  // the request the page does not advance and the error is returned.
  2861  func (page *WorkbooksListResultPage) NextWithContext(ctx context.Context) (err error) {
  2862  	if tracing.IsEnabled() {
  2863  		ctx = tracing.StartSpan(ctx, fqdn+"/WorkbooksListResultPage.NextWithContext")
  2864  		defer func() {
  2865  			sc := -1
  2866  			if page.Response().Response.Response != nil {
  2867  				sc = page.Response().Response.Response.StatusCode
  2868  			}
  2869  			tracing.EndSpan(ctx, sc, err)
  2870  		}()
  2871  	}
  2872  	for {
  2873  		next, err := page.fn(ctx, page.wlr)
  2874  		if err != nil {
  2875  			return err
  2876  		}
  2877  		page.wlr = next
  2878  		if !next.hasNextLink() || !next.IsEmpty() {
  2879  			break
  2880  		}
  2881  	}
  2882  	return nil
  2883  }
  2884  
  2885  // Next advances to the next page of values.  If there was an error making
  2886  // the request the page does not advance and the error is returned.
  2887  // Deprecated: Use NextWithContext() instead.
  2888  func (page *WorkbooksListResultPage) Next() error {
  2889  	return page.NextWithContext(context.Background())
  2890  }
  2891  
  2892  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2893  func (page WorkbooksListResultPage) NotDone() bool {
  2894  	return !page.wlr.IsEmpty()
  2895  }
  2896  
  2897  // Response returns the raw server response from the last page request.
  2898  func (page WorkbooksListResultPage) Response() WorkbooksListResult {
  2899  	return page.wlr
  2900  }
  2901  
  2902  // Values returns the slice of values for the current page or nil if there are no values.
  2903  func (page WorkbooksListResultPage) Values() []Workbook {
  2904  	if page.wlr.IsEmpty() {
  2905  		return nil
  2906  	}
  2907  	return *page.wlr.Value
  2908  }
  2909  
  2910  // Creates a new instance of the WorkbooksListResultPage type.
  2911  func NewWorkbooksListResultPage(cur WorkbooksListResult, getNextPage func(context.Context, WorkbooksListResult) (WorkbooksListResult, error)) WorkbooksListResultPage {
  2912  	return WorkbooksListResultPage{
  2913  		fn:  getNextPage,
  2914  		wlr: cur,
  2915  	}
  2916  }
  2917  
  2918  // WorkbookTemplate an Application Insights workbook template definition.
  2919  type WorkbookTemplate struct {
  2920  	autorest.Response `json:"-"`
  2921  	// WorkbookTemplateProperties - Metadata describing a workbook template for an Azure resource.
  2922  	*WorkbookTemplateProperties `json:"properties,omitempty"`
  2923  	// ID - READ-ONLY; Azure resource Id
  2924  	ID *string `json:"id,omitempty"`
  2925  	// Name - READ-ONLY; Azure resource name.
  2926  	Name *string `json:"name,omitempty"`
  2927  	// Type - READ-ONLY; Azure resource type
  2928  	Type *string `json:"type,omitempty"`
  2929  	// Location - Resource location
  2930  	Location *string `json:"location,omitempty"`
  2931  	// Tags - Resource tags
  2932  	Tags map[string]*string `json:"tags"`
  2933  }
  2934  
  2935  // MarshalJSON is the custom marshaler for WorkbookTemplate.
  2936  func (wt WorkbookTemplate) MarshalJSON() ([]byte, error) {
  2937  	objectMap := make(map[string]interface{})
  2938  	if wt.WorkbookTemplateProperties != nil {
  2939  		objectMap["properties"] = wt.WorkbookTemplateProperties
  2940  	}
  2941  	if wt.Location != nil {
  2942  		objectMap["location"] = wt.Location
  2943  	}
  2944  	if wt.Tags != nil {
  2945  		objectMap["tags"] = wt.Tags
  2946  	}
  2947  	return json.Marshal(objectMap)
  2948  }
  2949  
  2950  // UnmarshalJSON is the custom unmarshaler for WorkbookTemplate struct.
  2951  func (wt *WorkbookTemplate) UnmarshalJSON(body []byte) error {
  2952  	var m map[string]*json.RawMessage
  2953  	err := json.Unmarshal(body, &m)
  2954  	if err != nil {
  2955  		return err
  2956  	}
  2957  	for k, v := range m {
  2958  		switch k {
  2959  		case "properties":
  2960  			if v != nil {
  2961  				var workbookTemplateProperties WorkbookTemplateProperties
  2962  				err = json.Unmarshal(*v, &workbookTemplateProperties)
  2963  				if err != nil {
  2964  					return err
  2965  				}
  2966  				wt.WorkbookTemplateProperties = &workbookTemplateProperties
  2967  			}
  2968  		case "id":
  2969  			if v != nil {
  2970  				var ID string
  2971  				err = json.Unmarshal(*v, &ID)
  2972  				if err != nil {
  2973  					return err
  2974  				}
  2975  				wt.ID = &ID
  2976  			}
  2977  		case "name":
  2978  			if v != nil {
  2979  				var name string
  2980  				err = json.Unmarshal(*v, &name)
  2981  				if err != nil {
  2982  					return err
  2983  				}
  2984  				wt.Name = &name
  2985  			}
  2986  		case "type":
  2987  			if v != nil {
  2988  				var typeVar string
  2989  				err = json.Unmarshal(*v, &typeVar)
  2990  				if err != nil {
  2991  					return err
  2992  				}
  2993  				wt.Type = &typeVar
  2994  			}
  2995  		case "location":
  2996  			if v != nil {
  2997  				var location string
  2998  				err = json.Unmarshal(*v, &location)
  2999  				if err != nil {
  3000  					return err
  3001  				}
  3002  				wt.Location = &location
  3003  			}
  3004  		case "tags":
  3005  			if v != nil {
  3006  				var tags map[string]*string
  3007  				err = json.Unmarshal(*v, &tags)
  3008  				if err != nil {
  3009  					return err
  3010  				}
  3011  				wt.Tags = tags
  3012  			}
  3013  		}
  3014  	}
  3015  
  3016  	return nil
  3017  }
  3018  
  3019  // WorkbookTemplateError error message that will indicate why the operation failed.
  3020  type WorkbookTemplateError struct {
  3021  	// Error - Error message object that will indicate why the operation failed.
  3022  	Error *WorkbookTemplateErrorBody `json:"error,omitempty"`
  3023  }
  3024  
  3025  // WorkbookTemplateErrorBody error message body that will indicate why the operation failed.
  3026  type WorkbookTemplateErrorBody struct {
  3027  	// Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
  3028  	Code *string `json:"code,omitempty"`
  3029  	// Message - Human-readable representation of the error.
  3030  	Message *string `json:"message,omitempty"`
  3031  	// Details - The list of invalid fields send in request, in case of validation error.
  3032  	Details *[]WorkbookTemplateErrorFieldContract `json:"details,omitempty"`
  3033  }
  3034  
  3035  // WorkbookTemplateErrorFieldContract error Field contract.
  3036  type WorkbookTemplateErrorFieldContract struct {
  3037  	// Code - Property level error code.
  3038  	Code *string `json:"code,omitempty"`
  3039  	// Message - Human-readable representation of property-level error.
  3040  	Message *string `json:"message,omitempty"`
  3041  	// Target - Property name.
  3042  	Target *string `json:"target,omitempty"`
  3043  }
  3044  
  3045  // WorkbookTemplateGallery gallery information for a workbook template.
  3046  type WorkbookTemplateGallery struct {
  3047  	// Name - Name of the workbook template in the gallery.
  3048  	Name *string `json:"name,omitempty"`
  3049  	// Category - Category for the gallery.
  3050  	Category *string `json:"category,omitempty"`
  3051  	// Type - Type of workbook supported by the workbook template.
  3052  	Type *string `json:"type,omitempty"`
  3053  	// Order - Order of the template within the gallery.
  3054  	Order *int32 `json:"order,omitempty"`
  3055  	// ResourceType - Azure resource type supported by the gallery.
  3056  	ResourceType *string `json:"resourceType,omitempty"`
  3057  }
  3058  
  3059  // WorkbookTemplateLocalizedGallery localized template data and gallery information.
  3060  type WorkbookTemplateLocalizedGallery struct {
  3061  	// TemplateData - Valid JSON object containing workbook template payload.
  3062  	TemplateData interface{} `json:"templateData,omitempty"`
  3063  	// Galleries - Workbook galleries supported by the template.
  3064  	Galleries *[]WorkbookTemplateGallery `json:"galleries,omitempty"`
  3065  }
  3066  
  3067  // WorkbookTemplateProperties properties that contain a workbook template.
  3068  type WorkbookTemplateProperties struct {
  3069  	// Priority - Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode.
  3070  	Priority *int32 `json:"priority,omitempty"`
  3071  	// Author - Information about the author of the workbook template.
  3072  	Author *string `json:"author,omitempty"`
  3073  	// TemplateData - Valid JSON object containing workbook template payload.
  3074  	TemplateData interface{} `json:"templateData,omitempty"`
  3075  	// Galleries - Workbook galleries supported by the template.
  3076  	Galleries *[]WorkbookTemplateGallery `json:"galleries,omitempty"`
  3077  	// Localized - Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.
  3078  	Localized map[string][]WorkbookTemplateLocalizedGallery `json:"localized"`
  3079  }
  3080  
  3081  // MarshalJSON is the custom marshaler for WorkbookTemplateProperties.
  3082  func (wtp WorkbookTemplateProperties) MarshalJSON() ([]byte, error) {
  3083  	objectMap := make(map[string]interface{})
  3084  	if wtp.Priority != nil {
  3085  		objectMap["priority"] = wtp.Priority
  3086  	}
  3087  	if wtp.Author != nil {
  3088  		objectMap["author"] = wtp.Author
  3089  	}
  3090  	if wtp.TemplateData != nil {
  3091  		objectMap["templateData"] = wtp.TemplateData
  3092  	}
  3093  	if wtp.Galleries != nil {
  3094  		objectMap["galleries"] = wtp.Galleries
  3095  	}
  3096  	if wtp.Localized != nil {
  3097  		objectMap["localized"] = wtp.Localized
  3098  	}
  3099  	return json.Marshal(objectMap)
  3100  }
  3101  
  3102  // WorkbookTemplateResource an azure resource object
  3103  type WorkbookTemplateResource struct {
  3104  	// ID - READ-ONLY; Azure resource Id
  3105  	ID *string `json:"id,omitempty"`
  3106  	// Name - READ-ONLY; Azure resource name.
  3107  	Name *string `json:"name,omitempty"`
  3108  	// Type - READ-ONLY; Azure resource type
  3109  	Type *string `json:"type,omitempty"`
  3110  	// Location - Resource location
  3111  	Location *string `json:"location,omitempty"`
  3112  	// Tags - Resource tags
  3113  	Tags map[string]*string `json:"tags"`
  3114  }
  3115  
  3116  // MarshalJSON is the custom marshaler for WorkbookTemplateResource.
  3117  func (wtr WorkbookTemplateResource) MarshalJSON() ([]byte, error) {
  3118  	objectMap := make(map[string]interface{})
  3119  	if wtr.Location != nil {
  3120  		objectMap["location"] = wtr.Location
  3121  	}
  3122  	if wtr.Tags != nil {
  3123  		objectMap["tags"] = wtr.Tags
  3124  	}
  3125  	return json.Marshal(objectMap)
  3126  }
  3127  
  3128  // WorkbookTemplatesListResult workbookTemplate list result.
  3129  type WorkbookTemplatesListResult struct {
  3130  	autorest.Response `json:"-"`
  3131  	// Value - An array of workbook templates.
  3132  	Value *[]WorkbookTemplate `json:"value,omitempty"`
  3133  }
  3134  
  3135  // WorkbookTemplateUpdateParameters the parameters that can be provided when updating workbook template.
  3136  type WorkbookTemplateUpdateParameters struct {
  3137  	// Tags - Resource tags
  3138  	Tags map[string]*string `json:"tags"`
  3139  	// WorkbookTemplateProperties - Metadata describing a workbook for an Azure resource.
  3140  	*WorkbookTemplateProperties `json:"properties,omitempty"`
  3141  }
  3142  
  3143  // MarshalJSON is the custom marshaler for WorkbookTemplateUpdateParameters.
  3144  func (wtup WorkbookTemplateUpdateParameters) MarshalJSON() ([]byte, error) {
  3145  	objectMap := make(map[string]interface{})
  3146  	if wtup.Tags != nil {
  3147  		objectMap["tags"] = wtup.Tags
  3148  	}
  3149  	if wtup.WorkbookTemplateProperties != nil {
  3150  		objectMap["properties"] = wtup.WorkbookTemplateProperties
  3151  	}
  3152  	return json.Marshal(objectMap)
  3153  }
  3154  
  3155  // UnmarshalJSON is the custom unmarshaler for WorkbookTemplateUpdateParameters struct.
  3156  func (wtup *WorkbookTemplateUpdateParameters) UnmarshalJSON(body []byte) error {
  3157  	var m map[string]*json.RawMessage
  3158  	err := json.Unmarshal(body, &m)
  3159  	if err != nil {
  3160  		return err
  3161  	}
  3162  	for k, v := range m {
  3163  		switch k {
  3164  		case "tags":
  3165  			if v != nil {
  3166  				var tags map[string]*string
  3167  				err = json.Unmarshal(*v, &tags)
  3168  				if err != nil {
  3169  					return err
  3170  				}
  3171  				wtup.Tags = tags
  3172  			}
  3173  		case "properties":
  3174  			if v != nil {
  3175  				var workbookTemplateProperties WorkbookTemplateProperties
  3176  				err = json.Unmarshal(*v, &workbookTemplateProperties)
  3177  				if err != nil {
  3178  					return err
  3179  				}
  3180  				wtup.WorkbookTemplateProperties = &workbookTemplateProperties
  3181  			}
  3182  		}
  3183  	}
  3184  
  3185  	return nil
  3186  }
  3187  
  3188  // WorkbookUpdateParameters the parameters that can be provided when updating workbook properties
  3189  // properties.
  3190  type WorkbookUpdateParameters struct {
  3191  	// Kind - The kind of workbook. Choices are user and shared. Possible values include: 'SharedTypeKindUser', 'SharedTypeKindShared'
  3192  	Kind SharedTypeKind `json:"kind,omitempty"`
  3193  	// Tags - Resource tags.
  3194  	Tags map[string]*string `json:"tags"`
  3195  	// WorkbookPropertiesUpdateParameters - Metadata describing a workbook for an Azure resource.
  3196  	*WorkbookPropertiesUpdateParameters `json:"properties,omitempty"`
  3197  }
  3198  
  3199  // MarshalJSON is the custom marshaler for WorkbookUpdateParameters.
  3200  func (wup WorkbookUpdateParameters) MarshalJSON() ([]byte, error) {
  3201  	objectMap := make(map[string]interface{})
  3202  	if wup.Kind != "" {
  3203  		objectMap["kind"] = wup.Kind
  3204  	}
  3205  	if wup.Tags != nil {
  3206  		objectMap["tags"] = wup.Tags
  3207  	}
  3208  	if wup.WorkbookPropertiesUpdateParameters != nil {
  3209  		objectMap["properties"] = wup.WorkbookPropertiesUpdateParameters
  3210  	}
  3211  	return json.Marshal(objectMap)
  3212  }
  3213  
  3214  // UnmarshalJSON is the custom unmarshaler for WorkbookUpdateParameters struct.
  3215  func (wup *WorkbookUpdateParameters) UnmarshalJSON(body []byte) error {
  3216  	var m map[string]*json.RawMessage
  3217  	err := json.Unmarshal(body, &m)
  3218  	if err != nil {
  3219  		return err
  3220  	}
  3221  	for k, v := range m {
  3222  		switch k {
  3223  		case "kind":
  3224  			if v != nil {
  3225  				var kind SharedTypeKind
  3226  				err = json.Unmarshal(*v, &kind)
  3227  				if err != nil {
  3228  					return err
  3229  				}
  3230  				wup.Kind = kind
  3231  			}
  3232  		case "tags":
  3233  			if v != nil {
  3234  				var tags map[string]*string
  3235  				err = json.Unmarshal(*v, &tags)
  3236  				if err != nil {
  3237  					return err
  3238  				}
  3239  				wup.Tags = tags
  3240  			}
  3241  		case "properties":
  3242  			if v != nil {
  3243  				var workbookPropertiesUpdateParameters WorkbookPropertiesUpdateParameters
  3244  				err = json.Unmarshal(*v, &workbookPropertiesUpdateParameters)
  3245  				if err != nil {
  3246  					return err
  3247  				}
  3248  				wup.WorkbookPropertiesUpdateParameters = &workbookPropertiesUpdateParameters
  3249  			}
  3250  		}
  3251  	}
  3252  
  3253  	return nil
  3254  }
  3255  
  3256  // WorkItemConfiguration work item configuration associated with an application insights resource.
  3257  type WorkItemConfiguration struct {
  3258  	autorest.Response `json:"-"`
  3259  	// ConnectorID - Connector identifier where work item is created
  3260  	ConnectorID *string `json:"ConnectorId,omitempty"`
  3261  	// ConfigDisplayName - Configuration friendly name
  3262  	ConfigDisplayName *string `json:"ConfigDisplayName,omitempty"`
  3263  	// IsDefault - Boolean value indicating whether configuration is default
  3264  	IsDefault *bool `json:"IsDefault,omitempty"`
  3265  	// ID - Unique Id for work item
  3266  	ID *string `json:"Id,omitempty"`
  3267  	// ConfigProperties - Serialized JSON object for detailed properties
  3268  	ConfigProperties *string `json:"ConfigProperties,omitempty"`
  3269  }
  3270  
  3271  // WorkItemConfigurationError error associated with trying to get work item configuration or configurations
  3272  type WorkItemConfigurationError struct {
  3273  	// Code - Error detail code and explanation
  3274  	Code *string `json:"code,omitempty"`
  3275  	// Message - Error message
  3276  	Message    *string     `json:"message,omitempty"`
  3277  	Innererror *InnerError `json:"innererror,omitempty"`
  3278  }
  3279  
  3280  // WorkItemConfigurationsListResult work item configuration list result.
  3281  type WorkItemConfigurationsListResult struct {
  3282  	autorest.Response `json:"-"`
  3283  	// Value - READ-ONLY; An array of work item configurations.
  3284  	Value *[]WorkItemConfiguration `json:"value,omitempty"`
  3285  }
  3286  
  3287  // MarshalJSON is the custom marshaler for WorkItemConfigurationsListResult.
  3288  func (wiclr WorkItemConfigurationsListResult) MarshalJSON() ([]byte, error) {
  3289  	objectMap := make(map[string]interface{})
  3290  	return json.Marshal(objectMap)
  3291  }
  3292  
  3293  // WorkItemCreateConfiguration work item configuration creation payload
  3294  type WorkItemCreateConfiguration struct {
  3295  	// ConnectorID - Unique connector id
  3296  	ConnectorID *string `json:"ConnectorId,omitempty"`
  3297  	// ConnectorDataConfiguration - Serialized JSON object for detailed properties
  3298  	ConnectorDataConfiguration *string `json:"ConnectorDataConfiguration,omitempty"`
  3299  	// ValidateOnly - Boolean indicating validate only
  3300  	ValidateOnly *bool `json:"ValidateOnly,omitempty"`
  3301  	// WorkItemProperties - Custom work item properties
  3302  	WorkItemProperties map[string]*string `json:"WorkItemProperties"`
  3303  }
  3304  
  3305  // MarshalJSON is the custom marshaler for WorkItemCreateConfiguration.
  3306  func (wicc WorkItemCreateConfiguration) MarshalJSON() ([]byte, error) {
  3307  	objectMap := make(map[string]interface{})
  3308  	if wicc.ConnectorID != nil {
  3309  		objectMap["ConnectorId"] = wicc.ConnectorID
  3310  	}
  3311  	if wicc.ConnectorDataConfiguration != nil {
  3312  		objectMap["ConnectorDataConfiguration"] = wicc.ConnectorDataConfiguration
  3313  	}
  3314  	if wicc.ValidateOnly != nil {
  3315  		objectMap["ValidateOnly"] = wicc.ValidateOnly
  3316  	}
  3317  	if wicc.WorkItemProperties != nil {
  3318  		objectMap["WorkItemProperties"] = wicc.WorkItemProperties
  3319  	}
  3320  	return json.Marshal(objectMap)
  3321  }
  3322  

View as plain text