...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-09-01-preview/insights/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-09-01-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/azure"
    14  	"github.com/Azure/go-autorest/autorest/date"
    15  	"github.com/Azure/go-autorest/autorest/to"
    16  	"github.com/Azure/go-autorest/tracing"
    17  	"net/http"
    18  )
    19  
    20  // The package's fully qualified name.
    21  const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-09-01-preview/insights"
    22  
    23  // BasicAction action descriptor.
    24  type BasicAction interface {
    25  	AsAlertingAction() (*AlertingAction, bool)
    26  	AsLogToMetricAction() (*LogToMetricAction, bool)
    27  	AsAction() (*Action, bool)
    28  }
    29  
    30  // Action action descriptor.
    31  type Action struct {
    32  	// OdataType - Possible values include: 'OdataTypeBasicActionOdataTypeAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction'
    33  	OdataType OdataTypeBasicAction `json:"odata.type,omitempty"`
    34  }
    35  
    36  func unmarshalBasicAction(body []byte) (BasicAction, error) {
    37  	var m map[string]interface{}
    38  	err := json.Unmarshal(body, &m)
    39  	if err != nil {
    40  		return nil, err
    41  	}
    42  
    43  	switch m["odata.type"] {
    44  	case string(OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction):
    45  		var aa AlertingAction
    46  		err := json.Unmarshal(body, &aa)
    47  		return aa, err
    48  	case string(OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction):
    49  		var ltma LogToMetricAction
    50  		err := json.Unmarshal(body, &ltma)
    51  		return ltma, err
    52  	default:
    53  		var a Action
    54  		err := json.Unmarshal(body, &a)
    55  		return a, err
    56  	}
    57  }
    58  func unmarshalBasicActionArray(body []byte) ([]BasicAction, error) {
    59  	var rawMessages []*json.RawMessage
    60  	err := json.Unmarshal(body, &rawMessages)
    61  	if err != nil {
    62  		return nil, err
    63  	}
    64  
    65  	aArray := make([]BasicAction, len(rawMessages))
    66  
    67  	for index, rawMessage := range rawMessages {
    68  		a, err := unmarshalBasicAction(*rawMessage)
    69  		if err != nil {
    70  			return nil, err
    71  		}
    72  		aArray[index] = a
    73  	}
    74  	return aArray, nil
    75  }
    76  
    77  // MarshalJSON is the custom marshaler for Action.
    78  func (a Action) MarshalJSON() ([]byte, error) {
    79  	a.OdataType = OdataTypeBasicActionOdataTypeAction
    80  	objectMap := make(map[string]interface{})
    81  	if a.OdataType != "" {
    82  		objectMap["odata.type"] = a.OdataType
    83  	}
    84  	return json.Marshal(objectMap)
    85  }
    86  
    87  // AsAlertingAction is the BasicAction implementation for Action.
    88  func (a Action) AsAlertingAction() (*AlertingAction, bool) {
    89  	return nil, false
    90  }
    91  
    92  // AsLogToMetricAction is the BasicAction implementation for Action.
    93  func (a Action) AsLogToMetricAction() (*LogToMetricAction, bool) {
    94  	return nil, false
    95  }
    96  
    97  // AsAction is the BasicAction implementation for Action.
    98  func (a Action) AsAction() (*Action, bool) {
    99  	return &a, true
   100  }
   101  
   102  // AsBasicAction is the BasicAction implementation for Action.
   103  func (a Action) AsBasicAction() (BasicAction, bool) {
   104  	return &a, true
   105  }
   106  
   107  // ActionDetail the action detail
   108  type ActionDetail struct {
   109  	// MechanismType - The mechanism type
   110  	MechanismType *string `json:"MechanismType,omitempty"`
   111  	// Name - The name of the action
   112  	Name *string `json:"Name,omitempty"`
   113  	// Status - The status of the action
   114  	Status *string `json:"Status,omitempty"`
   115  	// SubState - The substatus of the action
   116  	SubState *string `json:"SubState,omitempty"`
   117  	// SendTime - The send time
   118  	SendTime *string `json:"SendTime,omitempty"`
   119  	// Detail - The detail of the friendly error message
   120  	Detail *string `json:"Detail,omitempty"`
   121  }
   122  
   123  // ActionGroup an Azure action group.
   124  type ActionGroup struct {
   125  	// GroupShortName - The short name of the action group. This will be used in SMS messages.
   126  	GroupShortName *string `json:"groupShortName,omitempty"`
   127  	// Enabled - Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications.
   128  	Enabled *bool `json:"enabled,omitempty"`
   129  	// EmailReceivers - The list of email receivers that are part of this action group.
   130  	EmailReceivers *[]EmailReceiver `json:"emailReceivers,omitempty"`
   131  	// SmsReceivers - The list of SMS receivers that are part of this action group.
   132  	SmsReceivers *[]SmsReceiver `json:"smsReceivers,omitempty"`
   133  	// WebhookReceivers - The list of webhook receivers that are part of this action group.
   134  	WebhookReceivers *[]WebhookReceiver `json:"webhookReceivers,omitempty"`
   135  	// ItsmReceivers - The list of ITSM receivers that are part of this action group.
   136  	ItsmReceivers *[]ItsmReceiver `json:"itsmReceivers,omitempty"`
   137  	// AzureAppPushReceivers - The list of AzureAppPush receivers that are part of this action group.
   138  	AzureAppPushReceivers *[]AzureAppPushReceiver `json:"azureAppPushReceivers,omitempty"`
   139  	// AutomationRunbookReceivers - The list of AutomationRunbook receivers that are part of this action group.
   140  	AutomationRunbookReceivers *[]AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"`
   141  	// VoiceReceivers - The list of voice receivers that are part of this action group.
   142  	VoiceReceivers *[]VoiceReceiver `json:"voiceReceivers,omitempty"`
   143  	// LogicAppReceivers - The list of logic app receivers that are part of this action group.
   144  	LogicAppReceivers *[]LogicAppReceiver `json:"logicAppReceivers,omitempty"`
   145  	// AzureFunctionReceivers - The list of azure function receivers that are part of this action group.
   146  	AzureFunctionReceivers *[]AzureFunctionReceiver `json:"azureFunctionReceivers,omitempty"`
   147  	// ArmRoleReceivers - The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported.
   148  	ArmRoleReceivers *[]ArmRoleReceiver `json:"armRoleReceivers,omitempty"`
   149  	// EventHubReceivers - The list of event hub receivers that are part of this action group.
   150  	EventHubReceivers *[]EventHubReceiver `json:"eventHubReceivers,omitempty"`
   151  }
   152  
   153  // ActionGroupList a list of action groups.
   154  type ActionGroupList struct {
   155  	autorest.Response `json:"-"`
   156  	// Value - The list of action groups.
   157  	Value *[]ActionGroupResource `json:"value,omitempty"`
   158  	// NextLink - Provides the link to retrieve the next set of elements.
   159  	NextLink *string `json:"nextLink,omitempty"`
   160  }
   161  
   162  // ActionGroupPatch an Azure action group for patch operations.
   163  type ActionGroupPatch struct {
   164  	// Enabled - Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated.
   165  	Enabled *bool `json:"enabled,omitempty"`
   166  }
   167  
   168  // ActionGroupPatchBody an action group object for the body of patch operations.
   169  type ActionGroupPatchBody struct {
   170  	// Tags - Resource tags
   171  	Tags map[string]*string `json:"tags"`
   172  	// ActionGroupPatch - The action group settings for an update operation.
   173  	*ActionGroupPatch `json:"properties,omitempty"`
   174  }
   175  
   176  // MarshalJSON is the custom marshaler for ActionGroupPatchBody.
   177  func (agpb ActionGroupPatchBody) MarshalJSON() ([]byte, error) {
   178  	objectMap := make(map[string]interface{})
   179  	if agpb.Tags != nil {
   180  		objectMap["tags"] = agpb.Tags
   181  	}
   182  	if agpb.ActionGroupPatch != nil {
   183  		objectMap["properties"] = agpb.ActionGroupPatch
   184  	}
   185  	return json.Marshal(objectMap)
   186  }
   187  
   188  // UnmarshalJSON is the custom unmarshaler for ActionGroupPatchBody struct.
   189  func (agpb *ActionGroupPatchBody) UnmarshalJSON(body []byte) error {
   190  	var m map[string]*json.RawMessage
   191  	err := json.Unmarshal(body, &m)
   192  	if err != nil {
   193  		return err
   194  	}
   195  	for k, v := range m {
   196  		switch k {
   197  		case "tags":
   198  			if v != nil {
   199  				var tags map[string]*string
   200  				err = json.Unmarshal(*v, &tags)
   201  				if err != nil {
   202  					return err
   203  				}
   204  				agpb.Tags = tags
   205  			}
   206  		case "properties":
   207  			if v != nil {
   208  				var actionGroupPatch ActionGroupPatch
   209  				err = json.Unmarshal(*v, &actionGroupPatch)
   210  				if err != nil {
   211  					return err
   212  				}
   213  				agpb.ActionGroupPatch = &actionGroupPatch
   214  			}
   215  		}
   216  	}
   217  
   218  	return nil
   219  }
   220  
   221  // ActionGroupResource an action group resource.
   222  type ActionGroupResource struct {
   223  	autorest.Response `json:"-"`
   224  	// ActionGroup - The action groups properties of the resource.
   225  	*ActionGroup `json:"properties,omitempty"`
   226  	// ID - READ-ONLY; Azure resource Id
   227  	ID *string `json:"id,omitempty"`
   228  	// Name - READ-ONLY; Azure resource name
   229  	Name *string `json:"name,omitempty"`
   230  	// Type - READ-ONLY; Azure resource type
   231  	Type *string `json:"type,omitempty"`
   232  	// Kind - READ-ONLY; Azure resource kind
   233  	Kind *string `json:"kind,omitempty"`
   234  	// Identity - READ-ONLY; Azure resource identity
   235  	Identity *string `json:"identity,omitempty"`
   236  	// Location - Resource location
   237  	Location *string `json:"location,omitempty"`
   238  	// Tags - Resource tags
   239  	Tags map[string]*string `json:"tags"`
   240  }
   241  
   242  // MarshalJSON is the custom marshaler for ActionGroupResource.
   243  func (agr ActionGroupResource) MarshalJSON() ([]byte, error) {
   244  	objectMap := make(map[string]interface{})
   245  	if agr.ActionGroup != nil {
   246  		objectMap["properties"] = agr.ActionGroup
   247  	}
   248  	if agr.Location != nil {
   249  		objectMap["location"] = agr.Location
   250  	}
   251  	if agr.Tags != nil {
   252  		objectMap["tags"] = agr.Tags
   253  	}
   254  	return json.Marshal(objectMap)
   255  }
   256  
   257  // UnmarshalJSON is the custom unmarshaler for ActionGroupResource struct.
   258  func (agr *ActionGroupResource) UnmarshalJSON(body []byte) error {
   259  	var m map[string]*json.RawMessage
   260  	err := json.Unmarshal(body, &m)
   261  	if err != nil {
   262  		return err
   263  	}
   264  	for k, v := range m {
   265  		switch k {
   266  		case "properties":
   267  			if v != nil {
   268  				var actionGroup ActionGroup
   269  				err = json.Unmarshal(*v, &actionGroup)
   270  				if err != nil {
   271  					return err
   272  				}
   273  				agr.ActionGroup = &actionGroup
   274  			}
   275  		case "id":
   276  			if v != nil {
   277  				var ID string
   278  				err = json.Unmarshal(*v, &ID)
   279  				if err != nil {
   280  					return err
   281  				}
   282  				agr.ID = &ID
   283  			}
   284  		case "name":
   285  			if v != nil {
   286  				var name string
   287  				err = json.Unmarshal(*v, &name)
   288  				if err != nil {
   289  					return err
   290  				}
   291  				agr.Name = &name
   292  			}
   293  		case "type":
   294  			if v != nil {
   295  				var typeVar string
   296  				err = json.Unmarshal(*v, &typeVar)
   297  				if err != nil {
   298  					return err
   299  				}
   300  				agr.Type = &typeVar
   301  			}
   302  		case "kind":
   303  			if v != nil {
   304  				var kind string
   305  				err = json.Unmarshal(*v, &kind)
   306  				if err != nil {
   307  					return err
   308  				}
   309  				agr.Kind = &kind
   310  			}
   311  		case "identity":
   312  			if v != nil {
   313  				var identity string
   314  				err = json.Unmarshal(*v, &identity)
   315  				if err != nil {
   316  					return err
   317  				}
   318  				agr.Identity = &identity
   319  			}
   320  		case "location":
   321  			if v != nil {
   322  				var location string
   323  				err = json.Unmarshal(*v, &location)
   324  				if err != nil {
   325  					return err
   326  				}
   327  				agr.Location = &location
   328  			}
   329  		case "tags":
   330  			if v != nil {
   331  				var tags map[string]*string
   332  				err = json.Unmarshal(*v, &tags)
   333  				if err != nil {
   334  					return err
   335  				}
   336  				agr.Tags = tags
   337  			}
   338  		}
   339  	}
   340  
   341  	return nil
   342  }
   343  
   344  // ActionGroupsPostTestNotificationsFuture an abstraction for monitoring and retrieving the results of a
   345  // long-running operation.
   346  type ActionGroupsPostTestNotificationsFuture struct {
   347  	azure.FutureAPI
   348  	// Result returns the result of the asynchronous operation.
   349  	// If the operation has not completed it will return an error.
   350  	Result func(ActionGroupsClient) (TestNotificationResponse, error)
   351  }
   352  
   353  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   354  func (future *ActionGroupsPostTestNotificationsFuture) UnmarshalJSON(body []byte) error {
   355  	var azFuture azure.Future
   356  	if err := json.Unmarshal(body, &azFuture); err != nil {
   357  		return err
   358  	}
   359  	future.FutureAPI = &azFuture
   360  	future.Result = future.result
   361  	return nil
   362  }
   363  
   364  // result is the default implementation for ActionGroupsPostTestNotificationsFuture.Result.
   365  func (future *ActionGroupsPostTestNotificationsFuture) result(client ActionGroupsClient) (tnr TestNotificationResponse, err error) {
   366  	var done bool
   367  	done, err = future.DoneWithContext(context.Background(), client)
   368  	if err != nil {
   369  		err = autorest.NewErrorWithError(err, "insights.ActionGroupsPostTestNotificationsFuture", "Result", future.Response(), "Polling failure")
   370  		return
   371  	}
   372  	if !done {
   373  		tnr.Response.Response = future.Response()
   374  		err = azure.NewAsyncOpIncompleteError("insights.ActionGroupsPostTestNotificationsFuture")
   375  		return
   376  	}
   377  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   378  	if tnr.Response.Response, err = future.GetResult(sender); err == nil && tnr.Response.Response.StatusCode != http.StatusNoContent {
   379  		tnr, err = client.PostTestNotificationsResponder(tnr.Response.Response)
   380  		if err != nil {
   381  			err = autorest.NewErrorWithError(err, "insights.ActionGroupsPostTestNotificationsFuture", "Result", tnr.Response.Response, "Failure responding to request")
   382  		}
   383  	}
   384  	return
   385  }
   386  
   387  // ActionList a list of Activity Log Alert rule actions.
   388  type ActionList struct {
   389  	// ActionGroups - The list of the Action Groups.
   390  	ActionGroups *[]ActionGroup `json:"actionGroups,omitempty"`
   391  }
   392  
   393  // ActivityLogAlertResource an Activity Log Alert rule resource.
   394  type ActivityLogAlertResource struct {
   395  	autorest.Response `json:"-"`
   396  	// AlertRuleProperties - The Activity Log Alert rule properties of the resource.
   397  	*AlertRuleProperties `json:"properties,omitempty"`
   398  	// ID - READ-ONLY; Azure resource Id
   399  	ID *string `json:"id,omitempty"`
   400  	// Name - READ-ONLY; Azure resource name
   401  	Name *string `json:"name,omitempty"`
   402  	// Type - READ-ONLY; Azure resource type
   403  	Type *string `json:"type,omitempty"`
   404  	// Kind - READ-ONLY; Azure resource kind
   405  	Kind *string `json:"kind,omitempty"`
   406  	// Identity - READ-ONLY; Azure resource identity
   407  	Identity *string `json:"identity,omitempty"`
   408  	// Location - Resource location
   409  	Location *string `json:"location,omitempty"`
   410  	// Tags - Resource tags
   411  	Tags map[string]*string `json:"tags"`
   412  }
   413  
   414  // MarshalJSON is the custom marshaler for ActivityLogAlertResource.
   415  func (alar ActivityLogAlertResource) MarshalJSON() ([]byte, error) {
   416  	objectMap := make(map[string]interface{})
   417  	if alar.AlertRuleProperties != nil {
   418  		objectMap["properties"] = alar.AlertRuleProperties
   419  	}
   420  	if alar.Location != nil {
   421  		objectMap["location"] = alar.Location
   422  	}
   423  	if alar.Tags != nil {
   424  		objectMap["tags"] = alar.Tags
   425  	}
   426  	return json.Marshal(objectMap)
   427  }
   428  
   429  // UnmarshalJSON is the custom unmarshaler for ActivityLogAlertResource struct.
   430  func (alar *ActivityLogAlertResource) UnmarshalJSON(body []byte) error {
   431  	var m map[string]*json.RawMessage
   432  	err := json.Unmarshal(body, &m)
   433  	if err != nil {
   434  		return err
   435  	}
   436  	for k, v := range m {
   437  		switch k {
   438  		case "properties":
   439  			if v != nil {
   440  				var alertRuleProperties AlertRuleProperties
   441  				err = json.Unmarshal(*v, &alertRuleProperties)
   442  				if err != nil {
   443  					return err
   444  				}
   445  				alar.AlertRuleProperties = &alertRuleProperties
   446  			}
   447  		case "id":
   448  			if v != nil {
   449  				var ID string
   450  				err = json.Unmarshal(*v, &ID)
   451  				if err != nil {
   452  					return err
   453  				}
   454  				alar.ID = &ID
   455  			}
   456  		case "name":
   457  			if v != nil {
   458  				var name string
   459  				err = json.Unmarshal(*v, &name)
   460  				if err != nil {
   461  					return err
   462  				}
   463  				alar.Name = &name
   464  			}
   465  		case "type":
   466  			if v != nil {
   467  				var typeVar string
   468  				err = json.Unmarshal(*v, &typeVar)
   469  				if err != nil {
   470  					return err
   471  				}
   472  				alar.Type = &typeVar
   473  			}
   474  		case "kind":
   475  			if v != nil {
   476  				var kind string
   477  				err = json.Unmarshal(*v, &kind)
   478  				if err != nil {
   479  					return err
   480  				}
   481  				alar.Kind = &kind
   482  			}
   483  		case "identity":
   484  			if v != nil {
   485  				var identity string
   486  				err = json.Unmarshal(*v, &identity)
   487  				if err != nil {
   488  					return err
   489  				}
   490  				alar.Identity = &identity
   491  			}
   492  		case "location":
   493  			if v != nil {
   494  				var location string
   495  				err = json.Unmarshal(*v, &location)
   496  				if err != nil {
   497  					return err
   498  				}
   499  				alar.Location = &location
   500  			}
   501  		case "tags":
   502  			if v != nil {
   503  				var tags map[string]*string
   504  				err = json.Unmarshal(*v, &tags)
   505  				if err != nil {
   506  					return err
   507  				}
   508  				alar.Tags = tags
   509  			}
   510  		}
   511  	}
   512  
   513  	return nil
   514  }
   515  
   516  // AlertingAction specify action need to be taken when rule type is Alert
   517  type AlertingAction struct {
   518  	// Severity - Severity of the alert. Possible values include: 'AlertSeverityZero', 'AlertSeverityOne', 'AlertSeverityTwo', 'AlertSeverityThree', 'AlertSeverityFour'
   519  	Severity AlertSeverity `json:"severity,omitempty"`
   520  	// AznsAction - Azure action group reference.
   521  	AznsAction *AzNsActionGroup `json:"aznsAction,omitempty"`
   522  	// ThrottlingInMin - time (in minutes) for which Alerts should be throttled or suppressed.
   523  	ThrottlingInMin *int32 `json:"throttlingInMin,omitempty"`
   524  	// Trigger - The trigger condition that results in the alert rule being.
   525  	Trigger *TriggerCondition `json:"trigger,omitempty"`
   526  	// OdataType - Possible values include: 'OdataTypeBasicActionOdataTypeAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction'
   527  	OdataType OdataTypeBasicAction `json:"odata.type,omitempty"`
   528  }
   529  
   530  // MarshalJSON is the custom marshaler for AlertingAction.
   531  func (aa AlertingAction) MarshalJSON() ([]byte, error) {
   532  	aa.OdataType = OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction
   533  	objectMap := make(map[string]interface{})
   534  	if aa.Severity != "" {
   535  		objectMap["severity"] = aa.Severity
   536  	}
   537  	if aa.AznsAction != nil {
   538  		objectMap["aznsAction"] = aa.AznsAction
   539  	}
   540  	if aa.ThrottlingInMin != nil {
   541  		objectMap["throttlingInMin"] = aa.ThrottlingInMin
   542  	}
   543  	if aa.Trigger != nil {
   544  		objectMap["trigger"] = aa.Trigger
   545  	}
   546  	if aa.OdataType != "" {
   547  		objectMap["odata.type"] = aa.OdataType
   548  	}
   549  	return json.Marshal(objectMap)
   550  }
   551  
   552  // AsAlertingAction is the BasicAction implementation for AlertingAction.
   553  func (aa AlertingAction) AsAlertingAction() (*AlertingAction, bool) {
   554  	return &aa, true
   555  }
   556  
   557  // AsLogToMetricAction is the BasicAction implementation for AlertingAction.
   558  func (aa AlertingAction) AsLogToMetricAction() (*LogToMetricAction, bool) {
   559  	return nil, false
   560  }
   561  
   562  // AsAction is the BasicAction implementation for AlertingAction.
   563  func (aa AlertingAction) AsAction() (*Action, bool) {
   564  	return nil, false
   565  }
   566  
   567  // AsBasicAction is the BasicAction implementation for AlertingAction.
   568  func (aa AlertingAction) AsBasicAction() (BasicAction, bool) {
   569  	return &aa, true
   570  }
   571  
   572  // AlertRule an alert rule.
   573  type AlertRule struct {
   574  	// Name - the name of the alert rule.
   575  	Name *string `json:"name,omitempty"`
   576  	// Description - the description of the alert rule that will be included in the alert email.
   577  	Description *string `json:"description,omitempty"`
   578  	// ProvisioningState - the provisioning state.
   579  	ProvisioningState *string `json:"provisioningState,omitempty"`
   580  	// IsEnabled - the flag that indicates whether the alert rule is enabled.
   581  	IsEnabled *bool `json:"isEnabled,omitempty"`
   582  	// Condition - the condition that results in the alert rule being activated.
   583  	Condition BasicRuleCondition `json:"condition,omitempty"`
   584  	// Action - action that is performed when the alert rule becomes active, and when an alert condition is resolved.
   585  	Action BasicRuleAction `json:"action,omitempty"`
   586  	// Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
   587  	Actions *[]BasicRuleAction `json:"actions,omitempty"`
   588  	// LastUpdatedTime - READ-ONLY; Last time the rule was updated in ISO8601 format.
   589  	LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
   590  }
   591  
   592  // MarshalJSON is the custom marshaler for AlertRule.
   593  func (ar AlertRule) MarshalJSON() ([]byte, error) {
   594  	objectMap := make(map[string]interface{})
   595  	if ar.Name != nil {
   596  		objectMap["name"] = ar.Name
   597  	}
   598  	if ar.Description != nil {
   599  		objectMap["description"] = ar.Description
   600  	}
   601  	if ar.ProvisioningState != nil {
   602  		objectMap["provisioningState"] = ar.ProvisioningState
   603  	}
   604  	if ar.IsEnabled != nil {
   605  		objectMap["isEnabled"] = ar.IsEnabled
   606  	}
   607  	objectMap["condition"] = ar.Condition
   608  	objectMap["action"] = ar.Action
   609  	if ar.Actions != nil {
   610  		objectMap["actions"] = ar.Actions
   611  	}
   612  	return json.Marshal(objectMap)
   613  }
   614  
   615  // UnmarshalJSON is the custom unmarshaler for AlertRule struct.
   616  func (ar *AlertRule) UnmarshalJSON(body []byte) error {
   617  	var m map[string]*json.RawMessage
   618  	err := json.Unmarshal(body, &m)
   619  	if err != nil {
   620  		return err
   621  	}
   622  	for k, v := range m {
   623  		switch k {
   624  		case "name":
   625  			if v != nil {
   626  				var name string
   627  				err = json.Unmarshal(*v, &name)
   628  				if err != nil {
   629  					return err
   630  				}
   631  				ar.Name = &name
   632  			}
   633  		case "description":
   634  			if v != nil {
   635  				var description string
   636  				err = json.Unmarshal(*v, &description)
   637  				if err != nil {
   638  					return err
   639  				}
   640  				ar.Description = &description
   641  			}
   642  		case "provisioningState":
   643  			if v != nil {
   644  				var provisioningState string
   645  				err = json.Unmarshal(*v, &provisioningState)
   646  				if err != nil {
   647  					return err
   648  				}
   649  				ar.ProvisioningState = &provisioningState
   650  			}
   651  		case "isEnabled":
   652  			if v != nil {
   653  				var isEnabled bool
   654  				err = json.Unmarshal(*v, &isEnabled)
   655  				if err != nil {
   656  					return err
   657  				}
   658  				ar.IsEnabled = &isEnabled
   659  			}
   660  		case "condition":
   661  			if v != nil {
   662  				condition, err := unmarshalBasicRuleCondition(*v)
   663  				if err != nil {
   664  					return err
   665  				}
   666  				ar.Condition = condition
   667  			}
   668  		case "action":
   669  			if v != nil {
   670  				action, err := unmarshalBasicRuleAction(*v)
   671  				if err != nil {
   672  					return err
   673  				}
   674  				ar.Action = action
   675  			}
   676  		case "actions":
   677  			if v != nil {
   678  				actions, err := unmarshalBasicRuleActionArray(*v)
   679  				if err != nil {
   680  					return err
   681  				}
   682  				ar.Actions = &actions
   683  			}
   684  		case "lastUpdatedTime":
   685  			if v != nil {
   686  				var lastUpdatedTime date.Time
   687  				err = json.Unmarshal(*v, &lastUpdatedTime)
   688  				if err != nil {
   689  					return err
   690  				}
   691  				ar.LastUpdatedTime = &lastUpdatedTime
   692  			}
   693  		}
   694  	}
   695  
   696  	return nil
   697  }
   698  
   699  // AlertRuleAllOfCondition an Activity Log Alert rule condition that is met when all its member conditions
   700  // are met.
   701  type AlertRuleAllOfCondition struct {
   702  	// AllOf - The list of Activity Log Alert rule conditions.
   703  	AllOf *[]AlertRuleAnyOfOrLeafCondition `json:"allOf,omitempty"`
   704  }
   705  
   706  // AlertRuleAnyOfOrLeafCondition an Activity Log Alert rule condition that is met when all its member
   707  // conditions are met.
   708  // Each condition can be of one of the following types:
   709  // __Important__: Each type has its unique subset of properties. Properties from different types CANNOT
   710  // exist in one condition.
   711  // * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'.
   712  // _Please note, 'anyOf' should __not__ be set in a Leaf Condition._
   713  // * __AnyOf Condition -__ must contain __only__ 'anyOf' (which is an array of Leaf Conditions).
   714  // _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._
   715  type AlertRuleAnyOfOrLeafCondition struct {
   716  	// AnyOf - An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met.
   717  	AnyOf *[]AlertRuleLeafCondition `json:"anyOf,omitempty"`
   718  	// Field - The name of the Activity Log event's field that this condition will examine.
   719  	// The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'.
   720  	Field *string `json:"field,omitempty"`
   721  	// Equals - The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met.
   722  	Equals *string `json:"equals,omitempty"`
   723  	// ContainsAny - The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met.
   724  	ContainsAny *[]string `json:"containsAny,omitempty"`
   725  }
   726  
   727  // AlertRuleLeafCondition an Activity Log Alert rule condition that is met by comparing the field and value
   728  // of an Activity Log event.
   729  // This condition must contain 'field' and either 'equals' or 'containsAny'.
   730  type AlertRuleLeafCondition struct {
   731  	// Field - The name of the Activity Log event's field that this condition will examine.
   732  	// The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'.
   733  	Field *string `json:"field,omitempty"`
   734  	// Equals - The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met.
   735  	Equals *string `json:"equals,omitempty"`
   736  	// ContainsAny - The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met.
   737  	ContainsAny *[]string `json:"containsAny,omitempty"`
   738  }
   739  
   740  // AlertRuleList a list of Activity Log Alert rules.
   741  type AlertRuleList struct {
   742  	autorest.Response `json:"-"`
   743  	// Value - The list of Activity Log Alert rules.
   744  	Value *[]ActivityLogAlertResource `json:"value,omitempty"`
   745  	// NextLink - Provides the link to retrieve the next set of elements.
   746  	NextLink *string `json:"nextLink,omitempty"`
   747  }
   748  
   749  // AlertRuleListIterator provides access to a complete listing of ActivityLogAlertResource values.
   750  type AlertRuleListIterator struct {
   751  	i    int
   752  	page AlertRuleListPage
   753  }
   754  
   755  // NextWithContext advances to the next value.  If there was an error making
   756  // the request the iterator does not advance and the error is returned.
   757  func (iter *AlertRuleListIterator) NextWithContext(ctx context.Context) (err error) {
   758  	if tracing.IsEnabled() {
   759  		ctx = tracing.StartSpan(ctx, fqdn+"/AlertRuleListIterator.NextWithContext")
   760  		defer func() {
   761  			sc := -1
   762  			if iter.Response().Response.Response != nil {
   763  				sc = iter.Response().Response.Response.StatusCode
   764  			}
   765  			tracing.EndSpan(ctx, sc, err)
   766  		}()
   767  	}
   768  	iter.i++
   769  	if iter.i < len(iter.page.Values()) {
   770  		return nil
   771  	}
   772  	err = iter.page.NextWithContext(ctx)
   773  	if err != nil {
   774  		iter.i--
   775  		return err
   776  	}
   777  	iter.i = 0
   778  	return nil
   779  }
   780  
   781  // Next advances to the next value.  If there was an error making
   782  // the request the iterator does not advance and the error is returned.
   783  // Deprecated: Use NextWithContext() instead.
   784  func (iter *AlertRuleListIterator) Next() error {
   785  	return iter.NextWithContext(context.Background())
   786  }
   787  
   788  // NotDone returns true if the enumeration should be started or is not yet complete.
   789  func (iter AlertRuleListIterator) NotDone() bool {
   790  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   791  }
   792  
   793  // Response returns the raw server response from the last page request.
   794  func (iter AlertRuleListIterator) Response() AlertRuleList {
   795  	return iter.page.Response()
   796  }
   797  
   798  // Value returns the current value or a zero-initialized value if the
   799  // iterator has advanced beyond the end of the collection.
   800  func (iter AlertRuleListIterator) Value() ActivityLogAlertResource {
   801  	if !iter.page.NotDone() {
   802  		return ActivityLogAlertResource{}
   803  	}
   804  	return iter.page.Values()[iter.i]
   805  }
   806  
   807  // Creates a new instance of the AlertRuleListIterator type.
   808  func NewAlertRuleListIterator(page AlertRuleListPage) AlertRuleListIterator {
   809  	return AlertRuleListIterator{page: page}
   810  }
   811  
   812  // IsEmpty returns true if the ListResult contains no values.
   813  func (arl AlertRuleList) IsEmpty() bool {
   814  	return arl.Value == nil || len(*arl.Value) == 0
   815  }
   816  
   817  // hasNextLink returns true if the NextLink is not empty.
   818  func (arl AlertRuleList) hasNextLink() bool {
   819  	return arl.NextLink != nil && len(*arl.NextLink) != 0
   820  }
   821  
   822  // alertRuleListPreparer prepares a request to retrieve the next set of results.
   823  // It returns nil if no more results exist.
   824  func (arl AlertRuleList) alertRuleListPreparer(ctx context.Context) (*http.Request, error) {
   825  	if !arl.hasNextLink() {
   826  		return nil, nil
   827  	}
   828  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   829  		autorest.AsJSON(),
   830  		autorest.AsGet(),
   831  		autorest.WithBaseURL(to.String(arl.NextLink)))
   832  }
   833  
   834  // AlertRuleListPage contains a page of ActivityLogAlertResource values.
   835  type AlertRuleListPage struct {
   836  	fn  func(context.Context, AlertRuleList) (AlertRuleList, error)
   837  	arl AlertRuleList
   838  }
   839  
   840  // NextWithContext advances to the next page of values.  If there was an error making
   841  // the request the page does not advance and the error is returned.
   842  func (page *AlertRuleListPage) NextWithContext(ctx context.Context) (err error) {
   843  	if tracing.IsEnabled() {
   844  		ctx = tracing.StartSpan(ctx, fqdn+"/AlertRuleListPage.NextWithContext")
   845  		defer func() {
   846  			sc := -1
   847  			if page.Response().Response.Response != nil {
   848  				sc = page.Response().Response.Response.StatusCode
   849  			}
   850  			tracing.EndSpan(ctx, sc, err)
   851  		}()
   852  	}
   853  	for {
   854  		next, err := page.fn(ctx, page.arl)
   855  		if err != nil {
   856  			return err
   857  		}
   858  		page.arl = next
   859  		if !next.hasNextLink() || !next.IsEmpty() {
   860  			break
   861  		}
   862  	}
   863  	return nil
   864  }
   865  
   866  // Next advances to the next page of values.  If there was an error making
   867  // the request the page does not advance and the error is returned.
   868  // Deprecated: Use NextWithContext() instead.
   869  func (page *AlertRuleListPage) Next() error {
   870  	return page.NextWithContext(context.Background())
   871  }
   872  
   873  // NotDone returns true if the page enumeration should be started or is not yet complete.
   874  func (page AlertRuleListPage) NotDone() bool {
   875  	return !page.arl.IsEmpty()
   876  }
   877  
   878  // Response returns the raw server response from the last page request.
   879  func (page AlertRuleListPage) Response() AlertRuleList {
   880  	return page.arl
   881  }
   882  
   883  // Values returns the slice of values for the current page or nil if there are no values.
   884  func (page AlertRuleListPage) Values() []ActivityLogAlertResource {
   885  	if page.arl.IsEmpty() {
   886  		return nil
   887  	}
   888  	return *page.arl.Value
   889  }
   890  
   891  // Creates a new instance of the AlertRuleListPage type.
   892  func NewAlertRuleListPage(cur AlertRuleList, getNextPage func(context.Context, AlertRuleList) (AlertRuleList, error)) AlertRuleListPage {
   893  	return AlertRuleListPage{
   894  		fn:  getNextPage,
   895  		arl: cur,
   896  	}
   897  }
   898  
   899  // AlertRulePatchObject an Activity Log Alert rule object for the body of patch operations.
   900  type AlertRulePatchObject struct {
   901  	// Tags - The resource tags
   902  	Tags map[string]*string `json:"tags"`
   903  	// AlertRulePatchProperties - The activity log alert settings for an update operation.
   904  	*AlertRulePatchProperties `json:"properties,omitempty"`
   905  }
   906  
   907  // MarshalJSON is the custom marshaler for AlertRulePatchObject.
   908  func (arpo AlertRulePatchObject) MarshalJSON() ([]byte, error) {
   909  	objectMap := make(map[string]interface{})
   910  	if arpo.Tags != nil {
   911  		objectMap["tags"] = arpo.Tags
   912  	}
   913  	if arpo.AlertRulePatchProperties != nil {
   914  		objectMap["properties"] = arpo.AlertRulePatchProperties
   915  	}
   916  	return json.Marshal(objectMap)
   917  }
   918  
   919  // UnmarshalJSON is the custom unmarshaler for AlertRulePatchObject struct.
   920  func (arpo *AlertRulePatchObject) UnmarshalJSON(body []byte) error {
   921  	var m map[string]*json.RawMessage
   922  	err := json.Unmarshal(body, &m)
   923  	if err != nil {
   924  		return err
   925  	}
   926  	for k, v := range m {
   927  		switch k {
   928  		case "tags":
   929  			if v != nil {
   930  				var tags map[string]*string
   931  				err = json.Unmarshal(*v, &tags)
   932  				if err != nil {
   933  					return err
   934  				}
   935  				arpo.Tags = tags
   936  			}
   937  		case "properties":
   938  			if v != nil {
   939  				var alertRulePatchProperties AlertRulePatchProperties
   940  				err = json.Unmarshal(*v, &alertRulePatchProperties)
   941  				if err != nil {
   942  					return err
   943  				}
   944  				arpo.AlertRulePatchProperties = &alertRulePatchProperties
   945  			}
   946  		}
   947  	}
   948  
   949  	return nil
   950  }
   951  
   952  // AlertRulePatchProperties an Activity Log Alert rule properties for patch operations.
   953  type AlertRulePatchProperties struct {
   954  	// Enabled - Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.
   955  	Enabled *bool `json:"enabled,omitempty"`
   956  }
   957  
   958  // AlertRuleProperties an Azure Activity Log Alert rule.
   959  type AlertRuleProperties struct {
   960  	// Scopes - A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.
   961  	Scopes *[]string `json:"scopes,omitempty"`
   962  	// Condition - The condition that will cause this alert to activate.
   963  	Condition *AlertRuleAllOfCondition `json:"condition,omitempty"`
   964  	// Actions - The actions that will activate when the condition is met.
   965  	Actions *ActionList `json:"actions,omitempty"`
   966  	// Enabled - Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.
   967  	Enabled *bool `json:"enabled,omitempty"`
   968  	// Description - A description of this Activity Log Alert rule.
   969  	Description *string `json:"description,omitempty"`
   970  }
   971  
   972  // AlertRuleResource the alert rule resource.
   973  type AlertRuleResource struct {
   974  	autorest.Response `json:"-"`
   975  	// AlertRule - The alert rule properties of the resource.
   976  	*AlertRule `json:"properties,omitempty"`
   977  	// ID - READ-ONLY; Azure resource Id
   978  	ID *string `json:"id,omitempty"`
   979  	// Name - READ-ONLY; Azure resource name
   980  	Name *string `json:"name,omitempty"`
   981  	// Type - READ-ONLY; Azure resource type
   982  	Type *string `json:"type,omitempty"`
   983  	// Location - Resource location
   984  	Location *string `json:"location,omitempty"`
   985  	// Tags - Resource tags
   986  	Tags map[string]*string `json:"tags"`
   987  	// Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type.  If supported, the resource provider must validate and persist this value.
   988  	Kind *string `json:"kind,omitempty"`
   989  	// Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
   990  	Etag *string `json:"etag,omitempty"`
   991  }
   992  
   993  // MarshalJSON is the custom marshaler for AlertRuleResource.
   994  func (arr AlertRuleResource) MarshalJSON() ([]byte, error) {
   995  	objectMap := make(map[string]interface{})
   996  	if arr.AlertRule != nil {
   997  		objectMap["properties"] = arr.AlertRule
   998  	}
   999  	if arr.Location != nil {
  1000  		objectMap["location"] = arr.Location
  1001  	}
  1002  	if arr.Tags != nil {
  1003  		objectMap["tags"] = arr.Tags
  1004  	}
  1005  	return json.Marshal(objectMap)
  1006  }
  1007  
  1008  // UnmarshalJSON is the custom unmarshaler for AlertRuleResource struct.
  1009  func (arr *AlertRuleResource) UnmarshalJSON(body []byte) error {
  1010  	var m map[string]*json.RawMessage
  1011  	err := json.Unmarshal(body, &m)
  1012  	if err != nil {
  1013  		return err
  1014  	}
  1015  	for k, v := range m {
  1016  		switch k {
  1017  		case "properties":
  1018  			if v != nil {
  1019  				var alertRule AlertRule
  1020  				err = json.Unmarshal(*v, &alertRule)
  1021  				if err != nil {
  1022  					return err
  1023  				}
  1024  				arr.AlertRule = &alertRule
  1025  			}
  1026  		case "id":
  1027  			if v != nil {
  1028  				var ID string
  1029  				err = json.Unmarshal(*v, &ID)
  1030  				if err != nil {
  1031  					return err
  1032  				}
  1033  				arr.ID = &ID
  1034  			}
  1035  		case "name":
  1036  			if v != nil {
  1037  				var name string
  1038  				err = json.Unmarshal(*v, &name)
  1039  				if err != nil {
  1040  					return err
  1041  				}
  1042  				arr.Name = &name
  1043  			}
  1044  		case "type":
  1045  			if v != nil {
  1046  				var typeVar string
  1047  				err = json.Unmarshal(*v, &typeVar)
  1048  				if err != nil {
  1049  					return err
  1050  				}
  1051  				arr.Type = &typeVar
  1052  			}
  1053  		case "location":
  1054  			if v != nil {
  1055  				var location string
  1056  				err = json.Unmarshal(*v, &location)
  1057  				if err != nil {
  1058  					return err
  1059  				}
  1060  				arr.Location = &location
  1061  			}
  1062  		case "tags":
  1063  			if v != nil {
  1064  				var tags map[string]*string
  1065  				err = json.Unmarshal(*v, &tags)
  1066  				if err != nil {
  1067  					return err
  1068  				}
  1069  				arr.Tags = tags
  1070  			}
  1071  		case "kind":
  1072  			if v != nil {
  1073  				var kind string
  1074  				err = json.Unmarshal(*v, &kind)
  1075  				if err != nil {
  1076  					return err
  1077  				}
  1078  				arr.Kind = &kind
  1079  			}
  1080  		case "etag":
  1081  			if v != nil {
  1082  				var etag string
  1083  				err = json.Unmarshal(*v, &etag)
  1084  				if err != nil {
  1085  					return err
  1086  				}
  1087  				arr.Etag = &etag
  1088  			}
  1089  		}
  1090  	}
  1091  
  1092  	return nil
  1093  }
  1094  
  1095  // AlertRuleResourceCollection represents a collection of alert rule resources.
  1096  type AlertRuleResourceCollection struct {
  1097  	autorest.Response `json:"-"`
  1098  	// Value - the values for the alert rule resources.
  1099  	Value *[]AlertRuleResource `json:"value,omitempty"`
  1100  }
  1101  
  1102  // AlertRuleResourcePatch the alert rule object for patch operations.
  1103  type AlertRuleResourcePatch struct {
  1104  	// Tags - Resource tags
  1105  	Tags map[string]*string `json:"tags"`
  1106  	// AlertRule - The properties of an alert rule.
  1107  	*AlertRule `json:"properties,omitempty"`
  1108  }
  1109  
  1110  // MarshalJSON is the custom marshaler for AlertRuleResourcePatch.
  1111  func (arrp AlertRuleResourcePatch) MarshalJSON() ([]byte, error) {
  1112  	objectMap := make(map[string]interface{})
  1113  	if arrp.Tags != nil {
  1114  		objectMap["tags"] = arrp.Tags
  1115  	}
  1116  	if arrp.AlertRule != nil {
  1117  		objectMap["properties"] = arrp.AlertRule
  1118  	}
  1119  	return json.Marshal(objectMap)
  1120  }
  1121  
  1122  // UnmarshalJSON is the custom unmarshaler for AlertRuleResourcePatch struct.
  1123  func (arrp *AlertRuleResourcePatch) UnmarshalJSON(body []byte) error {
  1124  	var m map[string]*json.RawMessage
  1125  	err := json.Unmarshal(body, &m)
  1126  	if err != nil {
  1127  		return err
  1128  	}
  1129  	for k, v := range m {
  1130  		switch k {
  1131  		case "tags":
  1132  			if v != nil {
  1133  				var tags map[string]*string
  1134  				err = json.Unmarshal(*v, &tags)
  1135  				if err != nil {
  1136  					return err
  1137  				}
  1138  				arrp.Tags = tags
  1139  			}
  1140  		case "properties":
  1141  			if v != nil {
  1142  				var alertRule AlertRule
  1143  				err = json.Unmarshal(*v, &alertRule)
  1144  				if err != nil {
  1145  					return err
  1146  				}
  1147  				arrp.AlertRule = &alertRule
  1148  			}
  1149  		}
  1150  	}
  1151  
  1152  	return nil
  1153  }
  1154  
  1155  // ArmRoleReceiver an arm role receiver.
  1156  type ArmRoleReceiver struct {
  1157  	// Name - The name of the arm role receiver. Names must be unique across all receivers within an action group.
  1158  	Name *string `json:"name,omitempty"`
  1159  	// RoleID - The arm role id.
  1160  	RoleID *string `json:"roleId,omitempty"`
  1161  	// UseCommonAlertSchema - Indicates whether to use common alert schema.
  1162  	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
  1163  }
  1164  
  1165  // AutomationRunbookReceiver the Azure Automation Runbook notification receiver.
  1166  type AutomationRunbookReceiver struct {
  1167  	// AutomationAccountID - The Azure automation account Id which holds this runbook and authenticate to Azure resource.
  1168  	AutomationAccountID *string `json:"automationAccountId,omitempty"`
  1169  	// RunbookName - The name for this runbook.
  1170  	RunbookName *string `json:"runbookName,omitempty"`
  1171  	// WebhookResourceID - The resource id for webhook linked to this runbook.
  1172  	WebhookResourceID *string `json:"webhookResourceId,omitempty"`
  1173  	// IsGlobalRunbook - Indicates whether this instance is global runbook.
  1174  	IsGlobalRunbook *bool `json:"isGlobalRunbook,omitempty"`
  1175  	// Name - Indicates name of the webhook.
  1176  	Name *string `json:"name,omitempty"`
  1177  	// ServiceURI - The URI where webhooks should be sent.
  1178  	ServiceURI *string `json:"serviceUri,omitempty"`
  1179  	// UseCommonAlertSchema - Indicates whether to use common alert schema.
  1180  	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
  1181  }
  1182  
  1183  // AutoscaleNotification autoscale notification.
  1184  type AutoscaleNotification struct {
  1185  	// Operation - the operation associated with the notification and its value must be "scale"
  1186  	Operation *string `json:"operation,omitempty"`
  1187  	// Email - the email notification.
  1188  	Email *EmailNotification `json:"email,omitempty"`
  1189  	// Webhooks - the collection of webhook notifications.
  1190  	Webhooks *[]WebhookNotification `json:"webhooks,omitempty"`
  1191  }
  1192  
  1193  // AutoscaleProfile autoscale profile.
  1194  type AutoscaleProfile struct {
  1195  	// Name - the name of the profile.
  1196  	Name *string `json:"name,omitempty"`
  1197  	// Capacity - the number of instances that can be used during this profile.
  1198  	Capacity *ScaleCapacity `json:"capacity,omitempty"`
  1199  	// Rules - the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified.
  1200  	Rules *[]ScaleRule `json:"rules,omitempty"`
  1201  	// FixedDate - the specific date-time for the profile. This element is not used if the Recurrence element is used.
  1202  	FixedDate *TimeWindow `json:"fixedDate,omitempty"`
  1203  	// Recurrence - the repeating times at which this profile begins. This element is not used if the FixedDate element is used.
  1204  	Recurrence *Recurrence `json:"recurrence,omitempty"`
  1205  }
  1206  
  1207  // AutoscaleSetting a setting that contains all of the configuration for the automatic scaling of a
  1208  // resource.
  1209  type AutoscaleSetting struct {
  1210  	// Profiles - the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified.
  1211  	Profiles *[]AutoscaleProfile `json:"profiles,omitempty"`
  1212  	// Notifications - the collection of notifications.
  1213  	Notifications *[]AutoscaleNotification `json:"notifications,omitempty"`
  1214  	// Enabled - the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'true'.
  1215  	Enabled *bool `json:"enabled,omitempty"`
  1216  	// Name - the name of the autoscale setting.
  1217  	Name *string `json:"name,omitempty"`
  1218  	// TargetResourceURI - the resource identifier of the resource that the autoscale setting should be added to.
  1219  	TargetResourceURI *string `json:"targetResourceUri,omitempty"`
  1220  	// TargetResourceLocation - the location of the resource that the autoscale setting should be added to.
  1221  	TargetResourceLocation *string `json:"targetResourceLocation,omitempty"`
  1222  }
  1223  
  1224  // AutoscaleSettingResource the autoscale setting resource.
  1225  type AutoscaleSettingResource struct {
  1226  	autorest.Response `json:"-"`
  1227  	// AutoscaleSetting - The autoscale setting of the resource.
  1228  	*AutoscaleSetting `json:"properties,omitempty"`
  1229  	// ID - READ-ONLY; Azure resource Id
  1230  	ID *string `json:"id,omitempty"`
  1231  	// Name - READ-ONLY; Azure resource name
  1232  	Name *string `json:"name,omitempty"`
  1233  	// Type - READ-ONLY; Azure resource type
  1234  	Type *string `json:"type,omitempty"`
  1235  	// Location - Resource location
  1236  	Location *string `json:"location,omitempty"`
  1237  	// Tags - Resource tags
  1238  	Tags map[string]*string `json:"tags"`
  1239  	// Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type.  If supported, the resource provider must validate and persist this value.
  1240  	Kind *string `json:"kind,omitempty"`
  1241  	// Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
  1242  	Etag *string `json:"etag,omitempty"`
  1243  }
  1244  
  1245  // MarshalJSON is the custom marshaler for AutoscaleSettingResource.
  1246  func (asr AutoscaleSettingResource) MarshalJSON() ([]byte, error) {
  1247  	objectMap := make(map[string]interface{})
  1248  	if asr.AutoscaleSetting != nil {
  1249  		objectMap["properties"] = asr.AutoscaleSetting
  1250  	}
  1251  	if asr.Location != nil {
  1252  		objectMap["location"] = asr.Location
  1253  	}
  1254  	if asr.Tags != nil {
  1255  		objectMap["tags"] = asr.Tags
  1256  	}
  1257  	return json.Marshal(objectMap)
  1258  }
  1259  
  1260  // UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResource struct.
  1261  func (asr *AutoscaleSettingResource) UnmarshalJSON(body []byte) error {
  1262  	var m map[string]*json.RawMessage
  1263  	err := json.Unmarshal(body, &m)
  1264  	if err != nil {
  1265  		return err
  1266  	}
  1267  	for k, v := range m {
  1268  		switch k {
  1269  		case "properties":
  1270  			if v != nil {
  1271  				var autoscaleSetting AutoscaleSetting
  1272  				err = json.Unmarshal(*v, &autoscaleSetting)
  1273  				if err != nil {
  1274  					return err
  1275  				}
  1276  				asr.AutoscaleSetting = &autoscaleSetting
  1277  			}
  1278  		case "id":
  1279  			if v != nil {
  1280  				var ID string
  1281  				err = json.Unmarshal(*v, &ID)
  1282  				if err != nil {
  1283  					return err
  1284  				}
  1285  				asr.ID = &ID
  1286  			}
  1287  		case "name":
  1288  			if v != nil {
  1289  				var name string
  1290  				err = json.Unmarshal(*v, &name)
  1291  				if err != nil {
  1292  					return err
  1293  				}
  1294  				asr.Name = &name
  1295  			}
  1296  		case "type":
  1297  			if v != nil {
  1298  				var typeVar string
  1299  				err = json.Unmarshal(*v, &typeVar)
  1300  				if err != nil {
  1301  					return err
  1302  				}
  1303  				asr.Type = &typeVar
  1304  			}
  1305  		case "location":
  1306  			if v != nil {
  1307  				var location string
  1308  				err = json.Unmarshal(*v, &location)
  1309  				if err != nil {
  1310  					return err
  1311  				}
  1312  				asr.Location = &location
  1313  			}
  1314  		case "tags":
  1315  			if v != nil {
  1316  				var tags map[string]*string
  1317  				err = json.Unmarshal(*v, &tags)
  1318  				if err != nil {
  1319  					return err
  1320  				}
  1321  				asr.Tags = tags
  1322  			}
  1323  		case "kind":
  1324  			if v != nil {
  1325  				var kind string
  1326  				err = json.Unmarshal(*v, &kind)
  1327  				if err != nil {
  1328  					return err
  1329  				}
  1330  				asr.Kind = &kind
  1331  			}
  1332  		case "etag":
  1333  			if v != nil {
  1334  				var etag string
  1335  				err = json.Unmarshal(*v, &etag)
  1336  				if err != nil {
  1337  					return err
  1338  				}
  1339  				asr.Etag = &etag
  1340  			}
  1341  		}
  1342  	}
  1343  
  1344  	return nil
  1345  }
  1346  
  1347  // AutoscaleSettingResourceCollection represents a collection of autoscale setting resources.
  1348  type AutoscaleSettingResourceCollection struct {
  1349  	autorest.Response `json:"-"`
  1350  	// Value - the values for the autoscale setting resources.
  1351  	Value *[]AutoscaleSettingResource `json:"value,omitempty"`
  1352  	// NextLink - URL to get the next set of results.
  1353  	NextLink *string `json:"nextLink,omitempty"`
  1354  }
  1355  
  1356  // AutoscaleSettingResourceCollectionIterator provides access to a complete listing of
  1357  // AutoscaleSettingResource values.
  1358  type AutoscaleSettingResourceCollectionIterator struct {
  1359  	i    int
  1360  	page AutoscaleSettingResourceCollectionPage
  1361  }
  1362  
  1363  // NextWithContext advances to the next value.  If there was an error making
  1364  // the request the iterator does not advance and the error is returned.
  1365  func (iter *AutoscaleSettingResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  1366  	if tracing.IsEnabled() {
  1367  		ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionIterator.NextWithContext")
  1368  		defer func() {
  1369  			sc := -1
  1370  			if iter.Response().Response.Response != nil {
  1371  				sc = iter.Response().Response.Response.StatusCode
  1372  			}
  1373  			tracing.EndSpan(ctx, sc, err)
  1374  		}()
  1375  	}
  1376  	iter.i++
  1377  	if iter.i < len(iter.page.Values()) {
  1378  		return nil
  1379  	}
  1380  	err = iter.page.NextWithContext(ctx)
  1381  	if err != nil {
  1382  		iter.i--
  1383  		return err
  1384  	}
  1385  	iter.i = 0
  1386  	return nil
  1387  }
  1388  
  1389  // Next advances to the next value.  If there was an error making
  1390  // the request the iterator does not advance and the error is returned.
  1391  // Deprecated: Use NextWithContext() instead.
  1392  func (iter *AutoscaleSettingResourceCollectionIterator) Next() error {
  1393  	return iter.NextWithContext(context.Background())
  1394  }
  1395  
  1396  // NotDone returns true if the enumeration should be started or is not yet complete.
  1397  func (iter AutoscaleSettingResourceCollectionIterator) NotDone() bool {
  1398  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1399  }
  1400  
  1401  // Response returns the raw server response from the last page request.
  1402  func (iter AutoscaleSettingResourceCollectionIterator) Response() AutoscaleSettingResourceCollection {
  1403  	return iter.page.Response()
  1404  }
  1405  
  1406  // Value returns the current value or a zero-initialized value if the
  1407  // iterator has advanced beyond the end of the collection.
  1408  func (iter AutoscaleSettingResourceCollectionIterator) Value() AutoscaleSettingResource {
  1409  	if !iter.page.NotDone() {
  1410  		return AutoscaleSettingResource{}
  1411  	}
  1412  	return iter.page.Values()[iter.i]
  1413  }
  1414  
  1415  // Creates a new instance of the AutoscaleSettingResourceCollectionIterator type.
  1416  func NewAutoscaleSettingResourceCollectionIterator(page AutoscaleSettingResourceCollectionPage) AutoscaleSettingResourceCollectionIterator {
  1417  	return AutoscaleSettingResourceCollectionIterator{page: page}
  1418  }
  1419  
  1420  // IsEmpty returns true if the ListResult contains no values.
  1421  func (asrc AutoscaleSettingResourceCollection) IsEmpty() bool {
  1422  	return asrc.Value == nil || len(*asrc.Value) == 0
  1423  }
  1424  
  1425  // hasNextLink returns true if the NextLink is not empty.
  1426  func (asrc AutoscaleSettingResourceCollection) hasNextLink() bool {
  1427  	return asrc.NextLink != nil && len(*asrc.NextLink) != 0
  1428  }
  1429  
  1430  // autoscaleSettingResourceCollectionPreparer prepares a request to retrieve the next set of results.
  1431  // It returns nil if no more results exist.
  1432  func (asrc AutoscaleSettingResourceCollection) autoscaleSettingResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
  1433  	if !asrc.hasNextLink() {
  1434  		return nil, nil
  1435  	}
  1436  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1437  		autorest.AsJSON(),
  1438  		autorest.AsGet(),
  1439  		autorest.WithBaseURL(to.String(asrc.NextLink)))
  1440  }
  1441  
  1442  // AutoscaleSettingResourceCollectionPage contains a page of AutoscaleSettingResource values.
  1443  type AutoscaleSettingResourceCollectionPage struct {
  1444  	fn   func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error)
  1445  	asrc AutoscaleSettingResourceCollection
  1446  }
  1447  
  1448  // NextWithContext advances to the next page of values.  If there was an error making
  1449  // the request the page does not advance and the error is returned.
  1450  func (page *AutoscaleSettingResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
  1451  	if tracing.IsEnabled() {
  1452  		ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionPage.NextWithContext")
  1453  		defer func() {
  1454  			sc := -1
  1455  			if page.Response().Response.Response != nil {
  1456  				sc = page.Response().Response.Response.StatusCode
  1457  			}
  1458  			tracing.EndSpan(ctx, sc, err)
  1459  		}()
  1460  	}
  1461  	for {
  1462  		next, err := page.fn(ctx, page.asrc)
  1463  		if err != nil {
  1464  			return err
  1465  		}
  1466  		page.asrc = next
  1467  		if !next.hasNextLink() || !next.IsEmpty() {
  1468  			break
  1469  		}
  1470  	}
  1471  	return nil
  1472  }
  1473  
  1474  // Next advances to the next page of values.  If there was an error making
  1475  // the request the page does not advance and the error is returned.
  1476  // Deprecated: Use NextWithContext() instead.
  1477  func (page *AutoscaleSettingResourceCollectionPage) Next() error {
  1478  	return page.NextWithContext(context.Background())
  1479  }
  1480  
  1481  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1482  func (page AutoscaleSettingResourceCollectionPage) NotDone() bool {
  1483  	return !page.asrc.IsEmpty()
  1484  }
  1485  
  1486  // Response returns the raw server response from the last page request.
  1487  func (page AutoscaleSettingResourceCollectionPage) Response() AutoscaleSettingResourceCollection {
  1488  	return page.asrc
  1489  }
  1490  
  1491  // Values returns the slice of values for the current page or nil if there are no values.
  1492  func (page AutoscaleSettingResourceCollectionPage) Values() []AutoscaleSettingResource {
  1493  	if page.asrc.IsEmpty() {
  1494  		return nil
  1495  	}
  1496  	return *page.asrc.Value
  1497  }
  1498  
  1499  // Creates a new instance of the AutoscaleSettingResourceCollectionPage type.
  1500  func NewAutoscaleSettingResourceCollectionPage(cur AutoscaleSettingResourceCollection, getNextPage func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error)) AutoscaleSettingResourceCollectionPage {
  1501  	return AutoscaleSettingResourceCollectionPage{
  1502  		fn:   getNextPage,
  1503  		asrc: cur,
  1504  	}
  1505  }
  1506  
  1507  // AutoscaleSettingResourcePatch the autoscale setting object for patch operations.
  1508  type AutoscaleSettingResourcePatch struct {
  1509  	// Tags - Resource tags
  1510  	Tags map[string]*string `json:"tags"`
  1511  	// AutoscaleSetting - The autoscale setting properties of the update operation.
  1512  	*AutoscaleSetting `json:"properties,omitempty"`
  1513  }
  1514  
  1515  // MarshalJSON is the custom marshaler for AutoscaleSettingResourcePatch.
  1516  func (asrp AutoscaleSettingResourcePatch) MarshalJSON() ([]byte, error) {
  1517  	objectMap := make(map[string]interface{})
  1518  	if asrp.Tags != nil {
  1519  		objectMap["tags"] = asrp.Tags
  1520  	}
  1521  	if asrp.AutoscaleSetting != nil {
  1522  		objectMap["properties"] = asrp.AutoscaleSetting
  1523  	}
  1524  	return json.Marshal(objectMap)
  1525  }
  1526  
  1527  // UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResourcePatch struct.
  1528  func (asrp *AutoscaleSettingResourcePatch) UnmarshalJSON(body []byte) error {
  1529  	var m map[string]*json.RawMessage
  1530  	err := json.Unmarshal(body, &m)
  1531  	if err != nil {
  1532  		return err
  1533  	}
  1534  	for k, v := range m {
  1535  		switch k {
  1536  		case "tags":
  1537  			if v != nil {
  1538  				var tags map[string]*string
  1539  				err = json.Unmarshal(*v, &tags)
  1540  				if err != nil {
  1541  					return err
  1542  				}
  1543  				asrp.Tags = tags
  1544  			}
  1545  		case "properties":
  1546  			if v != nil {
  1547  				var autoscaleSetting AutoscaleSetting
  1548  				err = json.Unmarshal(*v, &autoscaleSetting)
  1549  				if err != nil {
  1550  					return err
  1551  				}
  1552  				asrp.AutoscaleSetting = &autoscaleSetting
  1553  			}
  1554  		}
  1555  	}
  1556  
  1557  	return nil
  1558  }
  1559  
  1560  // AzNsActionGroup azure action group
  1561  type AzNsActionGroup struct {
  1562  	// ActionGroup - Azure Action Group reference.
  1563  	ActionGroup *[]string `json:"actionGroup,omitempty"`
  1564  	// EmailSubject - Custom subject override for all email ids in Azure action group
  1565  	EmailSubject *string `json:"emailSubject,omitempty"`
  1566  	// CustomWebhookPayload - Custom payload to be sent for all webhook URI in Azure action group
  1567  	CustomWebhookPayload *string `json:"customWebhookPayload,omitempty"`
  1568  }
  1569  
  1570  // AzureAppPushReceiver the Azure mobile App push notification receiver.
  1571  type AzureAppPushReceiver struct {
  1572  	// Name - The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group.
  1573  	Name *string `json:"name,omitempty"`
  1574  	// EmailAddress - The email address registered for the Azure mobile app.
  1575  	EmailAddress *string `json:"emailAddress,omitempty"`
  1576  }
  1577  
  1578  // AzureFunctionReceiver an azure function receiver.
  1579  type AzureFunctionReceiver struct {
  1580  	// Name - The name of the azure function receiver. Names must be unique across all receivers within an action group.
  1581  	Name *string `json:"name,omitempty"`
  1582  	// FunctionAppResourceID - The azure resource id of the function app.
  1583  	FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"`
  1584  	// FunctionName - The function name in the function app.
  1585  	FunctionName *string `json:"functionName,omitempty"`
  1586  	// HTTPTriggerURL - The http trigger url where http request sent to.
  1587  	HTTPTriggerURL *string `json:"httpTriggerUrl,omitempty"`
  1588  	// UseCommonAlertSchema - Indicates whether to use common alert schema.
  1589  	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
  1590  }
  1591  
  1592  // AzureMonitorMetricsDestination azure Monitor Metrics destination.
  1593  type AzureMonitorMetricsDestination struct {
  1594  	// Name - A friendly name for the destination.
  1595  	// This name should be unique across all destinations (regardless of type) within the data collection rule.
  1596  	Name *string `json:"name,omitempty"`
  1597  }
  1598  
  1599  // AzureMonitorPrivateLinkScope an Azure Monitor PrivateLinkScope definition.
  1600  type AzureMonitorPrivateLinkScope struct {
  1601  	autorest.Response `json:"-"`
  1602  	// AzureMonitorPrivateLinkScopeProperties - Properties that define a Azure Monitor PrivateLinkScope resource.
  1603  	*AzureMonitorPrivateLinkScopeProperties `json:"properties,omitempty"`
  1604  	// ID - READ-ONLY; Azure resource Id
  1605  	ID *string `json:"id,omitempty"`
  1606  	// Name - READ-ONLY; Azure resource name
  1607  	Name *string `json:"name,omitempty"`
  1608  	// Type - READ-ONLY; Azure resource type
  1609  	Type *string `json:"type,omitempty"`
  1610  	// Location - Resource location
  1611  	Location *string `json:"location,omitempty"`
  1612  	// Tags - Resource tags
  1613  	Tags map[string]*string `json:"tags"`
  1614  }
  1615  
  1616  // MarshalJSON is the custom marshaler for AzureMonitorPrivateLinkScope.
  1617  func (ampls AzureMonitorPrivateLinkScope) MarshalJSON() ([]byte, error) {
  1618  	objectMap := make(map[string]interface{})
  1619  	if ampls.AzureMonitorPrivateLinkScopeProperties != nil {
  1620  		objectMap["properties"] = ampls.AzureMonitorPrivateLinkScopeProperties
  1621  	}
  1622  	if ampls.Location != nil {
  1623  		objectMap["location"] = ampls.Location
  1624  	}
  1625  	if ampls.Tags != nil {
  1626  		objectMap["tags"] = ampls.Tags
  1627  	}
  1628  	return json.Marshal(objectMap)
  1629  }
  1630  
  1631  // UnmarshalJSON is the custom unmarshaler for AzureMonitorPrivateLinkScope struct.
  1632  func (ampls *AzureMonitorPrivateLinkScope) UnmarshalJSON(body []byte) error {
  1633  	var m map[string]*json.RawMessage
  1634  	err := json.Unmarshal(body, &m)
  1635  	if err != nil {
  1636  		return err
  1637  	}
  1638  	for k, v := range m {
  1639  		switch k {
  1640  		case "properties":
  1641  			if v != nil {
  1642  				var azureMonitorPrivateLinkScopeProperties AzureMonitorPrivateLinkScopeProperties
  1643  				err = json.Unmarshal(*v, &azureMonitorPrivateLinkScopeProperties)
  1644  				if err != nil {
  1645  					return err
  1646  				}
  1647  				ampls.AzureMonitorPrivateLinkScopeProperties = &azureMonitorPrivateLinkScopeProperties
  1648  			}
  1649  		case "id":
  1650  			if v != nil {
  1651  				var ID string
  1652  				err = json.Unmarshal(*v, &ID)
  1653  				if err != nil {
  1654  					return err
  1655  				}
  1656  				ampls.ID = &ID
  1657  			}
  1658  		case "name":
  1659  			if v != nil {
  1660  				var name string
  1661  				err = json.Unmarshal(*v, &name)
  1662  				if err != nil {
  1663  					return err
  1664  				}
  1665  				ampls.Name = &name
  1666  			}
  1667  		case "type":
  1668  			if v != nil {
  1669  				var typeVar string
  1670  				err = json.Unmarshal(*v, &typeVar)
  1671  				if err != nil {
  1672  					return err
  1673  				}
  1674  				ampls.Type = &typeVar
  1675  			}
  1676  		case "location":
  1677  			if v != nil {
  1678  				var location string
  1679  				err = json.Unmarshal(*v, &location)
  1680  				if err != nil {
  1681  					return err
  1682  				}
  1683  				ampls.Location = &location
  1684  			}
  1685  		case "tags":
  1686  			if v != nil {
  1687  				var tags map[string]*string
  1688  				err = json.Unmarshal(*v, &tags)
  1689  				if err != nil {
  1690  					return err
  1691  				}
  1692  				ampls.Tags = tags
  1693  			}
  1694  		}
  1695  	}
  1696  
  1697  	return nil
  1698  }
  1699  
  1700  // AzureMonitorPrivateLinkScopeListResult describes the list of Azure Monitor PrivateLinkScope resources.
  1701  type AzureMonitorPrivateLinkScopeListResult struct {
  1702  	autorest.Response `json:"-"`
  1703  	// Value - List of Azure Monitor PrivateLinkScope definitions.
  1704  	Value *[]AzureMonitorPrivateLinkScope `json:"value,omitempty"`
  1705  	// NextLink - The URI to get the next set of Azure Monitor PrivateLinkScope definitions if too many PrivateLinkScopes where returned in the result set.
  1706  	NextLink *string `json:"nextLink,omitempty"`
  1707  }
  1708  
  1709  // AzureMonitorPrivateLinkScopeListResultIterator provides access to a complete listing of
  1710  // AzureMonitorPrivateLinkScope values.
  1711  type AzureMonitorPrivateLinkScopeListResultIterator struct {
  1712  	i    int
  1713  	page AzureMonitorPrivateLinkScopeListResultPage
  1714  }
  1715  
  1716  // NextWithContext advances to the next value.  If there was an error making
  1717  // the request the iterator does not advance and the error is returned.
  1718  func (iter *AzureMonitorPrivateLinkScopeListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1719  	if tracing.IsEnabled() {
  1720  		ctx = tracing.StartSpan(ctx, fqdn+"/AzureMonitorPrivateLinkScopeListResultIterator.NextWithContext")
  1721  		defer func() {
  1722  			sc := -1
  1723  			if iter.Response().Response.Response != nil {
  1724  				sc = iter.Response().Response.Response.StatusCode
  1725  			}
  1726  			tracing.EndSpan(ctx, sc, err)
  1727  		}()
  1728  	}
  1729  	iter.i++
  1730  	if iter.i < len(iter.page.Values()) {
  1731  		return nil
  1732  	}
  1733  	err = iter.page.NextWithContext(ctx)
  1734  	if err != nil {
  1735  		iter.i--
  1736  		return err
  1737  	}
  1738  	iter.i = 0
  1739  	return nil
  1740  }
  1741  
  1742  // Next advances to the next value.  If there was an error making
  1743  // the request the iterator does not advance and the error is returned.
  1744  // Deprecated: Use NextWithContext() instead.
  1745  func (iter *AzureMonitorPrivateLinkScopeListResultIterator) Next() error {
  1746  	return iter.NextWithContext(context.Background())
  1747  }
  1748  
  1749  // NotDone returns true if the enumeration should be started or is not yet complete.
  1750  func (iter AzureMonitorPrivateLinkScopeListResultIterator) NotDone() bool {
  1751  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1752  }
  1753  
  1754  // Response returns the raw server response from the last page request.
  1755  func (iter AzureMonitorPrivateLinkScopeListResultIterator) Response() AzureMonitorPrivateLinkScopeListResult {
  1756  	return iter.page.Response()
  1757  }
  1758  
  1759  // Value returns the current value or a zero-initialized value if the
  1760  // iterator has advanced beyond the end of the collection.
  1761  func (iter AzureMonitorPrivateLinkScopeListResultIterator) Value() AzureMonitorPrivateLinkScope {
  1762  	if !iter.page.NotDone() {
  1763  		return AzureMonitorPrivateLinkScope{}
  1764  	}
  1765  	return iter.page.Values()[iter.i]
  1766  }
  1767  
  1768  // Creates a new instance of the AzureMonitorPrivateLinkScopeListResultIterator type.
  1769  func NewAzureMonitorPrivateLinkScopeListResultIterator(page AzureMonitorPrivateLinkScopeListResultPage) AzureMonitorPrivateLinkScopeListResultIterator {
  1770  	return AzureMonitorPrivateLinkScopeListResultIterator{page: page}
  1771  }
  1772  
  1773  // IsEmpty returns true if the ListResult contains no values.
  1774  func (amplslr AzureMonitorPrivateLinkScopeListResult) IsEmpty() bool {
  1775  	return amplslr.Value == nil || len(*amplslr.Value) == 0
  1776  }
  1777  
  1778  // hasNextLink returns true if the NextLink is not empty.
  1779  func (amplslr AzureMonitorPrivateLinkScopeListResult) hasNextLink() bool {
  1780  	return amplslr.NextLink != nil && len(*amplslr.NextLink) != 0
  1781  }
  1782  
  1783  // azureMonitorPrivateLinkScopeListResultPreparer prepares a request to retrieve the next set of results.
  1784  // It returns nil if no more results exist.
  1785  func (amplslr AzureMonitorPrivateLinkScopeListResult) azureMonitorPrivateLinkScopeListResultPreparer(ctx context.Context) (*http.Request, error) {
  1786  	if !amplslr.hasNextLink() {
  1787  		return nil, nil
  1788  	}
  1789  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1790  		autorest.AsJSON(),
  1791  		autorest.AsGet(),
  1792  		autorest.WithBaseURL(to.String(amplslr.NextLink)))
  1793  }
  1794  
  1795  // AzureMonitorPrivateLinkScopeListResultPage contains a page of AzureMonitorPrivateLinkScope values.
  1796  type AzureMonitorPrivateLinkScopeListResultPage struct {
  1797  	fn      func(context.Context, AzureMonitorPrivateLinkScopeListResult) (AzureMonitorPrivateLinkScopeListResult, error)
  1798  	amplslr AzureMonitorPrivateLinkScopeListResult
  1799  }
  1800  
  1801  // NextWithContext advances to the next page of values.  If there was an error making
  1802  // the request the page does not advance and the error is returned.
  1803  func (page *AzureMonitorPrivateLinkScopeListResultPage) NextWithContext(ctx context.Context) (err error) {
  1804  	if tracing.IsEnabled() {
  1805  		ctx = tracing.StartSpan(ctx, fqdn+"/AzureMonitorPrivateLinkScopeListResultPage.NextWithContext")
  1806  		defer func() {
  1807  			sc := -1
  1808  			if page.Response().Response.Response != nil {
  1809  				sc = page.Response().Response.Response.StatusCode
  1810  			}
  1811  			tracing.EndSpan(ctx, sc, err)
  1812  		}()
  1813  	}
  1814  	for {
  1815  		next, err := page.fn(ctx, page.amplslr)
  1816  		if err != nil {
  1817  			return err
  1818  		}
  1819  		page.amplslr = next
  1820  		if !next.hasNextLink() || !next.IsEmpty() {
  1821  			break
  1822  		}
  1823  	}
  1824  	return nil
  1825  }
  1826  
  1827  // Next advances to the next page of values.  If there was an error making
  1828  // the request the page does not advance and the error is returned.
  1829  // Deprecated: Use NextWithContext() instead.
  1830  func (page *AzureMonitorPrivateLinkScopeListResultPage) Next() error {
  1831  	return page.NextWithContext(context.Background())
  1832  }
  1833  
  1834  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1835  func (page AzureMonitorPrivateLinkScopeListResultPage) NotDone() bool {
  1836  	return !page.amplslr.IsEmpty()
  1837  }
  1838  
  1839  // Response returns the raw server response from the last page request.
  1840  func (page AzureMonitorPrivateLinkScopeListResultPage) Response() AzureMonitorPrivateLinkScopeListResult {
  1841  	return page.amplslr
  1842  }
  1843  
  1844  // Values returns the slice of values for the current page or nil if there are no values.
  1845  func (page AzureMonitorPrivateLinkScopeListResultPage) Values() []AzureMonitorPrivateLinkScope {
  1846  	if page.amplslr.IsEmpty() {
  1847  		return nil
  1848  	}
  1849  	return *page.amplslr.Value
  1850  }
  1851  
  1852  // Creates a new instance of the AzureMonitorPrivateLinkScopeListResultPage type.
  1853  func NewAzureMonitorPrivateLinkScopeListResultPage(cur AzureMonitorPrivateLinkScopeListResult, getNextPage func(context.Context, AzureMonitorPrivateLinkScopeListResult) (AzureMonitorPrivateLinkScopeListResult, error)) AzureMonitorPrivateLinkScopeListResultPage {
  1854  	return AzureMonitorPrivateLinkScopeListResultPage{
  1855  		fn:      getNextPage,
  1856  		amplslr: cur,
  1857  	}
  1858  }
  1859  
  1860  // AzureMonitorPrivateLinkScopeProperties properties that define a Azure Monitor PrivateLinkScope resource.
  1861  type AzureMonitorPrivateLinkScopeProperties struct {
  1862  	// ProvisioningState - READ-ONLY; Current state of this PrivateLinkScope: 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 Provisioning ,Succeeded, Canceled and Failed.
  1863  	ProvisioningState *string `json:"provisioningState,omitempty"`
  1864  	// PrivateEndpointConnections - READ-ONLY; List of private endpoint connections.
  1865  	PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
  1866  }
  1867  
  1868  // MarshalJSON is the custom marshaler for AzureMonitorPrivateLinkScopeProperties.
  1869  func (amplsp AzureMonitorPrivateLinkScopeProperties) MarshalJSON() ([]byte, error) {
  1870  	objectMap := make(map[string]interface{})
  1871  	return json.Marshal(objectMap)
  1872  }
  1873  
  1874  // AzureResource an azure resource object
  1875  type AzureResource struct {
  1876  	// ID - READ-ONLY; Azure resource Id
  1877  	ID *string `json:"id,omitempty"`
  1878  	// Name - READ-ONLY; Azure resource name
  1879  	Name *string `json:"name,omitempty"`
  1880  	// Type - READ-ONLY; Azure resource type
  1881  	Type *string `json:"type,omitempty"`
  1882  	// Kind - READ-ONLY; Azure resource kind
  1883  	Kind *string `json:"kind,omitempty"`
  1884  	// Identity - READ-ONLY; Azure resource identity
  1885  	Identity *string `json:"identity,omitempty"`
  1886  	// Location - Resource location
  1887  	Location *string `json:"location,omitempty"`
  1888  	// Tags - Resource tags
  1889  	Tags map[string]*string `json:"tags"`
  1890  }
  1891  
  1892  // MarshalJSON is the custom marshaler for AzureResource.
  1893  func (ar AzureResource) MarshalJSON() ([]byte, error) {
  1894  	objectMap := make(map[string]interface{})
  1895  	if ar.Location != nil {
  1896  		objectMap["location"] = ar.Location
  1897  	}
  1898  	if ar.Tags != nil {
  1899  		objectMap["tags"] = ar.Tags
  1900  	}
  1901  	return json.Marshal(objectMap)
  1902  }
  1903  
  1904  // BaselineMetadata represents a baseline metadata value.
  1905  type BaselineMetadata struct {
  1906  	// Name - Name of the baseline metadata.
  1907  	Name *string `json:"name,omitempty"`
  1908  	// Value - Value of the baseline metadata.
  1909  	Value *string `json:"value,omitempty"`
  1910  }
  1911  
  1912  // ConfigurationAccessEndpointSpec definition of the endpoint used for accessing configuration.
  1913  type ConfigurationAccessEndpointSpec struct {
  1914  	// Endpoint - READ-ONLY; The endpoint. This property is READ-ONLY.
  1915  	Endpoint *string `json:"endpoint,omitempty"`
  1916  }
  1917  
  1918  // MarshalJSON is the custom marshaler for ConfigurationAccessEndpointSpec.
  1919  func (caes ConfigurationAccessEndpointSpec) MarshalJSON() ([]byte, error) {
  1920  	objectMap := make(map[string]interface{})
  1921  	return json.Marshal(objectMap)
  1922  }
  1923  
  1924  // Context the context info
  1925  type Context struct {
  1926  	// NotificationSource - The source of the notification request
  1927  	NotificationSource *string `json:"NotificationSource,omitempty"`
  1928  	// ContextType - The context id type
  1929  	ContextType *string `json:"ContextType,omitempty"`
  1930  }
  1931  
  1932  // Criteria specifies the criteria for converting log to metric.
  1933  type Criteria struct {
  1934  	// MetricName - Name of the metric
  1935  	MetricName *string `json:"metricName,omitempty"`
  1936  	// Dimensions - List of Dimensions for creating metric
  1937  	Dimensions *[]Dimension `json:"dimensions,omitempty"`
  1938  }
  1939  
  1940  // DataCollectionEndpoint definition of data collection endpoint.
  1941  type DataCollectionEndpoint struct {
  1942  	// Description - Description of the data collection endpoint.
  1943  	Description *string `json:"description,omitempty"`
  1944  	// ImmutableID - The immutable ID of this data collection endpoint resource. This property is READ-ONLY.
  1945  	ImmutableID *string `json:"immutableId,omitempty"`
  1946  	// ConfigurationAccess - The endpoint used by agents to access their configuration.
  1947  	ConfigurationAccess *DataCollectionEndpointConfigurationAccess `json:"configurationAccess,omitempty"`
  1948  	// LogsIngestion - The endpoint used by clients to ingest logs.
  1949  	LogsIngestion *DataCollectionEndpointLogsIngestion `json:"logsIngestion,omitempty"`
  1950  	// NetworkAcls - Network access control rules for the endpoints.
  1951  	NetworkAcls *DataCollectionEndpointNetworkAcls `json:"networkAcls,omitempty"`
  1952  	// ProvisioningState - READ-ONLY; The resource provisioning state. This property is READ-ONLY. Possible values include: 'KnownDataCollectionEndpointProvisioningStateCreating', 'KnownDataCollectionEndpointProvisioningStateUpdating', 'KnownDataCollectionEndpointProvisioningStateDeleting', 'KnownDataCollectionEndpointProvisioningStateSucceeded', 'KnownDataCollectionEndpointProvisioningStateFailed'
  1953  	ProvisioningState KnownDataCollectionEndpointProvisioningState `json:"provisioningState,omitempty"`
  1954  }
  1955  
  1956  // MarshalJSON is the custom marshaler for DataCollectionEndpoint.
  1957  func (dce DataCollectionEndpoint) MarshalJSON() ([]byte, error) {
  1958  	objectMap := make(map[string]interface{})
  1959  	if dce.Description != nil {
  1960  		objectMap["description"] = dce.Description
  1961  	}
  1962  	if dce.ImmutableID != nil {
  1963  		objectMap["immutableId"] = dce.ImmutableID
  1964  	}
  1965  	if dce.ConfigurationAccess != nil {
  1966  		objectMap["configurationAccess"] = dce.ConfigurationAccess
  1967  	}
  1968  	if dce.LogsIngestion != nil {
  1969  		objectMap["logsIngestion"] = dce.LogsIngestion
  1970  	}
  1971  	if dce.NetworkAcls != nil {
  1972  		objectMap["networkAcls"] = dce.NetworkAcls
  1973  	}
  1974  	return json.Marshal(objectMap)
  1975  }
  1976  
  1977  // DataCollectionEndpointConfigurationAccess the endpoint used by agents to access their configuration.
  1978  type DataCollectionEndpointConfigurationAccess struct {
  1979  	// Endpoint - READ-ONLY; The endpoint. This property is READ-ONLY.
  1980  	Endpoint *string `json:"endpoint,omitempty"`
  1981  }
  1982  
  1983  // MarshalJSON is the custom marshaler for DataCollectionEndpointConfigurationAccess.
  1984  func (dceA DataCollectionEndpointConfigurationAccess) MarshalJSON() ([]byte, error) {
  1985  	objectMap := make(map[string]interface{})
  1986  	return json.Marshal(objectMap)
  1987  }
  1988  
  1989  // DataCollectionEndpointLogsIngestion the endpoint used by clients to ingest logs.
  1990  type DataCollectionEndpointLogsIngestion struct {
  1991  	// Endpoint - READ-ONLY; The endpoint. This property is READ-ONLY.
  1992  	Endpoint *string `json:"endpoint,omitempty"`
  1993  }
  1994  
  1995  // MarshalJSON is the custom marshaler for DataCollectionEndpointLogsIngestion.
  1996  func (dceI DataCollectionEndpointLogsIngestion) MarshalJSON() ([]byte, error) {
  1997  	objectMap := make(map[string]interface{})
  1998  	return json.Marshal(objectMap)
  1999  }
  2000  
  2001  // DataCollectionEndpointNetworkAcls network access control rules for the endpoints.
  2002  type DataCollectionEndpointNetworkAcls struct {
  2003  	// PublicNetworkAccess - The configuration to set whether network access from public internet to the endpoints are allowed. Possible values include: 'KnownPublicNetworkAccessOptionsEnabled', 'KnownPublicNetworkAccessOptionsDisabled'
  2004  	PublicNetworkAccess KnownPublicNetworkAccessOptions `json:"publicNetworkAccess,omitempty"`
  2005  }
  2006  
  2007  // DataCollectionEndpointResource definition of ARM tracked top level resource.
  2008  type DataCollectionEndpointResource struct {
  2009  	autorest.Response `json:"-"`
  2010  	// DataCollectionEndpointResourceProperties - Resource properties.
  2011  	*DataCollectionEndpointResourceProperties `json:"properties,omitempty"`
  2012  	// Location - The geo-location where the resource lives.
  2013  	Location *string `json:"location,omitempty"`
  2014  	// Tags - Resource tags.
  2015  	Tags map[string]*string `json:"tags"`
  2016  	// Kind - The kind of the resource. Possible values include: 'KnownDataCollectionEndpointResourceKindLinux', 'KnownDataCollectionEndpointResourceKindWindows'
  2017  	Kind KnownDataCollectionEndpointResourceKind `json:"kind,omitempty"`
  2018  	// ID - READ-ONLY; Fully qualified ID of the resource.
  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.
  2023  	Type *string `json:"type,omitempty"`
  2024  	// Etag - READ-ONLY; Resource entity tag (ETag).
  2025  	Etag *string `json:"etag,omitempty"`
  2026  	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
  2027  	SystemData *DataCollectionEndpointResourceSystemData `json:"systemData,omitempty"`
  2028  }
  2029  
  2030  // MarshalJSON is the custom marshaler for DataCollectionEndpointResource.
  2031  func (dcer DataCollectionEndpointResource) MarshalJSON() ([]byte, error) {
  2032  	objectMap := make(map[string]interface{})
  2033  	if dcer.DataCollectionEndpointResourceProperties != nil {
  2034  		objectMap["properties"] = dcer.DataCollectionEndpointResourceProperties
  2035  	}
  2036  	if dcer.Location != nil {
  2037  		objectMap["location"] = dcer.Location
  2038  	}
  2039  	if dcer.Tags != nil {
  2040  		objectMap["tags"] = dcer.Tags
  2041  	}
  2042  	if dcer.Kind != "" {
  2043  		objectMap["kind"] = dcer.Kind
  2044  	}
  2045  	return json.Marshal(objectMap)
  2046  }
  2047  
  2048  // UnmarshalJSON is the custom unmarshaler for DataCollectionEndpointResource struct.
  2049  func (dcer *DataCollectionEndpointResource) UnmarshalJSON(body []byte) error {
  2050  	var m map[string]*json.RawMessage
  2051  	err := json.Unmarshal(body, &m)
  2052  	if err != nil {
  2053  		return err
  2054  	}
  2055  	for k, v := range m {
  2056  		switch k {
  2057  		case "properties":
  2058  			if v != nil {
  2059  				var dataCollectionEndpointResourceProperties DataCollectionEndpointResourceProperties
  2060  				err = json.Unmarshal(*v, &dataCollectionEndpointResourceProperties)
  2061  				if err != nil {
  2062  					return err
  2063  				}
  2064  				dcer.DataCollectionEndpointResourceProperties = &dataCollectionEndpointResourceProperties
  2065  			}
  2066  		case "location":
  2067  			if v != nil {
  2068  				var location string
  2069  				err = json.Unmarshal(*v, &location)
  2070  				if err != nil {
  2071  					return err
  2072  				}
  2073  				dcer.Location = &location
  2074  			}
  2075  		case "tags":
  2076  			if v != nil {
  2077  				var tags map[string]*string
  2078  				err = json.Unmarshal(*v, &tags)
  2079  				if err != nil {
  2080  					return err
  2081  				}
  2082  				dcer.Tags = tags
  2083  			}
  2084  		case "kind":
  2085  			if v != nil {
  2086  				var kind KnownDataCollectionEndpointResourceKind
  2087  				err = json.Unmarshal(*v, &kind)
  2088  				if err != nil {
  2089  					return err
  2090  				}
  2091  				dcer.Kind = kind
  2092  			}
  2093  		case "id":
  2094  			if v != nil {
  2095  				var ID string
  2096  				err = json.Unmarshal(*v, &ID)
  2097  				if err != nil {
  2098  					return err
  2099  				}
  2100  				dcer.ID = &ID
  2101  			}
  2102  		case "name":
  2103  			if v != nil {
  2104  				var name string
  2105  				err = json.Unmarshal(*v, &name)
  2106  				if err != nil {
  2107  					return err
  2108  				}
  2109  				dcer.Name = &name
  2110  			}
  2111  		case "type":
  2112  			if v != nil {
  2113  				var typeVar string
  2114  				err = json.Unmarshal(*v, &typeVar)
  2115  				if err != nil {
  2116  					return err
  2117  				}
  2118  				dcer.Type = &typeVar
  2119  			}
  2120  		case "etag":
  2121  			if v != nil {
  2122  				var etag string
  2123  				err = json.Unmarshal(*v, &etag)
  2124  				if err != nil {
  2125  					return err
  2126  				}
  2127  				dcer.Etag = &etag
  2128  			}
  2129  		case "systemData":
  2130  			if v != nil {
  2131  				var systemData DataCollectionEndpointResourceSystemData
  2132  				err = json.Unmarshal(*v, &systemData)
  2133  				if err != nil {
  2134  					return err
  2135  				}
  2136  				dcer.SystemData = &systemData
  2137  			}
  2138  		}
  2139  	}
  2140  
  2141  	return nil
  2142  }
  2143  
  2144  // DataCollectionEndpointResourceListResult a pageable list of resources.
  2145  type DataCollectionEndpointResourceListResult struct {
  2146  	autorest.Response `json:"-"`
  2147  	// Value - A list of resources.
  2148  	Value *[]DataCollectionEndpointResource `json:"value,omitempty"`
  2149  	// NextLink - The URL to use for getting the next set of results.
  2150  	NextLink *string `json:"nextLink,omitempty"`
  2151  }
  2152  
  2153  // DataCollectionEndpointResourceListResultIterator provides access to a complete listing of
  2154  // DataCollectionEndpointResource values.
  2155  type DataCollectionEndpointResourceListResultIterator struct {
  2156  	i    int
  2157  	page DataCollectionEndpointResourceListResultPage
  2158  }
  2159  
  2160  // NextWithContext advances to the next value.  If there was an error making
  2161  // the request the iterator does not advance and the error is returned.
  2162  func (iter *DataCollectionEndpointResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
  2163  	if tracing.IsEnabled() {
  2164  		ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionEndpointResourceListResultIterator.NextWithContext")
  2165  		defer func() {
  2166  			sc := -1
  2167  			if iter.Response().Response.Response != nil {
  2168  				sc = iter.Response().Response.Response.StatusCode
  2169  			}
  2170  			tracing.EndSpan(ctx, sc, err)
  2171  		}()
  2172  	}
  2173  	iter.i++
  2174  	if iter.i < len(iter.page.Values()) {
  2175  		return nil
  2176  	}
  2177  	err = iter.page.NextWithContext(ctx)
  2178  	if err != nil {
  2179  		iter.i--
  2180  		return err
  2181  	}
  2182  	iter.i = 0
  2183  	return nil
  2184  }
  2185  
  2186  // Next advances to the next value.  If there was an error making
  2187  // the request the iterator does not advance and the error is returned.
  2188  // Deprecated: Use NextWithContext() instead.
  2189  func (iter *DataCollectionEndpointResourceListResultIterator) Next() error {
  2190  	return iter.NextWithContext(context.Background())
  2191  }
  2192  
  2193  // NotDone returns true if the enumeration should be started or is not yet complete.
  2194  func (iter DataCollectionEndpointResourceListResultIterator) NotDone() bool {
  2195  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2196  }
  2197  
  2198  // Response returns the raw server response from the last page request.
  2199  func (iter DataCollectionEndpointResourceListResultIterator) Response() DataCollectionEndpointResourceListResult {
  2200  	return iter.page.Response()
  2201  }
  2202  
  2203  // Value returns the current value or a zero-initialized value if the
  2204  // iterator has advanced beyond the end of the collection.
  2205  func (iter DataCollectionEndpointResourceListResultIterator) Value() DataCollectionEndpointResource {
  2206  	if !iter.page.NotDone() {
  2207  		return DataCollectionEndpointResource{}
  2208  	}
  2209  	return iter.page.Values()[iter.i]
  2210  }
  2211  
  2212  // Creates a new instance of the DataCollectionEndpointResourceListResultIterator type.
  2213  func NewDataCollectionEndpointResourceListResultIterator(page DataCollectionEndpointResourceListResultPage) DataCollectionEndpointResourceListResultIterator {
  2214  	return DataCollectionEndpointResourceListResultIterator{page: page}
  2215  }
  2216  
  2217  // IsEmpty returns true if the ListResult contains no values.
  2218  func (dcerlr DataCollectionEndpointResourceListResult) IsEmpty() bool {
  2219  	return dcerlr.Value == nil || len(*dcerlr.Value) == 0
  2220  }
  2221  
  2222  // hasNextLink returns true if the NextLink is not empty.
  2223  func (dcerlr DataCollectionEndpointResourceListResult) hasNextLink() bool {
  2224  	return dcerlr.NextLink != nil && len(*dcerlr.NextLink) != 0
  2225  }
  2226  
  2227  // dataCollectionEndpointResourceListResultPreparer prepares a request to retrieve the next set of results.
  2228  // It returns nil if no more results exist.
  2229  func (dcerlr DataCollectionEndpointResourceListResult) dataCollectionEndpointResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
  2230  	if !dcerlr.hasNextLink() {
  2231  		return nil, nil
  2232  	}
  2233  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2234  		autorest.AsJSON(),
  2235  		autorest.AsGet(),
  2236  		autorest.WithBaseURL(to.String(dcerlr.NextLink)))
  2237  }
  2238  
  2239  // DataCollectionEndpointResourceListResultPage contains a page of DataCollectionEndpointResource values.
  2240  type DataCollectionEndpointResourceListResultPage struct {
  2241  	fn     func(context.Context, DataCollectionEndpointResourceListResult) (DataCollectionEndpointResourceListResult, error)
  2242  	dcerlr DataCollectionEndpointResourceListResult
  2243  }
  2244  
  2245  // NextWithContext advances to the next page of values.  If there was an error making
  2246  // the request the page does not advance and the error is returned.
  2247  func (page *DataCollectionEndpointResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
  2248  	if tracing.IsEnabled() {
  2249  		ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionEndpointResourceListResultPage.NextWithContext")
  2250  		defer func() {
  2251  			sc := -1
  2252  			if page.Response().Response.Response != nil {
  2253  				sc = page.Response().Response.Response.StatusCode
  2254  			}
  2255  			tracing.EndSpan(ctx, sc, err)
  2256  		}()
  2257  	}
  2258  	for {
  2259  		next, err := page.fn(ctx, page.dcerlr)
  2260  		if err != nil {
  2261  			return err
  2262  		}
  2263  		page.dcerlr = next
  2264  		if !next.hasNextLink() || !next.IsEmpty() {
  2265  			break
  2266  		}
  2267  	}
  2268  	return nil
  2269  }
  2270  
  2271  // Next advances to the next page of values.  If there was an error making
  2272  // the request the page does not advance and the error is returned.
  2273  // Deprecated: Use NextWithContext() instead.
  2274  func (page *DataCollectionEndpointResourceListResultPage) Next() error {
  2275  	return page.NextWithContext(context.Background())
  2276  }
  2277  
  2278  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2279  func (page DataCollectionEndpointResourceListResultPage) NotDone() bool {
  2280  	return !page.dcerlr.IsEmpty()
  2281  }
  2282  
  2283  // Response returns the raw server response from the last page request.
  2284  func (page DataCollectionEndpointResourceListResultPage) Response() DataCollectionEndpointResourceListResult {
  2285  	return page.dcerlr
  2286  }
  2287  
  2288  // Values returns the slice of values for the current page or nil if there are no values.
  2289  func (page DataCollectionEndpointResourceListResultPage) Values() []DataCollectionEndpointResource {
  2290  	if page.dcerlr.IsEmpty() {
  2291  		return nil
  2292  	}
  2293  	return *page.dcerlr.Value
  2294  }
  2295  
  2296  // Creates a new instance of the DataCollectionEndpointResourceListResultPage type.
  2297  func NewDataCollectionEndpointResourceListResultPage(cur DataCollectionEndpointResourceListResult, getNextPage func(context.Context, DataCollectionEndpointResourceListResult) (DataCollectionEndpointResourceListResult, error)) DataCollectionEndpointResourceListResultPage {
  2298  	return DataCollectionEndpointResourceListResultPage{
  2299  		fn:     getNextPage,
  2300  		dcerlr: cur,
  2301  	}
  2302  }
  2303  
  2304  // DataCollectionEndpointResourceProperties resource properties.
  2305  type DataCollectionEndpointResourceProperties struct {
  2306  	// Description - Description of the data collection endpoint.
  2307  	Description *string `json:"description,omitempty"`
  2308  	// ImmutableID - The immutable ID of this data collection endpoint resource. This property is READ-ONLY.
  2309  	ImmutableID *string `json:"immutableId,omitempty"`
  2310  	// ConfigurationAccess - The endpoint used by agents to access their configuration.
  2311  	ConfigurationAccess *DataCollectionEndpointConfigurationAccess `json:"configurationAccess,omitempty"`
  2312  	// LogsIngestion - The endpoint used by clients to ingest logs.
  2313  	LogsIngestion *DataCollectionEndpointLogsIngestion `json:"logsIngestion,omitempty"`
  2314  	// NetworkAcls - Network access control rules for the endpoints.
  2315  	NetworkAcls *DataCollectionEndpointNetworkAcls `json:"networkAcls,omitempty"`
  2316  	// ProvisioningState - READ-ONLY; The resource provisioning state. This property is READ-ONLY. Possible values include: 'KnownDataCollectionEndpointProvisioningStateCreating', 'KnownDataCollectionEndpointProvisioningStateUpdating', 'KnownDataCollectionEndpointProvisioningStateDeleting', 'KnownDataCollectionEndpointProvisioningStateSucceeded', 'KnownDataCollectionEndpointProvisioningStateFailed'
  2317  	ProvisioningState KnownDataCollectionEndpointProvisioningState `json:"provisioningState,omitempty"`
  2318  }
  2319  
  2320  // MarshalJSON is the custom marshaler for DataCollectionEndpointResourceProperties.
  2321  func (dcer DataCollectionEndpointResourceProperties) MarshalJSON() ([]byte, error) {
  2322  	objectMap := make(map[string]interface{})
  2323  	if dcer.Description != nil {
  2324  		objectMap["description"] = dcer.Description
  2325  	}
  2326  	if dcer.ImmutableID != nil {
  2327  		objectMap["immutableId"] = dcer.ImmutableID
  2328  	}
  2329  	if dcer.ConfigurationAccess != nil {
  2330  		objectMap["configurationAccess"] = dcer.ConfigurationAccess
  2331  	}
  2332  	if dcer.LogsIngestion != nil {
  2333  		objectMap["logsIngestion"] = dcer.LogsIngestion
  2334  	}
  2335  	if dcer.NetworkAcls != nil {
  2336  		objectMap["networkAcls"] = dcer.NetworkAcls
  2337  	}
  2338  	return json.Marshal(objectMap)
  2339  }
  2340  
  2341  // DataCollectionEndpointResourceSystemData metadata pertaining to creation and last modification of the
  2342  // resource.
  2343  type DataCollectionEndpointResourceSystemData struct {
  2344  	// CreatedBy - The identity that created the resource.
  2345  	CreatedBy *string `json:"createdBy,omitempty"`
  2346  	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  2347  	CreatedByType CreatedByType `json:"createdByType,omitempty"`
  2348  	// CreatedAt - The timestamp of resource creation (UTC).
  2349  	CreatedAt *date.Time `json:"createdAt,omitempty"`
  2350  	// LastModifiedBy - The identity that last modified the resource.
  2351  	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
  2352  	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  2353  	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
  2354  	// LastModifiedAt - The timestamp of resource last modification (UTC)
  2355  	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
  2356  }
  2357  
  2358  // DataCollectionRule definition of what monitoring data to collect and where that data should be sent.
  2359  type DataCollectionRule struct {
  2360  	// Description - Description of the data collection rule.
  2361  	Description *string `json:"description,omitempty"`
  2362  	// ImmutableID - READ-ONLY; The immutable ID of this data collection rule. This property is READ-ONLY.
  2363  	ImmutableID *string `json:"immutableId,omitempty"`
  2364  	// DataSources - The specification of data sources.
  2365  	// This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.
  2366  	DataSources *DataCollectionRuleDataSources `json:"dataSources,omitempty"`
  2367  	// Destinations - The specification of destinations.
  2368  	Destinations *DataCollectionRuleDestinations `json:"destinations,omitempty"`
  2369  	// DataFlows - The specification of data flows.
  2370  	DataFlows *[]DataFlow `json:"dataFlows,omitempty"`
  2371  	// ProvisioningState - READ-ONLY; The resource provisioning state. Possible values include: 'KnownDataCollectionRuleProvisioningStateCreating', 'KnownDataCollectionRuleProvisioningStateUpdating', 'KnownDataCollectionRuleProvisioningStateDeleting', 'KnownDataCollectionRuleProvisioningStateSucceeded', 'KnownDataCollectionRuleProvisioningStateFailed'
  2372  	ProvisioningState KnownDataCollectionRuleProvisioningState `json:"provisioningState,omitempty"`
  2373  }
  2374  
  2375  // MarshalJSON is the custom marshaler for DataCollectionRule.
  2376  func (dcr DataCollectionRule) MarshalJSON() ([]byte, error) {
  2377  	objectMap := make(map[string]interface{})
  2378  	if dcr.Description != nil {
  2379  		objectMap["description"] = dcr.Description
  2380  	}
  2381  	if dcr.DataSources != nil {
  2382  		objectMap["dataSources"] = dcr.DataSources
  2383  	}
  2384  	if dcr.Destinations != nil {
  2385  		objectMap["destinations"] = dcr.Destinations
  2386  	}
  2387  	if dcr.DataFlows != nil {
  2388  		objectMap["dataFlows"] = dcr.DataFlows
  2389  	}
  2390  	return json.Marshal(objectMap)
  2391  }
  2392  
  2393  // DataCollectionRuleAssociation definition of association of a data collection rule with a monitored Azure
  2394  // resource.
  2395  type DataCollectionRuleAssociation struct {
  2396  	// Description - Description of the association.
  2397  	Description *string `json:"description,omitempty"`
  2398  	// DataCollectionRuleID - The resource ID of the data collection rule that is to be associated.
  2399  	DataCollectionRuleID *string `json:"dataCollectionRuleId,omitempty"`
  2400  	// DataCollectionEndpointID - The resource ID of the data collection endpoint that is to be associated.
  2401  	DataCollectionEndpointID *string `json:"dataCollectionEndpointId,omitempty"`
  2402  	// ProvisioningState - READ-ONLY; The resource provisioning state. Possible values include: 'KnownDataCollectionRuleAssociationProvisioningStateCreating', 'KnownDataCollectionRuleAssociationProvisioningStateUpdating', 'KnownDataCollectionRuleAssociationProvisioningStateDeleting', 'KnownDataCollectionRuleAssociationProvisioningStateSucceeded', 'KnownDataCollectionRuleAssociationProvisioningStateFailed'
  2403  	ProvisioningState KnownDataCollectionRuleAssociationProvisioningState `json:"provisioningState,omitempty"`
  2404  }
  2405  
  2406  // MarshalJSON is the custom marshaler for DataCollectionRuleAssociation.
  2407  func (dcra DataCollectionRuleAssociation) MarshalJSON() ([]byte, error) {
  2408  	objectMap := make(map[string]interface{})
  2409  	if dcra.Description != nil {
  2410  		objectMap["description"] = dcra.Description
  2411  	}
  2412  	if dcra.DataCollectionRuleID != nil {
  2413  		objectMap["dataCollectionRuleId"] = dcra.DataCollectionRuleID
  2414  	}
  2415  	if dcra.DataCollectionEndpointID != nil {
  2416  		objectMap["dataCollectionEndpointId"] = dcra.DataCollectionEndpointID
  2417  	}
  2418  	return json.Marshal(objectMap)
  2419  }
  2420  
  2421  // DataCollectionRuleAssociationProxyOnlyResource definition of generic ARM proxy resource.
  2422  type DataCollectionRuleAssociationProxyOnlyResource struct {
  2423  	autorest.Response `json:"-"`
  2424  	// DataCollectionRuleAssociationProxyOnlyResourceProperties - Resource properties.
  2425  	*DataCollectionRuleAssociationProxyOnlyResourceProperties `json:"properties,omitempty"`
  2426  	// ID - READ-ONLY; Fully qualified ID of the resource.
  2427  	ID *string `json:"id,omitempty"`
  2428  	// Name - READ-ONLY; The name of the resource.
  2429  	Name *string `json:"name,omitempty"`
  2430  	// Type - READ-ONLY; The type of the resource.
  2431  	Type *string `json:"type,omitempty"`
  2432  	// Etag - READ-ONLY; Resource entity tag (ETag).
  2433  	Etag *string `json:"etag,omitempty"`
  2434  	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
  2435  	SystemData *DataCollectionRuleAssociationProxyOnlyResourceSystemData `json:"systemData,omitempty"`
  2436  }
  2437  
  2438  // MarshalJSON is the custom marshaler for DataCollectionRuleAssociationProxyOnlyResource.
  2439  func (dcrapor DataCollectionRuleAssociationProxyOnlyResource) MarshalJSON() ([]byte, error) {
  2440  	objectMap := make(map[string]interface{})
  2441  	if dcrapor.DataCollectionRuleAssociationProxyOnlyResourceProperties != nil {
  2442  		objectMap["properties"] = dcrapor.DataCollectionRuleAssociationProxyOnlyResourceProperties
  2443  	}
  2444  	return json.Marshal(objectMap)
  2445  }
  2446  
  2447  // UnmarshalJSON is the custom unmarshaler for DataCollectionRuleAssociationProxyOnlyResource struct.
  2448  func (dcrapor *DataCollectionRuleAssociationProxyOnlyResource) UnmarshalJSON(body []byte) error {
  2449  	var m map[string]*json.RawMessage
  2450  	err := json.Unmarshal(body, &m)
  2451  	if err != nil {
  2452  		return err
  2453  	}
  2454  	for k, v := range m {
  2455  		switch k {
  2456  		case "properties":
  2457  			if v != nil {
  2458  				var dataCollectionRuleAssociationProxyOnlyResourceProperties DataCollectionRuleAssociationProxyOnlyResourceProperties
  2459  				err = json.Unmarshal(*v, &dataCollectionRuleAssociationProxyOnlyResourceProperties)
  2460  				if err != nil {
  2461  					return err
  2462  				}
  2463  				dcrapor.DataCollectionRuleAssociationProxyOnlyResourceProperties = &dataCollectionRuleAssociationProxyOnlyResourceProperties
  2464  			}
  2465  		case "id":
  2466  			if v != nil {
  2467  				var ID string
  2468  				err = json.Unmarshal(*v, &ID)
  2469  				if err != nil {
  2470  					return err
  2471  				}
  2472  				dcrapor.ID = &ID
  2473  			}
  2474  		case "name":
  2475  			if v != nil {
  2476  				var name string
  2477  				err = json.Unmarshal(*v, &name)
  2478  				if err != nil {
  2479  					return err
  2480  				}
  2481  				dcrapor.Name = &name
  2482  			}
  2483  		case "type":
  2484  			if v != nil {
  2485  				var typeVar string
  2486  				err = json.Unmarshal(*v, &typeVar)
  2487  				if err != nil {
  2488  					return err
  2489  				}
  2490  				dcrapor.Type = &typeVar
  2491  			}
  2492  		case "etag":
  2493  			if v != nil {
  2494  				var etag string
  2495  				err = json.Unmarshal(*v, &etag)
  2496  				if err != nil {
  2497  					return err
  2498  				}
  2499  				dcrapor.Etag = &etag
  2500  			}
  2501  		case "systemData":
  2502  			if v != nil {
  2503  				var systemData DataCollectionRuleAssociationProxyOnlyResourceSystemData
  2504  				err = json.Unmarshal(*v, &systemData)
  2505  				if err != nil {
  2506  					return err
  2507  				}
  2508  				dcrapor.SystemData = &systemData
  2509  			}
  2510  		}
  2511  	}
  2512  
  2513  	return nil
  2514  }
  2515  
  2516  // DataCollectionRuleAssociationProxyOnlyResourceListResult a pageable list of resources.
  2517  type DataCollectionRuleAssociationProxyOnlyResourceListResult struct {
  2518  	autorest.Response `json:"-"`
  2519  	// Value - A list of resources.
  2520  	Value *[]DataCollectionRuleAssociationProxyOnlyResource `json:"value,omitempty"`
  2521  	// NextLink - The URL to use for getting the next set of results.
  2522  	NextLink *string `json:"nextLink,omitempty"`
  2523  }
  2524  
  2525  // DataCollectionRuleAssociationProxyOnlyResourceListResultIterator provides access to a complete listing
  2526  // of DataCollectionRuleAssociationProxyOnlyResource values.
  2527  type DataCollectionRuleAssociationProxyOnlyResourceListResultIterator struct {
  2528  	i    int
  2529  	page DataCollectionRuleAssociationProxyOnlyResourceListResultPage
  2530  }
  2531  
  2532  // NextWithContext advances to the next value.  If there was an error making
  2533  // the request the iterator does not advance and the error is returned.
  2534  func (iter *DataCollectionRuleAssociationProxyOnlyResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
  2535  	if tracing.IsEnabled() {
  2536  		ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionRuleAssociationProxyOnlyResourceListResultIterator.NextWithContext")
  2537  		defer func() {
  2538  			sc := -1
  2539  			if iter.Response().Response.Response != nil {
  2540  				sc = iter.Response().Response.Response.StatusCode
  2541  			}
  2542  			tracing.EndSpan(ctx, sc, err)
  2543  		}()
  2544  	}
  2545  	iter.i++
  2546  	if iter.i < len(iter.page.Values()) {
  2547  		return nil
  2548  	}
  2549  	err = iter.page.NextWithContext(ctx)
  2550  	if err != nil {
  2551  		iter.i--
  2552  		return err
  2553  	}
  2554  	iter.i = 0
  2555  	return nil
  2556  }
  2557  
  2558  // Next advances to the next value.  If there was an error making
  2559  // the request the iterator does not advance and the error is returned.
  2560  // Deprecated: Use NextWithContext() instead.
  2561  func (iter *DataCollectionRuleAssociationProxyOnlyResourceListResultIterator) Next() error {
  2562  	return iter.NextWithContext(context.Background())
  2563  }
  2564  
  2565  // NotDone returns true if the enumeration should be started or is not yet complete.
  2566  func (iter DataCollectionRuleAssociationProxyOnlyResourceListResultIterator) NotDone() bool {
  2567  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2568  }
  2569  
  2570  // Response returns the raw server response from the last page request.
  2571  func (iter DataCollectionRuleAssociationProxyOnlyResourceListResultIterator) Response() DataCollectionRuleAssociationProxyOnlyResourceListResult {
  2572  	return iter.page.Response()
  2573  }
  2574  
  2575  // Value returns the current value or a zero-initialized value if the
  2576  // iterator has advanced beyond the end of the collection.
  2577  func (iter DataCollectionRuleAssociationProxyOnlyResourceListResultIterator) Value() DataCollectionRuleAssociationProxyOnlyResource {
  2578  	if !iter.page.NotDone() {
  2579  		return DataCollectionRuleAssociationProxyOnlyResource{}
  2580  	}
  2581  	return iter.page.Values()[iter.i]
  2582  }
  2583  
  2584  // Creates a new instance of the DataCollectionRuleAssociationProxyOnlyResourceListResultIterator type.
  2585  func NewDataCollectionRuleAssociationProxyOnlyResourceListResultIterator(page DataCollectionRuleAssociationProxyOnlyResourceListResultPage) DataCollectionRuleAssociationProxyOnlyResourceListResultIterator {
  2586  	return DataCollectionRuleAssociationProxyOnlyResourceListResultIterator{page: page}
  2587  }
  2588  
  2589  // IsEmpty returns true if the ListResult contains no values.
  2590  func (dcraporlr DataCollectionRuleAssociationProxyOnlyResourceListResult) IsEmpty() bool {
  2591  	return dcraporlr.Value == nil || len(*dcraporlr.Value) == 0
  2592  }
  2593  
  2594  // hasNextLink returns true if the NextLink is not empty.
  2595  func (dcraporlr DataCollectionRuleAssociationProxyOnlyResourceListResult) hasNextLink() bool {
  2596  	return dcraporlr.NextLink != nil && len(*dcraporlr.NextLink) != 0
  2597  }
  2598  
  2599  // dataCollectionRuleAssociationProxyOnlyResourceListResultPreparer prepares a request to retrieve the next set of results.
  2600  // It returns nil if no more results exist.
  2601  func (dcraporlr DataCollectionRuleAssociationProxyOnlyResourceListResult) dataCollectionRuleAssociationProxyOnlyResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
  2602  	if !dcraporlr.hasNextLink() {
  2603  		return nil, nil
  2604  	}
  2605  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2606  		autorest.AsJSON(),
  2607  		autorest.AsGet(),
  2608  		autorest.WithBaseURL(to.String(dcraporlr.NextLink)))
  2609  }
  2610  
  2611  // DataCollectionRuleAssociationProxyOnlyResourceListResultPage contains a page of
  2612  // DataCollectionRuleAssociationProxyOnlyResource values.
  2613  type DataCollectionRuleAssociationProxyOnlyResourceListResultPage struct {
  2614  	fn        func(context.Context, DataCollectionRuleAssociationProxyOnlyResourceListResult) (DataCollectionRuleAssociationProxyOnlyResourceListResult, error)
  2615  	dcraporlr DataCollectionRuleAssociationProxyOnlyResourceListResult
  2616  }
  2617  
  2618  // NextWithContext advances to the next page of values.  If there was an error making
  2619  // the request the page does not advance and the error is returned.
  2620  func (page *DataCollectionRuleAssociationProxyOnlyResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
  2621  	if tracing.IsEnabled() {
  2622  		ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionRuleAssociationProxyOnlyResourceListResultPage.NextWithContext")
  2623  		defer func() {
  2624  			sc := -1
  2625  			if page.Response().Response.Response != nil {
  2626  				sc = page.Response().Response.Response.StatusCode
  2627  			}
  2628  			tracing.EndSpan(ctx, sc, err)
  2629  		}()
  2630  	}
  2631  	for {
  2632  		next, err := page.fn(ctx, page.dcraporlr)
  2633  		if err != nil {
  2634  			return err
  2635  		}
  2636  		page.dcraporlr = next
  2637  		if !next.hasNextLink() || !next.IsEmpty() {
  2638  			break
  2639  		}
  2640  	}
  2641  	return nil
  2642  }
  2643  
  2644  // Next advances to the next page of values.  If there was an error making
  2645  // the request the page does not advance and the error is returned.
  2646  // Deprecated: Use NextWithContext() instead.
  2647  func (page *DataCollectionRuleAssociationProxyOnlyResourceListResultPage) Next() error {
  2648  	return page.NextWithContext(context.Background())
  2649  }
  2650  
  2651  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2652  func (page DataCollectionRuleAssociationProxyOnlyResourceListResultPage) NotDone() bool {
  2653  	return !page.dcraporlr.IsEmpty()
  2654  }
  2655  
  2656  // Response returns the raw server response from the last page request.
  2657  func (page DataCollectionRuleAssociationProxyOnlyResourceListResultPage) Response() DataCollectionRuleAssociationProxyOnlyResourceListResult {
  2658  	return page.dcraporlr
  2659  }
  2660  
  2661  // Values returns the slice of values for the current page or nil if there are no values.
  2662  func (page DataCollectionRuleAssociationProxyOnlyResourceListResultPage) Values() []DataCollectionRuleAssociationProxyOnlyResource {
  2663  	if page.dcraporlr.IsEmpty() {
  2664  		return nil
  2665  	}
  2666  	return *page.dcraporlr.Value
  2667  }
  2668  
  2669  // Creates a new instance of the DataCollectionRuleAssociationProxyOnlyResourceListResultPage type.
  2670  func NewDataCollectionRuleAssociationProxyOnlyResourceListResultPage(cur DataCollectionRuleAssociationProxyOnlyResourceListResult, getNextPage func(context.Context, DataCollectionRuleAssociationProxyOnlyResourceListResult) (DataCollectionRuleAssociationProxyOnlyResourceListResult, error)) DataCollectionRuleAssociationProxyOnlyResourceListResultPage {
  2671  	return DataCollectionRuleAssociationProxyOnlyResourceListResultPage{
  2672  		fn:        getNextPage,
  2673  		dcraporlr: cur,
  2674  	}
  2675  }
  2676  
  2677  // DataCollectionRuleAssociationProxyOnlyResourceProperties resource properties.
  2678  type DataCollectionRuleAssociationProxyOnlyResourceProperties struct {
  2679  	// Description - Description of the association.
  2680  	Description *string `json:"description,omitempty"`
  2681  	// DataCollectionRuleID - The resource ID of the data collection rule that is to be associated.
  2682  	DataCollectionRuleID *string `json:"dataCollectionRuleId,omitempty"`
  2683  	// DataCollectionEndpointID - The resource ID of the data collection endpoint that is to be associated.
  2684  	DataCollectionEndpointID *string `json:"dataCollectionEndpointId,omitempty"`
  2685  	// ProvisioningState - READ-ONLY; The resource provisioning state. Possible values include: 'KnownDataCollectionRuleAssociationProvisioningStateCreating', 'KnownDataCollectionRuleAssociationProvisioningStateUpdating', 'KnownDataCollectionRuleAssociationProvisioningStateDeleting', 'KnownDataCollectionRuleAssociationProvisioningStateSucceeded', 'KnownDataCollectionRuleAssociationProvisioningStateFailed'
  2686  	ProvisioningState KnownDataCollectionRuleAssociationProvisioningState `json:"provisioningState,omitempty"`
  2687  }
  2688  
  2689  // MarshalJSON is the custom marshaler for DataCollectionRuleAssociationProxyOnlyResourceProperties.
  2690  func (dcrapor DataCollectionRuleAssociationProxyOnlyResourceProperties) MarshalJSON() ([]byte, error) {
  2691  	objectMap := make(map[string]interface{})
  2692  	if dcrapor.Description != nil {
  2693  		objectMap["description"] = dcrapor.Description
  2694  	}
  2695  	if dcrapor.DataCollectionRuleID != nil {
  2696  		objectMap["dataCollectionRuleId"] = dcrapor.DataCollectionRuleID
  2697  	}
  2698  	if dcrapor.DataCollectionEndpointID != nil {
  2699  		objectMap["dataCollectionEndpointId"] = dcrapor.DataCollectionEndpointID
  2700  	}
  2701  	return json.Marshal(objectMap)
  2702  }
  2703  
  2704  // DataCollectionRuleAssociationProxyOnlyResourceSystemData metadata pertaining to creation and last
  2705  // modification of the resource.
  2706  type DataCollectionRuleAssociationProxyOnlyResourceSystemData struct {
  2707  	// CreatedBy - The identity that created the resource.
  2708  	CreatedBy *string `json:"createdBy,omitempty"`
  2709  	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  2710  	CreatedByType CreatedByType `json:"createdByType,omitempty"`
  2711  	// CreatedAt - The timestamp of resource creation (UTC).
  2712  	CreatedAt *date.Time `json:"createdAt,omitempty"`
  2713  	// LastModifiedBy - The identity that last modified the resource.
  2714  	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
  2715  	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  2716  	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
  2717  	// LastModifiedAt - The timestamp of resource last modification (UTC)
  2718  	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
  2719  }
  2720  
  2721  // DataCollectionRuleDataSources the specification of data sources.
  2722  // This property is optional and can be omitted if the rule is meant to be used via direct calls to the
  2723  // provisioned endpoint.
  2724  type DataCollectionRuleDataSources struct {
  2725  	// PerformanceCounters - The list of performance counter data source configurations.
  2726  	PerformanceCounters *[]PerfCounterDataSource `json:"performanceCounters,omitempty"`
  2727  	// WindowsEventLogs - The list of Windows Event Log data source configurations.
  2728  	WindowsEventLogs *[]WindowsEventLogDataSource `json:"windowsEventLogs,omitempty"`
  2729  	// Syslog - The list of Syslog data source configurations.
  2730  	Syslog *[]SyslogDataSource `json:"syslog,omitempty"`
  2731  	// Extensions - The list of Azure VM extension data source configurations.
  2732  	Extensions *[]ExtensionDataSource `json:"extensions,omitempty"`
  2733  }
  2734  
  2735  // DataCollectionRuleDestinations the specification of destinations.
  2736  type DataCollectionRuleDestinations struct {
  2737  	// LogAnalytics - List of Log Analytics destinations.
  2738  	LogAnalytics *[]LogAnalyticsDestination `json:"logAnalytics,omitempty"`
  2739  	// AzureMonitorMetrics - Azure Monitor Metrics destination.
  2740  	AzureMonitorMetrics *DestinationsSpecAzureMonitorMetrics `json:"azureMonitorMetrics,omitempty"`
  2741  }
  2742  
  2743  // DataCollectionRuleResource definition of ARM tracked top level resource.
  2744  type DataCollectionRuleResource struct {
  2745  	autorest.Response `json:"-"`
  2746  	// DataCollectionRuleResourceProperties - Resource properties.
  2747  	*DataCollectionRuleResourceProperties `json:"properties,omitempty"`
  2748  	// Location - The geo-location where the resource lives.
  2749  	Location *string `json:"location,omitempty"`
  2750  	// Tags - Resource tags.
  2751  	Tags map[string]*string `json:"tags"`
  2752  	// Kind - The kind of the resource. Possible values include: 'KnownDataCollectionRuleResourceKindLinux', 'KnownDataCollectionRuleResourceKindWindows'
  2753  	Kind KnownDataCollectionRuleResourceKind `json:"kind,omitempty"`
  2754  	// ID - READ-ONLY; Fully qualified ID of the resource.
  2755  	ID *string `json:"id,omitempty"`
  2756  	// Name - READ-ONLY; The name of the resource.
  2757  	Name *string `json:"name,omitempty"`
  2758  	// Type - READ-ONLY; The type of the resource.
  2759  	Type *string `json:"type,omitempty"`
  2760  	// Etag - READ-ONLY; Resource entity tag (ETag).
  2761  	Etag *string `json:"etag,omitempty"`
  2762  	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
  2763  	SystemData *DataCollectionRuleResourceSystemData `json:"systemData,omitempty"`
  2764  }
  2765  
  2766  // MarshalJSON is the custom marshaler for DataCollectionRuleResource.
  2767  func (dcrr DataCollectionRuleResource) MarshalJSON() ([]byte, error) {
  2768  	objectMap := make(map[string]interface{})
  2769  	if dcrr.DataCollectionRuleResourceProperties != nil {
  2770  		objectMap["properties"] = dcrr.DataCollectionRuleResourceProperties
  2771  	}
  2772  	if dcrr.Location != nil {
  2773  		objectMap["location"] = dcrr.Location
  2774  	}
  2775  	if dcrr.Tags != nil {
  2776  		objectMap["tags"] = dcrr.Tags
  2777  	}
  2778  	if dcrr.Kind != "" {
  2779  		objectMap["kind"] = dcrr.Kind
  2780  	}
  2781  	return json.Marshal(objectMap)
  2782  }
  2783  
  2784  // UnmarshalJSON is the custom unmarshaler for DataCollectionRuleResource struct.
  2785  func (dcrr *DataCollectionRuleResource) UnmarshalJSON(body []byte) error {
  2786  	var m map[string]*json.RawMessage
  2787  	err := json.Unmarshal(body, &m)
  2788  	if err != nil {
  2789  		return err
  2790  	}
  2791  	for k, v := range m {
  2792  		switch k {
  2793  		case "properties":
  2794  			if v != nil {
  2795  				var dataCollectionRuleResourceProperties DataCollectionRuleResourceProperties
  2796  				err = json.Unmarshal(*v, &dataCollectionRuleResourceProperties)
  2797  				if err != nil {
  2798  					return err
  2799  				}
  2800  				dcrr.DataCollectionRuleResourceProperties = &dataCollectionRuleResourceProperties
  2801  			}
  2802  		case "location":
  2803  			if v != nil {
  2804  				var location string
  2805  				err = json.Unmarshal(*v, &location)
  2806  				if err != nil {
  2807  					return err
  2808  				}
  2809  				dcrr.Location = &location
  2810  			}
  2811  		case "tags":
  2812  			if v != nil {
  2813  				var tags map[string]*string
  2814  				err = json.Unmarshal(*v, &tags)
  2815  				if err != nil {
  2816  					return err
  2817  				}
  2818  				dcrr.Tags = tags
  2819  			}
  2820  		case "kind":
  2821  			if v != nil {
  2822  				var kind KnownDataCollectionRuleResourceKind
  2823  				err = json.Unmarshal(*v, &kind)
  2824  				if err != nil {
  2825  					return err
  2826  				}
  2827  				dcrr.Kind = kind
  2828  			}
  2829  		case "id":
  2830  			if v != nil {
  2831  				var ID string
  2832  				err = json.Unmarshal(*v, &ID)
  2833  				if err != nil {
  2834  					return err
  2835  				}
  2836  				dcrr.ID = &ID
  2837  			}
  2838  		case "name":
  2839  			if v != nil {
  2840  				var name string
  2841  				err = json.Unmarshal(*v, &name)
  2842  				if err != nil {
  2843  					return err
  2844  				}
  2845  				dcrr.Name = &name
  2846  			}
  2847  		case "type":
  2848  			if v != nil {
  2849  				var typeVar string
  2850  				err = json.Unmarshal(*v, &typeVar)
  2851  				if err != nil {
  2852  					return err
  2853  				}
  2854  				dcrr.Type = &typeVar
  2855  			}
  2856  		case "etag":
  2857  			if v != nil {
  2858  				var etag string
  2859  				err = json.Unmarshal(*v, &etag)
  2860  				if err != nil {
  2861  					return err
  2862  				}
  2863  				dcrr.Etag = &etag
  2864  			}
  2865  		case "systemData":
  2866  			if v != nil {
  2867  				var systemData DataCollectionRuleResourceSystemData
  2868  				err = json.Unmarshal(*v, &systemData)
  2869  				if err != nil {
  2870  					return err
  2871  				}
  2872  				dcrr.SystemData = &systemData
  2873  			}
  2874  		}
  2875  	}
  2876  
  2877  	return nil
  2878  }
  2879  
  2880  // DataCollectionRuleResourceListResult a pageable list of resources.
  2881  type DataCollectionRuleResourceListResult struct {
  2882  	autorest.Response `json:"-"`
  2883  	// Value - A list of resources.
  2884  	Value *[]DataCollectionRuleResource `json:"value,omitempty"`
  2885  	// NextLink - The URL to use for getting the next set of results.
  2886  	NextLink *string `json:"nextLink,omitempty"`
  2887  }
  2888  
  2889  // DataCollectionRuleResourceListResultIterator provides access to a complete listing of
  2890  // DataCollectionRuleResource values.
  2891  type DataCollectionRuleResourceListResultIterator struct {
  2892  	i    int
  2893  	page DataCollectionRuleResourceListResultPage
  2894  }
  2895  
  2896  // NextWithContext advances to the next value.  If there was an error making
  2897  // the request the iterator does not advance and the error is returned.
  2898  func (iter *DataCollectionRuleResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
  2899  	if tracing.IsEnabled() {
  2900  		ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionRuleResourceListResultIterator.NextWithContext")
  2901  		defer func() {
  2902  			sc := -1
  2903  			if iter.Response().Response.Response != nil {
  2904  				sc = iter.Response().Response.Response.StatusCode
  2905  			}
  2906  			tracing.EndSpan(ctx, sc, err)
  2907  		}()
  2908  	}
  2909  	iter.i++
  2910  	if iter.i < len(iter.page.Values()) {
  2911  		return nil
  2912  	}
  2913  	err = iter.page.NextWithContext(ctx)
  2914  	if err != nil {
  2915  		iter.i--
  2916  		return err
  2917  	}
  2918  	iter.i = 0
  2919  	return nil
  2920  }
  2921  
  2922  // Next advances to the next value.  If there was an error making
  2923  // the request the iterator does not advance and the error is returned.
  2924  // Deprecated: Use NextWithContext() instead.
  2925  func (iter *DataCollectionRuleResourceListResultIterator) Next() error {
  2926  	return iter.NextWithContext(context.Background())
  2927  }
  2928  
  2929  // NotDone returns true if the enumeration should be started or is not yet complete.
  2930  func (iter DataCollectionRuleResourceListResultIterator) NotDone() bool {
  2931  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2932  }
  2933  
  2934  // Response returns the raw server response from the last page request.
  2935  func (iter DataCollectionRuleResourceListResultIterator) Response() DataCollectionRuleResourceListResult {
  2936  	return iter.page.Response()
  2937  }
  2938  
  2939  // Value returns the current value or a zero-initialized value if the
  2940  // iterator has advanced beyond the end of the collection.
  2941  func (iter DataCollectionRuleResourceListResultIterator) Value() DataCollectionRuleResource {
  2942  	if !iter.page.NotDone() {
  2943  		return DataCollectionRuleResource{}
  2944  	}
  2945  	return iter.page.Values()[iter.i]
  2946  }
  2947  
  2948  // Creates a new instance of the DataCollectionRuleResourceListResultIterator type.
  2949  func NewDataCollectionRuleResourceListResultIterator(page DataCollectionRuleResourceListResultPage) DataCollectionRuleResourceListResultIterator {
  2950  	return DataCollectionRuleResourceListResultIterator{page: page}
  2951  }
  2952  
  2953  // IsEmpty returns true if the ListResult contains no values.
  2954  func (dcrrlr DataCollectionRuleResourceListResult) IsEmpty() bool {
  2955  	return dcrrlr.Value == nil || len(*dcrrlr.Value) == 0
  2956  }
  2957  
  2958  // hasNextLink returns true if the NextLink is not empty.
  2959  func (dcrrlr DataCollectionRuleResourceListResult) hasNextLink() bool {
  2960  	return dcrrlr.NextLink != nil && len(*dcrrlr.NextLink) != 0
  2961  }
  2962  
  2963  // dataCollectionRuleResourceListResultPreparer prepares a request to retrieve the next set of results.
  2964  // It returns nil if no more results exist.
  2965  func (dcrrlr DataCollectionRuleResourceListResult) dataCollectionRuleResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
  2966  	if !dcrrlr.hasNextLink() {
  2967  		return nil, nil
  2968  	}
  2969  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2970  		autorest.AsJSON(),
  2971  		autorest.AsGet(),
  2972  		autorest.WithBaseURL(to.String(dcrrlr.NextLink)))
  2973  }
  2974  
  2975  // DataCollectionRuleResourceListResultPage contains a page of DataCollectionRuleResource values.
  2976  type DataCollectionRuleResourceListResultPage struct {
  2977  	fn     func(context.Context, DataCollectionRuleResourceListResult) (DataCollectionRuleResourceListResult, error)
  2978  	dcrrlr DataCollectionRuleResourceListResult
  2979  }
  2980  
  2981  // NextWithContext advances to the next page of values.  If there was an error making
  2982  // the request the page does not advance and the error is returned.
  2983  func (page *DataCollectionRuleResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
  2984  	if tracing.IsEnabled() {
  2985  		ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionRuleResourceListResultPage.NextWithContext")
  2986  		defer func() {
  2987  			sc := -1
  2988  			if page.Response().Response.Response != nil {
  2989  				sc = page.Response().Response.Response.StatusCode
  2990  			}
  2991  			tracing.EndSpan(ctx, sc, err)
  2992  		}()
  2993  	}
  2994  	for {
  2995  		next, err := page.fn(ctx, page.dcrrlr)
  2996  		if err != nil {
  2997  			return err
  2998  		}
  2999  		page.dcrrlr = next
  3000  		if !next.hasNextLink() || !next.IsEmpty() {
  3001  			break
  3002  		}
  3003  	}
  3004  	return nil
  3005  }
  3006  
  3007  // Next advances to the next page of values.  If there was an error making
  3008  // the request the page does not advance and the error is returned.
  3009  // Deprecated: Use NextWithContext() instead.
  3010  func (page *DataCollectionRuleResourceListResultPage) Next() error {
  3011  	return page.NextWithContext(context.Background())
  3012  }
  3013  
  3014  // NotDone returns true if the page enumeration should be started or is not yet complete.
  3015  func (page DataCollectionRuleResourceListResultPage) NotDone() bool {
  3016  	return !page.dcrrlr.IsEmpty()
  3017  }
  3018  
  3019  // Response returns the raw server response from the last page request.
  3020  func (page DataCollectionRuleResourceListResultPage) Response() DataCollectionRuleResourceListResult {
  3021  	return page.dcrrlr
  3022  }
  3023  
  3024  // Values returns the slice of values for the current page or nil if there are no values.
  3025  func (page DataCollectionRuleResourceListResultPage) Values() []DataCollectionRuleResource {
  3026  	if page.dcrrlr.IsEmpty() {
  3027  		return nil
  3028  	}
  3029  	return *page.dcrrlr.Value
  3030  }
  3031  
  3032  // Creates a new instance of the DataCollectionRuleResourceListResultPage type.
  3033  func NewDataCollectionRuleResourceListResultPage(cur DataCollectionRuleResourceListResult, getNextPage func(context.Context, DataCollectionRuleResourceListResult) (DataCollectionRuleResourceListResult, error)) DataCollectionRuleResourceListResultPage {
  3034  	return DataCollectionRuleResourceListResultPage{
  3035  		fn:     getNextPage,
  3036  		dcrrlr: cur,
  3037  	}
  3038  }
  3039  
  3040  // DataCollectionRuleResourceProperties resource properties.
  3041  type DataCollectionRuleResourceProperties struct {
  3042  	// Description - Description of the data collection rule.
  3043  	Description *string `json:"description,omitempty"`
  3044  	// ImmutableID - READ-ONLY; The immutable ID of this data collection rule. This property is READ-ONLY.
  3045  	ImmutableID *string `json:"immutableId,omitempty"`
  3046  	// DataSources - The specification of data sources.
  3047  	// This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.
  3048  	DataSources *DataCollectionRuleDataSources `json:"dataSources,omitempty"`
  3049  	// Destinations - The specification of destinations.
  3050  	Destinations *DataCollectionRuleDestinations `json:"destinations,omitempty"`
  3051  	// DataFlows - The specification of data flows.
  3052  	DataFlows *[]DataFlow `json:"dataFlows,omitempty"`
  3053  	// ProvisioningState - READ-ONLY; The resource provisioning state. Possible values include: 'KnownDataCollectionRuleProvisioningStateCreating', 'KnownDataCollectionRuleProvisioningStateUpdating', 'KnownDataCollectionRuleProvisioningStateDeleting', 'KnownDataCollectionRuleProvisioningStateSucceeded', 'KnownDataCollectionRuleProvisioningStateFailed'
  3054  	ProvisioningState KnownDataCollectionRuleProvisioningState `json:"provisioningState,omitempty"`
  3055  }
  3056  
  3057  // MarshalJSON is the custom marshaler for DataCollectionRuleResourceProperties.
  3058  func (dcrr DataCollectionRuleResourceProperties) MarshalJSON() ([]byte, error) {
  3059  	objectMap := make(map[string]interface{})
  3060  	if dcrr.Description != nil {
  3061  		objectMap["description"] = dcrr.Description
  3062  	}
  3063  	if dcrr.DataSources != nil {
  3064  		objectMap["dataSources"] = dcrr.DataSources
  3065  	}
  3066  	if dcrr.Destinations != nil {
  3067  		objectMap["destinations"] = dcrr.Destinations
  3068  	}
  3069  	if dcrr.DataFlows != nil {
  3070  		objectMap["dataFlows"] = dcrr.DataFlows
  3071  	}
  3072  	return json.Marshal(objectMap)
  3073  }
  3074  
  3075  // DataCollectionRuleResourceSystemData metadata pertaining to creation and last modification of the
  3076  // resource.
  3077  type DataCollectionRuleResourceSystemData struct {
  3078  	// CreatedBy - The identity that created the resource.
  3079  	CreatedBy *string `json:"createdBy,omitempty"`
  3080  	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  3081  	CreatedByType CreatedByType `json:"createdByType,omitempty"`
  3082  	// CreatedAt - The timestamp of resource creation (UTC).
  3083  	CreatedAt *date.Time `json:"createdAt,omitempty"`
  3084  	// LastModifiedBy - The identity that last modified the resource.
  3085  	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
  3086  	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  3087  	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
  3088  	// LastModifiedAt - The timestamp of resource last modification (UTC)
  3089  	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
  3090  }
  3091  
  3092  // DataContainer information about a container with data for a given resource.
  3093  type DataContainer struct {
  3094  	// Workspace - Log Analytics workspace information.
  3095  	Workspace *WorkspaceInfo `json:"workspace,omitempty"`
  3096  }
  3097  
  3098  // DataFlow definition of which streams are sent to which destinations.
  3099  type DataFlow struct {
  3100  	// Streams - List of streams for this data flow.
  3101  	Streams *[]KnownDataFlowStreams `json:"streams,omitempty"`
  3102  	// Destinations - List of destinations for this data flow.
  3103  	Destinations *[]string `json:"destinations,omitempty"`
  3104  }
  3105  
  3106  // DataSourcesSpec specification of data sources that will be collected.
  3107  type DataSourcesSpec struct {
  3108  	// PerformanceCounters - The list of performance counter data source configurations.
  3109  	PerformanceCounters *[]PerfCounterDataSource `json:"performanceCounters,omitempty"`
  3110  	// WindowsEventLogs - The list of Windows Event Log data source configurations.
  3111  	WindowsEventLogs *[]WindowsEventLogDataSource `json:"windowsEventLogs,omitempty"`
  3112  	// Syslog - The list of Syslog data source configurations.
  3113  	Syslog *[]SyslogDataSource `json:"syslog,omitempty"`
  3114  	// Extensions - The list of Azure VM extension data source configurations.
  3115  	Extensions *[]ExtensionDataSource `json:"extensions,omitempty"`
  3116  }
  3117  
  3118  // DestinationsSpec specification of destinations that can be used in data flows.
  3119  type DestinationsSpec struct {
  3120  	// LogAnalytics - List of Log Analytics destinations.
  3121  	LogAnalytics *[]LogAnalyticsDestination `json:"logAnalytics,omitempty"`
  3122  	// AzureMonitorMetrics - Azure Monitor Metrics destination.
  3123  	AzureMonitorMetrics *DestinationsSpecAzureMonitorMetrics `json:"azureMonitorMetrics,omitempty"`
  3124  }
  3125  
  3126  // DestinationsSpecAzureMonitorMetrics azure Monitor Metrics destination.
  3127  type DestinationsSpecAzureMonitorMetrics struct {
  3128  	// Name - A friendly name for the destination.
  3129  	// This name should be unique across all destinations (regardless of type) within the data collection rule.
  3130  	Name *string `json:"name,omitempty"`
  3131  }
  3132  
  3133  // DiagnosticSettings the diagnostic settings.
  3134  type DiagnosticSettings struct {
  3135  	// StorageAccountID - The resource ID of the storage account to which you would like to send Diagnostic Logs.
  3136  	StorageAccountID *string `json:"storageAccountId,omitempty"`
  3137  	// ServiceBusRuleID - The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
  3138  	ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"`
  3139  	// EventHubAuthorizationRuleID - The resource Id for the event hub authorization rule.
  3140  	EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"`
  3141  	// EventHubName - The name of the event hub. If none is specified, the default event hub will be selected.
  3142  	EventHubName *string `json:"eventHubName,omitempty"`
  3143  	// Metrics - The list of metric settings.
  3144  	Metrics *[]MetricSettings `json:"metrics,omitempty"`
  3145  	// Logs - The list of logs settings.
  3146  	Logs *[]LogSettings `json:"logs,omitempty"`
  3147  	// WorkspaceID - The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2
  3148  	WorkspaceID *string `json:"workspaceId,omitempty"`
  3149  	// LogAnalyticsDestinationType - A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: <normalized service identity>_<normalized category name>. Possible values are: Dedicated and null (null is default.)
  3150  	LogAnalyticsDestinationType *string `json:"logAnalyticsDestinationType,omitempty"`
  3151  }
  3152  
  3153  // DiagnosticSettingsCategory the diagnostic settings Category.
  3154  type DiagnosticSettingsCategory struct {
  3155  	// CategoryType - The type of the diagnostic settings category. Possible values include: 'CategoryTypeMetrics', 'CategoryTypeLogs'
  3156  	CategoryType CategoryType `json:"categoryType,omitempty"`
  3157  }
  3158  
  3159  // DiagnosticSettingsCategoryResource the diagnostic settings category resource.
  3160  type DiagnosticSettingsCategoryResource struct {
  3161  	autorest.Response `json:"-"`
  3162  	// DiagnosticSettingsCategory - The properties of a Diagnostic Settings Category.
  3163  	*DiagnosticSettingsCategory `json:"properties,omitempty"`
  3164  	// ID - READ-ONLY; Azure resource Id
  3165  	ID *string `json:"id,omitempty"`
  3166  	// Name - READ-ONLY; Azure resource name
  3167  	Name *string `json:"name,omitempty"`
  3168  	// Type - READ-ONLY; Azure resource type
  3169  	Type *string `json:"type,omitempty"`
  3170  }
  3171  
  3172  // MarshalJSON is the custom marshaler for DiagnosticSettingsCategoryResource.
  3173  func (dscr DiagnosticSettingsCategoryResource) MarshalJSON() ([]byte, error) {
  3174  	objectMap := make(map[string]interface{})
  3175  	if dscr.DiagnosticSettingsCategory != nil {
  3176  		objectMap["properties"] = dscr.DiagnosticSettingsCategory
  3177  	}
  3178  	return json.Marshal(objectMap)
  3179  }
  3180  
  3181  // UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsCategoryResource struct.
  3182  func (dscr *DiagnosticSettingsCategoryResource) UnmarshalJSON(body []byte) error {
  3183  	var m map[string]*json.RawMessage
  3184  	err := json.Unmarshal(body, &m)
  3185  	if err != nil {
  3186  		return err
  3187  	}
  3188  	for k, v := range m {
  3189  		switch k {
  3190  		case "properties":
  3191  			if v != nil {
  3192  				var diagnosticSettingsCategory DiagnosticSettingsCategory
  3193  				err = json.Unmarshal(*v, &diagnosticSettingsCategory)
  3194  				if err != nil {
  3195  					return err
  3196  				}
  3197  				dscr.DiagnosticSettingsCategory = &diagnosticSettingsCategory
  3198  			}
  3199  		case "id":
  3200  			if v != nil {
  3201  				var ID string
  3202  				err = json.Unmarshal(*v, &ID)
  3203  				if err != nil {
  3204  					return err
  3205  				}
  3206  				dscr.ID = &ID
  3207  			}
  3208  		case "name":
  3209  			if v != nil {
  3210  				var name string
  3211  				err = json.Unmarshal(*v, &name)
  3212  				if err != nil {
  3213  					return err
  3214  				}
  3215  				dscr.Name = &name
  3216  			}
  3217  		case "type":
  3218  			if v != nil {
  3219  				var typeVar string
  3220  				err = json.Unmarshal(*v, &typeVar)
  3221  				if err != nil {
  3222  					return err
  3223  				}
  3224  				dscr.Type = &typeVar
  3225  			}
  3226  		}
  3227  	}
  3228  
  3229  	return nil
  3230  }
  3231  
  3232  // DiagnosticSettingsCategoryResourceCollection represents a collection of diagnostic setting category
  3233  // resources.
  3234  type DiagnosticSettingsCategoryResourceCollection struct {
  3235  	autorest.Response `json:"-"`
  3236  	// Value - The collection of diagnostic settings category resources.
  3237  	Value *[]DiagnosticSettingsCategoryResource `json:"value,omitempty"`
  3238  }
  3239  
  3240  // DiagnosticSettingsResource the diagnostic setting resource.
  3241  type DiagnosticSettingsResource struct {
  3242  	autorest.Response `json:"-"`
  3243  	// DiagnosticSettings - Properties of a Diagnostic Settings Resource.
  3244  	*DiagnosticSettings `json:"properties,omitempty"`
  3245  	// ID - READ-ONLY; Azure resource Id
  3246  	ID *string `json:"id,omitempty"`
  3247  	// Name - READ-ONLY; Azure resource name
  3248  	Name *string `json:"name,omitempty"`
  3249  	// Type - READ-ONLY; Azure resource type
  3250  	Type *string `json:"type,omitempty"`
  3251  }
  3252  
  3253  // MarshalJSON is the custom marshaler for DiagnosticSettingsResource.
  3254  func (dsr DiagnosticSettingsResource) MarshalJSON() ([]byte, error) {
  3255  	objectMap := make(map[string]interface{})
  3256  	if dsr.DiagnosticSettings != nil {
  3257  		objectMap["properties"] = dsr.DiagnosticSettings
  3258  	}
  3259  	return json.Marshal(objectMap)
  3260  }
  3261  
  3262  // UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsResource struct.
  3263  func (dsr *DiagnosticSettingsResource) UnmarshalJSON(body []byte) error {
  3264  	var m map[string]*json.RawMessage
  3265  	err := json.Unmarshal(body, &m)
  3266  	if err != nil {
  3267  		return err
  3268  	}
  3269  	for k, v := range m {
  3270  		switch k {
  3271  		case "properties":
  3272  			if v != nil {
  3273  				var diagnosticSettings DiagnosticSettings
  3274  				err = json.Unmarshal(*v, &diagnosticSettings)
  3275  				if err != nil {
  3276  					return err
  3277  				}
  3278  				dsr.DiagnosticSettings = &diagnosticSettings
  3279  			}
  3280  		case "id":
  3281  			if v != nil {
  3282  				var ID string
  3283  				err = json.Unmarshal(*v, &ID)
  3284  				if err != nil {
  3285  					return err
  3286  				}
  3287  				dsr.ID = &ID
  3288  			}
  3289  		case "name":
  3290  			if v != nil {
  3291  				var name string
  3292  				err = json.Unmarshal(*v, &name)
  3293  				if err != nil {
  3294  					return err
  3295  				}
  3296  				dsr.Name = &name
  3297  			}
  3298  		case "type":
  3299  			if v != nil {
  3300  				var typeVar string
  3301  				err = json.Unmarshal(*v, &typeVar)
  3302  				if err != nil {
  3303  					return err
  3304  				}
  3305  				dsr.Type = &typeVar
  3306  			}
  3307  		}
  3308  	}
  3309  
  3310  	return nil
  3311  }
  3312  
  3313  // DiagnosticSettingsResourceCollection represents a collection of alert rule resources.
  3314  type DiagnosticSettingsResourceCollection struct {
  3315  	autorest.Response `json:"-"`
  3316  	// Value - The collection of diagnostic settings resources;.
  3317  	Value *[]DiagnosticSettingsResource `json:"value,omitempty"`
  3318  }
  3319  
  3320  // Dimension specifies the criteria for converting log to metric.
  3321  type Dimension struct {
  3322  	// Name - Name of the dimension
  3323  	Name *string `json:"name,omitempty"`
  3324  	// Operator - Operator for dimension values
  3325  	Operator *string `json:"operator,omitempty"`
  3326  	// Values - List of dimension values
  3327  	Values *[]string `json:"values,omitempty"`
  3328  }
  3329  
  3330  // DynamicMetricCriteria criterion for dynamic threshold.
  3331  type DynamicMetricCriteria struct {
  3332  	// Operator - The operator used to compare the metric value against the threshold. Possible values include: 'DynamicThresholdOperatorGreaterThan', 'DynamicThresholdOperatorLessThan', 'DynamicThresholdOperatorGreaterOrLessThan'
  3333  	Operator DynamicThresholdOperator `json:"operator,omitempty"`
  3334  	// AlertSensitivity - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. Possible values include: 'DynamicThresholdSensitivityLow', 'DynamicThresholdSensitivityMedium', 'DynamicThresholdSensitivityHigh'
  3335  	AlertSensitivity DynamicThresholdSensitivity `json:"alertSensitivity,omitempty"`
  3336  	// FailingPeriods - The minimum number of violations required within the selected lookback time window required to raise an alert.
  3337  	FailingPeriods *DynamicThresholdFailingPeriods `json:"failingPeriods,omitempty"`
  3338  	// IgnoreDataBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
  3339  	IgnoreDataBefore *date.Time `json:"ignoreDataBefore,omitempty"`
  3340  	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
  3341  	AdditionalProperties map[string]interface{} `json:""`
  3342  	// Name - Name of the criteria.
  3343  	Name *string `json:"name,omitempty"`
  3344  	// MetricName - Name of the metric.
  3345  	MetricName *string `json:"metricName,omitempty"`
  3346  	// MetricNamespace - Namespace of the metric.
  3347  	MetricNamespace *string `json:"metricNamespace,omitempty"`
  3348  	// TimeAggregation - the criteria time aggregation types. Possible values include: 'AggregationTypeEnumAverage', 'AggregationTypeEnumCount', 'AggregationTypeEnumMinimum', 'AggregationTypeEnumMaximum', 'AggregationTypeEnumTotal'
  3349  	TimeAggregation AggregationTypeEnum `json:"timeAggregation,omitempty"`
  3350  	// Dimensions - List of dimension conditions.
  3351  	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
  3352  	// SkipMetricValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
  3353  	SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"`
  3354  	// CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion'
  3355  	CriterionType CriterionType `json:"criterionType,omitempty"`
  3356  }
  3357  
  3358  // MarshalJSON is the custom marshaler for DynamicMetricCriteria.
  3359  func (dmc DynamicMetricCriteria) MarshalJSON() ([]byte, error) {
  3360  	dmc.CriterionType = CriterionTypeDynamicThresholdCriterion
  3361  	objectMap := make(map[string]interface{})
  3362  	if dmc.Operator != "" {
  3363  		objectMap["operator"] = dmc.Operator
  3364  	}
  3365  	if dmc.AlertSensitivity != "" {
  3366  		objectMap["alertSensitivity"] = dmc.AlertSensitivity
  3367  	}
  3368  	if dmc.FailingPeriods != nil {
  3369  		objectMap["failingPeriods"] = dmc.FailingPeriods
  3370  	}
  3371  	if dmc.IgnoreDataBefore != nil {
  3372  		objectMap["ignoreDataBefore"] = dmc.IgnoreDataBefore
  3373  	}
  3374  	if dmc.Name != nil {
  3375  		objectMap["name"] = dmc.Name
  3376  	}
  3377  	if dmc.MetricName != nil {
  3378  		objectMap["metricName"] = dmc.MetricName
  3379  	}
  3380  	if dmc.MetricNamespace != nil {
  3381  		objectMap["metricNamespace"] = dmc.MetricNamespace
  3382  	}
  3383  	if dmc.TimeAggregation != "" {
  3384  		objectMap["timeAggregation"] = dmc.TimeAggregation
  3385  	}
  3386  	if dmc.Dimensions != nil {
  3387  		objectMap["dimensions"] = dmc.Dimensions
  3388  	}
  3389  	if dmc.SkipMetricValidation != nil {
  3390  		objectMap["skipMetricValidation"] = dmc.SkipMetricValidation
  3391  	}
  3392  	if dmc.CriterionType != "" {
  3393  		objectMap["criterionType"] = dmc.CriterionType
  3394  	}
  3395  	for k, v := range dmc.AdditionalProperties {
  3396  		objectMap[k] = v
  3397  	}
  3398  	return json.Marshal(objectMap)
  3399  }
  3400  
  3401  // AsMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria.
  3402  func (dmc DynamicMetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) {
  3403  	return nil, false
  3404  }
  3405  
  3406  // AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria.
  3407  func (dmc DynamicMetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) {
  3408  	return &dmc, true
  3409  }
  3410  
  3411  // AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria.
  3412  func (dmc DynamicMetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) {
  3413  	return nil, false
  3414  }
  3415  
  3416  // AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria.
  3417  func (dmc DynamicMetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) {
  3418  	return &dmc, true
  3419  }
  3420  
  3421  // UnmarshalJSON is the custom unmarshaler for DynamicMetricCriteria struct.
  3422  func (dmc *DynamicMetricCriteria) UnmarshalJSON(body []byte) error {
  3423  	var m map[string]*json.RawMessage
  3424  	err := json.Unmarshal(body, &m)
  3425  	if err != nil {
  3426  		return err
  3427  	}
  3428  	for k, v := range m {
  3429  		switch k {
  3430  		case "operator":
  3431  			if v != nil {
  3432  				var operator DynamicThresholdOperator
  3433  				err = json.Unmarshal(*v, &operator)
  3434  				if err != nil {
  3435  					return err
  3436  				}
  3437  				dmc.Operator = operator
  3438  			}
  3439  		case "alertSensitivity":
  3440  			if v != nil {
  3441  				var alertSensitivity DynamicThresholdSensitivity
  3442  				err = json.Unmarshal(*v, &alertSensitivity)
  3443  				if err != nil {
  3444  					return err
  3445  				}
  3446  				dmc.AlertSensitivity = alertSensitivity
  3447  			}
  3448  		case "failingPeriods":
  3449  			if v != nil {
  3450  				var failingPeriods DynamicThresholdFailingPeriods
  3451  				err = json.Unmarshal(*v, &failingPeriods)
  3452  				if err != nil {
  3453  					return err
  3454  				}
  3455  				dmc.FailingPeriods = &failingPeriods
  3456  			}
  3457  		case "ignoreDataBefore":
  3458  			if v != nil {
  3459  				var ignoreDataBefore date.Time
  3460  				err = json.Unmarshal(*v, &ignoreDataBefore)
  3461  				if err != nil {
  3462  					return err
  3463  				}
  3464  				dmc.IgnoreDataBefore = &ignoreDataBefore
  3465  			}
  3466  		default:
  3467  			if v != nil {
  3468  				var additionalProperties interface{}
  3469  				err = json.Unmarshal(*v, &additionalProperties)
  3470  				if err != nil {
  3471  					return err
  3472  				}
  3473  				if dmc.AdditionalProperties == nil {
  3474  					dmc.AdditionalProperties = make(map[string]interface{})
  3475  				}
  3476  				dmc.AdditionalProperties[k] = additionalProperties
  3477  			}
  3478  		case "name":
  3479  			if v != nil {
  3480  				var name string
  3481  				err = json.Unmarshal(*v, &name)
  3482  				if err != nil {
  3483  					return err
  3484  				}
  3485  				dmc.Name = &name
  3486  			}
  3487  		case "metricName":
  3488  			if v != nil {
  3489  				var metricName string
  3490  				err = json.Unmarshal(*v, &metricName)
  3491  				if err != nil {
  3492  					return err
  3493  				}
  3494  				dmc.MetricName = &metricName
  3495  			}
  3496  		case "metricNamespace":
  3497  			if v != nil {
  3498  				var metricNamespace string
  3499  				err = json.Unmarshal(*v, &metricNamespace)
  3500  				if err != nil {
  3501  					return err
  3502  				}
  3503  				dmc.MetricNamespace = &metricNamespace
  3504  			}
  3505  		case "timeAggregation":
  3506  			if v != nil {
  3507  				var timeAggregation AggregationTypeEnum
  3508  				err = json.Unmarshal(*v, &timeAggregation)
  3509  				if err != nil {
  3510  					return err
  3511  				}
  3512  				dmc.TimeAggregation = timeAggregation
  3513  			}
  3514  		case "dimensions":
  3515  			if v != nil {
  3516  				var dimensions []MetricDimension
  3517  				err = json.Unmarshal(*v, &dimensions)
  3518  				if err != nil {
  3519  					return err
  3520  				}
  3521  				dmc.Dimensions = &dimensions
  3522  			}
  3523  		case "skipMetricValidation":
  3524  			if v != nil {
  3525  				var skipMetricValidation bool
  3526  				err = json.Unmarshal(*v, &skipMetricValidation)
  3527  				if err != nil {
  3528  					return err
  3529  				}
  3530  				dmc.SkipMetricValidation = &skipMetricValidation
  3531  			}
  3532  		case "criterionType":
  3533  			if v != nil {
  3534  				var criterionType CriterionType
  3535  				err = json.Unmarshal(*v, &criterionType)
  3536  				if err != nil {
  3537  					return err
  3538  				}
  3539  				dmc.CriterionType = criterionType
  3540  			}
  3541  		}
  3542  	}
  3543  
  3544  	return nil
  3545  }
  3546  
  3547  // DynamicThresholdFailingPeriods the minimum number of violations required within the selected lookback
  3548  // time window required to raise an alert.
  3549  type DynamicThresholdFailingPeriods struct {
  3550  	// NumberOfEvaluationPeriods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
  3551  	NumberOfEvaluationPeriods *float64 `json:"numberOfEvaluationPeriods,omitempty"`
  3552  	// MinFailingPeriodsToAlert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
  3553  	MinFailingPeriodsToAlert *float64 `json:"minFailingPeriodsToAlert,omitempty"`
  3554  }
  3555  
  3556  // EmailNotification email notification of an autoscale event.
  3557  type EmailNotification struct {
  3558  	// SendToSubscriptionAdministrator - a value indicating whether to send email to subscription administrator.
  3559  	SendToSubscriptionAdministrator *bool `json:"sendToSubscriptionAdministrator,omitempty"`
  3560  	// SendToSubscriptionCoAdministrators - a value indicating whether to send email to subscription co-administrators.
  3561  	SendToSubscriptionCoAdministrators *bool `json:"sendToSubscriptionCoAdministrators,omitempty"`
  3562  	// CustomEmails - the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored.
  3563  	CustomEmails *[]string `json:"customEmails,omitempty"`
  3564  }
  3565  
  3566  // EmailReceiver an email receiver.
  3567  type EmailReceiver struct {
  3568  	// Name - The name of the email receiver. Names must be unique across all receivers within an action group.
  3569  	Name *string `json:"name,omitempty"`
  3570  	// EmailAddress - The email address of this receiver.
  3571  	EmailAddress *string `json:"emailAddress,omitempty"`
  3572  	// UseCommonAlertSchema - Indicates whether to use common alert schema.
  3573  	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
  3574  	// Status - READ-ONLY; The receiver status of the e-mail. Possible values include: 'ReceiverStatusNotSpecified', 'ReceiverStatusEnabled', 'ReceiverStatusDisabled'
  3575  	Status ReceiverStatus `json:"status,omitempty"`
  3576  }
  3577  
  3578  // MarshalJSON is the custom marshaler for EmailReceiver.
  3579  func (er EmailReceiver) MarshalJSON() ([]byte, error) {
  3580  	objectMap := make(map[string]interface{})
  3581  	if er.Name != nil {
  3582  		objectMap["name"] = er.Name
  3583  	}
  3584  	if er.EmailAddress != nil {
  3585  		objectMap["emailAddress"] = er.EmailAddress
  3586  	}
  3587  	if er.UseCommonAlertSchema != nil {
  3588  		objectMap["useCommonAlertSchema"] = er.UseCommonAlertSchema
  3589  	}
  3590  	return json.Marshal(objectMap)
  3591  }
  3592  
  3593  // EnableRequest describes a receiver that should be resubscribed.
  3594  type EnableRequest struct {
  3595  	// ReceiverName - The name of the receiver to resubscribe.
  3596  	ReceiverName *string `json:"receiverName,omitempty"`
  3597  }
  3598  
  3599  // Error error details.
  3600  type Error struct {
  3601  	// Code - Error code identifying the specific error.
  3602  	Code *string `json:"code,omitempty"`
  3603  	// Message - Error message in the caller's locale.
  3604  	Message *string `json:"message,omitempty"`
  3605  }
  3606  
  3607  // ErrorAdditionalInfo the resource management error additional info.
  3608  type ErrorAdditionalInfo struct {
  3609  	// Type - READ-ONLY; The additional info type.
  3610  	Type *string `json:"type,omitempty"`
  3611  	// Info - READ-ONLY; The additional info.
  3612  	Info interface{} `json:"info,omitempty"`
  3613  }
  3614  
  3615  // MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
  3616  func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
  3617  	objectMap := make(map[string]interface{})
  3618  	return json.Marshal(objectMap)
  3619  }
  3620  
  3621  // ErrorContract describes the format of Error response.
  3622  type ErrorContract struct {
  3623  	// Error - The error details.
  3624  	Error *ErrorResponse `json:"error,omitempty"`
  3625  }
  3626  
  3627  // ErrorDetail the error detail.
  3628  type ErrorDetail struct {
  3629  	// Code - READ-ONLY; The error code.
  3630  	Code *string `json:"code,omitempty"`
  3631  	// Message - READ-ONLY; The error message.
  3632  	Message *string `json:"message,omitempty"`
  3633  	// Target - READ-ONLY; The error target.
  3634  	Target *string `json:"target,omitempty"`
  3635  	// Details - READ-ONLY; The error details.
  3636  	Details *[]ErrorDetail `json:"details,omitempty"`
  3637  	// AdditionalInfo - READ-ONLY; The error additional info.
  3638  	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
  3639  }
  3640  
  3641  // MarshalJSON is the custom marshaler for ErrorDetail.
  3642  func (ed ErrorDetail) MarshalJSON() ([]byte, error) {
  3643  	objectMap := make(map[string]interface{})
  3644  	return json.Marshal(objectMap)
  3645  }
  3646  
  3647  // ErrorResponse describes the format of Error response.
  3648  type ErrorResponse struct {
  3649  	// Code - Error code
  3650  	Code *string `json:"code,omitempty"`
  3651  	// Message - Error message indicating why the operation failed.
  3652  	Message *string `json:"message,omitempty"`
  3653  }
  3654  
  3655  // ErrorResponseCommon the resource management error response.
  3656  type ErrorResponseCommon struct {
  3657  	// Details - READ-ONLY; The error details.
  3658  	Details *[]ErrorResponseCommon `json:"details,omitempty"`
  3659  	// AdditionalInfo - READ-ONLY; The error additional info.
  3660  	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
  3661  	// Code - Error code
  3662  	Code *string `json:"code,omitempty"`
  3663  	// Message - Error message indicating why the operation failed.
  3664  	Message *string `json:"message,omitempty"`
  3665  }
  3666  
  3667  // MarshalJSON is the custom marshaler for ErrorResponseCommon.
  3668  func (erc ErrorResponseCommon) MarshalJSON() ([]byte, error) {
  3669  	objectMap := make(map[string]interface{})
  3670  	if erc.Code != nil {
  3671  		objectMap["code"] = erc.Code
  3672  	}
  3673  	if erc.Message != nil {
  3674  		objectMap["message"] = erc.Message
  3675  	}
  3676  	return json.Marshal(objectMap)
  3677  }
  3678  
  3679  // ErrorResponseCommonV2 common error response for all Azure Resource Manager APIs to return error details
  3680  // for failed operations. (This also follows the OData error response format.).
  3681  type ErrorResponseCommonV2 struct {
  3682  	// Error - The error object.
  3683  	Error *ErrorDetail `json:"error,omitempty"`
  3684  }
  3685  
  3686  // EventCategoryCollection a collection of event categories. Currently possible values are: Administrative,
  3687  // Security, ServiceHealth, Alert, Recommendation, Policy.
  3688  type EventCategoryCollection struct {
  3689  	autorest.Response `json:"-"`
  3690  	// Value - the list that includes the Azure event categories.
  3691  	Value *[]LocalizableString `json:"value,omitempty"`
  3692  }
  3693  
  3694  // EventData the Azure event log entries are of type EventData
  3695  type EventData struct {
  3696  	// Authorization - READ-ONLY; The sender authorization information.
  3697  	Authorization *SenderAuthorization `json:"authorization,omitempty"`
  3698  	// Claims - READ-ONLY; key value pairs to identify ARM permissions.
  3699  	Claims map[string]*string `json:"claims"`
  3700  	// Caller - READ-ONLY; the email address of the user who has performed the operation, the UPN claim or SPN claim based on availability.
  3701  	Caller *string `json:"caller,omitempty"`
  3702  	// Description - READ-ONLY; the description of the event.
  3703  	Description *string `json:"description,omitempty"`
  3704  	// ID - READ-ONLY; the Id of this event as required by ARM for RBAC. It contains the EventDataID and a timestamp information.
  3705  	ID *string `json:"id,omitempty"`
  3706  	// EventDataID - READ-ONLY; the event data Id. This is a unique identifier for an event.
  3707  	EventDataID *string `json:"eventDataId,omitempty"`
  3708  	// CorrelationID - READ-ONLY; the correlation Id, usually a GUID in the string format. The correlation Id is shared among the events that belong to the same uber operation.
  3709  	CorrelationID *string `json:"correlationId,omitempty"`
  3710  	// EventName - READ-ONLY; the event name. This value should not be confused with OperationName. For practical purposes, OperationName might be more appealing to end users.
  3711  	EventName *LocalizableString `json:"eventName,omitempty"`
  3712  	// Category - READ-ONLY; the event category.
  3713  	Category *LocalizableString `json:"category,omitempty"`
  3714  	// HTTPRequest - READ-ONLY; the HTTP request info. Usually includes the 'clientRequestId', 'clientIpAddress' (IP address of the user who initiated the event) and 'method' (HTTP method e.g. PUT).
  3715  	HTTPRequest *HTTPRequestInfo `json:"httpRequest,omitempty"`
  3716  	// Level - READ-ONLY; the event level. Possible values include: 'EventLevelCritical', 'EventLevelError', 'EventLevelWarning', 'EventLevelInformational', 'EventLevelVerbose'
  3717  	Level EventLevel `json:"level,omitempty"`
  3718  	// ResourceGroupName - READ-ONLY; the resource group name of the impacted resource.
  3719  	ResourceGroupName *string `json:"resourceGroupName,omitempty"`
  3720  	// ResourceProviderName - READ-ONLY; the resource provider name of the impacted resource.
  3721  	ResourceProviderName *LocalizableString `json:"resourceProviderName,omitempty"`
  3722  	// ResourceID - READ-ONLY; the resource uri that uniquely identifies the resource that caused this event.
  3723  	ResourceID *string `json:"resourceId,omitempty"`
  3724  	// ResourceType - READ-ONLY; the resource type
  3725  	ResourceType *LocalizableString `json:"resourceType,omitempty"`
  3726  	// OperationID - READ-ONLY; It is usually a GUID shared among the events corresponding to single operation. This value should not be confused with EventName.
  3727  	OperationID *string `json:"operationId,omitempty"`
  3728  	// OperationName - READ-ONLY; the operation name.
  3729  	OperationName *LocalizableString `json:"operationName,omitempty"`
  3730  	// Properties - READ-ONLY; the set of <Key, Value> pairs (usually a Dictionary<String, String>) that includes details about the event.
  3731  	Properties map[string]*string `json:"properties"`
  3732  	// Status - READ-ONLY; a string describing the status of the operation. Some typical values are: Started, In progress, Succeeded, Failed, Resolved.
  3733  	Status *LocalizableString `json:"status,omitempty"`
  3734  	// SubStatus - READ-ONLY; the event sub status. Most of the time, when included, this captures the HTTP status code of the REST call. Common values are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP Status Code: 409), Internal Server Error (HTTP Status Code: 500), Service Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: 504)
  3735  	SubStatus *LocalizableString `json:"subStatus,omitempty"`
  3736  	// EventTimestamp - READ-ONLY; the timestamp of when the event was generated by the Azure service processing the request corresponding the event. It in ISO 8601 format.
  3737  	EventTimestamp *date.Time `json:"eventTimestamp,omitempty"`
  3738  	// SubmissionTimestamp - READ-ONLY; the timestamp of when the event became available for querying via this API. It is in ISO 8601 format. This value should not be confused eventTimestamp. As there might be a delay between the occurrence time of the event, and the time that the event is submitted to the Azure logging infrastructure.
  3739  	SubmissionTimestamp *date.Time `json:"submissionTimestamp,omitempty"`
  3740  	// SubscriptionID - READ-ONLY; the Azure subscription Id usually a GUID.
  3741  	SubscriptionID *string `json:"subscriptionId,omitempty"`
  3742  	// TenantID - READ-ONLY; the Azure tenant Id
  3743  	TenantID *string `json:"tenantId,omitempty"`
  3744  }
  3745  
  3746  // MarshalJSON is the custom marshaler for EventData.
  3747  func (ed EventData) MarshalJSON() ([]byte, error) {
  3748  	objectMap := make(map[string]interface{})
  3749  	return json.Marshal(objectMap)
  3750  }
  3751  
  3752  // EventDataCollection represents collection of events.
  3753  type EventDataCollection struct {
  3754  	autorest.Response `json:"-"`
  3755  	// Value - this list that includes the Azure audit logs.
  3756  	Value *[]EventData `json:"value,omitempty"`
  3757  	// NextLink - Provides the link to retrieve the next set of events.
  3758  	NextLink *string `json:"nextLink,omitempty"`
  3759  }
  3760  
  3761  // EventDataCollectionIterator provides access to a complete listing of EventData values.
  3762  type EventDataCollectionIterator struct {
  3763  	i    int
  3764  	page EventDataCollectionPage
  3765  }
  3766  
  3767  // NextWithContext advances to the next value.  If there was an error making
  3768  // the request the iterator does not advance and the error is returned.
  3769  func (iter *EventDataCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  3770  	if tracing.IsEnabled() {
  3771  		ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionIterator.NextWithContext")
  3772  		defer func() {
  3773  			sc := -1
  3774  			if iter.Response().Response.Response != nil {
  3775  				sc = iter.Response().Response.Response.StatusCode
  3776  			}
  3777  			tracing.EndSpan(ctx, sc, err)
  3778  		}()
  3779  	}
  3780  	iter.i++
  3781  	if iter.i < len(iter.page.Values()) {
  3782  		return nil
  3783  	}
  3784  	err = iter.page.NextWithContext(ctx)
  3785  	if err != nil {
  3786  		iter.i--
  3787  		return err
  3788  	}
  3789  	iter.i = 0
  3790  	return nil
  3791  }
  3792  
  3793  // Next advances to the next value.  If there was an error making
  3794  // the request the iterator does not advance and the error is returned.
  3795  // Deprecated: Use NextWithContext() instead.
  3796  func (iter *EventDataCollectionIterator) Next() error {
  3797  	return iter.NextWithContext(context.Background())
  3798  }
  3799  
  3800  // NotDone returns true if the enumeration should be started or is not yet complete.
  3801  func (iter EventDataCollectionIterator) NotDone() bool {
  3802  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  3803  }
  3804  
  3805  // Response returns the raw server response from the last page request.
  3806  func (iter EventDataCollectionIterator) Response() EventDataCollection {
  3807  	return iter.page.Response()
  3808  }
  3809  
  3810  // Value returns the current value or a zero-initialized value if the
  3811  // iterator has advanced beyond the end of the collection.
  3812  func (iter EventDataCollectionIterator) Value() EventData {
  3813  	if !iter.page.NotDone() {
  3814  		return EventData{}
  3815  	}
  3816  	return iter.page.Values()[iter.i]
  3817  }
  3818  
  3819  // Creates a new instance of the EventDataCollectionIterator type.
  3820  func NewEventDataCollectionIterator(page EventDataCollectionPage) EventDataCollectionIterator {
  3821  	return EventDataCollectionIterator{page: page}
  3822  }
  3823  
  3824  // IsEmpty returns true if the ListResult contains no values.
  3825  func (edc EventDataCollection) IsEmpty() bool {
  3826  	return edc.Value == nil || len(*edc.Value) == 0
  3827  }
  3828  
  3829  // hasNextLink returns true if the NextLink is not empty.
  3830  func (edc EventDataCollection) hasNextLink() bool {
  3831  	return edc.NextLink != nil && len(*edc.NextLink) != 0
  3832  }
  3833  
  3834  // eventDataCollectionPreparer prepares a request to retrieve the next set of results.
  3835  // It returns nil if no more results exist.
  3836  func (edc EventDataCollection) eventDataCollectionPreparer(ctx context.Context) (*http.Request, error) {
  3837  	if !edc.hasNextLink() {
  3838  		return nil, nil
  3839  	}
  3840  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  3841  		autorest.AsJSON(),
  3842  		autorest.AsGet(),
  3843  		autorest.WithBaseURL(to.String(edc.NextLink)))
  3844  }
  3845  
  3846  // EventDataCollectionPage contains a page of EventData values.
  3847  type EventDataCollectionPage struct {
  3848  	fn  func(context.Context, EventDataCollection) (EventDataCollection, error)
  3849  	edc EventDataCollection
  3850  }
  3851  
  3852  // NextWithContext advances to the next page of values.  If there was an error making
  3853  // the request the page does not advance and the error is returned.
  3854  func (page *EventDataCollectionPage) NextWithContext(ctx context.Context) (err error) {
  3855  	if tracing.IsEnabled() {
  3856  		ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionPage.NextWithContext")
  3857  		defer func() {
  3858  			sc := -1
  3859  			if page.Response().Response.Response != nil {
  3860  				sc = page.Response().Response.Response.StatusCode
  3861  			}
  3862  			tracing.EndSpan(ctx, sc, err)
  3863  		}()
  3864  	}
  3865  	for {
  3866  		next, err := page.fn(ctx, page.edc)
  3867  		if err != nil {
  3868  			return err
  3869  		}
  3870  		page.edc = next
  3871  		if !next.hasNextLink() || !next.IsEmpty() {
  3872  			break
  3873  		}
  3874  	}
  3875  	return nil
  3876  }
  3877  
  3878  // Next advances to the next page of values.  If there was an error making
  3879  // the request the page does not advance and the error is returned.
  3880  // Deprecated: Use NextWithContext() instead.
  3881  func (page *EventDataCollectionPage) Next() error {
  3882  	return page.NextWithContext(context.Background())
  3883  }
  3884  
  3885  // NotDone returns true if the page enumeration should be started or is not yet complete.
  3886  func (page EventDataCollectionPage) NotDone() bool {
  3887  	return !page.edc.IsEmpty()
  3888  }
  3889  
  3890  // Response returns the raw server response from the last page request.
  3891  func (page EventDataCollectionPage) Response() EventDataCollection {
  3892  	return page.edc
  3893  }
  3894  
  3895  // Values returns the slice of values for the current page or nil if there are no values.
  3896  func (page EventDataCollectionPage) Values() []EventData {
  3897  	if page.edc.IsEmpty() {
  3898  		return nil
  3899  	}
  3900  	return *page.edc.Value
  3901  }
  3902  
  3903  // Creates a new instance of the EventDataCollectionPage type.
  3904  func NewEventDataCollectionPage(cur EventDataCollection, getNextPage func(context.Context, EventDataCollection) (EventDataCollection, error)) EventDataCollectionPage {
  3905  	return EventDataCollectionPage{
  3906  		fn:  getNextPage,
  3907  		edc: cur,
  3908  	}
  3909  }
  3910  
  3911  // EventHubReceiver an Event hub receiver.
  3912  type EventHubReceiver struct {
  3913  	// Name - The name of the Event hub receiver. Names must be unique across all receivers within an action group.
  3914  	Name *string `json:"name,omitempty"`
  3915  	// EventHubNameSpace - The Event Hub namespace
  3916  	EventHubNameSpace *string `json:"eventHubNameSpace,omitempty"`
  3917  	// EventHubName - The name of the specific Event Hub queue
  3918  	EventHubName *string `json:"eventHubName,omitempty"`
  3919  	// UseCommonAlertSchema - Indicates whether to use common alert schema.
  3920  	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
  3921  	// TenantID - The tenant Id for the subscription containing this event hub
  3922  	TenantID *string `json:"tenantId,omitempty"`
  3923  	// SubscriptionID - The Id for the subscription containing this event hub
  3924  	SubscriptionID *string `json:"subscriptionId,omitempty"`
  3925  }
  3926  
  3927  // ExtensionDataSource definition of which data will be collected from a separate VM extension that
  3928  // integrates with the Azure Monitor Agent.
  3929  // Collected from either Windows and Linux machines, depending on which extension is defined.
  3930  type ExtensionDataSource struct {
  3931  	// Streams - List of streams that this data source will be sent to.
  3932  	// A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to.
  3933  	Streams *[]KnownExtensionDataSourceStreams `json:"streams,omitempty"`
  3934  	// ExtensionName - The name of the VM extension.
  3935  	ExtensionName *string `json:"extensionName,omitempty"`
  3936  	// ExtensionSettings - The extension settings. The format is specific for particular extension.
  3937  	ExtensionSettings interface{} `json:"extensionSettings,omitempty"`
  3938  	// InputDataSources - The list of data sources this extension needs data from.
  3939  	InputDataSources *[]string `json:"inputDataSources,omitempty"`
  3940  	// Name - A friendly name for the data source.
  3941  	// This name should be unique across all data sources (regardless of type) within the data collection rule.
  3942  	Name *string `json:"name,omitempty"`
  3943  }
  3944  
  3945  // HTTPRequestInfo the Http request info.
  3946  type HTTPRequestInfo struct {
  3947  	// ClientRequestID - the client request id.
  3948  	ClientRequestID *string `json:"clientRequestId,omitempty"`
  3949  	// ClientIPAddress - the client Ip Address
  3950  	ClientIPAddress *string `json:"clientIpAddress,omitempty"`
  3951  	// Method - the Http request method.
  3952  	Method *string `json:"method,omitempty"`
  3953  	// URI - the Uri.
  3954  	URI *string `json:"uri,omitempty"`
  3955  }
  3956  
  3957  // Incident an alert incident indicates the activation status of an alert rule.
  3958  type Incident struct {
  3959  	autorest.Response `json:"-"`
  3960  	// Name - READ-ONLY; Incident name.
  3961  	Name *string `json:"name,omitempty"`
  3962  	// RuleName - READ-ONLY; Rule name that is associated with the incident.
  3963  	RuleName *string `json:"ruleName,omitempty"`
  3964  	// IsActive - READ-ONLY; A boolean to indicate whether the incident is active or resolved.
  3965  	IsActive *bool `json:"isActive,omitempty"`
  3966  	// ActivatedTime - READ-ONLY; The time at which the incident was activated in ISO8601 format.
  3967  	ActivatedTime *date.Time `json:"activatedTime,omitempty"`
  3968  	// ResolvedTime - READ-ONLY; The time at which the incident was resolved in ISO8601 format. If null, it means the incident is still active.
  3969  	ResolvedTime *date.Time `json:"resolvedTime,omitempty"`
  3970  }
  3971  
  3972  // MarshalJSON is the custom marshaler for Incident.
  3973  func (i Incident) MarshalJSON() ([]byte, error) {
  3974  	objectMap := make(map[string]interface{})
  3975  	return json.Marshal(objectMap)
  3976  }
  3977  
  3978  // IncidentListResult the List incidents operation response.
  3979  type IncidentListResult struct {
  3980  	autorest.Response `json:"-"`
  3981  	// Value - the incident collection.
  3982  	Value *[]Incident `json:"value,omitempty"`
  3983  }
  3984  
  3985  // ItsmReceiver an Itsm receiver.
  3986  type ItsmReceiver struct {
  3987  	// Name - The name of the Itsm receiver. Names must be unique across all receivers within an action group.
  3988  	Name *string `json:"name,omitempty"`
  3989  	// WorkspaceID - OMS LA instance identifier.
  3990  	WorkspaceID *string `json:"workspaceId,omitempty"`
  3991  	// ConnectionID - Unique identification of ITSM connection among multiple defined in above workspace.
  3992  	ConnectionID *string `json:"connectionId,omitempty"`
  3993  	// TicketConfiguration - JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well.
  3994  	TicketConfiguration *string `json:"ticketConfiguration,omitempty"`
  3995  	// Region - Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope'
  3996  	Region *string `json:"region,omitempty"`
  3997  }
  3998  
  3999  // LocalizableString the localizable string class.
  4000  type LocalizableString struct {
  4001  	// Value - the invariant value.
  4002  	Value *string `json:"value,omitempty"`
  4003  	// LocalizedValue - the locale specific value.
  4004  	LocalizedValue *string `json:"localizedValue,omitempty"`
  4005  }
  4006  
  4007  // LocationThresholdRuleCondition a rule condition based on a certain number of locations failing.
  4008  type LocationThresholdRuleCondition struct {
  4009  	// WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day.
  4010  	WindowSize *string `json:"windowSize,omitempty"`
  4011  	// FailedLocationCount - the number of locations that must fail to activate the alert.
  4012  	FailedLocationCount *int32 `json:"failedLocationCount,omitempty"`
  4013  	// DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource.
  4014  	DataSource BasicRuleDataSource `json:"dataSource,omitempty"`
  4015  	// OdataType - Possible values include: 'OdataTypeBasicRuleConditionOdataTypeRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition'
  4016  	OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"`
  4017  }
  4018  
  4019  // MarshalJSON is the custom marshaler for LocationThresholdRuleCondition.
  4020  func (ltrc LocationThresholdRuleCondition) MarshalJSON() ([]byte, error) {
  4021  	ltrc.OdataType = OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition
  4022  	objectMap := make(map[string]interface{})
  4023  	if ltrc.WindowSize != nil {
  4024  		objectMap["windowSize"] = ltrc.WindowSize
  4025  	}
  4026  	if ltrc.FailedLocationCount != nil {
  4027  		objectMap["failedLocationCount"] = ltrc.FailedLocationCount
  4028  	}
  4029  	objectMap["dataSource"] = ltrc.DataSource
  4030  	if ltrc.OdataType != "" {
  4031  		objectMap["odata.type"] = ltrc.OdataType
  4032  	}
  4033  	return json.Marshal(objectMap)
  4034  }
  4035  
  4036  // AsThresholdRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition.
  4037  func (ltrc LocationThresholdRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) {
  4038  	return nil, false
  4039  }
  4040  
  4041  // AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition.
  4042  func (ltrc LocationThresholdRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) {
  4043  	return &ltrc, true
  4044  }
  4045  
  4046  // AsManagementEventRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition.
  4047  func (ltrc LocationThresholdRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) {
  4048  	return nil, false
  4049  }
  4050  
  4051  // AsRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition.
  4052  func (ltrc LocationThresholdRuleCondition) AsRuleCondition() (*RuleCondition, bool) {
  4053  	return nil, false
  4054  }
  4055  
  4056  // AsBasicRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition.
  4057  func (ltrc LocationThresholdRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) {
  4058  	return &ltrc, true
  4059  }
  4060  
  4061  // UnmarshalJSON is the custom unmarshaler for LocationThresholdRuleCondition struct.
  4062  func (ltrc *LocationThresholdRuleCondition) UnmarshalJSON(body []byte) error {
  4063  	var m map[string]*json.RawMessage
  4064  	err := json.Unmarshal(body, &m)
  4065  	if err != nil {
  4066  		return err
  4067  	}
  4068  	for k, v := range m {
  4069  		switch k {
  4070  		case "windowSize":
  4071  			if v != nil {
  4072  				var windowSize string
  4073  				err = json.Unmarshal(*v, &windowSize)
  4074  				if err != nil {
  4075  					return err
  4076  				}
  4077  				ltrc.WindowSize = &windowSize
  4078  			}
  4079  		case "failedLocationCount":
  4080  			if v != nil {
  4081  				var failedLocationCount int32
  4082  				err = json.Unmarshal(*v, &failedLocationCount)
  4083  				if err != nil {
  4084  					return err
  4085  				}
  4086  				ltrc.FailedLocationCount = &failedLocationCount
  4087  			}
  4088  		case "dataSource":
  4089  			if v != nil {
  4090  				dataSource, err := unmarshalBasicRuleDataSource(*v)
  4091  				if err != nil {
  4092  					return err
  4093  				}
  4094  				ltrc.DataSource = dataSource
  4095  			}
  4096  		case "odata.type":
  4097  			if v != nil {
  4098  				var odataType OdataTypeBasicRuleCondition
  4099  				err = json.Unmarshal(*v, &odataType)
  4100  				if err != nil {
  4101  					return err
  4102  				}
  4103  				ltrc.OdataType = odataType
  4104  			}
  4105  		}
  4106  	}
  4107  
  4108  	return nil
  4109  }
  4110  
  4111  // LogAnalyticsDestination log Analytics destination.
  4112  type LogAnalyticsDestination struct {
  4113  	// WorkspaceResourceID - The resource ID of the Log Analytics workspace.
  4114  	WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"`
  4115  	// WorkspaceID - READ-ONLY; The Customer ID of the Log Analytics workspace.
  4116  	WorkspaceID *string `json:"workspaceId,omitempty"`
  4117  	// Name - A friendly name for the destination.
  4118  	// This name should be unique across all destinations (regardless of type) within the data collection rule.
  4119  	Name *string `json:"name,omitempty"`
  4120  }
  4121  
  4122  // MarshalJSON is the custom marshaler for LogAnalyticsDestination.
  4123  func (lad LogAnalyticsDestination) MarshalJSON() ([]byte, error) {
  4124  	objectMap := make(map[string]interface{})
  4125  	if lad.WorkspaceResourceID != nil {
  4126  		objectMap["workspaceResourceId"] = lad.WorkspaceResourceID
  4127  	}
  4128  	if lad.Name != nil {
  4129  		objectMap["name"] = lad.Name
  4130  	}
  4131  	return json.Marshal(objectMap)
  4132  }
  4133  
  4134  // LogicAppReceiver a logic app receiver.
  4135  type LogicAppReceiver struct {
  4136  	// Name - The name of the logic app receiver. Names must be unique across all receivers within an action group.
  4137  	Name *string `json:"name,omitempty"`
  4138  	// ResourceID - The azure resource id of the logic app receiver.
  4139  	ResourceID *string `json:"resourceId,omitempty"`
  4140  	// CallbackURL - The callback url where http request sent to.
  4141  	CallbackURL *string `json:"callbackUrl,omitempty"`
  4142  	// UseCommonAlertSchema - Indicates whether to use common alert schema.
  4143  	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
  4144  }
  4145  
  4146  // LogMetricTrigger a log metrics trigger descriptor.
  4147  type LogMetricTrigger struct {
  4148  	// ThresholdOperator - Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. Possible values include: 'ConditionalOperatorGreaterThanOrEqual', 'ConditionalOperatorLessThanOrEqual', 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual'
  4149  	ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"`
  4150  	// Threshold - The threshold of the metric trigger.
  4151  	Threshold *float64 `json:"threshold,omitempty"`
  4152  	// MetricTriggerType - Metric Trigger Type - 'Consecutive' or 'Total'. Possible values include: 'MetricTriggerTypeConsecutive', 'MetricTriggerTypeTotal'
  4153  	MetricTriggerType MetricTriggerType `json:"metricTriggerType,omitempty"`
  4154  	// MetricColumn - Evaluation of metric on a particular column
  4155  	MetricColumn *string `json:"metricColumn,omitempty"`
  4156  }
  4157  
  4158  // LogProfileCollection represents a collection of log profiles.
  4159  type LogProfileCollection struct {
  4160  	autorest.Response `json:"-"`
  4161  	// Value - the values of the log profiles.
  4162  	Value *[]LogProfileResource `json:"value,omitempty"`
  4163  }
  4164  
  4165  // LogProfileProperties the log profile properties.
  4166  type LogProfileProperties struct {
  4167  	// StorageAccountID - the resource id of the storage account to which you would like to send the Activity Log.
  4168  	StorageAccountID *string `json:"storageAccountId,omitempty"`
  4169  	// ServiceBusRuleID - The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
  4170  	ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"`
  4171  	// Locations - List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
  4172  	Locations *[]string `json:"locations,omitempty"`
  4173  	// Categories - the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
  4174  	Categories *[]string `json:"categories,omitempty"`
  4175  	// RetentionPolicy - the retention policy for the events in the log.
  4176  	RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
  4177  }
  4178  
  4179  // LogProfileResource the log profile resource.
  4180  type LogProfileResource struct {
  4181  	autorest.Response `json:"-"`
  4182  	// LogProfileProperties - The log profile properties of the resource.
  4183  	*LogProfileProperties `json:"properties,omitempty"`
  4184  	// ID - READ-ONLY; Azure resource Id
  4185  	ID *string `json:"id,omitempty"`
  4186  	// Name - READ-ONLY; Azure resource name
  4187  	Name *string `json:"name,omitempty"`
  4188  	// Type - READ-ONLY; Azure resource type
  4189  	Type *string `json:"type,omitempty"`
  4190  	// Location - Resource location
  4191  	Location *string `json:"location,omitempty"`
  4192  	// Tags - Resource tags
  4193  	Tags map[string]*string `json:"tags"`
  4194  	// Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type.  If supported, the resource provider must validate and persist this value.
  4195  	Kind *string `json:"kind,omitempty"`
  4196  	// Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
  4197  	Etag *string `json:"etag,omitempty"`
  4198  }
  4199  
  4200  // MarshalJSON is the custom marshaler for LogProfileResource.
  4201  func (lpr LogProfileResource) MarshalJSON() ([]byte, error) {
  4202  	objectMap := make(map[string]interface{})
  4203  	if lpr.LogProfileProperties != nil {
  4204  		objectMap["properties"] = lpr.LogProfileProperties
  4205  	}
  4206  	if lpr.Location != nil {
  4207  		objectMap["location"] = lpr.Location
  4208  	}
  4209  	if lpr.Tags != nil {
  4210  		objectMap["tags"] = lpr.Tags
  4211  	}
  4212  	return json.Marshal(objectMap)
  4213  }
  4214  
  4215  // UnmarshalJSON is the custom unmarshaler for LogProfileResource struct.
  4216  func (lpr *LogProfileResource) UnmarshalJSON(body []byte) error {
  4217  	var m map[string]*json.RawMessage
  4218  	err := json.Unmarshal(body, &m)
  4219  	if err != nil {
  4220  		return err
  4221  	}
  4222  	for k, v := range m {
  4223  		switch k {
  4224  		case "properties":
  4225  			if v != nil {
  4226  				var logProfileProperties LogProfileProperties
  4227  				err = json.Unmarshal(*v, &logProfileProperties)
  4228  				if err != nil {
  4229  					return err
  4230  				}
  4231  				lpr.LogProfileProperties = &logProfileProperties
  4232  			}
  4233  		case "id":
  4234  			if v != nil {
  4235  				var ID string
  4236  				err = json.Unmarshal(*v, &ID)
  4237  				if err != nil {
  4238  					return err
  4239  				}
  4240  				lpr.ID = &ID
  4241  			}
  4242  		case "name":
  4243  			if v != nil {
  4244  				var name string
  4245  				err = json.Unmarshal(*v, &name)
  4246  				if err != nil {
  4247  					return err
  4248  				}
  4249  				lpr.Name = &name
  4250  			}
  4251  		case "type":
  4252  			if v != nil {
  4253  				var typeVar string
  4254  				err = json.Unmarshal(*v, &typeVar)
  4255  				if err != nil {
  4256  					return err
  4257  				}
  4258  				lpr.Type = &typeVar
  4259  			}
  4260  		case "location":
  4261  			if v != nil {
  4262  				var location string
  4263  				err = json.Unmarshal(*v, &location)
  4264  				if err != nil {
  4265  					return err
  4266  				}
  4267  				lpr.Location = &location
  4268  			}
  4269  		case "tags":
  4270  			if v != nil {
  4271  				var tags map[string]*string
  4272  				err = json.Unmarshal(*v, &tags)
  4273  				if err != nil {
  4274  					return err
  4275  				}
  4276  				lpr.Tags = tags
  4277  			}
  4278  		case "kind":
  4279  			if v != nil {
  4280  				var kind string
  4281  				err = json.Unmarshal(*v, &kind)
  4282  				if err != nil {
  4283  					return err
  4284  				}
  4285  				lpr.Kind = &kind
  4286  			}
  4287  		case "etag":
  4288  			if v != nil {
  4289  				var etag string
  4290  				err = json.Unmarshal(*v, &etag)
  4291  				if err != nil {
  4292  					return err
  4293  				}
  4294  				lpr.Etag = &etag
  4295  			}
  4296  		}
  4297  	}
  4298  
  4299  	return nil
  4300  }
  4301  
  4302  // LogProfileResourcePatch the log profile resource for patch operations.
  4303  type LogProfileResourcePatch struct {
  4304  	// Tags - Resource tags
  4305  	Tags map[string]*string `json:"tags"`
  4306  	// LogProfileProperties - The log profile properties for an update operation.
  4307  	*LogProfileProperties `json:"properties,omitempty"`
  4308  }
  4309  
  4310  // MarshalJSON is the custom marshaler for LogProfileResourcePatch.
  4311  func (lprp LogProfileResourcePatch) MarshalJSON() ([]byte, error) {
  4312  	objectMap := make(map[string]interface{})
  4313  	if lprp.Tags != nil {
  4314  		objectMap["tags"] = lprp.Tags
  4315  	}
  4316  	if lprp.LogProfileProperties != nil {
  4317  		objectMap["properties"] = lprp.LogProfileProperties
  4318  	}
  4319  	return json.Marshal(objectMap)
  4320  }
  4321  
  4322  // UnmarshalJSON is the custom unmarshaler for LogProfileResourcePatch struct.
  4323  func (lprp *LogProfileResourcePatch) UnmarshalJSON(body []byte) error {
  4324  	var m map[string]*json.RawMessage
  4325  	err := json.Unmarshal(body, &m)
  4326  	if err != nil {
  4327  		return err
  4328  	}
  4329  	for k, v := range m {
  4330  		switch k {
  4331  		case "tags":
  4332  			if v != nil {
  4333  				var tags map[string]*string
  4334  				err = json.Unmarshal(*v, &tags)
  4335  				if err != nil {
  4336  					return err
  4337  				}
  4338  				lprp.Tags = tags
  4339  			}
  4340  		case "properties":
  4341  			if v != nil {
  4342  				var logProfileProperties LogProfileProperties
  4343  				err = json.Unmarshal(*v, &logProfileProperties)
  4344  				if err != nil {
  4345  					return err
  4346  				}
  4347  				lprp.LogProfileProperties = &logProfileProperties
  4348  			}
  4349  		}
  4350  	}
  4351  
  4352  	return nil
  4353  }
  4354  
  4355  // LogSearchRule log Search Rule Definition
  4356  type LogSearchRule struct {
  4357  	// CreatedWithAPIVersion - READ-ONLY; The api-version used when creating this alert rule
  4358  	CreatedWithAPIVersion *string `json:"createdWithApiVersion,omitempty"`
  4359  	// IsLegacyLogAnalyticsRule - READ-ONLY; True if alert rule is legacy Log Analytic rule
  4360  	IsLegacyLogAnalyticsRule *bool `json:"isLegacyLogAnalyticsRule,omitempty"`
  4361  	// Description - The description of the Log Search rule.
  4362  	Description *string `json:"description,omitempty"`
  4363  	// DisplayName - The display name of the alert rule
  4364  	DisplayName *string `json:"displayName,omitempty"`
  4365  	// AutoMitigate - The flag that indicates whether the alert should be automatically resolved or not. The default is false.
  4366  	AutoMitigate *bool `json:"autoMitigate,omitempty"`
  4367  	// Enabled - The flag which indicates whether the Log Search rule is enabled. Value should be true or false. Possible values include: 'EnabledTrue', 'EnabledFalse'
  4368  	Enabled Enabled `json:"enabled,omitempty"`
  4369  	// LastUpdatedTime - READ-ONLY; Last time the rule was updated in IS08601 format.
  4370  	LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
  4371  	// ProvisioningState - READ-ONLY; Provisioning state of the scheduled query rule. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateDeploying', 'ProvisioningStateCanceled', 'ProvisioningStateFailed'
  4372  	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
  4373  	// Source - Data Source against which rule will Query Data
  4374  	Source *Source `json:"source,omitempty"`
  4375  	// Schedule - Schedule (Frequency, Time Window) for rule. Required for action type - AlertingAction
  4376  	Schedule *Schedule `json:"schedule,omitempty"`
  4377  	// Action - Action needs to be taken on rule execution.
  4378  	Action BasicAction `json:"action,omitempty"`
  4379  }
  4380  
  4381  // MarshalJSON is the custom marshaler for LogSearchRule.
  4382  func (lsr LogSearchRule) MarshalJSON() ([]byte, error) {
  4383  	objectMap := make(map[string]interface{})
  4384  	if lsr.Description != nil {
  4385  		objectMap["description"] = lsr.Description
  4386  	}
  4387  	if lsr.DisplayName != nil {
  4388  		objectMap["displayName"] = lsr.DisplayName
  4389  	}
  4390  	if lsr.AutoMitigate != nil {
  4391  		objectMap["autoMitigate"] = lsr.AutoMitigate
  4392  	}
  4393  	if lsr.Enabled != "" {
  4394  		objectMap["enabled"] = lsr.Enabled
  4395  	}
  4396  	if lsr.Source != nil {
  4397  		objectMap["source"] = lsr.Source
  4398  	}
  4399  	if lsr.Schedule != nil {
  4400  		objectMap["schedule"] = lsr.Schedule
  4401  	}
  4402  	objectMap["action"] = lsr.Action
  4403  	return json.Marshal(objectMap)
  4404  }
  4405  
  4406  // UnmarshalJSON is the custom unmarshaler for LogSearchRule struct.
  4407  func (lsr *LogSearchRule) UnmarshalJSON(body []byte) error {
  4408  	var m map[string]*json.RawMessage
  4409  	err := json.Unmarshal(body, &m)
  4410  	if err != nil {
  4411  		return err
  4412  	}
  4413  	for k, v := range m {
  4414  		switch k {
  4415  		case "createdWithApiVersion":
  4416  			if v != nil {
  4417  				var createdWithAPIVersion string
  4418  				err = json.Unmarshal(*v, &createdWithAPIVersion)
  4419  				if err != nil {
  4420  					return err
  4421  				}
  4422  				lsr.CreatedWithAPIVersion = &createdWithAPIVersion
  4423  			}
  4424  		case "isLegacyLogAnalyticsRule":
  4425  			if v != nil {
  4426  				var isLegacyLogAnalyticsRule bool
  4427  				err = json.Unmarshal(*v, &isLegacyLogAnalyticsRule)
  4428  				if err != nil {
  4429  					return err
  4430  				}
  4431  				lsr.IsLegacyLogAnalyticsRule = &isLegacyLogAnalyticsRule
  4432  			}
  4433  		case "description":
  4434  			if v != nil {
  4435  				var description string
  4436  				err = json.Unmarshal(*v, &description)
  4437  				if err != nil {
  4438  					return err
  4439  				}
  4440  				lsr.Description = &description
  4441  			}
  4442  		case "displayName":
  4443  			if v != nil {
  4444  				var displayName string
  4445  				err = json.Unmarshal(*v, &displayName)
  4446  				if err != nil {
  4447  					return err
  4448  				}
  4449  				lsr.DisplayName = &displayName
  4450  			}
  4451  		case "autoMitigate":
  4452  			if v != nil {
  4453  				var autoMitigate bool
  4454  				err = json.Unmarshal(*v, &autoMitigate)
  4455  				if err != nil {
  4456  					return err
  4457  				}
  4458  				lsr.AutoMitigate = &autoMitigate
  4459  			}
  4460  		case "enabled":
  4461  			if v != nil {
  4462  				var enabled Enabled
  4463  				err = json.Unmarshal(*v, &enabled)
  4464  				if err != nil {
  4465  					return err
  4466  				}
  4467  				lsr.Enabled = enabled
  4468  			}
  4469  		case "lastUpdatedTime":
  4470  			if v != nil {
  4471  				var lastUpdatedTime date.Time
  4472  				err = json.Unmarshal(*v, &lastUpdatedTime)
  4473  				if err != nil {
  4474  					return err
  4475  				}
  4476  				lsr.LastUpdatedTime = &lastUpdatedTime
  4477  			}
  4478  		case "provisioningState":
  4479  			if v != nil {
  4480  				var provisioningState ProvisioningState
  4481  				err = json.Unmarshal(*v, &provisioningState)
  4482  				if err != nil {
  4483  					return err
  4484  				}
  4485  				lsr.ProvisioningState = provisioningState
  4486  			}
  4487  		case "source":
  4488  			if v != nil {
  4489  				var source Source
  4490  				err = json.Unmarshal(*v, &source)
  4491  				if err != nil {
  4492  					return err
  4493  				}
  4494  				lsr.Source = &source
  4495  			}
  4496  		case "schedule":
  4497  			if v != nil {
  4498  				var schedule Schedule
  4499  				err = json.Unmarshal(*v, &schedule)
  4500  				if err != nil {
  4501  					return err
  4502  				}
  4503  				lsr.Schedule = &schedule
  4504  			}
  4505  		case "action":
  4506  			if v != nil {
  4507  				action, err := unmarshalBasicAction(*v)
  4508  				if err != nil {
  4509  					return err
  4510  				}
  4511  				lsr.Action = action
  4512  			}
  4513  		}
  4514  	}
  4515  
  4516  	return nil
  4517  }
  4518  
  4519  // LogSearchRulePatch log Search Rule Definition for Patching
  4520  type LogSearchRulePatch struct {
  4521  	// Enabled - The flag which indicates whether the Log Search rule is enabled. Value should be true or false. Possible values include: 'EnabledTrue', 'EnabledFalse'
  4522  	Enabled Enabled `json:"enabled,omitempty"`
  4523  }
  4524  
  4525  // LogSearchRuleResource the Log Search Rule resource.
  4526  type LogSearchRuleResource struct {
  4527  	autorest.Response `json:"-"`
  4528  	// LogSearchRule - The rule properties of the resource.
  4529  	*LogSearchRule `json:"properties,omitempty"`
  4530  	// ID - READ-ONLY; Azure resource Id
  4531  	ID *string `json:"id,omitempty"`
  4532  	// Name - READ-ONLY; Azure resource name
  4533  	Name *string `json:"name,omitempty"`
  4534  	// Type - READ-ONLY; Azure resource type
  4535  	Type *string `json:"type,omitempty"`
  4536  	// Location - Resource location
  4537  	Location *string `json:"location,omitempty"`
  4538  	// Tags - Resource tags
  4539  	Tags map[string]*string `json:"tags"`
  4540  	// Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type.  If supported, the resource provider must validate and persist this value.
  4541  	Kind *string `json:"kind,omitempty"`
  4542  	// Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
  4543  	Etag *string `json:"etag,omitempty"`
  4544  }
  4545  
  4546  // MarshalJSON is the custom marshaler for LogSearchRuleResource.
  4547  func (lsrr LogSearchRuleResource) MarshalJSON() ([]byte, error) {
  4548  	objectMap := make(map[string]interface{})
  4549  	if lsrr.LogSearchRule != nil {
  4550  		objectMap["properties"] = lsrr.LogSearchRule
  4551  	}
  4552  	if lsrr.Location != nil {
  4553  		objectMap["location"] = lsrr.Location
  4554  	}
  4555  	if lsrr.Tags != nil {
  4556  		objectMap["tags"] = lsrr.Tags
  4557  	}
  4558  	return json.Marshal(objectMap)
  4559  }
  4560  
  4561  // UnmarshalJSON is the custom unmarshaler for LogSearchRuleResource struct.
  4562  func (lsrr *LogSearchRuleResource) UnmarshalJSON(body []byte) error {
  4563  	var m map[string]*json.RawMessage
  4564  	err := json.Unmarshal(body, &m)
  4565  	if err != nil {
  4566  		return err
  4567  	}
  4568  	for k, v := range m {
  4569  		switch k {
  4570  		case "properties":
  4571  			if v != nil {
  4572  				var logSearchRule LogSearchRule
  4573  				err = json.Unmarshal(*v, &logSearchRule)
  4574  				if err != nil {
  4575  					return err
  4576  				}
  4577  				lsrr.LogSearchRule = &logSearchRule
  4578  			}
  4579  		case "id":
  4580  			if v != nil {
  4581  				var ID string
  4582  				err = json.Unmarshal(*v, &ID)
  4583  				if err != nil {
  4584  					return err
  4585  				}
  4586  				lsrr.ID = &ID
  4587  			}
  4588  		case "name":
  4589  			if v != nil {
  4590  				var name string
  4591  				err = json.Unmarshal(*v, &name)
  4592  				if err != nil {
  4593  					return err
  4594  				}
  4595  				lsrr.Name = &name
  4596  			}
  4597  		case "type":
  4598  			if v != nil {
  4599  				var typeVar string
  4600  				err = json.Unmarshal(*v, &typeVar)
  4601  				if err != nil {
  4602  					return err
  4603  				}
  4604  				lsrr.Type = &typeVar
  4605  			}
  4606  		case "location":
  4607  			if v != nil {
  4608  				var location string
  4609  				err = json.Unmarshal(*v, &location)
  4610  				if err != nil {
  4611  					return err
  4612  				}
  4613  				lsrr.Location = &location
  4614  			}
  4615  		case "tags":
  4616  			if v != nil {
  4617  				var tags map[string]*string
  4618  				err = json.Unmarshal(*v, &tags)
  4619  				if err != nil {
  4620  					return err
  4621  				}
  4622  				lsrr.Tags = tags
  4623  			}
  4624  		case "kind":
  4625  			if v != nil {
  4626  				var kind string
  4627  				err = json.Unmarshal(*v, &kind)
  4628  				if err != nil {
  4629  					return err
  4630  				}
  4631  				lsrr.Kind = &kind
  4632  			}
  4633  		case "etag":
  4634  			if v != nil {
  4635  				var etag string
  4636  				err = json.Unmarshal(*v, &etag)
  4637  				if err != nil {
  4638  					return err
  4639  				}
  4640  				lsrr.Etag = &etag
  4641  			}
  4642  		}
  4643  	}
  4644  
  4645  	return nil
  4646  }
  4647  
  4648  // LogSearchRuleResourceCollection represents a collection of Log Search rule resources.
  4649  type LogSearchRuleResourceCollection struct {
  4650  	autorest.Response `json:"-"`
  4651  	// Value - The values for the Log Search Rule resources.
  4652  	Value *[]LogSearchRuleResource `json:"value,omitempty"`
  4653  }
  4654  
  4655  // LogSearchRuleResourcePatch the log search rule resource for patch operations.
  4656  type LogSearchRuleResourcePatch struct {
  4657  	// Tags - Resource tags
  4658  	Tags map[string]*string `json:"tags"`
  4659  	// LogSearchRulePatch - The log search rule properties of the resource.
  4660  	*LogSearchRulePatch `json:"properties,omitempty"`
  4661  }
  4662  
  4663  // MarshalJSON is the custom marshaler for LogSearchRuleResourcePatch.
  4664  func (lsrrp LogSearchRuleResourcePatch) MarshalJSON() ([]byte, error) {
  4665  	objectMap := make(map[string]interface{})
  4666  	if lsrrp.Tags != nil {
  4667  		objectMap["tags"] = lsrrp.Tags
  4668  	}
  4669  	if lsrrp.LogSearchRulePatch != nil {
  4670  		objectMap["properties"] = lsrrp.LogSearchRulePatch
  4671  	}
  4672  	return json.Marshal(objectMap)
  4673  }
  4674  
  4675  // UnmarshalJSON is the custom unmarshaler for LogSearchRuleResourcePatch struct.
  4676  func (lsrrp *LogSearchRuleResourcePatch) UnmarshalJSON(body []byte) error {
  4677  	var m map[string]*json.RawMessage
  4678  	err := json.Unmarshal(body, &m)
  4679  	if err != nil {
  4680  		return err
  4681  	}
  4682  	for k, v := range m {
  4683  		switch k {
  4684  		case "tags":
  4685  			if v != nil {
  4686  				var tags map[string]*string
  4687  				err = json.Unmarshal(*v, &tags)
  4688  				if err != nil {
  4689  					return err
  4690  				}
  4691  				lsrrp.Tags = tags
  4692  			}
  4693  		case "properties":
  4694  			if v != nil {
  4695  				var logSearchRulePatch LogSearchRulePatch
  4696  				err = json.Unmarshal(*v, &logSearchRulePatch)
  4697  				if err != nil {
  4698  					return err
  4699  				}
  4700  				lsrrp.LogSearchRulePatch = &logSearchRulePatch
  4701  			}
  4702  		}
  4703  	}
  4704  
  4705  	return nil
  4706  }
  4707  
  4708  // LogSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log.
  4709  type LogSettings struct {
  4710  	// Category - Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
  4711  	Category *string `json:"category,omitempty"`
  4712  	// Enabled - a value indicating whether this log is enabled.
  4713  	Enabled *bool `json:"enabled,omitempty"`
  4714  	// RetentionPolicy - the retention policy for this log.
  4715  	RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
  4716  }
  4717  
  4718  // LogsIngestionEndpointSpec definition of the endpoint used for ingesting logs.
  4719  type LogsIngestionEndpointSpec struct {
  4720  	// Endpoint - READ-ONLY; The endpoint. This property is READ-ONLY.
  4721  	Endpoint *string `json:"endpoint,omitempty"`
  4722  }
  4723  
  4724  // MarshalJSON is the custom marshaler for LogsIngestionEndpointSpec.
  4725  func (lies LogsIngestionEndpointSpec) MarshalJSON() ([]byte, error) {
  4726  	objectMap := make(map[string]interface{})
  4727  	return json.Marshal(objectMap)
  4728  }
  4729  
  4730  // LogToMetricAction specify action need to be taken when rule type is converting log to metric
  4731  type LogToMetricAction struct {
  4732  	// Criteria - Criteria of Metric
  4733  	Criteria *[]Criteria `json:"criteria,omitempty"`
  4734  	// OdataType - Possible values include: 'OdataTypeBasicActionOdataTypeAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction'
  4735  	OdataType OdataTypeBasicAction `json:"odata.type,omitempty"`
  4736  }
  4737  
  4738  // MarshalJSON is the custom marshaler for LogToMetricAction.
  4739  func (ltma LogToMetricAction) MarshalJSON() ([]byte, error) {
  4740  	ltma.OdataType = OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction
  4741  	objectMap := make(map[string]interface{})
  4742  	if ltma.Criteria != nil {
  4743  		objectMap["criteria"] = ltma.Criteria
  4744  	}
  4745  	if ltma.OdataType != "" {
  4746  		objectMap["odata.type"] = ltma.OdataType
  4747  	}
  4748  	return json.Marshal(objectMap)
  4749  }
  4750  
  4751  // AsAlertingAction is the BasicAction implementation for LogToMetricAction.
  4752  func (ltma LogToMetricAction) AsAlertingAction() (*AlertingAction, bool) {
  4753  	return nil, false
  4754  }
  4755  
  4756  // AsLogToMetricAction is the BasicAction implementation for LogToMetricAction.
  4757  func (ltma LogToMetricAction) AsLogToMetricAction() (*LogToMetricAction, bool) {
  4758  	return &ltma, true
  4759  }
  4760  
  4761  // AsAction is the BasicAction implementation for LogToMetricAction.
  4762  func (ltma LogToMetricAction) AsAction() (*Action, bool) {
  4763  	return nil, false
  4764  }
  4765  
  4766  // AsBasicAction is the BasicAction implementation for LogToMetricAction.
  4767  func (ltma LogToMetricAction) AsBasicAction() (BasicAction, bool) {
  4768  	return &ltma, true
  4769  }
  4770  
  4771  // ManagementEventAggregationCondition how the data that is collected should be combined over time.
  4772  type ManagementEventAggregationCondition struct {
  4773  	// Operator - the condition operator. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual'
  4774  	Operator ConditionOperator `json:"operator,omitempty"`
  4775  	// Threshold - The threshold value that activates the alert.
  4776  	Threshold *float64 `json:"threshold,omitempty"`
  4777  	// WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day.
  4778  	WindowSize *string `json:"windowSize,omitempty"`
  4779  }
  4780  
  4781  // ManagementEventRuleCondition a management event rule condition.
  4782  type ManagementEventRuleCondition struct {
  4783  	// Aggregation - How the data that is collected should be combined over time and when the alert is activated. Note that for management event alerts aggregation is optional – if it is not provided then any event will cause the alert to activate.
  4784  	Aggregation *ManagementEventAggregationCondition `json:"aggregation,omitempty"`
  4785  	// DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource.
  4786  	DataSource BasicRuleDataSource `json:"dataSource,omitempty"`
  4787  	// OdataType - Possible values include: 'OdataTypeBasicRuleConditionOdataTypeRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition'
  4788  	OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"`
  4789  }
  4790  
  4791  // MarshalJSON is the custom marshaler for ManagementEventRuleCondition.
  4792  func (merc ManagementEventRuleCondition) MarshalJSON() ([]byte, error) {
  4793  	merc.OdataType = OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition
  4794  	objectMap := make(map[string]interface{})
  4795  	if merc.Aggregation != nil {
  4796  		objectMap["aggregation"] = merc.Aggregation
  4797  	}
  4798  	objectMap["dataSource"] = merc.DataSource
  4799  	if merc.OdataType != "" {
  4800  		objectMap["odata.type"] = merc.OdataType
  4801  	}
  4802  	return json.Marshal(objectMap)
  4803  }
  4804  
  4805  // AsThresholdRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition.
  4806  func (merc ManagementEventRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) {
  4807  	return nil, false
  4808  }
  4809  
  4810  // AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition.
  4811  func (merc ManagementEventRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) {
  4812  	return nil, false
  4813  }
  4814  
  4815  // AsManagementEventRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition.
  4816  func (merc ManagementEventRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) {
  4817  	return &merc, true
  4818  }
  4819  
  4820  // AsRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition.
  4821  func (merc ManagementEventRuleCondition) AsRuleCondition() (*RuleCondition, bool) {
  4822  	return nil, false
  4823  }
  4824  
  4825  // AsBasicRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition.
  4826  func (merc ManagementEventRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) {
  4827  	return &merc, true
  4828  }
  4829  
  4830  // UnmarshalJSON is the custom unmarshaler for ManagementEventRuleCondition struct.
  4831  func (merc *ManagementEventRuleCondition) UnmarshalJSON(body []byte) error {
  4832  	var m map[string]*json.RawMessage
  4833  	err := json.Unmarshal(body, &m)
  4834  	if err != nil {
  4835  		return err
  4836  	}
  4837  	for k, v := range m {
  4838  		switch k {
  4839  		case "aggregation":
  4840  			if v != nil {
  4841  				var aggregation ManagementEventAggregationCondition
  4842  				err = json.Unmarshal(*v, &aggregation)
  4843  				if err != nil {
  4844  					return err
  4845  				}
  4846  				merc.Aggregation = &aggregation
  4847  			}
  4848  		case "dataSource":
  4849  			if v != nil {
  4850  				dataSource, err := unmarshalBasicRuleDataSource(*v)
  4851  				if err != nil {
  4852  					return err
  4853  				}
  4854  				merc.DataSource = dataSource
  4855  			}
  4856  		case "odata.type":
  4857  			if v != nil {
  4858  				var odataType OdataTypeBasicRuleCondition
  4859  				err = json.Unmarshal(*v, &odataType)
  4860  				if err != nil {
  4861  					return err
  4862  				}
  4863  				merc.OdataType = odataType
  4864  			}
  4865  		}
  4866  	}
  4867  
  4868  	return nil
  4869  }
  4870  
  4871  // MetadataValue represents a metric metadata value.
  4872  type MetadataValue struct {
  4873  	// Name - the name of the metadata.
  4874  	Name *LocalizableString `json:"name,omitempty"`
  4875  	// Value - the value of the metadata.
  4876  	Value *string `json:"value,omitempty"`
  4877  }
  4878  
  4879  // Metric the result data of a query.
  4880  type Metric struct {
  4881  	// ID - the metric Id.
  4882  	ID *string `json:"id,omitempty"`
  4883  	// Type - the resource type of the metric resource.
  4884  	Type *string `json:"type,omitempty"`
  4885  	// Name - the name and the display name of the metric, i.e. it is localizable string.
  4886  	Name *LocalizableString `json:"name,omitempty"`
  4887  	// DisplayDescription - Detailed description of this metric.
  4888  	DisplayDescription *string `json:"displayDescription,omitempty"`
  4889  	// ErrorCode - 'Success' or the error details on query failures for this metric.
  4890  	ErrorCode *string `json:"errorCode,omitempty"`
  4891  	// ErrorMessage - Error message encountered querying this specific metric.
  4892  	ErrorMessage *string `json:"errorMessage,omitempty"`
  4893  	// Unit - The unit of the metric. Possible values include: 'MetricUnitCount', 'MetricUnitBytes', 'MetricUnitSeconds', 'MetricUnitCountPerSecond', 'MetricUnitBytesPerSecond', 'MetricUnitPercent', 'MetricUnitMilliSeconds', 'MetricUnitByteSeconds', 'MetricUnitUnspecified', 'MetricUnitCores', 'MetricUnitMilliCores', 'MetricUnitNanoCores', 'MetricUnitBitsPerSecond'
  4894  	Unit MetricUnit `json:"unit,omitempty"`
  4895  	// Timeseries - the time series returned when a data query is performed.
  4896  	Timeseries *[]TimeSeriesElement `json:"timeseries,omitempty"`
  4897  }
  4898  
  4899  // MetricAlertAction an alert action.
  4900  type MetricAlertAction struct {
  4901  	// ActionGroupID - the id of the action group to use.
  4902  	ActionGroupID *string `json:"actionGroupId,omitempty"`
  4903  	// WebHookProperties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
  4904  	WebHookProperties map[string]*string `json:"webHookProperties"`
  4905  }
  4906  
  4907  // MarshalJSON is the custom marshaler for MetricAlertAction.
  4908  func (maa MetricAlertAction) MarshalJSON() ([]byte, error) {
  4909  	objectMap := make(map[string]interface{})
  4910  	if maa.ActionGroupID != nil {
  4911  		objectMap["actionGroupId"] = maa.ActionGroupID
  4912  	}
  4913  	if maa.WebHookProperties != nil {
  4914  		objectMap["webHookProperties"] = maa.WebHookProperties
  4915  	}
  4916  	return json.Marshal(objectMap)
  4917  }
  4918  
  4919  // BasicMetricAlertCriteria the rule criteria that defines the conditions of the alert rule.
  4920  type BasicMetricAlertCriteria interface {
  4921  	AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool)
  4922  	AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool)
  4923  	AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool)
  4924  	AsMetricAlertCriteria() (*MetricAlertCriteria, bool)
  4925  }
  4926  
  4927  // MetricAlertCriteria the rule criteria that defines the conditions of the alert rule.
  4928  type MetricAlertCriteria struct {
  4929  	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
  4930  	AdditionalProperties map[string]interface{} `json:""`
  4931  	// OdataType - Possible values include: 'OdataTypeBasicMetricAlertCriteriaOdataTypeMetricAlertCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria'
  4932  	OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"`
  4933  }
  4934  
  4935  func unmarshalBasicMetricAlertCriteria(body []byte) (BasicMetricAlertCriteria, error) {
  4936  	var m map[string]interface{}
  4937  	err := json.Unmarshal(body, &m)
  4938  	if err != nil {
  4939  		return nil, err
  4940  	}
  4941  
  4942  	switch m["odata.type"] {
  4943  	case string(OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria):
  4944  		var masrmmc MetricAlertSingleResourceMultipleMetricCriteria
  4945  		err := json.Unmarshal(body, &masrmmc)
  4946  		return masrmmc, err
  4947  	case string(OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria):
  4948  		var wlac WebtestLocationAvailabilityCriteria
  4949  		err := json.Unmarshal(body, &wlac)
  4950  		return wlac, err
  4951  	case string(OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria):
  4952  		var mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria
  4953  		err := json.Unmarshal(body, &mamrmmc)
  4954  		return mamrmmc, err
  4955  	default:
  4956  		var mac MetricAlertCriteria
  4957  		err := json.Unmarshal(body, &mac)
  4958  		return mac, err
  4959  	}
  4960  }
  4961  func unmarshalBasicMetricAlertCriteriaArray(body []byte) ([]BasicMetricAlertCriteria, error) {
  4962  	var rawMessages []*json.RawMessage
  4963  	err := json.Unmarshal(body, &rawMessages)
  4964  	if err != nil {
  4965  		return nil, err
  4966  	}
  4967  
  4968  	macArray := make([]BasicMetricAlertCriteria, len(rawMessages))
  4969  
  4970  	for index, rawMessage := range rawMessages {
  4971  		mac, err := unmarshalBasicMetricAlertCriteria(*rawMessage)
  4972  		if err != nil {
  4973  			return nil, err
  4974  		}
  4975  		macArray[index] = mac
  4976  	}
  4977  	return macArray, nil
  4978  }
  4979  
  4980  // MarshalJSON is the custom marshaler for MetricAlertCriteria.
  4981  func (mac MetricAlertCriteria) MarshalJSON() ([]byte, error) {
  4982  	mac.OdataType = OdataTypeBasicMetricAlertCriteriaOdataTypeMetricAlertCriteria
  4983  	objectMap := make(map[string]interface{})
  4984  	if mac.OdataType != "" {
  4985  		objectMap["odata.type"] = mac.OdataType
  4986  	}
  4987  	for k, v := range mac.AdditionalProperties {
  4988  		objectMap[k] = v
  4989  	}
  4990  	return json.Marshal(objectMap)
  4991  }
  4992  
  4993  // AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
  4994  func (mac MetricAlertCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) {
  4995  	return nil, false
  4996  }
  4997  
  4998  // AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
  4999  func (mac MetricAlertCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) {
  5000  	return nil, false
  5001  }
  5002  
  5003  // AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
  5004  func (mac MetricAlertCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) {
  5005  	return nil, false
  5006  }
  5007  
  5008  // AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
  5009  func (mac MetricAlertCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) {
  5010  	return &mac, true
  5011  }
  5012  
  5013  // AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
  5014  func (mac MetricAlertCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) {
  5015  	return &mac, true
  5016  }
  5017  
  5018  // UnmarshalJSON is the custom unmarshaler for MetricAlertCriteria struct.
  5019  func (mac *MetricAlertCriteria) UnmarshalJSON(body []byte) error {
  5020  	var m map[string]*json.RawMessage
  5021  	err := json.Unmarshal(body, &m)
  5022  	if err != nil {
  5023  		return err
  5024  	}
  5025  	for k, v := range m {
  5026  		switch k {
  5027  		default:
  5028  			if v != nil {
  5029  				var additionalProperties interface{}
  5030  				err = json.Unmarshal(*v, &additionalProperties)
  5031  				if err != nil {
  5032  					return err
  5033  				}
  5034  				if mac.AdditionalProperties == nil {
  5035  					mac.AdditionalProperties = make(map[string]interface{})
  5036  				}
  5037  				mac.AdditionalProperties[k] = additionalProperties
  5038  			}
  5039  		case "odata.type":
  5040  			if v != nil {
  5041  				var odataType OdataTypeBasicMetricAlertCriteria
  5042  				err = json.Unmarshal(*v, &odataType)
  5043  				if err != nil {
  5044  					return err
  5045  				}
  5046  				mac.OdataType = odataType
  5047  			}
  5048  		}
  5049  	}
  5050  
  5051  	return nil
  5052  }
  5053  
  5054  // MetricAlertMultipleResourceMultipleMetricCriteria specifies the metric alert criteria for multiple
  5055  // resource that has multiple metric criteria.
  5056  type MetricAlertMultipleResourceMultipleMetricCriteria struct {
  5057  	// AllOf - the list of multiple metric criteria for this 'all of' operation.
  5058  	AllOf *[]BasicMultiMetricCriteria `json:"allOf,omitempty"`
  5059  	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
  5060  	AdditionalProperties map[string]interface{} `json:""`
  5061  	// OdataType - Possible values include: 'OdataTypeBasicMetricAlertCriteriaOdataTypeMetricAlertCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria'
  5062  	OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"`
  5063  }
  5064  
  5065  // MarshalJSON is the custom marshaler for MetricAlertMultipleResourceMultipleMetricCriteria.
  5066  func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) {
  5067  	mamrmmc.OdataType = OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria
  5068  	objectMap := make(map[string]interface{})
  5069  	if mamrmmc.AllOf != nil {
  5070  		objectMap["allOf"] = mamrmmc.AllOf
  5071  	}
  5072  	if mamrmmc.OdataType != "" {
  5073  		objectMap["odata.type"] = mamrmmc.OdataType
  5074  	}
  5075  	for k, v := range mamrmmc.AdditionalProperties {
  5076  		objectMap[k] = v
  5077  	}
  5078  	return json.Marshal(objectMap)
  5079  }
  5080  
  5081  // AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
  5082  func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) {
  5083  	return nil, false
  5084  }
  5085  
  5086  // AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
  5087  func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) {
  5088  	return nil, false
  5089  }
  5090  
  5091  // AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
  5092  func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) {
  5093  	return &mamrmmc, true
  5094  }
  5095  
  5096  // AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
  5097  func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) {
  5098  	return nil, false
  5099  }
  5100  
  5101  // AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
  5102  func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) {
  5103  	return &mamrmmc, true
  5104  }
  5105  
  5106  // UnmarshalJSON is the custom unmarshaler for MetricAlertMultipleResourceMultipleMetricCriteria struct.
  5107  func (mamrmmc *MetricAlertMultipleResourceMultipleMetricCriteria) UnmarshalJSON(body []byte) error {
  5108  	var m map[string]*json.RawMessage
  5109  	err := json.Unmarshal(body, &m)
  5110  	if err != nil {
  5111  		return err
  5112  	}
  5113  	for k, v := range m {
  5114  		switch k {
  5115  		case "allOf":
  5116  			if v != nil {
  5117  				allOf, err := unmarshalBasicMultiMetricCriteriaArray(*v)
  5118  				if err != nil {
  5119  					return err
  5120  				}
  5121  				mamrmmc.AllOf = &allOf
  5122  			}
  5123  		default:
  5124  			if v != nil {
  5125  				var additionalProperties interface{}
  5126  				err = json.Unmarshal(*v, &additionalProperties)
  5127  				if err != nil {
  5128  					return err
  5129  				}
  5130  				if mamrmmc.AdditionalProperties == nil {
  5131  					mamrmmc.AdditionalProperties = make(map[string]interface{})
  5132  				}
  5133  				mamrmmc.AdditionalProperties[k] = additionalProperties
  5134  			}
  5135  		case "odata.type":
  5136  			if v != nil {
  5137  				var odataType OdataTypeBasicMetricAlertCriteria
  5138  				err = json.Unmarshal(*v, &odataType)
  5139  				if err != nil {
  5140  					return err
  5141  				}
  5142  				mamrmmc.OdataType = odataType
  5143  			}
  5144  		}
  5145  	}
  5146  
  5147  	return nil
  5148  }
  5149  
  5150  // MetricAlertProperties an alert rule.
  5151  type MetricAlertProperties struct {
  5152  	// Description - the description of the metric alert that will be included in the alert email.
  5153  	Description *string `json:"description,omitempty"`
  5154  	// Severity - Alert severity {0, 1, 2, 3, 4}
  5155  	Severity *int32 `json:"severity,omitempty"`
  5156  	// Enabled - the flag that indicates whether the metric alert is enabled.
  5157  	Enabled *bool `json:"enabled,omitempty"`
  5158  	// Scopes - the list of resource id's that this metric alert is scoped to.
  5159  	Scopes *[]string `json:"scopes,omitempty"`
  5160  	// EvaluationFrequency - how often the metric alert is evaluated represented in ISO 8601 duration format.
  5161  	EvaluationFrequency *string `json:"evaluationFrequency,omitempty"`
  5162  	// WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
  5163  	WindowSize *string `json:"windowSize,omitempty"`
  5164  	// TargetResourceType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
  5165  	TargetResourceType *string `json:"targetResourceType,omitempty"`
  5166  	// TargetResourceRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
  5167  	TargetResourceRegion *string `json:"targetResourceRegion,omitempty"`
  5168  	// Criteria - defines the specific alert criteria information.
  5169  	Criteria BasicMetricAlertCriteria `json:"criteria,omitempty"`
  5170  	// AutoMitigate - the flag that indicates whether the alert should be auto resolved or not. The default is true.
  5171  	AutoMitigate *bool `json:"autoMitigate,omitempty"`
  5172  	// Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
  5173  	Actions *[]MetricAlertAction `json:"actions,omitempty"`
  5174  	// LastUpdatedTime - READ-ONLY; Last time the rule was updated in ISO8601 format.
  5175  	LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
  5176  	// IsMigrated - READ-ONLY; the value indicating whether this alert rule is migrated.
  5177  	IsMigrated *bool `json:"isMigrated,omitempty"`
  5178  }
  5179  
  5180  // MarshalJSON is the custom marshaler for MetricAlertProperties.
  5181  func (mapVar MetricAlertProperties) MarshalJSON() ([]byte, error) {
  5182  	objectMap := make(map[string]interface{})
  5183  	if mapVar.Description != nil {
  5184  		objectMap["description"] = mapVar.Description
  5185  	}
  5186  	if mapVar.Severity != nil {
  5187  		objectMap["severity"] = mapVar.Severity
  5188  	}
  5189  	if mapVar.Enabled != nil {
  5190  		objectMap["enabled"] = mapVar.Enabled
  5191  	}
  5192  	if mapVar.Scopes != nil {
  5193  		objectMap["scopes"] = mapVar.Scopes
  5194  	}
  5195  	if mapVar.EvaluationFrequency != nil {
  5196  		objectMap["evaluationFrequency"] = mapVar.EvaluationFrequency
  5197  	}
  5198  	if mapVar.WindowSize != nil {
  5199  		objectMap["windowSize"] = mapVar.WindowSize
  5200  	}
  5201  	if mapVar.TargetResourceType != nil {
  5202  		objectMap["targetResourceType"] = mapVar.TargetResourceType
  5203  	}
  5204  	if mapVar.TargetResourceRegion != nil {
  5205  		objectMap["targetResourceRegion"] = mapVar.TargetResourceRegion
  5206  	}
  5207  	objectMap["criteria"] = mapVar.Criteria
  5208  	if mapVar.AutoMitigate != nil {
  5209  		objectMap["autoMitigate"] = mapVar.AutoMitigate
  5210  	}
  5211  	if mapVar.Actions != nil {
  5212  		objectMap["actions"] = mapVar.Actions
  5213  	}
  5214  	return json.Marshal(objectMap)
  5215  }
  5216  
  5217  // UnmarshalJSON is the custom unmarshaler for MetricAlertProperties struct.
  5218  func (mapVar *MetricAlertProperties) UnmarshalJSON(body []byte) error {
  5219  	var m map[string]*json.RawMessage
  5220  	err := json.Unmarshal(body, &m)
  5221  	if err != nil {
  5222  		return err
  5223  	}
  5224  	for k, v := range m {
  5225  		switch k {
  5226  		case "description":
  5227  			if v != nil {
  5228  				var description string
  5229  				err = json.Unmarshal(*v, &description)
  5230  				if err != nil {
  5231  					return err
  5232  				}
  5233  				mapVar.Description = &description
  5234  			}
  5235  		case "severity":
  5236  			if v != nil {
  5237  				var severity int32
  5238  				err = json.Unmarshal(*v, &severity)
  5239  				if err != nil {
  5240  					return err
  5241  				}
  5242  				mapVar.Severity = &severity
  5243  			}
  5244  		case "enabled":
  5245  			if v != nil {
  5246  				var enabled bool
  5247  				err = json.Unmarshal(*v, &enabled)
  5248  				if err != nil {
  5249  					return err
  5250  				}
  5251  				mapVar.Enabled = &enabled
  5252  			}
  5253  		case "scopes":
  5254  			if v != nil {
  5255  				var scopes []string
  5256  				err = json.Unmarshal(*v, &scopes)
  5257  				if err != nil {
  5258  					return err
  5259  				}
  5260  				mapVar.Scopes = &scopes
  5261  			}
  5262  		case "evaluationFrequency":
  5263  			if v != nil {
  5264  				var evaluationFrequency string
  5265  				err = json.Unmarshal(*v, &evaluationFrequency)
  5266  				if err != nil {
  5267  					return err
  5268  				}
  5269  				mapVar.EvaluationFrequency = &evaluationFrequency
  5270  			}
  5271  		case "windowSize":
  5272  			if v != nil {
  5273  				var windowSize string
  5274  				err = json.Unmarshal(*v, &windowSize)
  5275  				if err != nil {
  5276  					return err
  5277  				}
  5278  				mapVar.WindowSize = &windowSize
  5279  			}
  5280  		case "targetResourceType":
  5281  			if v != nil {
  5282  				var targetResourceType string
  5283  				err = json.Unmarshal(*v, &targetResourceType)
  5284  				if err != nil {
  5285  					return err
  5286  				}
  5287  				mapVar.TargetResourceType = &targetResourceType
  5288  			}
  5289  		case "targetResourceRegion":
  5290  			if v != nil {
  5291  				var targetResourceRegion string
  5292  				err = json.Unmarshal(*v, &targetResourceRegion)
  5293  				if err != nil {
  5294  					return err
  5295  				}
  5296  				mapVar.TargetResourceRegion = &targetResourceRegion
  5297  			}
  5298  		case "criteria":
  5299  			if v != nil {
  5300  				criteria, err := unmarshalBasicMetricAlertCriteria(*v)
  5301  				if err != nil {
  5302  					return err
  5303  				}
  5304  				mapVar.Criteria = criteria
  5305  			}
  5306  		case "autoMitigate":
  5307  			if v != nil {
  5308  				var autoMitigate bool
  5309  				err = json.Unmarshal(*v, &autoMitigate)
  5310  				if err != nil {
  5311  					return err
  5312  				}
  5313  				mapVar.AutoMitigate = &autoMitigate
  5314  			}
  5315  		case "actions":
  5316  			if v != nil {
  5317  				var actions []MetricAlertAction
  5318  				err = json.Unmarshal(*v, &actions)
  5319  				if err != nil {
  5320  					return err
  5321  				}
  5322  				mapVar.Actions = &actions
  5323  			}
  5324  		case "lastUpdatedTime":
  5325  			if v != nil {
  5326  				var lastUpdatedTime date.Time
  5327  				err = json.Unmarshal(*v, &lastUpdatedTime)
  5328  				if err != nil {
  5329  					return err
  5330  				}
  5331  				mapVar.LastUpdatedTime = &lastUpdatedTime
  5332  			}
  5333  		case "isMigrated":
  5334  			if v != nil {
  5335  				var isMigrated bool
  5336  				err = json.Unmarshal(*v, &isMigrated)
  5337  				if err != nil {
  5338  					return err
  5339  				}
  5340  				mapVar.IsMigrated = &isMigrated
  5341  			}
  5342  		}
  5343  	}
  5344  
  5345  	return nil
  5346  }
  5347  
  5348  // MetricAlertPropertiesPatch an alert rule properties for patch.
  5349  type MetricAlertPropertiesPatch struct {
  5350  	// Description - the description of the metric alert that will be included in the alert email.
  5351  	Description *string `json:"description,omitempty"`
  5352  	// Severity - Alert severity {0, 1, 2, 3, 4}
  5353  	Severity *int32 `json:"severity,omitempty"`
  5354  	// Enabled - the flag that indicates whether the metric alert is enabled.
  5355  	Enabled *bool `json:"enabled,omitempty"`
  5356  	// Scopes - the list of resource id's that this metric alert is scoped to.
  5357  	Scopes *[]string `json:"scopes,omitempty"`
  5358  	// EvaluationFrequency - how often the metric alert is evaluated represented in ISO 8601 duration format.
  5359  	EvaluationFrequency *string `json:"evaluationFrequency,omitempty"`
  5360  	// WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
  5361  	WindowSize *string `json:"windowSize,omitempty"`
  5362  	// TargetResourceType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
  5363  	TargetResourceType *string `json:"targetResourceType,omitempty"`
  5364  	// TargetResourceRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
  5365  	TargetResourceRegion *string `json:"targetResourceRegion,omitempty"`
  5366  	// Criteria - defines the specific alert criteria information.
  5367  	Criteria BasicMetricAlertCriteria `json:"criteria,omitempty"`
  5368  	// AutoMitigate - the flag that indicates whether the alert should be auto resolved or not. The default is true.
  5369  	AutoMitigate *bool `json:"autoMitigate,omitempty"`
  5370  	// Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
  5371  	Actions *[]MetricAlertAction `json:"actions,omitempty"`
  5372  	// LastUpdatedTime - READ-ONLY; Last time the rule was updated in ISO8601 format.
  5373  	LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
  5374  	// IsMigrated - READ-ONLY; the value indicating whether this alert rule is migrated.
  5375  	IsMigrated *bool `json:"isMigrated,omitempty"`
  5376  }
  5377  
  5378  // MarshalJSON is the custom marshaler for MetricAlertPropertiesPatch.
  5379  func (mapp MetricAlertPropertiesPatch) MarshalJSON() ([]byte, error) {
  5380  	objectMap := make(map[string]interface{})
  5381  	if mapp.Description != nil {
  5382  		objectMap["description"] = mapp.Description
  5383  	}
  5384  	if mapp.Severity != nil {
  5385  		objectMap["severity"] = mapp.Severity
  5386  	}
  5387  	if mapp.Enabled != nil {
  5388  		objectMap["enabled"] = mapp.Enabled
  5389  	}
  5390  	if mapp.Scopes != nil {
  5391  		objectMap["scopes"] = mapp.Scopes
  5392  	}
  5393  	if mapp.EvaluationFrequency != nil {
  5394  		objectMap["evaluationFrequency"] = mapp.EvaluationFrequency
  5395  	}
  5396  	if mapp.WindowSize != nil {
  5397  		objectMap["windowSize"] = mapp.WindowSize
  5398  	}
  5399  	if mapp.TargetResourceType != nil {
  5400  		objectMap["targetResourceType"] = mapp.TargetResourceType
  5401  	}
  5402  	if mapp.TargetResourceRegion != nil {
  5403  		objectMap["targetResourceRegion"] = mapp.TargetResourceRegion
  5404  	}
  5405  	objectMap["criteria"] = mapp.Criteria
  5406  	if mapp.AutoMitigate != nil {
  5407  		objectMap["autoMitigate"] = mapp.AutoMitigate
  5408  	}
  5409  	if mapp.Actions != nil {
  5410  		objectMap["actions"] = mapp.Actions
  5411  	}
  5412  	return json.Marshal(objectMap)
  5413  }
  5414  
  5415  // UnmarshalJSON is the custom unmarshaler for MetricAlertPropertiesPatch struct.
  5416  func (mapp *MetricAlertPropertiesPatch) UnmarshalJSON(body []byte) error {
  5417  	var m map[string]*json.RawMessage
  5418  	err := json.Unmarshal(body, &m)
  5419  	if err != nil {
  5420  		return err
  5421  	}
  5422  	for k, v := range m {
  5423  		switch k {
  5424  		case "description":
  5425  			if v != nil {
  5426  				var description string
  5427  				err = json.Unmarshal(*v, &description)
  5428  				if err != nil {
  5429  					return err
  5430  				}
  5431  				mapp.Description = &description
  5432  			}
  5433  		case "severity":
  5434  			if v != nil {
  5435  				var severity int32
  5436  				err = json.Unmarshal(*v, &severity)
  5437  				if err != nil {
  5438  					return err
  5439  				}
  5440  				mapp.Severity = &severity
  5441  			}
  5442  		case "enabled":
  5443  			if v != nil {
  5444  				var enabled bool
  5445  				err = json.Unmarshal(*v, &enabled)
  5446  				if err != nil {
  5447  					return err
  5448  				}
  5449  				mapp.Enabled = &enabled
  5450  			}
  5451  		case "scopes":
  5452  			if v != nil {
  5453  				var scopes []string
  5454  				err = json.Unmarshal(*v, &scopes)
  5455  				if err != nil {
  5456  					return err
  5457  				}
  5458  				mapp.Scopes = &scopes
  5459  			}
  5460  		case "evaluationFrequency":
  5461  			if v != nil {
  5462  				var evaluationFrequency string
  5463  				err = json.Unmarshal(*v, &evaluationFrequency)
  5464  				if err != nil {
  5465  					return err
  5466  				}
  5467  				mapp.EvaluationFrequency = &evaluationFrequency
  5468  			}
  5469  		case "windowSize":
  5470  			if v != nil {
  5471  				var windowSize string
  5472  				err = json.Unmarshal(*v, &windowSize)
  5473  				if err != nil {
  5474  					return err
  5475  				}
  5476  				mapp.WindowSize = &windowSize
  5477  			}
  5478  		case "targetResourceType":
  5479  			if v != nil {
  5480  				var targetResourceType string
  5481  				err = json.Unmarshal(*v, &targetResourceType)
  5482  				if err != nil {
  5483  					return err
  5484  				}
  5485  				mapp.TargetResourceType = &targetResourceType
  5486  			}
  5487  		case "targetResourceRegion":
  5488  			if v != nil {
  5489  				var targetResourceRegion string
  5490  				err = json.Unmarshal(*v, &targetResourceRegion)
  5491  				if err != nil {
  5492  					return err
  5493  				}
  5494  				mapp.TargetResourceRegion = &targetResourceRegion
  5495  			}
  5496  		case "criteria":
  5497  			if v != nil {
  5498  				criteria, err := unmarshalBasicMetricAlertCriteria(*v)
  5499  				if err != nil {
  5500  					return err
  5501  				}
  5502  				mapp.Criteria = criteria
  5503  			}
  5504  		case "autoMitigate":
  5505  			if v != nil {
  5506  				var autoMitigate bool
  5507  				err = json.Unmarshal(*v, &autoMitigate)
  5508  				if err != nil {
  5509  					return err
  5510  				}
  5511  				mapp.AutoMitigate = &autoMitigate
  5512  			}
  5513  		case "actions":
  5514  			if v != nil {
  5515  				var actions []MetricAlertAction
  5516  				err = json.Unmarshal(*v, &actions)
  5517  				if err != nil {
  5518  					return err
  5519  				}
  5520  				mapp.Actions = &actions
  5521  			}
  5522  		case "lastUpdatedTime":
  5523  			if v != nil {
  5524  				var lastUpdatedTime date.Time
  5525  				err = json.Unmarshal(*v, &lastUpdatedTime)
  5526  				if err != nil {
  5527  					return err
  5528  				}
  5529  				mapp.LastUpdatedTime = &lastUpdatedTime
  5530  			}
  5531  		case "isMigrated":
  5532  			if v != nil {
  5533  				var isMigrated bool
  5534  				err = json.Unmarshal(*v, &isMigrated)
  5535  				if err != nil {
  5536  					return err
  5537  				}
  5538  				mapp.IsMigrated = &isMigrated
  5539  			}
  5540  		}
  5541  	}
  5542  
  5543  	return nil
  5544  }
  5545  
  5546  // MetricAlertResource the metric alert resource.
  5547  type MetricAlertResource struct {
  5548  	autorest.Response `json:"-"`
  5549  	// MetricAlertProperties - The alert rule properties of the resource.
  5550  	*MetricAlertProperties `json:"properties,omitempty"`
  5551  	// ID - READ-ONLY; Azure resource Id
  5552  	ID *string `json:"id,omitempty"`
  5553  	// Name - READ-ONLY; Azure resource name
  5554  	Name *string `json:"name,omitempty"`
  5555  	// Type - READ-ONLY; Azure resource type
  5556  	Type *string `json:"type,omitempty"`
  5557  	// Location - Resource location
  5558  	Location *string `json:"location,omitempty"`
  5559  	// Tags - Resource tags
  5560  	Tags map[string]*string `json:"tags"`
  5561  	// Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type.  If supported, the resource provider must validate and persist this value.
  5562  	Kind *string `json:"kind,omitempty"`
  5563  	// Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
  5564  	Etag *string `json:"etag,omitempty"`
  5565  }
  5566  
  5567  // MarshalJSON is the custom marshaler for MetricAlertResource.
  5568  func (mar MetricAlertResource) MarshalJSON() ([]byte, error) {
  5569  	objectMap := make(map[string]interface{})
  5570  	if mar.MetricAlertProperties != nil {
  5571  		objectMap["properties"] = mar.MetricAlertProperties
  5572  	}
  5573  	if mar.Location != nil {
  5574  		objectMap["location"] = mar.Location
  5575  	}
  5576  	if mar.Tags != nil {
  5577  		objectMap["tags"] = mar.Tags
  5578  	}
  5579  	return json.Marshal(objectMap)
  5580  }
  5581  
  5582  // UnmarshalJSON is the custom unmarshaler for MetricAlertResource struct.
  5583  func (mar *MetricAlertResource) UnmarshalJSON(body []byte) error {
  5584  	var m map[string]*json.RawMessage
  5585  	err := json.Unmarshal(body, &m)
  5586  	if err != nil {
  5587  		return err
  5588  	}
  5589  	for k, v := range m {
  5590  		switch k {
  5591  		case "properties":
  5592  			if v != nil {
  5593  				var metricAlertProperties MetricAlertProperties
  5594  				err = json.Unmarshal(*v, &metricAlertProperties)
  5595  				if err != nil {
  5596  					return err
  5597  				}
  5598  				mar.MetricAlertProperties = &metricAlertProperties
  5599  			}
  5600  		case "id":
  5601  			if v != nil {
  5602  				var ID string
  5603  				err = json.Unmarshal(*v, &ID)
  5604  				if err != nil {
  5605  					return err
  5606  				}
  5607  				mar.ID = &ID
  5608  			}
  5609  		case "name":
  5610  			if v != nil {
  5611  				var name string
  5612  				err = json.Unmarshal(*v, &name)
  5613  				if err != nil {
  5614  					return err
  5615  				}
  5616  				mar.Name = &name
  5617  			}
  5618  		case "type":
  5619  			if v != nil {
  5620  				var typeVar string
  5621  				err = json.Unmarshal(*v, &typeVar)
  5622  				if err != nil {
  5623  					return err
  5624  				}
  5625  				mar.Type = &typeVar
  5626  			}
  5627  		case "location":
  5628  			if v != nil {
  5629  				var location string
  5630  				err = json.Unmarshal(*v, &location)
  5631  				if err != nil {
  5632  					return err
  5633  				}
  5634  				mar.Location = &location
  5635  			}
  5636  		case "tags":
  5637  			if v != nil {
  5638  				var tags map[string]*string
  5639  				err = json.Unmarshal(*v, &tags)
  5640  				if err != nil {
  5641  					return err
  5642  				}
  5643  				mar.Tags = tags
  5644  			}
  5645  		case "kind":
  5646  			if v != nil {
  5647  				var kind string
  5648  				err = json.Unmarshal(*v, &kind)
  5649  				if err != nil {
  5650  					return err
  5651  				}
  5652  				mar.Kind = &kind
  5653  			}
  5654  		case "etag":
  5655  			if v != nil {
  5656  				var etag string
  5657  				err = json.Unmarshal(*v, &etag)
  5658  				if err != nil {
  5659  					return err
  5660  				}
  5661  				mar.Etag = &etag
  5662  			}
  5663  		}
  5664  	}
  5665  
  5666  	return nil
  5667  }
  5668  
  5669  // MetricAlertResourceCollection represents a collection of alert rule resources.
  5670  type MetricAlertResourceCollection struct {
  5671  	autorest.Response `json:"-"`
  5672  	// Value - the values for the alert rule resources.
  5673  	Value *[]MetricAlertResource `json:"value,omitempty"`
  5674  }
  5675  
  5676  // MetricAlertResourcePatch the metric alert resource for patch operations.
  5677  type MetricAlertResourcePatch struct {
  5678  	// Tags - Resource tags
  5679  	Tags map[string]*string `json:"tags"`
  5680  	// MetricAlertPropertiesPatch - The alert rule properties of the resource.
  5681  	*MetricAlertPropertiesPatch `json:"properties,omitempty"`
  5682  }
  5683  
  5684  // MarshalJSON is the custom marshaler for MetricAlertResourcePatch.
  5685  func (marp MetricAlertResourcePatch) MarshalJSON() ([]byte, error) {
  5686  	objectMap := make(map[string]interface{})
  5687  	if marp.Tags != nil {
  5688  		objectMap["tags"] = marp.Tags
  5689  	}
  5690  	if marp.MetricAlertPropertiesPatch != nil {
  5691  		objectMap["properties"] = marp.MetricAlertPropertiesPatch
  5692  	}
  5693  	return json.Marshal(objectMap)
  5694  }
  5695  
  5696  // UnmarshalJSON is the custom unmarshaler for MetricAlertResourcePatch struct.
  5697  func (marp *MetricAlertResourcePatch) UnmarshalJSON(body []byte) error {
  5698  	var m map[string]*json.RawMessage
  5699  	err := json.Unmarshal(body, &m)
  5700  	if err != nil {
  5701  		return err
  5702  	}
  5703  	for k, v := range m {
  5704  		switch k {
  5705  		case "tags":
  5706  			if v != nil {
  5707  				var tags map[string]*string
  5708  				err = json.Unmarshal(*v, &tags)
  5709  				if err != nil {
  5710  					return err
  5711  				}
  5712  				marp.Tags = tags
  5713  			}
  5714  		case "properties":
  5715  			if v != nil {
  5716  				var metricAlertPropertiesPatch MetricAlertPropertiesPatch
  5717  				err = json.Unmarshal(*v, &metricAlertPropertiesPatch)
  5718  				if err != nil {
  5719  					return err
  5720  				}
  5721  				marp.MetricAlertPropertiesPatch = &metricAlertPropertiesPatch
  5722  			}
  5723  		}
  5724  	}
  5725  
  5726  	return nil
  5727  }
  5728  
  5729  // MetricAlertSingleResourceMultipleMetricCriteria specifies the metric alert criteria for a single
  5730  // resource that has multiple metric criteria.
  5731  type MetricAlertSingleResourceMultipleMetricCriteria struct {
  5732  	// AllOf - The list of metric criteria for this 'all of' operation.
  5733  	AllOf *[]MetricCriteria `json:"allOf,omitempty"`
  5734  	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
  5735  	AdditionalProperties map[string]interface{} `json:""`
  5736  	// OdataType - Possible values include: 'OdataTypeBasicMetricAlertCriteriaOdataTypeMetricAlertCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria'
  5737  	OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"`
  5738  }
  5739  
  5740  // MarshalJSON is the custom marshaler for MetricAlertSingleResourceMultipleMetricCriteria.
  5741  func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) {
  5742  	masrmmc.OdataType = OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria
  5743  	objectMap := make(map[string]interface{})
  5744  	if masrmmc.AllOf != nil {
  5745  		objectMap["allOf"] = masrmmc.AllOf
  5746  	}
  5747  	if masrmmc.OdataType != "" {
  5748  		objectMap["odata.type"] = masrmmc.OdataType
  5749  	}
  5750  	for k, v := range masrmmc.AdditionalProperties {
  5751  		objectMap[k] = v
  5752  	}
  5753  	return json.Marshal(objectMap)
  5754  }
  5755  
  5756  // AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
  5757  func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) {
  5758  	return &masrmmc, true
  5759  }
  5760  
  5761  // AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
  5762  func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) {
  5763  	return nil, false
  5764  }
  5765  
  5766  // AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
  5767  func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) {
  5768  	return nil, false
  5769  }
  5770  
  5771  // AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
  5772  func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) {
  5773  	return nil, false
  5774  }
  5775  
  5776  // AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
  5777  func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) {
  5778  	return &masrmmc, true
  5779  }
  5780  
  5781  // UnmarshalJSON is the custom unmarshaler for MetricAlertSingleResourceMultipleMetricCriteria struct.
  5782  func (masrmmc *MetricAlertSingleResourceMultipleMetricCriteria) UnmarshalJSON(body []byte) error {
  5783  	var m map[string]*json.RawMessage
  5784  	err := json.Unmarshal(body, &m)
  5785  	if err != nil {
  5786  		return err
  5787  	}
  5788  	for k, v := range m {
  5789  		switch k {
  5790  		case "allOf":
  5791  			if v != nil {
  5792  				var allOf []MetricCriteria
  5793  				err = json.Unmarshal(*v, &allOf)
  5794  				if err != nil {
  5795  					return err
  5796  				}
  5797  				masrmmc.AllOf = &allOf
  5798  			}
  5799  		default:
  5800  			if v != nil {
  5801  				var additionalProperties interface{}
  5802  				err = json.Unmarshal(*v, &additionalProperties)
  5803  				if err != nil {
  5804  					return err
  5805  				}
  5806  				if masrmmc.AdditionalProperties == nil {
  5807  					masrmmc.AdditionalProperties = make(map[string]interface{})
  5808  				}
  5809  				masrmmc.AdditionalProperties[k] = additionalProperties
  5810  			}
  5811  		case "odata.type":
  5812  			if v != nil {
  5813  				var odataType OdataTypeBasicMetricAlertCriteria
  5814  				err = json.Unmarshal(*v, &odataType)
  5815  				if err != nil {
  5816  					return err
  5817  				}
  5818  				masrmmc.OdataType = odataType
  5819  			}
  5820  		}
  5821  	}
  5822  
  5823  	return nil
  5824  }
  5825  
  5826  // MetricAlertStatus an alert status.
  5827  type MetricAlertStatus struct {
  5828  	// Name - The status name.
  5829  	Name *string `json:"name,omitempty"`
  5830  	// ID - The alert rule arm id.
  5831  	ID *string `json:"id,omitempty"`
  5832  	// Type - The extended resource type name.
  5833  	Type *string `json:"type,omitempty"`
  5834  	// Properties - The alert status properties of the metric alert status.
  5835  	Properties *MetricAlertStatusProperties `json:"properties,omitempty"`
  5836  }
  5837  
  5838  // MetricAlertStatusCollection represents a collection of alert rule resources.
  5839  type MetricAlertStatusCollection struct {
  5840  	autorest.Response `json:"-"`
  5841  	// Value - the values for the alert rule resources.
  5842  	Value *[]MetricAlertStatus `json:"value,omitempty"`
  5843  }
  5844  
  5845  // MetricAlertStatusProperties an alert status properties.
  5846  type MetricAlertStatusProperties struct {
  5847  	// Dimensions - An object describing the type of the dimensions.
  5848  	Dimensions map[string]*string `json:"dimensions"`
  5849  	// Status - status value
  5850  	Status *string `json:"status,omitempty"`
  5851  	// Timestamp - UTC time when the status was checked.
  5852  	Timestamp *date.Time `json:"timestamp,omitempty"`
  5853  }
  5854  
  5855  // MarshalJSON is the custom marshaler for MetricAlertStatusProperties.
  5856  func (masp MetricAlertStatusProperties) MarshalJSON() ([]byte, error) {
  5857  	objectMap := make(map[string]interface{})
  5858  	if masp.Dimensions != nil {
  5859  		objectMap["dimensions"] = masp.Dimensions
  5860  	}
  5861  	if masp.Status != nil {
  5862  		objectMap["status"] = masp.Status
  5863  	}
  5864  	if masp.Timestamp != nil {
  5865  		objectMap["timestamp"] = masp.Timestamp
  5866  	}
  5867  	return json.Marshal(objectMap)
  5868  }
  5869  
  5870  // MetricAvailability metric availability specifies the time grain (aggregation interval or frequency) and
  5871  // the retention period for that time grain.
  5872  type MetricAvailability struct {
  5873  	// TimeGrain - the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc.
  5874  	TimeGrain *string `json:"timeGrain,omitempty"`
  5875  	// Retention - the retention period for the metric at the specified timegrain.  Expressed as a duration 'PT1M', 'P1D', etc.
  5876  	Retention *string `json:"retention,omitempty"`
  5877  }
  5878  
  5879  // MetricBaselinesProperties the response to a metric baselines query.
  5880  type MetricBaselinesProperties struct {
  5881  	// Timespan - The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'.  This may be adjusted in the future and returned back from what was originally requested.
  5882  	Timespan *string `json:"timespan,omitempty"`
  5883  	// Interval - The interval (window size) for which the metric data was returned in.  This may be adjusted in the future and returned back from what was originally requested.  This is not present if a metadata request was made.
  5884  	Interval *string `json:"interval,omitempty"`
  5885  	// Namespace - The namespace of the metrics been queried.
  5886  	Namespace *string `json:"namespace,omitempty"`
  5887  	// Baselines - The baseline for each time series that was queried.
  5888  	Baselines *[]TimeSeriesBaseline `json:"baselines,omitempty"`
  5889  }
  5890  
  5891  // MetricBaselinesResponse a list of metric baselines.
  5892  type MetricBaselinesResponse struct {
  5893  	autorest.Response `json:"-"`
  5894  	// Value - The list of metric baselines.
  5895  	Value *[]SingleMetricBaseline `json:"value,omitempty"`
  5896  }
  5897  
  5898  // MetricCriteria criterion to filter metrics.
  5899  type MetricCriteria struct {
  5900  	// Operator - the criteria operator. Possible values include: 'OperatorEquals', 'OperatorGreaterThan', 'OperatorGreaterThanOrEqual', 'OperatorLessThan', 'OperatorLessThanOrEqual'
  5901  	Operator Operator `json:"operator,omitempty"`
  5902  	// Threshold - the criteria threshold value that activates the alert.
  5903  	Threshold *float64 `json:"threshold,omitempty"`
  5904  	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
  5905  	AdditionalProperties map[string]interface{} `json:""`
  5906  	// Name - Name of the criteria.
  5907  	Name *string `json:"name,omitempty"`
  5908  	// MetricName - Name of the metric.
  5909  	MetricName *string `json:"metricName,omitempty"`
  5910  	// MetricNamespace - Namespace of the metric.
  5911  	MetricNamespace *string `json:"metricNamespace,omitempty"`
  5912  	// TimeAggregation - the criteria time aggregation types. Possible values include: 'AggregationTypeEnumAverage', 'AggregationTypeEnumCount', 'AggregationTypeEnumMinimum', 'AggregationTypeEnumMaximum', 'AggregationTypeEnumTotal'
  5913  	TimeAggregation AggregationTypeEnum `json:"timeAggregation,omitempty"`
  5914  	// Dimensions - List of dimension conditions.
  5915  	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
  5916  	// SkipMetricValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
  5917  	SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"`
  5918  	// CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion'
  5919  	CriterionType CriterionType `json:"criterionType,omitempty"`
  5920  }
  5921  
  5922  // MarshalJSON is the custom marshaler for MetricCriteria.
  5923  func (mc MetricCriteria) MarshalJSON() ([]byte, error) {
  5924  	mc.CriterionType = CriterionTypeStaticThresholdCriterion
  5925  	objectMap := make(map[string]interface{})
  5926  	if mc.Operator != "" {
  5927  		objectMap["operator"] = mc.Operator
  5928  	}
  5929  	if mc.Threshold != nil {
  5930  		objectMap["threshold"] = mc.Threshold
  5931  	}
  5932  	if mc.Name != nil {
  5933  		objectMap["name"] = mc.Name
  5934  	}
  5935  	if mc.MetricName != nil {
  5936  		objectMap["metricName"] = mc.MetricName
  5937  	}
  5938  	if mc.MetricNamespace != nil {
  5939  		objectMap["metricNamespace"] = mc.MetricNamespace
  5940  	}
  5941  	if mc.TimeAggregation != "" {
  5942  		objectMap["timeAggregation"] = mc.TimeAggregation
  5943  	}
  5944  	if mc.Dimensions != nil {
  5945  		objectMap["dimensions"] = mc.Dimensions
  5946  	}
  5947  	if mc.SkipMetricValidation != nil {
  5948  		objectMap["skipMetricValidation"] = mc.SkipMetricValidation
  5949  	}
  5950  	if mc.CriterionType != "" {
  5951  		objectMap["criterionType"] = mc.CriterionType
  5952  	}
  5953  	for k, v := range mc.AdditionalProperties {
  5954  		objectMap[k] = v
  5955  	}
  5956  	return json.Marshal(objectMap)
  5957  }
  5958  
  5959  // AsMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria.
  5960  func (mc MetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) {
  5961  	return &mc, true
  5962  }
  5963  
  5964  // AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria.
  5965  func (mc MetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) {
  5966  	return nil, false
  5967  }
  5968  
  5969  // AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria.
  5970  func (mc MetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) {
  5971  	return nil, false
  5972  }
  5973  
  5974  // AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria.
  5975  func (mc MetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) {
  5976  	return &mc, true
  5977  }
  5978  
  5979  // UnmarshalJSON is the custom unmarshaler for MetricCriteria struct.
  5980  func (mc *MetricCriteria) UnmarshalJSON(body []byte) error {
  5981  	var m map[string]*json.RawMessage
  5982  	err := json.Unmarshal(body, &m)
  5983  	if err != nil {
  5984  		return err
  5985  	}
  5986  	for k, v := range m {
  5987  		switch k {
  5988  		case "operator":
  5989  			if v != nil {
  5990  				var operator Operator
  5991  				err = json.Unmarshal(*v, &operator)
  5992  				if err != nil {
  5993  					return err
  5994  				}
  5995  				mc.Operator = operator
  5996  			}
  5997  		case "threshold":
  5998  			if v != nil {
  5999  				var threshold float64
  6000  				err = json.Unmarshal(*v, &threshold)
  6001  				if err != nil {
  6002  					return err
  6003  				}
  6004  				mc.Threshold = &threshold
  6005  			}
  6006  		default:
  6007  			if v != nil {
  6008  				var additionalProperties interface{}
  6009  				err = json.Unmarshal(*v, &additionalProperties)
  6010  				if err != nil {
  6011  					return err
  6012  				}
  6013  				if mc.AdditionalProperties == nil {
  6014  					mc.AdditionalProperties = make(map[string]interface{})
  6015  				}
  6016  				mc.AdditionalProperties[k] = additionalProperties
  6017  			}
  6018  		case "name":
  6019  			if v != nil {
  6020  				var name string
  6021  				err = json.Unmarshal(*v, &name)
  6022  				if err != nil {
  6023  					return err
  6024  				}
  6025  				mc.Name = &name
  6026  			}
  6027  		case "metricName":
  6028  			if v != nil {
  6029  				var metricName string
  6030  				err = json.Unmarshal(*v, &metricName)
  6031  				if err != nil {
  6032  					return err
  6033  				}
  6034  				mc.MetricName = &metricName
  6035  			}
  6036  		case "metricNamespace":
  6037  			if v != nil {
  6038  				var metricNamespace string
  6039  				err = json.Unmarshal(*v, &metricNamespace)
  6040  				if err != nil {
  6041  					return err
  6042  				}
  6043  				mc.MetricNamespace = &metricNamespace
  6044  			}
  6045  		case "timeAggregation":
  6046  			if v != nil {
  6047  				var timeAggregation AggregationTypeEnum
  6048  				err = json.Unmarshal(*v, &timeAggregation)
  6049  				if err != nil {
  6050  					return err
  6051  				}
  6052  				mc.TimeAggregation = timeAggregation
  6053  			}
  6054  		case "dimensions":
  6055  			if v != nil {
  6056  				var dimensions []MetricDimension
  6057  				err = json.Unmarshal(*v, &dimensions)
  6058  				if err != nil {
  6059  					return err
  6060  				}
  6061  				mc.Dimensions = &dimensions
  6062  			}
  6063  		case "skipMetricValidation":
  6064  			if v != nil {
  6065  				var skipMetricValidation bool
  6066  				err = json.Unmarshal(*v, &skipMetricValidation)
  6067  				if err != nil {
  6068  					return err
  6069  				}
  6070  				mc.SkipMetricValidation = &skipMetricValidation
  6071  			}
  6072  		case "criterionType":
  6073  			if v != nil {
  6074  				var criterionType CriterionType
  6075  				err = json.Unmarshal(*v, &criterionType)
  6076  				if err != nil {
  6077  					return err
  6078  				}
  6079  				mc.CriterionType = criterionType
  6080  			}
  6081  		}
  6082  	}
  6083  
  6084  	return nil
  6085  }
  6086  
  6087  // MetricDefinition metric definition class specifies the metadata for a metric.
  6088  type MetricDefinition struct {
  6089  	// IsDimensionRequired - Flag to indicate whether the dimension is required.
  6090  	IsDimensionRequired *bool `json:"isDimensionRequired,omitempty"`
  6091  	// ResourceID - the resource identifier of the resource that emitted the metric.
  6092  	ResourceID *string `json:"resourceId,omitempty"`
  6093  	// Namespace - the namespace the metric belongs to.
  6094  	Namespace *string `json:"namespace,omitempty"`
  6095  	// Name - the name and the display name of the metric, i.e. it is a localizable string.
  6096  	Name *LocalizableString `json:"name,omitempty"`
  6097  	// DisplayDescription - Detailed description of this metric.
  6098  	DisplayDescription *string `json:"displayDescription,omitempty"`
  6099  	// Category - Custom category name for this metric.
  6100  	Category *string `json:"category,omitempty"`
  6101  	// MetricClass - The class of the metric. Possible values include: 'MetricClassAvailability', 'MetricClassTransactions', 'MetricClassErrors', 'MetricClassLatency', 'MetricClassSaturation'
  6102  	MetricClass MetricClass `json:"metricClass,omitempty"`
  6103  	// Unit - The unit of the metric. Possible values include: 'MetricUnitCount', 'MetricUnitBytes', 'MetricUnitSeconds', 'MetricUnitCountPerSecond', 'MetricUnitBytesPerSecond', 'MetricUnitPercent', 'MetricUnitMilliSeconds', 'MetricUnitByteSeconds', 'MetricUnitUnspecified', 'MetricUnitCores', 'MetricUnitMilliCores', 'MetricUnitNanoCores', 'MetricUnitBitsPerSecond'
  6104  	Unit MetricUnit `json:"unit,omitempty"`
  6105  	// PrimaryAggregationType - the primary aggregation type value defining how to use the values for display. Possible values include: 'AggregationTypeNone', 'AggregationTypeAverage', 'AggregationTypeCount', 'AggregationTypeMinimum', 'AggregationTypeMaximum', 'AggregationTypeTotal'
  6106  	PrimaryAggregationType AggregationType `json:"primaryAggregationType,omitempty"`
  6107  	// SupportedAggregationTypes - the collection of what aggregation types are supported.
  6108  	SupportedAggregationTypes *[]AggregationType `json:"supportedAggregationTypes,omitempty"`
  6109  	// MetricAvailabilities - the collection of what aggregation intervals are available to be queried.
  6110  	MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
  6111  	// ID - the resource identifier of the metric definition.
  6112  	ID *string `json:"id,omitempty"`
  6113  	// Dimensions - the name and the display name of the dimension, i.e. it is a localizable string.
  6114  	Dimensions *[]LocalizableString `json:"dimensions,omitempty"`
  6115  }
  6116  
  6117  // MetricDefinitionCollection represents collection of metric definitions.
  6118  type MetricDefinitionCollection struct {
  6119  	autorest.Response `json:"-"`
  6120  	// Value - the values for the metric definitions.
  6121  	Value *[]MetricDefinition `json:"value,omitempty"`
  6122  }
  6123  
  6124  // MetricDimension specifies a metric dimension.
  6125  type MetricDimension struct {
  6126  	// Name - Name of the dimension.
  6127  	Name *string `json:"name,omitempty"`
  6128  	// Operator - the dimension operator. Only 'Include' and 'Exclude' are supported
  6129  	Operator *string `json:"operator,omitempty"`
  6130  	// Values - list of dimension values.
  6131  	Values *[]string `json:"values,omitempty"`
  6132  }
  6133  
  6134  // MetricNamespace metric namespace class specifies the metadata for a metric namespace.
  6135  type MetricNamespace struct {
  6136  	// ID - The ID of the metric namespace.
  6137  	ID *string `json:"id,omitempty"`
  6138  	// Type - The type of the namespace.
  6139  	Type *string `json:"type,omitempty"`
  6140  	// Name - The escaped name of the namespace.
  6141  	Name *string `json:"name,omitempty"`
  6142  	// Classification - Kind of namespace. Possible values include: 'NamespaceClassificationPlatform', 'NamespaceClassificationCustom', 'NamespaceClassificationQos'
  6143  	Classification NamespaceClassification `json:"classification,omitempty"`
  6144  	// Properties - Properties which include the fully qualified namespace name.
  6145  	Properties *MetricNamespaceName `json:"properties,omitempty"`
  6146  }
  6147  
  6148  // MetricNamespaceCollection represents collection of metric namespaces.
  6149  type MetricNamespaceCollection struct {
  6150  	autorest.Response `json:"-"`
  6151  	// Value - The values for the metric namespaces.
  6152  	Value *[]MetricNamespace `json:"value,omitempty"`
  6153  }
  6154  
  6155  // MetricNamespaceName the fully qualified metric namespace name.
  6156  type MetricNamespaceName struct {
  6157  	// MetricNamespaceName - The metric namespace name.
  6158  	MetricNamespaceName *string `json:"metricNamespaceName,omitempty"`
  6159  }
  6160  
  6161  // MetricSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric.
  6162  type MetricSettings struct {
  6163  	// TimeGrain - the timegrain of the metric in ISO8601 format.
  6164  	TimeGrain *string `json:"timeGrain,omitempty"`
  6165  	// Category - Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation.
  6166  	Category *string `json:"category,omitempty"`
  6167  	// Enabled - a value indicating whether this category is enabled.
  6168  	Enabled *bool `json:"enabled,omitempty"`
  6169  	// RetentionPolicy - the retention policy for this category.
  6170  	RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
  6171  }
  6172  
  6173  // MetricSingleDimension the metric dimension name and value.
  6174  type MetricSingleDimension struct {
  6175  	// Name - Name of the dimension.
  6176  	Name *string `json:"name,omitempty"`
  6177  	// Value - Value of the dimension.
  6178  	Value *string `json:"value,omitempty"`
  6179  }
  6180  
  6181  // MetricTrigger the trigger that results in a scaling action.
  6182  type MetricTrigger struct {
  6183  	// MetricName - the name of the metric that defines what the rule monitors.
  6184  	MetricName *string `json:"metricName,omitempty"`
  6185  	// MetricNamespace - the namespace of the metric that defines what the rule monitors.
  6186  	MetricNamespace *string `json:"metricNamespace,omitempty"`
  6187  	// MetricResourceURI - the resource identifier of the resource the rule monitors.
  6188  	MetricResourceURI *string `json:"metricResourceUri,omitempty"`
  6189  	// MetricResourceLocation - the location of the resource the rule monitors.
  6190  	MetricResourceLocation *string `json:"metricResourceLocation,omitempty"`
  6191  	// TimeGrain - the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute.
  6192  	TimeGrain *string `json:"timeGrain,omitempty"`
  6193  	// Statistic - the metric statistic type. How the metrics from multiple instances are combined. Possible values include: 'MetricStatisticTypeAverage', 'MetricStatisticTypeMin', 'MetricStatisticTypeMax', 'MetricStatisticTypeSum', 'MetricStatisticTypeCount'
  6194  	Statistic MetricStatisticType `json:"statistic,omitempty"`
  6195  	// TimeWindow - the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes.
  6196  	TimeWindow *string `json:"timeWindow,omitempty"`
  6197  	// TimeAggregation - time aggregation type. How the data that is collected should be combined over time. The default value is Average. Possible values include: 'TimeAggregationTypeAverage', 'TimeAggregationTypeMinimum', 'TimeAggregationTypeMaximum', 'TimeAggregationTypeTotal', 'TimeAggregationTypeCount', 'TimeAggregationTypeLast'
  6198  	TimeAggregation TimeAggregationType `json:"timeAggregation,omitempty"`
  6199  	// Operator - the operator that is used to compare the metric data and the threshold. Possible values include: 'ComparisonOperationTypeEquals', 'ComparisonOperationTypeNotEquals', 'ComparisonOperationTypeGreaterThan', 'ComparisonOperationTypeGreaterThanOrEqual', 'ComparisonOperationTypeLessThan', 'ComparisonOperationTypeLessThanOrEqual'
  6200  	Operator ComparisonOperationType `json:"operator,omitempty"`
  6201  	// Threshold - the threshold of the metric that triggers the scale action.
  6202  	Threshold *float64 `json:"threshold,omitempty"`
  6203  	// Dimensions - List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}].
  6204  	Dimensions *[]ScaleRuleMetricDimension `json:"dimensions,omitempty"`
  6205  	// DividePerInstance - a value indicating whether metric should divide per instance.
  6206  	DividePerInstance *bool `json:"dividePerInstance,omitempty"`
  6207  }
  6208  
  6209  // MetricValue represents a metric value.
  6210  type MetricValue struct {
  6211  	// TimeStamp - the timestamp for the metric value in ISO 8601 format.
  6212  	TimeStamp *date.Time `json:"timeStamp,omitempty"`
  6213  	// Average - the average value in the time range.
  6214  	Average *float64 `json:"average,omitempty"`
  6215  	// Minimum - the least value in the time range.
  6216  	Minimum *float64 `json:"minimum,omitempty"`
  6217  	// Maximum - the greatest value in the time range.
  6218  	Maximum *float64 `json:"maximum,omitempty"`
  6219  	// Total - the sum of all of the values in the time range.
  6220  	Total *float64 `json:"total,omitempty"`
  6221  	// Count - the number of samples in the time range. Can be used to determine the number of values that contributed to the average value.
  6222  	Count *float64 `json:"count,omitempty"`
  6223  }
  6224  
  6225  // BasicMultiMetricCriteria the types of conditions for a multi resource alert.
  6226  type BasicMultiMetricCriteria interface {
  6227  	AsMetricCriteria() (*MetricCriteria, bool)
  6228  	AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool)
  6229  	AsMultiMetricCriteria() (*MultiMetricCriteria, bool)
  6230  }
  6231  
  6232  // MultiMetricCriteria the types of conditions for a multi resource alert.
  6233  type MultiMetricCriteria struct {
  6234  	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
  6235  	AdditionalProperties map[string]interface{} `json:""`
  6236  	// Name - Name of the criteria.
  6237  	Name *string `json:"name,omitempty"`
  6238  	// MetricName - Name of the metric.
  6239  	MetricName *string `json:"metricName,omitempty"`
  6240  	// MetricNamespace - Namespace of the metric.
  6241  	MetricNamespace *string `json:"metricNamespace,omitempty"`
  6242  	// TimeAggregation - the criteria time aggregation types. Possible values include: 'AggregationTypeEnumAverage', 'AggregationTypeEnumCount', 'AggregationTypeEnumMinimum', 'AggregationTypeEnumMaximum', 'AggregationTypeEnumTotal'
  6243  	TimeAggregation AggregationTypeEnum `json:"timeAggregation,omitempty"`
  6244  	// Dimensions - List of dimension conditions.
  6245  	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
  6246  	// SkipMetricValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
  6247  	SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"`
  6248  	// CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion'
  6249  	CriterionType CriterionType `json:"criterionType,omitempty"`
  6250  }
  6251  
  6252  func unmarshalBasicMultiMetricCriteria(body []byte) (BasicMultiMetricCriteria, error) {
  6253  	var m map[string]interface{}
  6254  	err := json.Unmarshal(body, &m)
  6255  	if err != nil {
  6256  		return nil, err
  6257  	}
  6258  
  6259  	switch m["criterionType"] {
  6260  	case string(CriterionTypeStaticThresholdCriterion):
  6261  		var mc MetricCriteria
  6262  		err := json.Unmarshal(body, &mc)
  6263  		return mc, err
  6264  	case string(CriterionTypeDynamicThresholdCriterion):
  6265  		var dmc DynamicMetricCriteria
  6266  		err := json.Unmarshal(body, &dmc)
  6267  		return dmc, err
  6268  	default:
  6269  		var mmc MultiMetricCriteria
  6270  		err := json.Unmarshal(body, &mmc)
  6271  		return mmc, err
  6272  	}
  6273  }
  6274  func unmarshalBasicMultiMetricCriteriaArray(body []byte) ([]BasicMultiMetricCriteria, error) {
  6275  	var rawMessages []*json.RawMessage
  6276  	err := json.Unmarshal(body, &rawMessages)
  6277  	if err != nil {
  6278  		return nil, err
  6279  	}
  6280  
  6281  	mmcArray := make([]BasicMultiMetricCriteria, len(rawMessages))
  6282  
  6283  	for index, rawMessage := range rawMessages {
  6284  		mmc, err := unmarshalBasicMultiMetricCriteria(*rawMessage)
  6285  		if err != nil {
  6286  			return nil, err
  6287  		}
  6288  		mmcArray[index] = mmc
  6289  	}
  6290  	return mmcArray, nil
  6291  }
  6292  
  6293  // MarshalJSON is the custom marshaler for MultiMetricCriteria.
  6294  func (mmc MultiMetricCriteria) MarshalJSON() ([]byte, error) {
  6295  	mmc.CriterionType = CriterionTypeMultiMetricCriteria
  6296  	objectMap := make(map[string]interface{})
  6297  	if mmc.Name != nil {
  6298  		objectMap["name"] = mmc.Name
  6299  	}
  6300  	if mmc.MetricName != nil {
  6301  		objectMap["metricName"] = mmc.MetricName
  6302  	}
  6303  	if mmc.MetricNamespace != nil {
  6304  		objectMap["metricNamespace"] = mmc.MetricNamespace
  6305  	}
  6306  	if mmc.TimeAggregation != "" {
  6307  		objectMap["timeAggregation"] = mmc.TimeAggregation
  6308  	}
  6309  	if mmc.Dimensions != nil {
  6310  		objectMap["dimensions"] = mmc.Dimensions
  6311  	}
  6312  	if mmc.SkipMetricValidation != nil {
  6313  		objectMap["skipMetricValidation"] = mmc.SkipMetricValidation
  6314  	}
  6315  	if mmc.CriterionType != "" {
  6316  		objectMap["criterionType"] = mmc.CriterionType
  6317  	}
  6318  	for k, v := range mmc.AdditionalProperties {
  6319  		objectMap[k] = v
  6320  	}
  6321  	return json.Marshal(objectMap)
  6322  }
  6323  
  6324  // AsMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria.
  6325  func (mmc MultiMetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) {
  6326  	return nil, false
  6327  }
  6328  
  6329  // AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria.
  6330  func (mmc MultiMetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) {
  6331  	return nil, false
  6332  }
  6333  
  6334  // AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria.
  6335  func (mmc MultiMetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) {
  6336  	return &mmc, true
  6337  }
  6338  
  6339  // AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria.
  6340  func (mmc MultiMetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) {
  6341  	return &mmc, true
  6342  }
  6343  
  6344  // UnmarshalJSON is the custom unmarshaler for MultiMetricCriteria struct.
  6345  func (mmc *MultiMetricCriteria) UnmarshalJSON(body []byte) error {
  6346  	var m map[string]*json.RawMessage
  6347  	err := json.Unmarshal(body, &m)
  6348  	if err != nil {
  6349  		return err
  6350  	}
  6351  	for k, v := range m {
  6352  		switch k {
  6353  		default:
  6354  			if v != nil {
  6355  				var additionalProperties interface{}
  6356  				err = json.Unmarshal(*v, &additionalProperties)
  6357  				if err != nil {
  6358  					return err
  6359  				}
  6360  				if mmc.AdditionalProperties == nil {
  6361  					mmc.AdditionalProperties = make(map[string]interface{})
  6362  				}
  6363  				mmc.AdditionalProperties[k] = additionalProperties
  6364  			}
  6365  		case "name":
  6366  			if v != nil {
  6367  				var name string
  6368  				err = json.Unmarshal(*v, &name)
  6369  				if err != nil {
  6370  					return err
  6371  				}
  6372  				mmc.Name = &name
  6373  			}
  6374  		case "metricName":
  6375  			if v != nil {
  6376  				var metricName string
  6377  				err = json.Unmarshal(*v, &metricName)
  6378  				if err != nil {
  6379  					return err
  6380  				}
  6381  				mmc.MetricName = &metricName
  6382  			}
  6383  		case "metricNamespace":
  6384  			if v != nil {
  6385  				var metricNamespace string
  6386  				err = json.Unmarshal(*v, &metricNamespace)
  6387  				if err != nil {
  6388  					return err
  6389  				}
  6390  				mmc.MetricNamespace = &metricNamespace
  6391  			}
  6392  		case "timeAggregation":
  6393  			if v != nil {
  6394  				var timeAggregation AggregationTypeEnum
  6395  				err = json.Unmarshal(*v, &timeAggregation)
  6396  				if err != nil {
  6397  					return err
  6398  				}
  6399  				mmc.TimeAggregation = timeAggregation
  6400  			}
  6401  		case "dimensions":
  6402  			if v != nil {
  6403  				var dimensions []MetricDimension
  6404  				err = json.Unmarshal(*v, &dimensions)
  6405  				if err != nil {
  6406  					return err
  6407  				}
  6408  				mmc.Dimensions = &dimensions
  6409  			}
  6410  		case "skipMetricValidation":
  6411  			if v != nil {
  6412  				var skipMetricValidation bool
  6413  				err = json.Unmarshal(*v, &skipMetricValidation)
  6414  				if err != nil {
  6415  					return err
  6416  				}
  6417  				mmc.SkipMetricValidation = &skipMetricValidation
  6418  			}
  6419  		case "criterionType":
  6420  			if v != nil {
  6421  				var criterionType CriterionType
  6422  				err = json.Unmarshal(*v, &criterionType)
  6423  				if err != nil {
  6424  					return err
  6425  				}
  6426  				mmc.CriterionType = criterionType
  6427  			}
  6428  		}
  6429  	}
  6430  
  6431  	return nil
  6432  }
  6433  
  6434  // NetworkRuleSet definition of the network rules.
  6435  type NetworkRuleSet struct {
  6436  	// PublicNetworkAccess - The configuration to set whether network access from public internet to the endpoints are allowed. Possible values include: 'KnownPublicNetworkAccessOptionsEnabled', 'KnownPublicNetworkAccessOptionsDisabled'
  6437  	PublicNetworkAccess KnownPublicNetworkAccessOptions `json:"publicNetworkAccess,omitempty"`
  6438  }
  6439  
  6440  // NotificationRequestBody the request body which contain contact detail metadata
  6441  type NotificationRequestBody struct {
  6442  	// AlertType - The name of the supported alert type.
  6443  	AlertType *string `json:"alertType,omitempty"`
  6444  	// EmailReceivers - The list of email receivers that are part of this action group.
  6445  	EmailReceivers *[]EmailReceiver `json:"emailReceivers,omitempty"`
  6446  	// SmsReceivers - The list of SMS receivers that are part of this action group.
  6447  	SmsReceivers *[]SmsReceiver `json:"smsReceivers,omitempty"`
  6448  	// WebhookReceivers - The list of webhook receivers that are part of this action group.
  6449  	WebhookReceivers *[]WebhookReceiver `json:"webhookReceivers,omitempty"`
  6450  	// ItsmReceivers - The list of ITSM receivers that are part of this action group.
  6451  	ItsmReceivers *[]ItsmReceiver `json:"itsmReceivers,omitempty"`
  6452  	// AzureAppPushReceivers - The list of AzureAppPush receivers that are part of this action group.
  6453  	AzureAppPushReceivers *[]AzureAppPushReceiver `json:"azureAppPushReceivers,omitempty"`
  6454  	// AutomationRunbookReceivers - The list of AutomationRunbook receivers that are part of this action group.
  6455  	AutomationRunbookReceivers *[]AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"`
  6456  	// VoiceReceivers - The list of voice receivers that are part of this action group.
  6457  	VoiceReceivers *[]VoiceReceiver `json:"voiceReceivers,omitempty"`
  6458  	// LogicAppReceivers - The list of logic app receivers that are part of this action group.
  6459  	LogicAppReceivers *[]LogicAppReceiver `json:"logicAppReceivers,omitempty"`
  6460  	// AzureFunctionReceivers - The list of azure function receivers that are part of this action group.
  6461  	AzureFunctionReceivers *[]AzureFunctionReceiver `json:"azureFunctionReceivers,omitempty"`
  6462  	// ArmRoleReceivers - The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported.
  6463  	ArmRoleReceivers *[]ArmRoleReceiver `json:"armRoleReceivers,omitempty"`
  6464  	// EventHubReceivers - The list of event hub receivers that are part of this action group.
  6465  	EventHubReceivers *[]EventHubReceiver `json:"eventHubReceivers,omitempty"`
  6466  }
  6467  
  6468  // Operation microsoft Insights API operation definition.
  6469  type Operation struct {
  6470  	// Name - Operation name: {provider}/{resource}/{operation}
  6471  	Name *string `json:"name,omitempty"`
  6472  	// Display - Display metadata associated with the operation.
  6473  	Display *OperationDisplay `json:"display,omitempty"`
  6474  }
  6475  
  6476  // OperationDisplay display metadata associated with the operation.
  6477  type OperationDisplay struct {
  6478  	// Provider - Service provider: Microsoft.Insights
  6479  	Provider *string `json:"provider,omitempty"`
  6480  	// Resource - Resource on which the operation is performed: AlertRules, Autoscale, etc.
  6481  	Resource *string `json:"resource,omitempty"`
  6482  	// Operation - Operation type: Read, write, delete, etc.
  6483  	Operation *string `json:"operation,omitempty"`
  6484  }
  6485  
  6486  // OperationListResult result of the request to list Microsoft.Insights operations. It contains a list of
  6487  // operations and a URL link to get the next set of results.
  6488  type OperationListResult struct {
  6489  	autorest.Response `json:"-"`
  6490  	// Value - List of operations supported by the Microsoft.Insights provider.
  6491  	Value *[]Operation `json:"value,omitempty"`
  6492  	// NextLink - URL to get the next set of operation list results if there are any.
  6493  	NextLink *string `json:"nextLink,omitempty"`
  6494  }
  6495  
  6496  // OperationStatus the status of operation.
  6497  type OperationStatus struct {
  6498  	autorest.Response `json:"-"`
  6499  	// ID - The operation Id.
  6500  	ID *string `json:"id,omitempty"`
  6501  	// Name - The operation name.
  6502  	Name *string `json:"name,omitempty"`
  6503  	// StartTime - Start time of the job in standard ISO8601 format.
  6504  	StartTime *date.Time `json:"startTime,omitempty"`
  6505  	// EndTime - End time of the job in standard ISO8601 format.
  6506  	EndTime *date.Time `json:"endTime,omitempty"`
  6507  	// Status - The status of the operation.
  6508  	Status *string `json:"status,omitempty"`
  6509  	// Error - The error detail of the operation if any.
  6510  	Error *ErrorResponseCommon `json:"error,omitempty"`
  6511  }
  6512  
  6513  // PerfCounterDataSource definition of which performance counters will be collected and how they will be
  6514  // collected by this data collection rule.
  6515  // Collected from both Windows and Linux machines where the counter is present.
  6516  type PerfCounterDataSource struct {
  6517  	// Streams - List of streams that this data source will be sent to.
  6518  	// A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to.
  6519  	Streams *[]KnownPerfCounterDataSourceStreams `json:"streams,omitempty"`
  6520  	// SamplingFrequencyInSeconds - The number of seconds between consecutive counter measurements (samples).
  6521  	SamplingFrequencyInSeconds *int32 `json:"samplingFrequencyInSeconds,omitempty"`
  6522  	// CounterSpecifiers - A list of specifier names of the performance counters you want to collect.
  6523  	// Use a wildcard (*) to collect a counter for all instances.
  6524  	// To get a list of performance counters on Windows, run the command 'typeperf'.
  6525  	CounterSpecifiers *[]string `json:"counterSpecifiers,omitempty"`
  6526  	// Name - A friendly name for the data source.
  6527  	// This name should be unique across all data sources (regardless of type) within the data collection rule.
  6528  	Name *string `json:"name,omitempty"`
  6529  }
  6530  
  6531  // PrivateEndpointConnection a private endpoint connection
  6532  type PrivateEndpointConnection struct {
  6533  	autorest.Response `json:"-"`
  6534  	// PrivateEndpointConnectionProperties - Resource properties.
  6535  	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
  6536  	// ID - READ-ONLY; Azure resource Id
  6537  	ID *string `json:"id,omitempty"`
  6538  	// Name - READ-ONLY; Azure resource name
  6539  	Name *string `json:"name,omitempty"`
  6540  	// Type - READ-ONLY; Azure resource type
  6541  	Type *string `json:"type,omitempty"`
  6542  }
  6543  
  6544  // MarshalJSON is the custom marshaler for PrivateEndpointConnection.
  6545  func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
  6546  	objectMap := make(map[string]interface{})
  6547  	if pec.PrivateEndpointConnectionProperties != nil {
  6548  		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
  6549  	}
  6550  	return json.Marshal(objectMap)
  6551  }
  6552  
  6553  // UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
  6554  func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
  6555  	var m map[string]*json.RawMessage
  6556  	err := json.Unmarshal(body, &m)
  6557  	if err != nil {
  6558  		return err
  6559  	}
  6560  	for k, v := range m {
  6561  		switch k {
  6562  		case "properties":
  6563  			if v != nil {
  6564  				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
  6565  				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
  6566  				if err != nil {
  6567  					return err
  6568  				}
  6569  				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
  6570  			}
  6571  		case "id":
  6572  			if v != nil {
  6573  				var ID string
  6574  				err = json.Unmarshal(*v, &ID)
  6575  				if err != nil {
  6576  					return err
  6577  				}
  6578  				pec.ID = &ID
  6579  			}
  6580  		case "name":
  6581  			if v != nil {
  6582  				var name string
  6583  				err = json.Unmarshal(*v, &name)
  6584  				if err != nil {
  6585  					return err
  6586  				}
  6587  				pec.Name = &name
  6588  			}
  6589  		case "type":
  6590  			if v != nil {
  6591  				var typeVar string
  6592  				err = json.Unmarshal(*v, &typeVar)
  6593  				if err != nil {
  6594  					return err
  6595  				}
  6596  				pec.Type = &typeVar
  6597  			}
  6598  		}
  6599  	}
  6600  
  6601  	return nil
  6602  }
  6603  
  6604  // PrivateEndpointConnectionListResult a list of private endpoint connections.
  6605  type PrivateEndpointConnectionListResult struct {
  6606  	autorest.Response `json:"-"`
  6607  	// Value - READ-ONLY; Array of results.
  6608  	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
  6609  	// NextLink - READ-ONLY; Link to retrieve next page of results.
  6610  	NextLink *string `json:"nextLink,omitempty"`
  6611  }
  6612  
  6613  // MarshalJSON is the custom marshaler for PrivateEndpointConnectionListResult.
  6614  func (peclr PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) {
  6615  	objectMap := make(map[string]interface{})
  6616  	return json.Marshal(objectMap)
  6617  }
  6618  
  6619  // PrivateEndpointConnectionListResultIterator provides access to a complete listing of
  6620  // PrivateEndpointConnection values.
  6621  type PrivateEndpointConnectionListResultIterator struct {
  6622  	i    int
  6623  	page PrivateEndpointConnectionListResultPage
  6624  }
  6625  
  6626  // NextWithContext advances to the next value.  If there was an error making
  6627  // the request the iterator does not advance and the error is returned.
  6628  func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
  6629  	if tracing.IsEnabled() {
  6630  		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext")
  6631  		defer func() {
  6632  			sc := -1
  6633  			if iter.Response().Response.Response != nil {
  6634  				sc = iter.Response().Response.Response.StatusCode
  6635  			}
  6636  			tracing.EndSpan(ctx, sc, err)
  6637  		}()
  6638  	}
  6639  	iter.i++
  6640  	if iter.i < len(iter.page.Values()) {
  6641  		return nil
  6642  	}
  6643  	err = iter.page.NextWithContext(ctx)
  6644  	if err != nil {
  6645  		iter.i--
  6646  		return err
  6647  	}
  6648  	iter.i = 0
  6649  	return nil
  6650  }
  6651  
  6652  // Next advances to the next value.  If there was an error making
  6653  // the request the iterator does not advance and the error is returned.
  6654  // Deprecated: Use NextWithContext() instead.
  6655  func (iter *PrivateEndpointConnectionListResultIterator) Next() error {
  6656  	return iter.NextWithContext(context.Background())
  6657  }
  6658  
  6659  // NotDone returns true if the enumeration should be started or is not yet complete.
  6660  func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool {
  6661  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  6662  }
  6663  
  6664  // Response returns the raw server response from the last page request.
  6665  func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult {
  6666  	return iter.page.Response()
  6667  }
  6668  
  6669  // Value returns the current value or a zero-initialized value if the
  6670  // iterator has advanced beyond the end of the collection.
  6671  func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection {
  6672  	if !iter.page.NotDone() {
  6673  		return PrivateEndpointConnection{}
  6674  	}
  6675  	return iter.page.Values()[iter.i]
  6676  }
  6677  
  6678  // Creates a new instance of the PrivateEndpointConnectionListResultIterator type.
  6679  func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator {
  6680  	return PrivateEndpointConnectionListResultIterator{page: page}
  6681  }
  6682  
  6683  // IsEmpty returns true if the ListResult contains no values.
  6684  func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool {
  6685  	return peclr.Value == nil || len(*peclr.Value) == 0
  6686  }
  6687  
  6688  // hasNextLink returns true if the NextLink is not empty.
  6689  func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool {
  6690  	return peclr.NextLink != nil && len(*peclr.NextLink) != 0
  6691  }
  6692  
  6693  // privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results.
  6694  // It returns nil if no more results exist.
  6695  func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
  6696  	if !peclr.hasNextLink() {
  6697  		return nil, nil
  6698  	}
  6699  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  6700  		autorest.AsJSON(),
  6701  		autorest.AsGet(),
  6702  		autorest.WithBaseURL(to.String(peclr.NextLink)))
  6703  }
  6704  
  6705  // PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values.
  6706  type PrivateEndpointConnectionListResultPage struct {
  6707  	fn    func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)
  6708  	peclr PrivateEndpointConnectionListResult
  6709  }
  6710  
  6711  // NextWithContext advances to the next page of values.  If there was an error making
  6712  // the request the page does not advance and the error is returned.
  6713  func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
  6714  	if tracing.IsEnabled() {
  6715  		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext")
  6716  		defer func() {
  6717  			sc := -1
  6718  			if page.Response().Response.Response != nil {
  6719  				sc = page.Response().Response.Response.StatusCode
  6720  			}
  6721  			tracing.EndSpan(ctx, sc, err)
  6722  		}()
  6723  	}
  6724  	for {
  6725  		next, err := page.fn(ctx, page.peclr)
  6726  		if err != nil {
  6727  			return err
  6728  		}
  6729  		page.peclr = next
  6730  		if !next.hasNextLink() || !next.IsEmpty() {
  6731  			break
  6732  		}
  6733  	}
  6734  	return nil
  6735  }
  6736  
  6737  // Next advances to the next page of values.  If there was an error making
  6738  // the request the page does not advance and the error is returned.
  6739  // Deprecated: Use NextWithContext() instead.
  6740  func (page *PrivateEndpointConnectionListResultPage) Next() error {
  6741  	return page.NextWithContext(context.Background())
  6742  }
  6743  
  6744  // NotDone returns true if the page enumeration should be started or is not yet complete.
  6745  func (page PrivateEndpointConnectionListResultPage) NotDone() bool {
  6746  	return !page.peclr.IsEmpty()
  6747  }
  6748  
  6749  // Response returns the raw server response from the last page request.
  6750  func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult {
  6751  	return page.peclr
  6752  }
  6753  
  6754  // Values returns the slice of values for the current page or nil if there are no values.
  6755  func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection {
  6756  	if page.peclr.IsEmpty() {
  6757  		return nil
  6758  	}
  6759  	return *page.peclr.Value
  6760  }
  6761  
  6762  // Creates a new instance of the PrivateEndpointConnectionListResultPage type.
  6763  func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage {
  6764  	return PrivateEndpointConnectionListResultPage{
  6765  		fn:    getNextPage,
  6766  		peclr: cur,
  6767  	}
  6768  }
  6769  
  6770  // PrivateEndpointConnectionProperties properties of a private endpoint connection.
  6771  type PrivateEndpointConnectionProperties struct {
  6772  	// PrivateEndpoint - Private endpoint which the connection belongs to.
  6773  	PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"`
  6774  	// PrivateLinkServiceConnectionState - Connection state of the private endpoint connection.
  6775  	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
  6776  	// ProvisioningState - READ-ONLY; State of the private endpoint connection.
  6777  	ProvisioningState *string `json:"provisioningState,omitempty"`
  6778  }
  6779  
  6780  // MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties.
  6781  func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
  6782  	objectMap := make(map[string]interface{})
  6783  	if pecp.PrivateEndpoint != nil {
  6784  		objectMap["privateEndpoint"] = pecp.PrivateEndpoint
  6785  	}
  6786  	if pecp.PrivateLinkServiceConnectionState != nil {
  6787  		objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
  6788  	}
  6789  	return json.Marshal(objectMap)
  6790  }
  6791  
  6792  // PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
  6793  // of a long-running operation.
  6794  type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
  6795  	azure.FutureAPI
  6796  	// Result returns the result of the asynchronous operation.
  6797  	// If the operation has not completed it will return an error.
  6798  	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
  6799  }
  6800  
  6801  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  6802  func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  6803  	var azFuture azure.Future
  6804  	if err := json.Unmarshal(body, &azFuture); err != nil {
  6805  		return err
  6806  	}
  6807  	future.FutureAPI = &azFuture
  6808  	future.Result = future.result
  6809  	return nil
  6810  }
  6811  
  6812  // result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result.
  6813  func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
  6814  	var done bool
  6815  	done, err = future.DoneWithContext(context.Background(), client)
  6816  	if err != nil {
  6817  		err = autorest.NewErrorWithError(err, "insights.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  6818  		return
  6819  	}
  6820  	if !done {
  6821  		pec.Response.Response = future.Response()
  6822  		err = azure.NewAsyncOpIncompleteError("insights.PrivateEndpointConnectionsCreateOrUpdateFuture")
  6823  		return
  6824  	}
  6825  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  6826  	if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
  6827  		pec, err = client.CreateOrUpdateResponder(pec.Response.Response)
  6828  		if err != nil {
  6829  			err = autorest.NewErrorWithError(err, "insights.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request")
  6830  		}
  6831  	}
  6832  	return
  6833  }
  6834  
  6835  // PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
  6836  // long-running operation.
  6837  type PrivateEndpointConnectionsDeleteFuture struct {
  6838  	azure.FutureAPI
  6839  	// Result returns the result of the asynchronous operation.
  6840  	// If the operation has not completed it will return an error.
  6841  	Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
  6842  }
  6843  
  6844  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  6845  func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
  6846  	var azFuture azure.Future
  6847  	if err := json.Unmarshal(body, &azFuture); err != nil {
  6848  		return err
  6849  	}
  6850  	future.FutureAPI = &azFuture
  6851  	future.Result = future.result
  6852  	return nil
  6853  }
  6854  
  6855  // result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result.
  6856  func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
  6857  	var done bool
  6858  	done, err = future.DoneWithContext(context.Background(), client)
  6859  	if err != nil {
  6860  		err = autorest.NewErrorWithError(err, "insights.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
  6861  		return
  6862  	}
  6863  	if !done {
  6864  		ar.Response = future.Response()
  6865  		err = azure.NewAsyncOpIncompleteError("insights.PrivateEndpointConnectionsDeleteFuture")
  6866  		return
  6867  	}
  6868  	ar.Response = future.Response()
  6869  	return
  6870  }
  6871  
  6872  // PrivateEndpointProperty private endpoint which the connection belongs to.
  6873  type PrivateEndpointProperty struct {
  6874  	// ID - Resource id of the private endpoint.
  6875  	ID *string `json:"id,omitempty"`
  6876  }
  6877  
  6878  // PrivateLinkResource a private link resource
  6879  type PrivateLinkResource struct {
  6880  	autorest.Response `json:"-"`
  6881  	// PrivateLinkResourceProperties - Resource properties.
  6882  	*PrivateLinkResourceProperties `json:"properties,omitempty"`
  6883  	// ID - READ-ONLY; Azure resource Id
  6884  	ID *string `json:"id,omitempty"`
  6885  	// Name - READ-ONLY; Azure resource name
  6886  	Name *string `json:"name,omitempty"`
  6887  	// Type - READ-ONLY; Azure resource type
  6888  	Type *string `json:"type,omitempty"`
  6889  }
  6890  
  6891  // MarshalJSON is the custom marshaler for PrivateLinkResource.
  6892  func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
  6893  	objectMap := make(map[string]interface{})
  6894  	if plr.PrivateLinkResourceProperties != nil {
  6895  		objectMap["properties"] = plr.PrivateLinkResourceProperties
  6896  	}
  6897  	return json.Marshal(objectMap)
  6898  }
  6899  
  6900  // UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
  6901  func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
  6902  	var m map[string]*json.RawMessage
  6903  	err := json.Unmarshal(body, &m)
  6904  	if err != nil {
  6905  		return err
  6906  	}
  6907  	for k, v := range m {
  6908  		switch k {
  6909  		case "properties":
  6910  			if v != nil {
  6911  				var privateLinkResourceProperties PrivateLinkResourceProperties
  6912  				err = json.Unmarshal(*v, &privateLinkResourceProperties)
  6913  				if err != nil {
  6914  					return err
  6915  				}
  6916  				plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
  6917  			}
  6918  		case "id":
  6919  			if v != nil {
  6920  				var ID string
  6921  				err = json.Unmarshal(*v, &ID)
  6922  				if err != nil {
  6923  					return err
  6924  				}
  6925  				plr.ID = &ID
  6926  			}
  6927  		case "name":
  6928  			if v != nil {
  6929  				var name string
  6930  				err = json.Unmarshal(*v, &name)
  6931  				if err != nil {
  6932  					return err
  6933  				}
  6934  				plr.Name = &name
  6935  			}
  6936  		case "type":
  6937  			if v != nil {
  6938  				var typeVar string
  6939  				err = json.Unmarshal(*v, &typeVar)
  6940  				if err != nil {
  6941  					return err
  6942  				}
  6943  				plr.Type = &typeVar
  6944  			}
  6945  		}
  6946  	}
  6947  
  6948  	return nil
  6949  }
  6950  
  6951  // PrivateLinkResourceListResult a list of private link resources
  6952  type PrivateLinkResourceListResult struct {
  6953  	autorest.Response `json:"-"`
  6954  	// Value - READ-ONLY; Array of results.
  6955  	Value *[]PrivateLinkResource `json:"value,omitempty"`
  6956  	// NextLink - READ-ONLY; Link to retrieve next page of results.
  6957  	NextLink *string `json:"nextLink,omitempty"`
  6958  }
  6959  
  6960  // MarshalJSON is the custom marshaler for PrivateLinkResourceListResult.
  6961  func (plrlr PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
  6962  	objectMap := make(map[string]interface{})
  6963  	return json.Marshal(objectMap)
  6964  }
  6965  
  6966  // PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource
  6967  // values.
  6968  type PrivateLinkResourceListResultIterator struct {
  6969  	i    int
  6970  	page PrivateLinkResourceListResultPage
  6971  }
  6972  
  6973  // NextWithContext advances to the next value.  If there was an error making
  6974  // the request the iterator does not advance and the error is returned.
  6975  func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
  6976  	if tracing.IsEnabled() {
  6977  		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext")
  6978  		defer func() {
  6979  			sc := -1
  6980  			if iter.Response().Response.Response != nil {
  6981  				sc = iter.Response().Response.Response.StatusCode
  6982  			}
  6983  			tracing.EndSpan(ctx, sc, err)
  6984  		}()
  6985  	}
  6986  	iter.i++
  6987  	if iter.i < len(iter.page.Values()) {
  6988  		return nil
  6989  	}
  6990  	err = iter.page.NextWithContext(ctx)
  6991  	if err != nil {
  6992  		iter.i--
  6993  		return err
  6994  	}
  6995  	iter.i = 0
  6996  	return nil
  6997  }
  6998  
  6999  // Next advances to the next value.  If there was an error making
  7000  // the request the iterator does not advance and the error is returned.
  7001  // Deprecated: Use NextWithContext() instead.
  7002  func (iter *PrivateLinkResourceListResultIterator) Next() error {
  7003  	return iter.NextWithContext(context.Background())
  7004  }
  7005  
  7006  // NotDone returns true if the enumeration should be started or is not yet complete.
  7007  func (iter PrivateLinkResourceListResultIterator) NotDone() bool {
  7008  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  7009  }
  7010  
  7011  // Response returns the raw server response from the last page request.
  7012  func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult {
  7013  	return iter.page.Response()
  7014  }
  7015  
  7016  // Value returns the current value or a zero-initialized value if the
  7017  // iterator has advanced beyond the end of the collection.
  7018  func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource {
  7019  	if !iter.page.NotDone() {
  7020  		return PrivateLinkResource{}
  7021  	}
  7022  	return iter.page.Values()[iter.i]
  7023  }
  7024  
  7025  // Creates a new instance of the PrivateLinkResourceListResultIterator type.
  7026  func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator {
  7027  	return PrivateLinkResourceListResultIterator{page: page}
  7028  }
  7029  
  7030  // IsEmpty returns true if the ListResult contains no values.
  7031  func (plrlr PrivateLinkResourceListResult) IsEmpty() bool {
  7032  	return plrlr.Value == nil || len(*plrlr.Value) == 0
  7033  }
  7034  
  7035  // hasNextLink returns true if the NextLink is not empty.
  7036  func (plrlr PrivateLinkResourceListResult) hasNextLink() bool {
  7037  	return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0
  7038  }
  7039  
  7040  // privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results.
  7041  // It returns nil if no more results exist.
  7042  func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
  7043  	if !plrlr.hasNextLink() {
  7044  		return nil, nil
  7045  	}
  7046  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  7047  		autorest.AsJSON(),
  7048  		autorest.AsGet(),
  7049  		autorest.WithBaseURL(to.String(plrlr.NextLink)))
  7050  }
  7051  
  7052  // PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values.
  7053  type PrivateLinkResourceListResultPage struct {
  7054  	fn    func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)
  7055  	plrlr PrivateLinkResourceListResult
  7056  }
  7057  
  7058  // NextWithContext advances to the next page of values.  If there was an error making
  7059  // the request the page does not advance and the error is returned.
  7060  func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
  7061  	if tracing.IsEnabled() {
  7062  		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext")
  7063  		defer func() {
  7064  			sc := -1
  7065  			if page.Response().Response.Response != nil {
  7066  				sc = page.Response().Response.Response.StatusCode
  7067  			}
  7068  			tracing.EndSpan(ctx, sc, err)
  7069  		}()
  7070  	}
  7071  	for {
  7072  		next, err := page.fn(ctx, page.plrlr)
  7073  		if err != nil {
  7074  			return err
  7075  		}
  7076  		page.plrlr = next
  7077  		if !next.hasNextLink() || !next.IsEmpty() {
  7078  			break
  7079  		}
  7080  	}
  7081  	return nil
  7082  }
  7083  
  7084  // Next advances to the next page of values.  If there was an error making
  7085  // the request the page does not advance and the error is returned.
  7086  // Deprecated: Use NextWithContext() instead.
  7087  func (page *PrivateLinkResourceListResultPage) Next() error {
  7088  	return page.NextWithContext(context.Background())
  7089  }
  7090  
  7091  // NotDone returns true if the page enumeration should be started or is not yet complete.
  7092  func (page PrivateLinkResourceListResultPage) NotDone() bool {
  7093  	return !page.plrlr.IsEmpty()
  7094  }
  7095  
  7096  // Response returns the raw server response from the last page request.
  7097  func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult {
  7098  	return page.plrlr
  7099  }
  7100  
  7101  // Values returns the slice of values for the current page or nil if there are no values.
  7102  func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource {
  7103  	if page.plrlr.IsEmpty() {
  7104  		return nil
  7105  	}
  7106  	return *page.plrlr.Value
  7107  }
  7108  
  7109  // Creates a new instance of the PrivateLinkResourceListResultPage type.
  7110  func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage {
  7111  	return PrivateLinkResourceListResultPage{
  7112  		fn:    getNextPage,
  7113  		plrlr: cur,
  7114  	}
  7115  }
  7116  
  7117  // PrivateLinkResourceProperties properties of a private link resource.
  7118  type PrivateLinkResourceProperties struct {
  7119  	// GroupID - READ-ONLY; The private link resource group id.
  7120  	GroupID *string `json:"groupId,omitempty"`
  7121  	// RequiredMembers - READ-ONLY; The private link resource required member names.
  7122  	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
  7123  }
  7124  
  7125  // MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
  7126  func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
  7127  	objectMap := make(map[string]interface{})
  7128  	return json.Marshal(objectMap)
  7129  }
  7130  
  7131  // PrivateLinkScopedResourcesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
  7132  // of a long-running operation.
  7133  type PrivateLinkScopedResourcesCreateOrUpdateFuture struct {
  7134  	azure.FutureAPI
  7135  	// Result returns the result of the asynchronous operation.
  7136  	// If the operation has not completed it will return an error.
  7137  	Result func(PrivateLinkScopedResourcesClient) (ScopedResource, error)
  7138  }
  7139  
  7140  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7141  func (future *PrivateLinkScopedResourcesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  7142  	var azFuture azure.Future
  7143  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7144  		return err
  7145  	}
  7146  	future.FutureAPI = &azFuture
  7147  	future.Result = future.result
  7148  	return nil
  7149  }
  7150  
  7151  // result is the default implementation for PrivateLinkScopedResourcesCreateOrUpdateFuture.Result.
  7152  func (future *PrivateLinkScopedResourcesCreateOrUpdateFuture) result(client PrivateLinkScopedResourcesClient) (sr ScopedResource, err error) {
  7153  	var done bool
  7154  	done, err = future.DoneWithContext(context.Background(), client)
  7155  	if err != nil {
  7156  		err = autorest.NewErrorWithError(err, "insights.PrivateLinkScopedResourcesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  7157  		return
  7158  	}
  7159  	if !done {
  7160  		sr.Response.Response = future.Response()
  7161  		err = azure.NewAsyncOpIncompleteError("insights.PrivateLinkScopedResourcesCreateOrUpdateFuture")
  7162  		return
  7163  	}
  7164  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  7165  	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
  7166  		sr, err = client.CreateOrUpdateResponder(sr.Response.Response)
  7167  		if err != nil {
  7168  			err = autorest.NewErrorWithError(err, "insights.PrivateLinkScopedResourcesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
  7169  		}
  7170  	}
  7171  	return
  7172  }
  7173  
  7174  // PrivateLinkScopedResourcesDeleteFuture an abstraction for monitoring and retrieving the results of a
  7175  // long-running operation.
  7176  type PrivateLinkScopedResourcesDeleteFuture struct {
  7177  	azure.FutureAPI
  7178  	// Result returns the result of the asynchronous operation.
  7179  	// If the operation has not completed it will return an error.
  7180  	Result func(PrivateLinkScopedResourcesClient) (autorest.Response, error)
  7181  }
  7182  
  7183  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7184  func (future *PrivateLinkScopedResourcesDeleteFuture) UnmarshalJSON(body []byte) error {
  7185  	var azFuture azure.Future
  7186  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7187  		return err
  7188  	}
  7189  	future.FutureAPI = &azFuture
  7190  	future.Result = future.result
  7191  	return nil
  7192  }
  7193  
  7194  // result is the default implementation for PrivateLinkScopedResourcesDeleteFuture.Result.
  7195  func (future *PrivateLinkScopedResourcesDeleteFuture) result(client PrivateLinkScopedResourcesClient) (ar autorest.Response, err error) {
  7196  	var done bool
  7197  	done, err = future.DoneWithContext(context.Background(), client)
  7198  	if err != nil {
  7199  		err = autorest.NewErrorWithError(err, "insights.PrivateLinkScopedResourcesDeleteFuture", "Result", future.Response(), "Polling failure")
  7200  		return
  7201  	}
  7202  	if !done {
  7203  		ar.Response = future.Response()
  7204  		err = azure.NewAsyncOpIncompleteError("insights.PrivateLinkScopedResourcesDeleteFuture")
  7205  		return
  7206  	}
  7207  	ar.Response = future.Response()
  7208  	return
  7209  }
  7210  
  7211  // PrivateLinkScopesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  7212  // operation.
  7213  type PrivateLinkScopesDeleteFuture struct {
  7214  	azure.FutureAPI
  7215  	// Result returns the result of the asynchronous operation.
  7216  	// If the operation has not completed it will return an error.
  7217  	Result func(PrivateLinkScopesClient) (autorest.Response, error)
  7218  }
  7219  
  7220  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7221  func (future *PrivateLinkScopesDeleteFuture) UnmarshalJSON(body []byte) error {
  7222  	var azFuture azure.Future
  7223  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7224  		return err
  7225  	}
  7226  	future.FutureAPI = &azFuture
  7227  	future.Result = future.result
  7228  	return nil
  7229  }
  7230  
  7231  // result is the default implementation for PrivateLinkScopesDeleteFuture.Result.
  7232  func (future *PrivateLinkScopesDeleteFuture) result(client PrivateLinkScopesClient) (ar autorest.Response, err error) {
  7233  	var done bool
  7234  	done, err = future.DoneWithContext(context.Background(), client)
  7235  	if err != nil {
  7236  		err = autorest.NewErrorWithError(err, "insights.PrivateLinkScopesDeleteFuture", "Result", future.Response(), "Polling failure")
  7237  		return
  7238  	}
  7239  	if !done {
  7240  		ar.Response = future.Response()
  7241  		err = azure.NewAsyncOpIncompleteError("insights.PrivateLinkScopesDeleteFuture")
  7242  		return
  7243  	}
  7244  	ar.Response = future.Response()
  7245  	return
  7246  }
  7247  
  7248  // PrivateLinkScopesResource an azure resource object
  7249  type PrivateLinkScopesResource struct {
  7250  	// ID - READ-ONLY; Azure resource Id
  7251  	ID *string `json:"id,omitempty"`
  7252  	// Name - READ-ONLY; Azure resource name
  7253  	Name *string `json:"name,omitempty"`
  7254  	// Type - READ-ONLY; Azure resource type
  7255  	Type *string `json:"type,omitempty"`
  7256  	// Location - Resource location
  7257  	Location *string `json:"location,omitempty"`
  7258  	// Tags - Resource tags
  7259  	Tags map[string]*string `json:"tags"`
  7260  }
  7261  
  7262  // MarshalJSON is the custom marshaler for PrivateLinkScopesResource.
  7263  func (plsr PrivateLinkScopesResource) MarshalJSON() ([]byte, error) {
  7264  	objectMap := make(map[string]interface{})
  7265  	if plsr.Location != nil {
  7266  		objectMap["location"] = plsr.Location
  7267  	}
  7268  	if plsr.Tags != nil {
  7269  		objectMap["tags"] = plsr.Tags
  7270  	}
  7271  	return json.Marshal(objectMap)
  7272  }
  7273  
  7274  // PrivateLinkServiceConnectionStateProperty state of the private endpoint connection.
  7275  type PrivateLinkServiceConnectionStateProperty struct {
  7276  	// Status - The private link service connection status.
  7277  	Status *string `json:"status,omitempty"`
  7278  	// Description - The private link service connection description.
  7279  	Description *string `json:"description,omitempty"`
  7280  	// ActionsRequired - READ-ONLY; The actions required for private link service connection.
  7281  	ActionsRequired *string `json:"actionsRequired,omitempty"`
  7282  }
  7283  
  7284  // MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty.
  7285  func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
  7286  	objectMap := make(map[string]interface{})
  7287  	if plscsp.Status != nil {
  7288  		objectMap["status"] = plscsp.Status
  7289  	}
  7290  	if plscsp.Description != nil {
  7291  		objectMap["description"] = plscsp.Description
  7292  	}
  7293  	return json.Marshal(objectMap)
  7294  }
  7295  
  7296  // ProxyOnlyResource a proxy only azure resource object
  7297  type ProxyOnlyResource struct {
  7298  	// ID - READ-ONLY; Azure resource Id
  7299  	ID *string `json:"id,omitempty"`
  7300  	// Name - READ-ONLY; Azure resource name
  7301  	Name *string `json:"name,omitempty"`
  7302  	// Type - READ-ONLY; Azure resource type
  7303  	Type *string `json:"type,omitempty"`
  7304  }
  7305  
  7306  // MarshalJSON is the custom marshaler for ProxyOnlyResource.
  7307  func (por ProxyOnlyResource) MarshalJSON() ([]byte, error) {
  7308  	objectMap := make(map[string]interface{})
  7309  	return json.Marshal(objectMap)
  7310  }
  7311  
  7312  // ProxyResource an azure resource object
  7313  type ProxyResource struct {
  7314  	// ID - READ-ONLY; Azure resource Id
  7315  	ID *string `json:"id,omitempty"`
  7316  	// Name - READ-ONLY; Azure resource name
  7317  	Name *string `json:"name,omitempty"`
  7318  	// Type - READ-ONLY; Azure resource type
  7319  	Type *string `json:"type,omitempty"`
  7320  }
  7321  
  7322  // MarshalJSON is the custom marshaler for ProxyResource.
  7323  func (pr ProxyResource) MarshalJSON() ([]byte, error) {
  7324  	objectMap := make(map[string]interface{})
  7325  	return json.Marshal(objectMap)
  7326  }
  7327  
  7328  // Recurrence the repeating times at which this profile begins. This element is not used if the FixedDate
  7329  // element is used.
  7330  type Recurrence struct {
  7331  	// Frequency - the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly. Possible values include: 'RecurrenceFrequencyNone', 'RecurrenceFrequencySecond', 'RecurrenceFrequencyMinute', 'RecurrenceFrequencyHour', 'RecurrenceFrequencyDay', 'RecurrenceFrequencyWeek', 'RecurrenceFrequencyMonth', 'RecurrenceFrequencyYear'
  7332  	Frequency RecurrenceFrequency `json:"frequency,omitempty"`
  7333  	// Schedule - the scheduling constraints for when the profile begins.
  7334  	Schedule *RecurrentSchedule `json:"schedule,omitempty"`
  7335  }
  7336  
  7337  // RecurrentSchedule the scheduling constraints for when the profile begins.
  7338  type RecurrentSchedule struct {
  7339  	// TimeZone - the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time
  7340  	TimeZone *string `json:"timeZone,omitempty"`
  7341  	// Days - the collection of days that the profile takes effect on. Possible values are Sunday through Saturday.
  7342  	Days *[]string `json:"days,omitempty"`
  7343  	// Hours - A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times are not supported).
  7344  	Hours *[]int32 `json:"hours,omitempty"`
  7345  	// Minutes - A collection of minutes at which the profile takes effect at.
  7346  	Minutes *[]int32 `json:"minutes,omitempty"`
  7347  }
  7348  
  7349  // Resource an azure resource object
  7350  type Resource struct {
  7351  	// ID - READ-ONLY; Azure resource Id
  7352  	ID *string `json:"id,omitempty"`
  7353  	// Name - READ-ONLY; Azure resource name
  7354  	Name *string `json:"name,omitempty"`
  7355  	// Type - READ-ONLY; Azure resource type
  7356  	Type *string `json:"type,omitempty"`
  7357  	// Location - Resource location
  7358  	Location *string `json:"location,omitempty"`
  7359  	// Tags - Resource tags
  7360  	Tags map[string]*string `json:"tags"`
  7361  	// Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type.  If supported, the resource provider must validate and persist this value.
  7362  	Kind *string `json:"kind,omitempty"`
  7363  	// Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
  7364  	Etag *string `json:"etag,omitempty"`
  7365  }
  7366  
  7367  // MarshalJSON is the custom marshaler for Resource.
  7368  func (r Resource) MarshalJSON() ([]byte, error) {
  7369  	objectMap := make(map[string]interface{})
  7370  	if r.Location != nil {
  7371  		objectMap["location"] = r.Location
  7372  	}
  7373  	if r.Tags != nil {
  7374  		objectMap["tags"] = r.Tags
  7375  	}
  7376  	return json.Marshal(objectMap)
  7377  }
  7378  
  7379  // ResourceForUpdate definition of ARM tracked top level resource properties for update operation.
  7380  type ResourceForUpdate struct {
  7381  	// Tags - Resource tags.
  7382  	Tags map[string]*string `json:"tags"`
  7383  }
  7384  
  7385  // MarshalJSON is the custom marshaler for ResourceForUpdate.
  7386  func (rfu ResourceForUpdate) MarshalJSON() ([]byte, error) {
  7387  	objectMap := make(map[string]interface{})
  7388  	if rfu.Tags != nil {
  7389  		objectMap["tags"] = rfu.Tags
  7390  	}
  7391  	return json.Marshal(objectMap)
  7392  }
  7393  
  7394  // Response the response to a metrics query.
  7395  type Response struct {
  7396  	autorest.Response `json:"-"`
  7397  	// Cost - The integer value representing the relative cost of the query.
  7398  	Cost *float64 `json:"cost,omitempty"`
  7399  	// Timespan - The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'.  This may be adjusted in the future and returned back from what was originally requested.
  7400  	Timespan *string `json:"timespan,omitempty"`
  7401  	// Interval - The interval (window size) for which the metric data was returned in.  This may be adjusted in the future and returned back from what was originally requested.  This is not present if a metadata request was made.
  7402  	Interval *string `json:"interval,omitempty"`
  7403  	// Namespace - The namespace of the metrics being queried
  7404  	Namespace *string `json:"namespace,omitempty"`
  7405  	// Resourceregion - The region of the resource being queried for metrics.
  7406  	Resourceregion *string `json:"resourceregion,omitempty"`
  7407  	// Value - the value of the collection.
  7408  	Value *[]Metric `json:"value,omitempty"`
  7409  }
  7410  
  7411  // ResponseWithError an error response from the API.
  7412  type ResponseWithError struct {
  7413  	// Error - Error information.
  7414  	Error *Error `json:"error,omitempty"`
  7415  }
  7416  
  7417  // RetentionPolicy specifies the retention policy for the log.
  7418  type RetentionPolicy struct {
  7419  	// Enabled - a value indicating whether the retention policy is enabled.
  7420  	Enabled *bool `json:"enabled,omitempty"`
  7421  	// Days - the number of days for the retention in days. A value of 0 will retain the events indefinitely.
  7422  	Days *int32 `json:"days,omitempty"`
  7423  }
  7424  
  7425  // BasicRuleAction the action that is performed when the alert rule becomes active, and when an alert condition is
  7426  // resolved.
  7427  type BasicRuleAction interface {
  7428  	AsRuleEmailAction() (*RuleEmailAction, bool)
  7429  	AsRuleWebhookAction() (*RuleWebhookAction, bool)
  7430  	AsRuleAction() (*RuleAction, bool)
  7431  }
  7432  
  7433  // RuleAction the action that is performed when the alert rule becomes active, and when an alert condition is
  7434  // resolved.
  7435  type RuleAction struct {
  7436  	// OdataType - Possible values include: 'OdataTypeBasicRuleActionOdataTypeRuleAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction'
  7437  	OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"`
  7438  }
  7439  
  7440  func unmarshalBasicRuleAction(body []byte) (BasicRuleAction, error) {
  7441  	var m map[string]interface{}
  7442  	err := json.Unmarshal(body, &m)
  7443  	if err != nil {
  7444  		return nil, err
  7445  	}
  7446  
  7447  	switch m["odata.type"] {
  7448  	case string(OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction):
  7449  		var rea RuleEmailAction
  7450  		err := json.Unmarshal(body, &rea)
  7451  		return rea, err
  7452  	case string(OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction):
  7453  		var rwa RuleWebhookAction
  7454  		err := json.Unmarshal(body, &rwa)
  7455  		return rwa, err
  7456  	default:
  7457  		var ra RuleAction
  7458  		err := json.Unmarshal(body, &ra)
  7459  		return ra, err
  7460  	}
  7461  }
  7462  func unmarshalBasicRuleActionArray(body []byte) ([]BasicRuleAction, error) {
  7463  	var rawMessages []*json.RawMessage
  7464  	err := json.Unmarshal(body, &rawMessages)
  7465  	if err != nil {
  7466  		return nil, err
  7467  	}
  7468  
  7469  	raArray := make([]BasicRuleAction, len(rawMessages))
  7470  
  7471  	for index, rawMessage := range rawMessages {
  7472  		ra, err := unmarshalBasicRuleAction(*rawMessage)
  7473  		if err != nil {
  7474  			return nil, err
  7475  		}
  7476  		raArray[index] = ra
  7477  	}
  7478  	return raArray, nil
  7479  }
  7480  
  7481  // MarshalJSON is the custom marshaler for RuleAction.
  7482  func (ra RuleAction) MarshalJSON() ([]byte, error) {
  7483  	ra.OdataType = OdataTypeBasicRuleActionOdataTypeRuleAction
  7484  	objectMap := make(map[string]interface{})
  7485  	if ra.OdataType != "" {
  7486  		objectMap["odata.type"] = ra.OdataType
  7487  	}
  7488  	return json.Marshal(objectMap)
  7489  }
  7490  
  7491  // AsRuleEmailAction is the BasicRuleAction implementation for RuleAction.
  7492  func (ra RuleAction) AsRuleEmailAction() (*RuleEmailAction, bool) {
  7493  	return nil, false
  7494  }
  7495  
  7496  // AsRuleWebhookAction is the BasicRuleAction implementation for RuleAction.
  7497  func (ra RuleAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) {
  7498  	return nil, false
  7499  }
  7500  
  7501  // AsRuleAction is the BasicRuleAction implementation for RuleAction.
  7502  func (ra RuleAction) AsRuleAction() (*RuleAction, bool) {
  7503  	return &ra, true
  7504  }
  7505  
  7506  // AsBasicRuleAction is the BasicRuleAction implementation for RuleAction.
  7507  func (ra RuleAction) AsBasicRuleAction() (BasicRuleAction, bool) {
  7508  	return &ra, true
  7509  }
  7510  
  7511  // BasicRuleCondition the condition that results in the alert rule being activated.
  7512  type BasicRuleCondition interface {
  7513  	AsThresholdRuleCondition() (*ThresholdRuleCondition, bool)
  7514  	AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool)
  7515  	AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool)
  7516  	AsRuleCondition() (*RuleCondition, bool)
  7517  }
  7518  
  7519  // RuleCondition the condition that results in the alert rule being activated.
  7520  type RuleCondition struct {
  7521  	// DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource.
  7522  	DataSource BasicRuleDataSource `json:"dataSource,omitempty"`
  7523  	// OdataType - Possible values include: 'OdataTypeBasicRuleConditionOdataTypeRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition'
  7524  	OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"`
  7525  }
  7526  
  7527  func unmarshalBasicRuleCondition(body []byte) (BasicRuleCondition, error) {
  7528  	var m map[string]interface{}
  7529  	err := json.Unmarshal(body, &m)
  7530  	if err != nil {
  7531  		return nil, err
  7532  	}
  7533  
  7534  	switch m["odata.type"] {
  7535  	case string(OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition):
  7536  		var trc ThresholdRuleCondition
  7537  		err := json.Unmarshal(body, &trc)
  7538  		return trc, err
  7539  	case string(OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition):
  7540  		var ltrc LocationThresholdRuleCondition
  7541  		err := json.Unmarshal(body, &ltrc)
  7542  		return ltrc, err
  7543  	case string(OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition):
  7544  		var merc ManagementEventRuleCondition
  7545  		err := json.Unmarshal(body, &merc)
  7546  		return merc, err
  7547  	default:
  7548  		var rc RuleCondition
  7549  		err := json.Unmarshal(body, &rc)
  7550  		return rc, err
  7551  	}
  7552  }
  7553  func unmarshalBasicRuleConditionArray(body []byte) ([]BasicRuleCondition, error) {
  7554  	var rawMessages []*json.RawMessage
  7555  	err := json.Unmarshal(body, &rawMessages)
  7556  	if err != nil {
  7557  		return nil, err
  7558  	}
  7559  
  7560  	rcArray := make([]BasicRuleCondition, len(rawMessages))
  7561  
  7562  	for index, rawMessage := range rawMessages {
  7563  		rc, err := unmarshalBasicRuleCondition(*rawMessage)
  7564  		if err != nil {
  7565  			return nil, err
  7566  		}
  7567  		rcArray[index] = rc
  7568  	}
  7569  	return rcArray, nil
  7570  }
  7571  
  7572  // MarshalJSON is the custom marshaler for RuleCondition.
  7573  func (rc RuleCondition) MarshalJSON() ([]byte, error) {
  7574  	rc.OdataType = OdataTypeBasicRuleConditionOdataTypeRuleCondition
  7575  	objectMap := make(map[string]interface{})
  7576  	objectMap["dataSource"] = rc.DataSource
  7577  	if rc.OdataType != "" {
  7578  		objectMap["odata.type"] = rc.OdataType
  7579  	}
  7580  	return json.Marshal(objectMap)
  7581  }
  7582  
  7583  // AsThresholdRuleCondition is the BasicRuleCondition implementation for RuleCondition.
  7584  func (rc RuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) {
  7585  	return nil, false
  7586  }
  7587  
  7588  // AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for RuleCondition.
  7589  func (rc RuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) {
  7590  	return nil, false
  7591  }
  7592  
  7593  // AsManagementEventRuleCondition is the BasicRuleCondition implementation for RuleCondition.
  7594  func (rc RuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) {
  7595  	return nil, false
  7596  }
  7597  
  7598  // AsRuleCondition is the BasicRuleCondition implementation for RuleCondition.
  7599  func (rc RuleCondition) AsRuleCondition() (*RuleCondition, bool) {
  7600  	return &rc, true
  7601  }
  7602  
  7603  // AsBasicRuleCondition is the BasicRuleCondition implementation for RuleCondition.
  7604  func (rc RuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) {
  7605  	return &rc, true
  7606  }
  7607  
  7608  // UnmarshalJSON is the custom unmarshaler for RuleCondition struct.
  7609  func (rc *RuleCondition) UnmarshalJSON(body []byte) error {
  7610  	var m map[string]*json.RawMessage
  7611  	err := json.Unmarshal(body, &m)
  7612  	if err != nil {
  7613  		return err
  7614  	}
  7615  	for k, v := range m {
  7616  		switch k {
  7617  		case "dataSource":
  7618  			if v != nil {
  7619  				dataSource, err := unmarshalBasicRuleDataSource(*v)
  7620  				if err != nil {
  7621  					return err
  7622  				}
  7623  				rc.DataSource = dataSource
  7624  			}
  7625  		case "odata.type":
  7626  			if v != nil {
  7627  				var odataType OdataTypeBasicRuleCondition
  7628  				err = json.Unmarshal(*v, &odataType)
  7629  				if err != nil {
  7630  					return err
  7631  				}
  7632  				rc.OdataType = odataType
  7633  			}
  7634  		}
  7635  	}
  7636  
  7637  	return nil
  7638  }
  7639  
  7640  // BasicRuleDataSource the resource from which the rule collects its data.
  7641  type BasicRuleDataSource interface {
  7642  	AsRuleMetricDataSource() (*RuleMetricDataSource, bool)
  7643  	AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool)
  7644  	AsRuleDataSource() (*RuleDataSource, bool)
  7645  }
  7646  
  7647  // RuleDataSource the resource from which the rule collects its data.
  7648  type RuleDataSource struct {
  7649  	// ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
  7650  	ResourceURI *string `json:"resourceUri,omitempty"`
  7651  	// LegacyResourceID - the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
  7652  	LegacyResourceID *string `json:"legacyResourceId,omitempty"`
  7653  	// ResourceLocation - the location of the resource.
  7654  	ResourceLocation *string `json:"resourceLocation,omitempty"`
  7655  	// MetricNamespace - the namespace of the metric.
  7656  	MetricNamespace *string `json:"metricNamespace,omitempty"`
  7657  	// OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource'
  7658  	OdataType OdataType `json:"odata.type,omitempty"`
  7659  }
  7660  
  7661  func unmarshalBasicRuleDataSource(body []byte) (BasicRuleDataSource, error) {
  7662  	var m map[string]interface{}
  7663  	err := json.Unmarshal(body, &m)
  7664  	if err != nil {
  7665  		return nil, err
  7666  	}
  7667  
  7668  	switch m["odata.type"] {
  7669  	case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource):
  7670  		var rmds RuleMetricDataSource
  7671  		err := json.Unmarshal(body, &rmds)
  7672  		return rmds, err
  7673  	case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource):
  7674  		var rmeds RuleManagementEventDataSource
  7675  		err := json.Unmarshal(body, &rmeds)
  7676  		return rmeds, err
  7677  	default:
  7678  		var rds RuleDataSource
  7679  		err := json.Unmarshal(body, &rds)
  7680  		return rds, err
  7681  	}
  7682  }
  7683  func unmarshalBasicRuleDataSourceArray(body []byte) ([]BasicRuleDataSource, error) {
  7684  	var rawMessages []*json.RawMessage
  7685  	err := json.Unmarshal(body, &rawMessages)
  7686  	if err != nil {
  7687  		return nil, err
  7688  	}
  7689  
  7690  	rdsArray := make([]BasicRuleDataSource, len(rawMessages))
  7691  
  7692  	for index, rawMessage := range rawMessages {
  7693  		rds, err := unmarshalBasicRuleDataSource(*rawMessage)
  7694  		if err != nil {
  7695  			return nil, err
  7696  		}
  7697  		rdsArray[index] = rds
  7698  	}
  7699  	return rdsArray, nil
  7700  }
  7701  
  7702  // MarshalJSON is the custom marshaler for RuleDataSource.
  7703  func (rds RuleDataSource) MarshalJSON() ([]byte, error) {
  7704  	rds.OdataType = OdataTypeRuleDataSource
  7705  	objectMap := make(map[string]interface{})
  7706  	if rds.ResourceURI != nil {
  7707  		objectMap["resourceUri"] = rds.ResourceURI
  7708  	}
  7709  	if rds.LegacyResourceID != nil {
  7710  		objectMap["legacyResourceId"] = rds.LegacyResourceID
  7711  	}
  7712  	if rds.ResourceLocation != nil {
  7713  		objectMap["resourceLocation"] = rds.ResourceLocation
  7714  	}
  7715  	if rds.MetricNamespace != nil {
  7716  		objectMap["metricNamespace"] = rds.MetricNamespace
  7717  	}
  7718  	if rds.OdataType != "" {
  7719  		objectMap["odata.type"] = rds.OdataType
  7720  	}
  7721  	return json.Marshal(objectMap)
  7722  }
  7723  
  7724  // AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleDataSource.
  7725  func (rds RuleDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) {
  7726  	return nil, false
  7727  }
  7728  
  7729  // AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleDataSource.
  7730  func (rds RuleDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) {
  7731  	return nil, false
  7732  }
  7733  
  7734  // AsRuleDataSource is the BasicRuleDataSource implementation for RuleDataSource.
  7735  func (rds RuleDataSource) AsRuleDataSource() (*RuleDataSource, bool) {
  7736  	return &rds, true
  7737  }
  7738  
  7739  // AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleDataSource.
  7740  func (rds RuleDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) {
  7741  	return &rds, true
  7742  }
  7743  
  7744  // RuleEmailAction specifies the action to send email when the rule condition is evaluated. The
  7745  // discriminator is always RuleEmailAction in this case.
  7746  type RuleEmailAction struct {
  7747  	// SendToServiceOwners - Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated.
  7748  	SendToServiceOwners *bool `json:"sendToServiceOwners,omitempty"`
  7749  	// CustomEmails - the list of administrator's custom email addresses to notify of the activation of the alert.
  7750  	CustomEmails *[]string `json:"customEmails,omitempty"`
  7751  	// OdataType - Possible values include: 'OdataTypeBasicRuleActionOdataTypeRuleAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction'
  7752  	OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"`
  7753  }
  7754  
  7755  // MarshalJSON is the custom marshaler for RuleEmailAction.
  7756  func (rea RuleEmailAction) MarshalJSON() ([]byte, error) {
  7757  	rea.OdataType = OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction
  7758  	objectMap := make(map[string]interface{})
  7759  	if rea.SendToServiceOwners != nil {
  7760  		objectMap["sendToServiceOwners"] = rea.SendToServiceOwners
  7761  	}
  7762  	if rea.CustomEmails != nil {
  7763  		objectMap["customEmails"] = rea.CustomEmails
  7764  	}
  7765  	if rea.OdataType != "" {
  7766  		objectMap["odata.type"] = rea.OdataType
  7767  	}
  7768  	return json.Marshal(objectMap)
  7769  }
  7770  
  7771  // AsRuleEmailAction is the BasicRuleAction implementation for RuleEmailAction.
  7772  func (rea RuleEmailAction) AsRuleEmailAction() (*RuleEmailAction, bool) {
  7773  	return &rea, true
  7774  }
  7775  
  7776  // AsRuleWebhookAction is the BasicRuleAction implementation for RuleEmailAction.
  7777  func (rea RuleEmailAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) {
  7778  	return nil, false
  7779  }
  7780  
  7781  // AsRuleAction is the BasicRuleAction implementation for RuleEmailAction.
  7782  func (rea RuleEmailAction) AsRuleAction() (*RuleAction, bool) {
  7783  	return nil, false
  7784  }
  7785  
  7786  // AsBasicRuleAction is the BasicRuleAction implementation for RuleEmailAction.
  7787  func (rea RuleEmailAction) AsBasicRuleAction() (BasicRuleAction, bool) {
  7788  	return &rea, true
  7789  }
  7790  
  7791  // RuleManagementEventClaimsDataSource the claims for a rule management event data source.
  7792  type RuleManagementEventClaimsDataSource struct {
  7793  	// EmailAddress - the email address.
  7794  	EmailAddress *string `json:"emailAddress,omitempty"`
  7795  }
  7796  
  7797  // RuleManagementEventDataSource a rule management event data source. The discriminator fields is always
  7798  // RuleManagementEventDataSource in this case.
  7799  type RuleManagementEventDataSource struct {
  7800  	// EventName - the event name.
  7801  	EventName *string `json:"eventName,omitempty"`
  7802  	// EventSource - the event source.
  7803  	EventSource *string `json:"eventSource,omitempty"`
  7804  	// Level - the level.
  7805  	Level *string `json:"level,omitempty"`
  7806  	// OperationName - The name of the operation that should be checked for. If no name is provided, any operation will match.
  7807  	OperationName *string `json:"operationName,omitempty"`
  7808  	// ResourceGroupName - the resource group name.
  7809  	ResourceGroupName *string `json:"resourceGroupName,omitempty"`
  7810  	// ResourceProviderName - the resource provider name.
  7811  	ResourceProviderName *string `json:"resourceProviderName,omitempty"`
  7812  	// Status - The status of the operation that should be checked for. If no status is provided, any status will match.
  7813  	Status *string `json:"status,omitempty"`
  7814  	// SubStatus - the substatus.
  7815  	SubStatus *string `json:"subStatus,omitempty"`
  7816  	// Claims - the claims.
  7817  	Claims *RuleManagementEventClaimsDataSource `json:"claims,omitempty"`
  7818  	// ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
  7819  	ResourceURI *string `json:"resourceUri,omitempty"`
  7820  	// LegacyResourceID - the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
  7821  	LegacyResourceID *string `json:"legacyResourceId,omitempty"`
  7822  	// ResourceLocation - the location of the resource.
  7823  	ResourceLocation *string `json:"resourceLocation,omitempty"`
  7824  	// MetricNamespace - the namespace of the metric.
  7825  	MetricNamespace *string `json:"metricNamespace,omitempty"`
  7826  	// OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource'
  7827  	OdataType OdataType `json:"odata.type,omitempty"`
  7828  }
  7829  
  7830  // MarshalJSON is the custom marshaler for RuleManagementEventDataSource.
  7831  func (rmeds RuleManagementEventDataSource) MarshalJSON() ([]byte, error) {
  7832  	rmeds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource
  7833  	objectMap := make(map[string]interface{})
  7834  	if rmeds.EventName != nil {
  7835  		objectMap["eventName"] = rmeds.EventName
  7836  	}
  7837  	if rmeds.EventSource != nil {
  7838  		objectMap["eventSource"] = rmeds.EventSource
  7839  	}
  7840  	if rmeds.Level != nil {
  7841  		objectMap["level"] = rmeds.Level
  7842  	}
  7843  	if rmeds.OperationName != nil {
  7844  		objectMap["operationName"] = rmeds.OperationName
  7845  	}
  7846  	if rmeds.ResourceGroupName != nil {
  7847  		objectMap["resourceGroupName"] = rmeds.ResourceGroupName
  7848  	}
  7849  	if rmeds.ResourceProviderName != nil {
  7850  		objectMap["resourceProviderName"] = rmeds.ResourceProviderName
  7851  	}
  7852  	if rmeds.Status != nil {
  7853  		objectMap["status"] = rmeds.Status
  7854  	}
  7855  	if rmeds.SubStatus != nil {
  7856  		objectMap["subStatus"] = rmeds.SubStatus
  7857  	}
  7858  	if rmeds.Claims != nil {
  7859  		objectMap["claims"] = rmeds.Claims
  7860  	}
  7861  	if rmeds.ResourceURI != nil {
  7862  		objectMap["resourceUri"] = rmeds.ResourceURI
  7863  	}
  7864  	if rmeds.LegacyResourceID != nil {
  7865  		objectMap["legacyResourceId"] = rmeds.LegacyResourceID
  7866  	}
  7867  	if rmeds.ResourceLocation != nil {
  7868  		objectMap["resourceLocation"] = rmeds.ResourceLocation
  7869  	}
  7870  	if rmeds.MetricNamespace != nil {
  7871  		objectMap["metricNamespace"] = rmeds.MetricNamespace
  7872  	}
  7873  	if rmeds.OdataType != "" {
  7874  		objectMap["odata.type"] = rmeds.OdataType
  7875  	}
  7876  	return json.Marshal(objectMap)
  7877  }
  7878  
  7879  // AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource.
  7880  func (rmeds RuleManagementEventDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) {
  7881  	return nil, false
  7882  }
  7883  
  7884  // AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource.
  7885  func (rmeds RuleManagementEventDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) {
  7886  	return &rmeds, true
  7887  }
  7888  
  7889  // AsRuleDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource.
  7890  func (rmeds RuleManagementEventDataSource) AsRuleDataSource() (*RuleDataSource, bool) {
  7891  	return nil, false
  7892  }
  7893  
  7894  // AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource.
  7895  func (rmeds RuleManagementEventDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) {
  7896  	return &rmeds, true
  7897  }
  7898  
  7899  // RuleMetricDataSource a rule metric data source. The discriminator value is always RuleMetricDataSource
  7900  // in this case.
  7901  type RuleMetricDataSource struct {
  7902  	// MetricName - the name of the metric that defines what the rule monitors.
  7903  	MetricName *string `json:"metricName,omitempty"`
  7904  	// ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
  7905  	ResourceURI *string `json:"resourceUri,omitempty"`
  7906  	// LegacyResourceID - the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
  7907  	LegacyResourceID *string `json:"legacyResourceId,omitempty"`
  7908  	// ResourceLocation - the location of the resource.
  7909  	ResourceLocation *string `json:"resourceLocation,omitempty"`
  7910  	// MetricNamespace - the namespace of the metric.
  7911  	MetricNamespace *string `json:"metricNamespace,omitempty"`
  7912  	// OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource'
  7913  	OdataType OdataType `json:"odata.type,omitempty"`
  7914  }
  7915  
  7916  // MarshalJSON is the custom marshaler for RuleMetricDataSource.
  7917  func (rmds RuleMetricDataSource) MarshalJSON() ([]byte, error) {
  7918  	rmds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource
  7919  	objectMap := make(map[string]interface{})
  7920  	if rmds.MetricName != nil {
  7921  		objectMap["metricName"] = rmds.MetricName
  7922  	}
  7923  	if rmds.ResourceURI != nil {
  7924  		objectMap["resourceUri"] = rmds.ResourceURI
  7925  	}
  7926  	if rmds.LegacyResourceID != nil {
  7927  		objectMap["legacyResourceId"] = rmds.LegacyResourceID
  7928  	}
  7929  	if rmds.ResourceLocation != nil {
  7930  		objectMap["resourceLocation"] = rmds.ResourceLocation
  7931  	}
  7932  	if rmds.MetricNamespace != nil {
  7933  		objectMap["metricNamespace"] = rmds.MetricNamespace
  7934  	}
  7935  	if rmds.OdataType != "" {
  7936  		objectMap["odata.type"] = rmds.OdataType
  7937  	}
  7938  	return json.Marshal(objectMap)
  7939  }
  7940  
  7941  // AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource.
  7942  func (rmds RuleMetricDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) {
  7943  	return &rmds, true
  7944  }
  7945  
  7946  // AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource.
  7947  func (rmds RuleMetricDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) {
  7948  	return nil, false
  7949  }
  7950  
  7951  // AsRuleDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource.
  7952  func (rmds RuleMetricDataSource) AsRuleDataSource() (*RuleDataSource, bool) {
  7953  	return nil, false
  7954  }
  7955  
  7956  // AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource.
  7957  func (rmds RuleMetricDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) {
  7958  	return &rmds, true
  7959  }
  7960  
  7961  // RuleWebhookAction specifies the action to post to service when the rule condition is evaluated. The
  7962  // discriminator is always RuleWebhookAction in this case.
  7963  type RuleWebhookAction struct {
  7964  	// ServiceURI - the service uri to Post the notification when the alert activates or resolves.
  7965  	ServiceURI *string `json:"serviceUri,omitempty"`
  7966  	// Properties - the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload.
  7967  	Properties map[string]*string `json:"properties"`
  7968  	// OdataType - Possible values include: 'OdataTypeBasicRuleActionOdataTypeRuleAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction'
  7969  	OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"`
  7970  }
  7971  
  7972  // MarshalJSON is the custom marshaler for RuleWebhookAction.
  7973  func (rwa RuleWebhookAction) MarshalJSON() ([]byte, error) {
  7974  	rwa.OdataType = OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction
  7975  	objectMap := make(map[string]interface{})
  7976  	if rwa.ServiceURI != nil {
  7977  		objectMap["serviceUri"] = rwa.ServiceURI
  7978  	}
  7979  	if rwa.Properties != nil {
  7980  		objectMap["properties"] = rwa.Properties
  7981  	}
  7982  	if rwa.OdataType != "" {
  7983  		objectMap["odata.type"] = rwa.OdataType
  7984  	}
  7985  	return json.Marshal(objectMap)
  7986  }
  7987  
  7988  // AsRuleEmailAction is the BasicRuleAction implementation for RuleWebhookAction.
  7989  func (rwa RuleWebhookAction) AsRuleEmailAction() (*RuleEmailAction, bool) {
  7990  	return nil, false
  7991  }
  7992  
  7993  // AsRuleWebhookAction is the BasicRuleAction implementation for RuleWebhookAction.
  7994  func (rwa RuleWebhookAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) {
  7995  	return &rwa, true
  7996  }
  7997  
  7998  // AsRuleAction is the BasicRuleAction implementation for RuleWebhookAction.
  7999  func (rwa RuleWebhookAction) AsRuleAction() (*RuleAction, bool) {
  8000  	return nil, false
  8001  }
  8002  
  8003  // AsBasicRuleAction is the BasicRuleAction implementation for RuleWebhookAction.
  8004  func (rwa RuleWebhookAction) AsBasicRuleAction() (BasicRuleAction, bool) {
  8005  	return &rwa, true
  8006  }
  8007  
  8008  // ScaleAction the parameters for the scaling action.
  8009  type ScaleAction struct {
  8010  	// Direction - the scale direction. Whether the scaling action increases or decreases the number of instances. Possible values include: 'ScaleDirectionNone', 'ScaleDirectionIncrease', 'ScaleDirectionDecrease'
  8011  	Direction ScaleDirection `json:"direction,omitempty"`
  8012  	// Type - the type of action that should occur when the scale rule fires. Possible values include: 'ScaleTypeChangeCount', 'ScaleTypePercentChangeCount', 'ScaleTypeExactCount', 'ScaleTypeServiceAllowedNextValue'
  8013  	Type ScaleType `json:"type,omitempty"`
  8014  	// Value - the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.
  8015  	Value *string `json:"value,omitempty"`
  8016  	// Cooldown - the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format.
  8017  	Cooldown *string `json:"cooldown,omitempty"`
  8018  }
  8019  
  8020  // ScaleCapacity the number of instances that can be used during this profile.
  8021  type ScaleCapacity struct {
  8022  	// Minimum - the minimum number of instances for the resource.
  8023  	Minimum *string `json:"minimum,omitempty"`
  8024  	// Maximum - the maximum number of instances for the resource. The actual maximum number of instances is limited by the cores that are available in the subscription.
  8025  	Maximum *string `json:"maximum,omitempty"`
  8026  	// Default - the number of instances that will be set if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default.
  8027  	Default *string `json:"default,omitempty"`
  8028  }
  8029  
  8030  // ScaleRule a rule that provide the triggers and parameters for the scaling action.
  8031  type ScaleRule struct {
  8032  	// MetricTrigger - the trigger that results in a scaling action.
  8033  	MetricTrigger *MetricTrigger `json:"metricTrigger,omitempty"`
  8034  	// ScaleAction - the parameters for the scaling action.
  8035  	ScaleAction *ScaleAction `json:"scaleAction,omitempty"`
  8036  }
  8037  
  8038  // ScaleRuleMetricDimension specifies an auto scale rule metric dimension.
  8039  type ScaleRuleMetricDimension struct {
  8040  	// DimensionName - Name of the dimension.
  8041  	DimensionName *string `json:"DimensionName,omitempty"`
  8042  	// Operator - the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values. Possible values include: 'ScaleRuleMetricDimensionOperationTypeEquals', 'ScaleRuleMetricDimensionOperationTypeNotEquals'
  8043  	Operator ScaleRuleMetricDimensionOperationType `json:"Operator,omitempty"`
  8044  	// Values - list of dimension values. For example: ["App1","App2"].
  8045  	Values *[]string `json:"Values,omitempty"`
  8046  }
  8047  
  8048  // Schedule defines how often to run the search and the time interval.
  8049  type Schedule struct {
  8050  	// FrequencyInMinutes - frequency (in minutes) at which rule condition should be evaluated.
  8051  	FrequencyInMinutes *int32 `json:"frequencyInMinutes,omitempty"`
  8052  	// TimeWindowInMinutes - Time window for which data needs to be fetched for query (should be greater than or equal to frequencyInMinutes).
  8053  	TimeWindowInMinutes *int32 `json:"timeWindowInMinutes,omitempty"`
  8054  }
  8055  
  8056  // ScopedResource a private link scoped resource
  8057  type ScopedResource struct {
  8058  	autorest.Response `json:"-"`
  8059  	// ScopedResourceProperties - Resource properties.
  8060  	*ScopedResourceProperties `json:"properties,omitempty"`
  8061  	// ID - READ-ONLY; Azure resource Id
  8062  	ID *string `json:"id,omitempty"`
  8063  	// Name - READ-ONLY; Azure resource name
  8064  	Name *string `json:"name,omitempty"`
  8065  	// Type - READ-ONLY; Azure resource type
  8066  	Type *string `json:"type,omitempty"`
  8067  }
  8068  
  8069  // MarshalJSON is the custom marshaler for ScopedResource.
  8070  func (sr ScopedResource) MarshalJSON() ([]byte, error) {
  8071  	objectMap := make(map[string]interface{})
  8072  	if sr.ScopedResourceProperties != nil {
  8073  		objectMap["properties"] = sr.ScopedResourceProperties
  8074  	}
  8075  	return json.Marshal(objectMap)
  8076  }
  8077  
  8078  // UnmarshalJSON is the custom unmarshaler for ScopedResource struct.
  8079  func (sr *ScopedResource) UnmarshalJSON(body []byte) error {
  8080  	var m map[string]*json.RawMessage
  8081  	err := json.Unmarshal(body, &m)
  8082  	if err != nil {
  8083  		return err
  8084  	}
  8085  	for k, v := range m {
  8086  		switch k {
  8087  		case "properties":
  8088  			if v != nil {
  8089  				var scopedResourceProperties ScopedResourceProperties
  8090  				err = json.Unmarshal(*v, &scopedResourceProperties)
  8091  				if err != nil {
  8092  					return err
  8093  				}
  8094  				sr.ScopedResourceProperties = &scopedResourceProperties
  8095  			}
  8096  		case "id":
  8097  			if v != nil {
  8098  				var ID string
  8099  				err = json.Unmarshal(*v, &ID)
  8100  				if err != nil {
  8101  					return err
  8102  				}
  8103  				sr.ID = &ID
  8104  			}
  8105  		case "name":
  8106  			if v != nil {
  8107  				var name string
  8108  				err = json.Unmarshal(*v, &name)
  8109  				if err != nil {
  8110  					return err
  8111  				}
  8112  				sr.Name = &name
  8113  			}
  8114  		case "type":
  8115  			if v != nil {
  8116  				var typeVar string
  8117  				err = json.Unmarshal(*v, &typeVar)
  8118  				if err != nil {
  8119  					return err
  8120  				}
  8121  				sr.Type = &typeVar
  8122  			}
  8123  		}
  8124  	}
  8125  
  8126  	return nil
  8127  }
  8128  
  8129  // ScopedResourceListResult a list of scoped resources in a private link scope.
  8130  type ScopedResourceListResult struct {
  8131  	autorest.Response `json:"-"`
  8132  	// Value - READ-ONLY; Array of results.
  8133  	Value *[]ScopedResource `json:"value,omitempty"`
  8134  	// NextLink - READ-ONLY; Link to retrieve next page of results.
  8135  	NextLink *string `json:"nextLink,omitempty"`
  8136  }
  8137  
  8138  // MarshalJSON is the custom marshaler for ScopedResourceListResult.
  8139  func (srlr ScopedResourceListResult) MarshalJSON() ([]byte, error) {
  8140  	objectMap := make(map[string]interface{})
  8141  	return json.Marshal(objectMap)
  8142  }
  8143  
  8144  // ScopedResourceListResultIterator provides access to a complete listing of ScopedResource values.
  8145  type ScopedResourceListResultIterator struct {
  8146  	i    int
  8147  	page ScopedResourceListResultPage
  8148  }
  8149  
  8150  // NextWithContext advances to the next value.  If there was an error making
  8151  // the request the iterator does not advance and the error is returned.
  8152  func (iter *ScopedResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
  8153  	if tracing.IsEnabled() {
  8154  		ctx = tracing.StartSpan(ctx, fqdn+"/ScopedResourceListResultIterator.NextWithContext")
  8155  		defer func() {
  8156  			sc := -1
  8157  			if iter.Response().Response.Response != nil {
  8158  				sc = iter.Response().Response.Response.StatusCode
  8159  			}
  8160  			tracing.EndSpan(ctx, sc, err)
  8161  		}()
  8162  	}
  8163  	iter.i++
  8164  	if iter.i < len(iter.page.Values()) {
  8165  		return nil
  8166  	}
  8167  	err = iter.page.NextWithContext(ctx)
  8168  	if err != nil {
  8169  		iter.i--
  8170  		return err
  8171  	}
  8172  	iter.i = 0
  8173  	return nil
  8174  }
  8175  
  8176  // Next advances to the next value.  If there was an error making
  8177  // the request the iterator does not advance and the error is returned.
  8178  // Deprecated: Use NextWithContext() instead.
  8179  func (iter *ScopedResourceListResultIterator) Next() error {
  8180  	return iter.NextWithContext(context.Background())
  8181  }
  8182  
  8183  // NotDone returns true if the enumeration should be started or is not yet complete.
  8184  func (iter ScopedResourceListResultIterator) NotDone() bool {
  8185  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  8186  }
  8187  
  8188  // Response returns the raw server response from the last page request.
  8189  func (iter ScopedResourceListResultIterator) Response() ScopedResourceListResult {
  8190  	return iter.page.Response()
  8191  }
  8192  
  8193  // Value returns the current value or a zero-initialized value if the
  8194  // iterator has advanced beyond the end of the collection.
  8195  func (iter ScopedResourceListResultIterator) Value() ScopedResource {
  8196  	if !iter.page.NotDone() {
  8197  		return ScopedResource{}
  8198  	}
  8199  	return iter.page.Values()[iter.i]
  8200  }
  8201  
  8202  // Creates a new instance of the ScopedResourceListResultIterator type.
  8203  func NewScopedResourceListResultIterator(page ScopedResourceListResultPage) ScopedResourceListResultIterator {
  8204  	return ScopedResourceListResultIterator{page: page}
  8205  }
  8206  
  8207  // IsEmpty returns true if the ListResult contains no values.
  8208  func (srlr ScopedResourceListResult) IsEmpty() bool {
  8209  	return srlr.Value == nil || len(*srlr.Value) == 0
  8210  }
  8211  
  8212  // hasNextLink returns true if the NextLink is not empty.
  8213  func (srlr ScopedResourceListResult) hasNextLink() bool {
  8214  	return srlr.NextLink != nil && len(*srlr.NextLink) != 0
  8215  }
  8216  
  8217  // scopedResourceListResultPreparer prepares a request to retrieve the next set of results.
  8218  // It returns nil if no more results exist.
  8219  func (srlr ScopedResourceListResult) scopedResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
  8220  	if !srlr.hasNextLink() {
  8221  		return nil, nil
  8222  	}
  8223  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  8224  		autorest.AsJSON(),
  8225  		autorest.AsGet(),
  8226  		autorest.WithBaseURL(to.String(srlr.NextLink)))
  8227  }
  8228  
  8229  // ScopedResourceListResultPage contains a page of ScopedResource values.
  8230  type ScopedResourceListResultPage struct {
  8231  	fn   func(context.Context, ScopedResourceListResult) (ScopedResourceListResult, error)
  8232  	srlr ScopedResourceListResult
  8233  }
  8234  
  8235  // NextWithContext advances to the next page of values.  If there was an error making
  8236  // the request the page does not advance and the error is returned.
  8237  func (page *ScopedResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
  8238  	if tracing.IsEnabled() {
  8239  		ctx = tracing.StartSpan(ctx, fqdn+"/ScopedResourceListResultPage.NextWithContext")
  8240  		defer func() {
  8241  			sc := -1
  8242  			if page.Response().Response.Response != nil {
  8243  				sc = page.Response().Response.Response.StatusCode
  8244  			}
  8245  			tracing.EndSpan(ctx, sc, err)
  8246  		}()
  8247  	}
  8248  	for {
  8249  		next, err := page.fn(ctx, page.srlr)
  8250  		if err != nil {
  8251  			return err
  8252  		}
  8253  		page.srlr = next
  8254  		if !next.hasNextLink() || !next.IsEmpty() {
  8255  			break
  8256  		}
  8257  	}
  8258  	return nil
  8259  }
  8260  
  8261  // Next advances to the next page of values.  If there was an error making
  8262  // the request the page does not advance and the error is returned.
  8263  // Deprecated: Use NextWithContext() instead.
  8264  func (page *ScopedResourceListResultPage) Next() error {
  8265  	return page.NextWithContext(context.Background())
  8266  }
  8267  
  8268  // NotDone returns true if the page enumeration should be started or is not yet complete.
  8269  func (page ScopedResourceListResultPage) NotDone() bool {
  8270  	return !page.srlr.IsEmpty()
  8271  }
  8272  
  8273  // Response returns the raw server response from the last page request.
  8274  func (page ScopedResourceListResultPage) Response() ScopedResourceListResult {
  8275  	return page.srlr
  8276  }
  8277  
  8278  // Values returns the slice of values for the current page or nil if there are no values.
  8279  func (page ScopedResourceListResultPage) Values() []ScopedResource {
  8280  	if page.srlr.IsEmpty() {
  8281  		return nil
  8282  	}
  8283  	return *page.srlr.Value
  8284  }
  8285  
  8286  // Creates a new instance of the ScopedResourceListResultPage type.
  8287  func NewScopedResourceListResultPage(cur ScopedResourceListResult, getNextPage func(context.Context, ScopedResourceListResult) (ScopedResourceListResult, error)) ScopedResourceListResultPage {
  8288  	return ScopedResourceListResultPage{
  8289  		fn:   getNextPage,
  8290  		srlr: cur,
  8291  	}
  8292  }
  8293  
  8294  // ScopedResourceProperties properties of a private link scoped resource.
  8295  type ScopedResourceProperties struct {
  8296  	// LinkedResourceID - The resource id of the scoped Azure monitor resource.
  8297  	LinkedResourceID *string `json:"linkedResourceId,omitempty"`
  8298  	// ProvisioningState - READ-ONLY; State of the private endpoint connection.
  8299  	ProvisioningState *string `json:"provisioningState,omitempty"`
  8300  }
  8301  
  8302  // MarshalJSON is the custom marshaler for ScopedResourceProperties.
  8303  func (srp ScopedResourceProperties) MarshalJSON() ([]byte, error) {
  8304  	objectMap := make(map[string]interface{})
  8305  	if srp.LinkedResourceID != nil {
  8306  		objectMap["linkedResourceId"] = srp.LinkedResourceID
  8307  	}
  8308  	return json.Marshal(objectMap)
  8309  }
  8310  
  8311  // SenderAuthorization the authorization used by the user who has performed the operation that led to this
  8312  // event. This captures the RBAC properties of the event. These usually include the 'action', 'role' and
  8313  // the 'scope'
  8314  type SenderAuthorization struct {
  8315  	// Action - the permissible actions. For instance: microsoft.support/supporttickets/write
  8316  	Action *string `json:"action,omitempty"`
  8317  	// Role - the role of the user. For instance: Subscription Admin
  8318  	Role *string `json:"role,omitempty"`
  8319  	// Scope - the scope.
  8320  	Scope *string `json:"scope,omitempty"`
  8321  }
  8322  
  8323  // SingleBaseline the baseline values for a single sensitivity value.
  8324  type SingleBaseline struct {
  8325  	// Sensitivity - the sensitivity of the baseline. Possible values include: 'BaselineSensitivityLow', 'BaselineSensitivityMedium', 'BaselineSensitivityHigh'
  8326  	Sensitivity BaselineSensitivity `json:"sensitivity,omitempty"`
  8327  	// LowThresholds - The low thresholds of the baseline.
  8328  	LowThresholds *[]float64 `json:"lowThresholds,omitempty"`
  8329  	// HighThresholds - The high thresholds of the baseline.
  8330  	HighThresholds *[]float64 `json:"highThresholds,omitempty"`
  8331  }
  8332  
  8333  // SingleMetricBaseline the baseline results of a single metric.
  8334  type SingleMetricBaseline struct {
  8335  	// ID - The metric baseline Id.
  8336  	ID *string `json:"id,omitempty"`
  8337  	// Type - The resource type of the metric baseline resource.
  8338  	Type *string `json:"type,omitempty"`
  8339  	// Name - The name of the metric for which the baselines were retrieved.
  8340  	Name *string `json:"name,omitempty"`
  8341  	// MetricBaselinesProperties - The metric baseline properties of the metric.
  8342  	*MetricBaselinesProperties `json:"properties,omitempty"`
  8343  }
  8344  
  8345  // MarshalJSON is the custom marshaler for SingleMetricBaseline.
  8346  func (smb SingleMetricBaseline) MarshalJSON() ([]byte, error) {
  8347  	objectMap := make(map[string]interface{})
  8348  	if smb.ID != nil {
  8349  		objectMap["id"] = smb.ID
  8350  	}
  8351  	if smb.Type != nil {
  8352  		objectMap["type"] = smb.Type
  8353  	}
  8354  	if smb.Name != nil {
  8355  		objectMap["name"] = smb.Name
  8356  	}
  8357  	if smb.MetricBaselinesProperties != nil {
  8358  		objectMap["properties"] = smb.MetricBaselinesProperties
  8359  	}
  8360  	return json.Marshal(objectMap)
  8361  }
  8362  
  8363  // UnmarshalJSON is the custom unmarshaler for SingleMetricBaseline struct.
  8364  func (smb *SingleMetricBaseline) UnmarshalJSON(body []byte) error {
  8365  	var m map[string]*json.RawMessage
  8366  	err := json.Unmarshal(body, &m)
  8367  	if err != nil {
  8368  		return err
  8369  	}
  8370  	for k, v := range m {
  8371  		switch k {
  8372  		case "id":
  8373  			if v != nil {
  8374  				var ID string
  8375  				err = json.Unmarshal(*v, &ID)
  8376  				if err != nil {
  8377  					return err
  8378  				}
  8379  				smb.ID = &ID
  8380  			}
  8381  		case "type":
  8382  			if v != nil {
  8383  				var typeVar string
  8384  				err = json.Unmarshal(*v, &typeVar)
  8385  				if err != nil {
  8386  					return err
  8387  				}
  8388  				smb.Type = &typeVar
  8389  			}
  8390  		case "name":
  8391  			if v != nil {
  8392  				var name string
  8393  				err = json.Unmarshal(*v, &name)
  8394  				if err != nil {
  8395  					return err
  8396  				}
  8397  				smb.Name = &name
  8398  			}
  8399  		case "properties":
  8400  			if v != nil {
  8401  				var metricBaselinesProperties MetricBaselinesProperties
  8402  				err = json.Unmarshal(*v, &metricBaselinesProperties)
  8403  				if err != nil {
  8404  					return err
  8405  				}
  8406  				smb.MetricBaselinesProperties = &metricBaselinesProperties
  8407  			}
  8408  		}
  8409  	}
  8410  
  8411  	return nil
  8412  }
  8413  
  8414  // SmsReceiver an SMS receiver.
  8415  type SmsReceiver struct {
  8416  	// Name - The name of the SMS receiver. Names must be unique across all receivers within an action group.
  8417  	Name *string `json:"name,omitempty"`
  8418  	// CountryCode - The country code of the SMS receiver.
  8419  	CountryCode *string `json:"countryCode,omitempty"`
  8420  	// PhoneNumber - The phone number of the SMS receiver.
  8421  	PhoneNumber *string `json:"phoneNumber,omitempty"`
  8422  	// Status - READ-ONLY; The status of the receiver. Possible values include: 'ReceiverStatusNotSpecified', 'ReceiverStatusEnabled', 'ReceiverStatusDisabled'
  8423  	Status ReceiverStatus `json:"status,omitempty"`
  8424  }
  8425  
  8426  // MarshalJSON is the custom marshaler for SmsReceiver.
  8427  func (sr SmsReceiver) MarshalJSON() ([]byte, error) {
  8428  	objectMap := make(map[string]interface{})
  8429  	if sr.Name != nil {
  8430  		objectMap["name"] = sr.Name
  8431  	}
  8432  	if sr.CountryCode != nil {
  8433  		objectMap["countryCode"] = sr.CountryCode
  8434  	}
  8435  	if sr.PhoneNumber != nil {
  8436  		objectMap["phoneNumber"] = sr.PhoneNumber
  8437  	}
  8438  	return json.Marshal(objectMap)
  8439  }
  8440  
  8441  // Source specifies the log search query.
  8442  type Source struct {
  8443  	// Query - Log search query. Required for action type - AlertingAction
  8444  	Query *string `json:"query,omitempty"`
  8445  	// AuthorizedResources - List of  Resource referred into query
  8446  	AuthorizedResources *[]string `json:"authorizedResources,omitempty"`
  8447  	// DataSourceID - The resource uri over which log search query is to be run.
  8448  	DataSourceID *string `json:"dataSourceId,omitempty"`
  8449  	// QueryType - Set value to 'ResultCount'. Possible values include: 'QueryTypeResultCount'
  8450  	QueryType QueryType `json:"queryType,omitempty"`
  8451  }
  8452  
  8453  // SyslogDataSource definition of which syslog data will be collected and how it will be collected.
  8454  // Only collected from Linux machines.
  8455  type SyslogDataSource struct {
  8456  	// Streams - List of streams that this data source will be sent to.
  8457  	// A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to.
  8458  	Streams *[]KnownSyslogDataSourceStreams `json:"streams,omitempty"`
  8459  	// FacilityNames - The list of facility names.
  8460  	FacilityNames *[]KnownSyslogDataSourceFacilityNames `json:"facilityNames,omitempty"`
  8461  	// LogLevels - The log levels to collect.
  8462  	LogLevels *[]KnownSyslogDataSourceLogLevels `json:"logLevels,omitempty"`
  8463  	// Name - A friendly name for the data source.
  8464  	// This name should be unique across all data sources (regardless of type) within the data collection rule.
  8465  	Name *string `json:"name,omitempty"`
  8466  }
  8467  
  8468  // SystemData metadata pertaining to creation and last modification of the resource.
  8469  type SystemData struct {
  8470  	// CreatedBy - The identity that created the resource.
  8471  	CreatedBy *string `json:"createdBy,omitempty"`
  8472  	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  8473  	CreatedByType CreatedByType `json:"createdByType,omitempty"`
  8474  	// CreatedAt - The timestamp of resource creation (UTC).
  8475  	CreatedAt *date.Time `json:"createdAt,omitempty"`
  8476  	// LastModifiedBy - The identity that last modified the resource.
  8477  	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
  8478  	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  8479  	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
  8480  	// LastModifiedAt - The timestamp of resource last modification (UTC)
  8481  	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
  8482  }
  8483  
  8484  // TagsResource a container holding only the Tags for a resource, allowing the user to update the tags on a
  8485  // PrivateLinkScope instance.
  8486  type TagsResource struct {
  8487  	// Tags - Resource tags
  8488  	Tags map[string]*string `json:"tags"`
  8489  }
  8490  
  8491  // MarshalJSON is the custom marshaler for TagsResource.
  8492  func (tr TagsResource) MarshalJSON() ([]byte, error) {
  8493  	objectMap := make(map[string]interface{})
  8494  	if tr.Tags != nil {
  8495  		objectMap["tags"] = tr.Tags
  8496  	}
  8497  	return json.Marshal(objectMap)
  8498  }
  8499  
  8500  // TestNotificationDetailsResponse the details of the test notification results.
  8501  type TestNotificationDetailsResponse struct {
  8502  	autorest.Response `json:"-"`
  8503  	Context           *Context `json:"Context,omitempty"`
  8504  	// State - The overall state
  8505  	State *string `json:"State,omitempty"`
  8506  	// CompletedTime - The completed time
  8507  	CompletedTime *string `json:"CompletedTime,omitempty"`
  8508  	// CreatedTime - The created time
  8509  	CreatedTime *string `json:"CreatedTime,omitempty"`
  8510  	// ActionDetails - The list of action detail
  8511  	ActionDetails *[]ActionDetail `json:"ActionDetails,omitempty"`
  8512  }
  8513  
  8514  // TestNotificationResponse the response when test notification succeeded
  8515  type TestNotificationResponse struct {
  8516  	autorest.Response `json:"-"`
  8517  	// NotificationID - The notification id
  8518  	NotificationID *string `json:"notificationId,omitempty"`
  8519  	// CorrelationID - The correlation id
  8520  	CorrelationID *string `json:"correlationId,omitempty"`
  8521  	// CreatedTime - The created time
  8522  	CreatedTime *string `json:"createdTime,omitempty"`
  8523  }
  8524  
  8525  // ThresholdRuleCondition a rule condition based on a metric crossing a threshold.
  8526  type ThresholdRuleCondition struct {
  8527  	// Operator - the operator used to compare the data and the threshold. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual'
  8528  	Operator ConditionOperator `json:"operator,omitempty"`
  8529  	// Threshold - the threshold value that activates the alert.
  8530  	Threshold *float64 `json:"threshold,omitempty"`
  8531  	// WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day.
  8532  	WindowSize *string `json:"windowSize,omitempty"`
  8533  	// TimeAggregation - the time aggregation operator. How the data that are collected should be combined over time. The default value is the PrimaryAggregationType of the Metric. Possible values include: 'TimeAggregationOperatorAverage', 'TimeAggregationOperatorMinimum', 'TimeAggregationOperatorMaximum', 'TimeAggregationOperatorTotal', 'TimeAggregationOperatorLast'
  8534  	TimeAggregation TimeAggregationOperator `json:"timeAggregation,omitempty"`
  8535  	// DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource.
  8536  	DataSource BasicRuleDataSource `json:"dataSource,omitempty"`
  8537  	// OdataType - Possible values include: 'OdataTypeBasicRuleConditionOdataTypeRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition'
  8538  	OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"`
  8539  }
  8540  
  8541  // MarshalJSON is the custom marshaler for ThresholdRuleCondition.
  8542  func (trc ThresholdRuleCondition) MarshalJSON() ([]byte, error) {
  8543  	trc.OdataType = OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition
  8544  	objectMap := make(map[string]interface{})
  8545  	if trc.Operator != "" {
  8546  		objectMap["operator"] = trc.Operator
  8547  	}
  8548  	if trc.Threshold != nil {
  8549  		objectMap["threshold"] = trc.Threshold
  8550  	}
  8551  	if trc.WindowSize != nil {
  8552  		objectMap["windowSize"] = trc.WindowSize
  8553  	}
  8554  	if trc.TimeAggregation != "" {
  8555  		objectMap["timeAggregation"] = trc.TimeAggregation
  8556  	}
  8557  	objectMap["dataSource"] = trc.DataSource
  8558  	if trc.OdataType != "" {
  8559  		objectMap["odata.type"] = trc.OdataType
  8560  	}
  8561  	return json.Marshal(objectMap)
  8562  }
  8563  
  8564  // AsThresholdRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition.
  8565  func (trc ThresholdRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) {
  8566  	return &trc, true
  8567  }
  8568  
  8569  // AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition.
  8570  func (trc ThresholdRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) {
  8571  	return nil, false
  8572  }
  8573  
  8574  // AsManagementEventRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition.
  8575  func (trc ThresholdRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) {
  8576  	return nil, false
  8577  }
  8578  
  8579  // AsRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition.
  8580  func (trc ThresholdRuleCondition) AsRuleCondition() (*RuleCondition, bool) {
  8581  	return nil, false
  8582  }
  8583  
  8584  // AsBasicRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition.
  8585  func (trc ThresholdRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) {
  8586  	return &trc, true
  8587  }
  8588  
  8589  // UnmarshalJSON is the custom unmarshaler for ThresholdRuleCondition struct.
  8590  func (trc *ThresholdRuleCondition) UnmarshalJSON(body []byte) error {
  8591  	var m map[string]*json.RawMessage
  8592  	err := json.Unmarshal(body, &m)
  8593  	if err != nil {
  8594  		return err
  8595  	}
  8596  	for k, v := range m {
  8597  		switch k {
  8598  		case "operator":
  8599  			if v != nil {
  8600  				var operator ConditionOperator
  8601  				err = json.Unmarshal(*v, &operator)
  8602  				if err != nil {
  8603  					return err
  8604  				}
  8605  				trc.Operator = operator
  8606  			}
  8607  		case "threshold":
  8608  			if v != nil {
  8609  				var threshold float64
  8610  				err = json.Unmarshal(*v, &threshold)
  8611  				if err != nil {
  8612  					return err
  8613  				}
  8614  				trc.Threshold = &threshold
  8615  			}
  8616  		case "windowSize":
  8617  			if v != nil {
  8618  				var windowSize string
  8619  				err = json.Unmarshal(*v, &windowSize)
  8620  				if err != nil {
  8621  					return err
  8622  				}
  8623  				trc.WindowSize = &windowSize
  8624  			}
  8625  		case "timeAggregation":
  8626  			if v != nil {
  8627  				var timeAggregation TimeAggregationOperator
  8628  				err = json.Unmarshal(*v, &timeAggregation)
  8629  				if err != nil {
  8630  					return err
  8631  				}
  8632  				trc.TimeAggregation = timeAggregation
  8633  			}
  8634  		case "dataSource":
  8635  			if v != nil {
  8636  				dataSource, err := unmarshalBasicRuleDataSource(*v)
  8637  				if err != nil {
  8638  					return err
  8639  				}
  8640  				trc.DataSource = dataSource
  8641  			}
  8642  		case "odata.type":
  8643  			if v != nil {
  8644  				var odataType OdataTypeBasicRuleCondition
  8645  				err = json.Unmarshal(*v, &odataType)
  8646  				if err != nil {
  8647  					return err
  8648  				}
  8649  				trc.OdataType = odataType
  8650  			}
  8651  		}
  8652  	}
  8653  
  8654  	return nil
  8655  }
  8656  
  8657  // TimeSeriesBaseline the baseline values for a single time series.
  8658  type TimeSeriesBaseline struct {
  8659  	// Aggregation - The aggregation type of the metric.
  8660  	Aggregation *string `json:"aggregation,omitempty"`
  8661  	// Dimensions - The dimensions of this time series.
  8662  	Dimensions *[]MetricSingleDimension `json:"dimensions,omitempty"`
  8663  	// Timestamps - The list of timestamps of the baselines.
  8664  	Timestamps *[]date.Time `json:"timestamps,omitempty"`
  8665  	// Data - The baseline values for each sensitivity.
  8666  	Data *[]SingleBaseline `json:"data,omitempty"`
  8667  	// MetadataValues - The baseline metadata values.
  8668  	MetadataValues *[]BaselineMetadata `json:"metadataValues,omitempty"`
  8669  }
  8670  
  8671  // TimeSeriesElement a time series result type. The discriminator value is always TimeSeries in this case.
  8672  type TimeSeriesElement struct {
  8673  	// Metadatavalues - the metadata values returned if $filter was specified in the call.
  8674  	Metadatavalues *[]MetadataValue `json:"metadatavalues,omitempty"`
  8675  	// Data - An array of data points representing the metric values.  This is only returned if a result type of data is specified.
  8676  	Data *[]MetricValue `json:"data,omitempty"`
  8677  }
  8678  
  8679  // TimeWindow a specific date-time for the profile.
  8680  type TimeWindow struct {
  8681  	// TimeZone - the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time
  8682  	TimeZone *string `json:"timeZone,omitempty"`
  8683  	// Start - the start time for the profile in ISO 8601 format.
  8684  	Start *date.Time `json:"start,omitempty"`
  8685  	// End - the end time for the profile in ISO 8601 format.
  8686  	End *date.Time `json:"end,omitempty"`
  8687  }
  8688  
  8689  // TriggerCondition the condition that results in the Log Search rule.
  8690  type TriggerCondition struct {
  8691  	// ThresholdOperator - Evaluation operation for rule - 'GreaterThan' or 'LessThan. Possible values include: 'ConditionalOperatorGreaterThanOrEqual', 'ConditionalOperatorLessThanOrEqual', 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual'
  8692  	ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"`
  8693  	// Threshold - Result or count threshold based on which rule should be triggered.
  8694  	Threshold *float64 `json:"threshold,omitempty"`
  8695  	// MetricTrigger - Trigger condition for metric query rule
  8696  	MetricTrigger *LogMetricTrigger `json:"metricTrigger,omitempty"`
  8697  }
  8698  
  8699  // VMInsightsOnboardingStatus VM Insights onboarding status for a resource.
  8700  type VMInsightsOnboardingStatus struct {
  8701  	autorest.Response `json:"-"`
  8702  	// VMInsightsOnboardingStatusProperties - Resource properties.
  8703  	*VMInsightsOnboardingStatusProperties `json:"properties,omitempty"`
  8704  	// ID - READ-ONLY; Azure resource Id
  8705  	ID *string `json:"id,omitempty"`
  8706  	// Name - READ-ONLY; Azure resource name
  8707  	Name *string `json:"name,omitempty"`
  8708  	// Type - READ-ONLY; Azure resource type
  8709  	Type *string `json:"type,omitempty"`
  8710  }
  8711  
  8712  // MarshalJSON is the custom marshaler for VMInsightsOnboardingStatus.
  8713  func (vios VMInsightsOnboardingStatus) MarshalJSON() ([]byte, error) {
  8714  	objectMap := make(map[string]interface{})
  8715  	if vios.VMInsightsOnboardingStatusProperties != nil {
  8716  		objectMap["properties"] = vios.VMInsightsOnboardingStatusProperties
  8717  	}
  8718  	return json.Marshal(objectMap)
  8719  }
  8720  
  8721  // UnmarshalJSON is the custom unmarshaler for VMInsightsOnboardingStatus struct.
  8722  func (vios *VMInsightsOnboardingStatus) UnmarshalJSON(body []byte) error {
  8723  	var m map[string]*json.RawMessage
  8724  	err := json.Unmarshal(body, &m)
  8725  	if err != nil {
  8726  		return err
  8727  	}
  8728  	for k, v := range m {
  8729  		switch k {
  8730  		case "properties":
  8731  			if v != nil {
  8732  				var VMInsightsOnboardingStatusProperties VMInsightsOnboardingStatusProperties
  8733  				err = json.Unmarshal(*v, &VMInsightsOnboardingStatusProperties)
  8734  				if err != nil {
  8735  					return err
  8736  				}
  8737  				vios.VMInsightsOnboardingStatusProperties = &VMInsightsOnboardingStatusProperties
  8738  			}
  8739  		case "id":
  8740  			if v != nil {
  8741  				var ID string
  8742  				err = json.Unmarshal(*v, &ID)
  8743  				if err != nil {
  8744  					return err
  8745  				}
  8746  				vios.ID = &ID
  8747  			}
  8748  		case "name":
  8749  			if v != nil {
  8750  				var name string
  8751  				err = json.Unmarshal(*v, &name)
  8752  				if err != nil {
  8753  					return err
  8754  				}
  8755  				vios.Name = &name
  8756  			}
  8757  		case "type":
  8758  			if v != nil {
  8759  				var typeVar string
  8760  				err = json.Unmarshal(*v, &typeVar)
  8761  				if err != nil {
  8762  					return err
  8763  				}
  8764  				vios.Type = &typeVar
  8765  			}
  8766  		}
  8767  	}
  8768  
  8769  	return nil
  8770  }
  8771  
  8772  // VMInsightsOnboardingStatusProperties resource properties.
  8773  type VMInsightsOnboardingStatusProperties struct {
  8774  	// ResourceID - Azure Resource Manager identifier of the resource whose onboarding status is being represented.
  8775  	ResourceID *string `json:"resourceId,omitempty"`
  8776  	// OnboardingStatus - The onboarding status for the resource. Note that, a higher level scope, e.g., resource group or subscription, is considered onboarded if at least one resource under it is onboarded. Possible values include: 'OnboardingStatusOnboarded', 'OnboardingStatusNotOnboarded', 'OnboardingStatusUnknown'
  8777  	OnboardingStatus OnboardingStatus `json:"onboardingStatus,omitempty"`
  8778  	// DataStatus - The status of VM Insights data from the resource. When reported as `present` the data array will contain information about the data containers to which data for the specified resource is being routed. Possible values include: 'DataStatusPresent', 'DataStatusNotPresent'
  8779  	DataStatus DataStatus `json:"dataStatus,omitempty"`
  8780  	// Data - Containers that currently store VM Insights data for the specified resource.
  8781  	Data *[]DataContainer `json:"data,omitempty"`
  8782  }
  8783  
  8784  // VoiceReceiver a voice receiver.
  8785  type VoiceReceiver struct {
  8786  	// Name - The name of the voice receiver. Names must be unique across all receivers within an action group.
  8787  	Name *string `json:"name,omitempty"`
  8788  	// CountryCode - The country code of the voice receiver.
  8789  	CountryCode *string `json:"countryCode,omitempty"`
  8790  	// PhoneNumber - The phone number of the voice receiver.
  8791  	PhoneNumber *string `json:"phoneNumber,omitempty"`
  8792  }
  8793  
  8794  // WebhookNotification webhook notification of an autoscale event.
  8795  type WebhookNotification struct {
  8796  	// ServiceURI - the service address to receive the notification.
  8797  	ServiceURI *string `json:"serviceUri,omitempty"`
  8798  	// Properties - a property bag of settings. This value can be empty.
  8799  	Properties map[string]*string `json:"properties"`
  8800  }
  8801  
  8802  // MarshalJSON is the custom marshaler for WebhookNotification.
  8803  func (wn WebhookNotification) MarshalJSON() ([]byte, error) {
  8804  	objectMap := make(map[string]interface{})
  8805  	if wn.ServiceURI != nil {
  8806  		objectMap["serviceUri"] = wn.ServiceURI
  8807  	}
  8808  	if wn.Properties != nil {
  8809  		objectMap["properties"] = wn.Properties
  8810  	}
  8811  	return json.Marshal(objectMap)
  8812  }
  8813  
  8814  // WebhookReceiver a webhook receiver.
  8815  type WebhookReceiver struct {
  8816  	// Name - The name of the webhook receiver. Names must be unique across all receivers within an action group.
  8817  	Name *string `json:"name,omitempty"`
  8818  	// ServiceURI - The URI where webhooks should be sent.
  8819  	ServiceURI *string `json:"serviceUri,omitempty"`
  8820  	// UseCommonAlertSchema - Indicates whether to use common alert schema.
  8821  	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
  8822  	// UseAadAuth - Indicates whether or not use AAD authentication.
  8823  	UseAadAuth *bool `json:"useAadAuth,omitempty"`
  8824  	// ObjectID - Indicates the webhook app object Id for aad auth.
  8825  	ObjectID *string `json:"objectId,omitempty"`
  8826  	// IdentifierURI - Indicates the identifier uri for aad auth.
  8827  	IdentifierURI *string `json:"identifierUri,omitempty"`
  8828  	// TenantID - Indicates the tenant id for aad auth.
  8829  	TenantID *string `json:"tenantId,omitempty"`
  8830  }
  8831  
  8832  // WebtestLocationAvailabilityCriteria specifies the metric alert rule criteria for a web test resource.
  8833  type WebtestLocationAvailabilityCriteria struct {
  8834  	// WebTestID - The Application Insights web test Id.
  8835  	WebTestID *string `json:"webTestId,omitempty"`
  8836  	// ComponentID - The Application Insights resource Id.
  8837  	ComponentID *string `json:"componentId,omitempty"`
  8838  	// FailedLocationCount - The number of failed locations.
  8839  	FailedLocationCount *float64 `json:"failedLocationCount,omitempty"`
  8840  	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
  8841  	AdditionalProperties map[string]interface{} `json:""`
  8842  	// OdataType - Possible values include: 'OdataTypeBasicMetricAlertCriteriaOdataTypeMetricAlertCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria'
  8843  	OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"`
  8844  }
  8845  
  8846  // MarshalJSON is the custom marshaler for WebtestLocationAvailabilityCriteria.
  8847  func (wlac WebtestLocationAvailabilityCriteria) MarshalJSON() ([]byte, error) {
  8848  	wlac.OdataType = OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria
  8849  	objectMap := make(map[string]interface{})
  8850  	if wlac.WebTestID != nil {
  8851  		objectMap["webTestId"] = wlac.WebTestID
  8852  	}
  8853  	if wlac.ComponentID != nil {
  8854  		objectMap["componentId"] = wlac.ComponentID
  8855  	}
  8856  	if wlac.FailedLocationCount != nil {
  8857  		objectMap["failedLocationCount"] = wlac.FailedLocationCount
  8858  	}
  8859  	if wlac.OdataType != "" {
  8860  		objectMap["odata.type"] = wlac.OdataType
  8861  	}
  8862  	for k, v := range wlac.AdditionalProperties {
  8863  		objectMap[k] = v
  8864  	}
  8865  	return json.Marshal(objectMap)
  8866  }
  8867  
  8868  // AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria.
  8869  func (wlac WebtestLocationAvailabilityCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) {
  8870  	return nil, false
  8871  }
  8872  
  8873  // AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria.
  8874  func (wlac WebtestLocationAvailabilityCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) {
  8875  	return &wlac, true
  8876  }
  8877  
  8878  // AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria.
  8879  func (wlac WebtestLocationAvailabilityCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) {
  8880  	return nil, false
  8881  }
  8882  
  8883  // AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria.
  8884  func (wlac WebtestLocationAvailabilityCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) {
  8885  	return nil, false
  8886  }
  8887  
  8888  // AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria.
  8889  func (wlac WebtestLocationAvailabilityCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) {
  8890  	return &wlac, true
  8891  }
  8892  
  8893  // UnmarshalJSON is the custom unmarshaler for WebtestLocationAvailabilityCriteria struct.
  8894  func (wlac *WebtestLocationAvailabilityCriteria) UnmarshalJSON(body []byte) error {
  8895  	var m map[string]*json.RawMessage
  8896  	err := json.Unmarshal(body, &m)
  8897  	if err != nil {
  8898  		return err
  8899  	}
  8900  	for k, v := range m {
  8901  		switch k {
  8902  		case "webTestId":
  8903  			if v != nil {
  8904  				var webTestID string
  8905  				err = json.Unmarshal(*v, &webTestID)
  8906  				if err != nil {
  8907  					return err
  8908  				}
  8909  				wlac.WebTestID = &webTestID
  8910  			}
  8911  		case "componentId":
  8912  			if v != nil {
  8913  				var componentID string
  8914  				err = json.Unmarshal(*v, &componentID)
  8915  				if err != nil {
  8916  					return err
  8917  				}
  8918  				wlac.ComponentID = &componentID
  8919  			}
  8920  		case "failedLocationCount":
  8921  			if v != nil {
  8922  				var failedLocationCount float64
  8923  				err = json.Unmarshal(*v, &failedLocationCount)
  8924  				if err != nil {
  8925  					return err
  8926  				}
  8927  				wlac.FailedLocationCount = &failedLocationCount
  8928  			}
  8929  		default:
  8930  			if v != nil {
  8931  				var additionalProperties interface{}
  8932  				err = json.Unmarshal(*v, &additionalProperties)
  8933  				if err != nil {
  8934  					return err
  8935  				}
  8936  				if wlac.AdditionalProperties == nil {
  8937  					wlac.AdditionalProperties = make(map[string]interface{})
  8938  				}
  8939  				wlac.AdditionalProperties[k] = additionalProperties
  8940  			}
  8941  		case "odata.type":
  8942  			if v != nil {
  8943  				var odataType OdataTypeBasicMetricAlertCriteria
  8944  				err = json.Unmarshal(*v, &odataType)
  8945  				if err != nil {
  8946  					return err
  8947  				}
  8948  				wlac.OdataType = odataType
  8949  			}
  8950  		}
  8951  	}
  8952  
  8953  	return nil
  8954  }
  8955  
  8956  // WindowsEventLogDataSource definition of which Windows Event Log events will be collected and how they
  8957  // will be collected.
  8958  // Only collected from Windows machines.
  8959  type WindowsEventLogDataSource struct {
  8960  	// Streams - List of streams that this data source will be sent to.
  8961  	// A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to.
  8962  	Streams *[]KnownWindowsEventLogDataSourceStreams `json:"streams,omitempty"`
  8963  	// XPathQueries - A list of Windows Event Log queries in XPATH format.
  8964  	XPathQueries *[]string `json:"xPathQueries,omitempty"`
  8965  	// Name - A friendly name for the data source.
  8966  	// This name should be unique across all data sources (regardless of type) within the data collection rule.
  8967  	Name *string `json:"name,omitempty"`
  8968  }
  8969  
  8970  // WorkspaceInfo information about a Log Analytics Workspace.
  8971  type WorkspaceInfo struct {
  8972  	// ID - Azure Resource Manager identifier of the Log Analytics Workspace.
  8973  	ID *string `json:"id,omitempty"`
  8974  	// Location - Location of the Log Analytics workspace.
  8975  	Location *string `json:"location,omitempty"`
  8976  	// WorkspaceInfoProperties - Resource properties.
  8977  	*WorkspaceInfoProperties `json:"properties,omitempty"`
  8978  }
  8979  
  8980  // MarshalJSON is the custom marshaler for WorkspaceInfo.
  8981  func (wi WorkspaceInfo) MarshalJSON() ([]byte, error) {
  8982  	objectMap := make(map[string]interface{})
  8983  	if wi.ID != nil {
  8984  		objectMap["id"] = wi.ID
  8985  	}
  8986  	if wi.Location != nil {
  8987  		objectMap["location"] = wi.Location
  8988  	}
  8989  	if wi.WorkspaceInfoProperties != nil {
  8990  		objectMap["properties"] = wi.WorkspaceInfoProperties
  8991  	}
  8992  	return json.Marshal(objectMap)
  8993  }
  8994  
  8995  // UnmarshalJSON is the custom unmarshaler for WorkspaceInfo struct.
  8996  func (wi *WorkspaceInfo) UnmarshalJSON(body []byte) error {
  8997  	var m map[string]*json.RawMessage
  8998  	err := json.Unmarshal(body, &m)
  8999  	if err != nil {
  9000  		return err
  9001  	}
  9002  	for k, v := range m {
  9003  		switch k {
  9004  		case "id":
  9005  			if v != nil {
  9006  				var ID string
  9007  				err = json.Unmarshal(*v, &ID)
  9008  				if err != nil {
  9009  					return err
  9010  				}
  9011  				wi.ID = &ID
  9012  			}
  9013  		case "location":
  9014  			if v != nil {
  9015  				var location string
  9016  				err = json.Unmarshal(*v, &location)
  9017  				if err != nil {
  9018  					return err
  9019  				}
  9020  				wi.Location = &location
  9021  			}
  9022  		case "properties":
  9023  			if v != nil {
  9024  				var workspaceInfoProperties WorkspaceInfoProperties
  9025  				err = json.Unmarshal(*v, &workspaceInfoProperties)
  9026  				if err != nil {
  9027  					return err
  9028  				}
  9029  				wi.WorkspaceInfoProperties = &workspaceInfoProperties
  9030  			}
  9031  		}
  9032  	}
  9033  
  9034  	return nil
  9035  }
  9036  
  9037  // WorkspaceInfoProperties resource properties.
  9038  type WorkspaceInfoProperties struct {
  9039  	// CustomerID - Log Analytics workspace identifier.
  9040  	CustomerID *string `json:"customerId,omitempty"`
  9041  }
  9042  

View as plain text