...

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

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

View as plain text