...

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

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

View as plain text