1package insights
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"context"
22	"encoding/json"
23	"github.com/Azure/go-autorest/autorest"
24	"github.com/Azure/go-autorest/autorest/date"
25	"github.com/Azure/go-autorest/autorest/to"
26	"github.com/Azure/go-autorest/tracing"
27	"net/http"
28)
29
30// The package's fully qualified name.
31const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-09-01/insights"
32
33// BasicAction action descriptor.
34type BasicAction interface {
35	AsAlertingAction() (*AlertingAction, bool)
36	AsLogToMetricAction() (*LogToMetricAction, bool)
37	AsAction() (*Action, bool)
38}
39
40// Action action descriptor.
41type Action struct {
42	// OdataType - Possible values include: 'OdataTypeAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction'
43	OdataType OdataTypeBasicAction `json:"odata.type,omitempty"`
44}
45
46func unmarshalBasicAction(body []byte) (BasicAction, error) {
47	var m map[string]interface{}
48	err := json.Unmarshal(body, &m)
49	if err != nil {
50		return nil, err
51	}
52
53	switch m["odata.type"] {
54	case string(OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction):
55		var aa AlertingAction
56		err := json.Unmarshal(body, &aa)
57		return aa, err
58	case string(OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction):
59		var ltma LogToMetricAction
60		err := json.Unmarshal(body, &ltma)
61		return ltma, err
62	default:
63		var a Action
64		err := json.Unmarshal(body, &a)
65		return a, err
66	}
67}
68func unmarshalBasicActionArray(body []byte) ([]BasicAction, error) {
69	var rawMessages []*json.RawMessage
70	err := json.Unmarshal(body, &rawMessages)
71	if err != nil {
72		return nil, err
73	}
74
75	aArray := make([]BasicAction, len(rawMessages))
76
77	for index, rawMessage := range rawMessages {
78		a, err := unmarshalBasicAction(*rawMessage)
79		if err != nil {
80			return nil, err
81		}
82		aArray[index] = a
83	}
84	return aArray, nil
85}
86
87// MarshalJSON is the custom marshaler for Action.
88func (a Action) MarshalJSON() ([]byte, error) {
89	a.OdataType = OdataTypeAction
90	objectMap := make(map[string]interface{})
91	if a.OdataType != "" {
92		objectMap["odata.type"] = a.OdataType
93	}
94	return json.Marshal(objectMap)
95}
96
97// AsAlertingAction is the BasicAction implementation for Action.
98func (a Action) AsAlertingAction() (*AlertingAction, bool) {
99	return nil, false
100}
101
102// AsLogToMetricAction is the BasicAction implementation for Action.
103func (a Action) AsLogToMetricAction() (*LogToMetricAction, bool) {
104	return nil, false
105}
106
107// AsAction is the BasicAction implementation for Action.
108func (a Action) AsAction() (*Action, bool) {
109	return &a, true
110}
111
112// AsBasicAction is the BasicAction implementation for Action.
113func (a Action) AsBasicAction() (BasicAction, bool) {
114	return &a, true
115}
116
117// ActionGroup an Azure action group.
118type ActionGroup struct {
119	// GroupShortName - The short name of the action group. This will be used in SMS messages.
120	GroupShortName *string `json:"groupShortName,omitempty"`
121	// Enabled - Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications.
122	Enabled *bool `json:"enabled,omitempty"`
123	// EmailReceivers - The list of email receivers that are part of this action group.
124	EmailReceivers *[]EmailReceiver `json:"emailReceivers,omitempty"`
125	// SmsReceivers - The list of SMS receivers that are part of this action group.
126	SmsReceivers *[]SmsReceiver `json:"smsReceivers,omitempty"`
127	// WebhookReceivers - The list of webhook receivers that are part of this action group.
128	WebhookReceivers *[]WebhookReceiver `json:"webhookReceivers,omitempty"`
129	// ItsmReceivers - The list of ITSM receivers that are part of this action group.
130	ItsmReceivers *[]ItsmReceiver `json:"itsmReceivers,omitempty"`
131	// AzureAppPushReceivers - The list of AzureAppPush receivers that are part of this action group.
132	AzureAppPushReceivers *[]AzureAppPushReceiver `json:"azureAppPushReceivers,omitempty"`
133	// AutomationRunbookReceivers - The list of AutomationRunbook receivers that are part of this action group.
134	AutomationRunbookReceivers *[]AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"`
135	// VoiceReceivers - The list of voice receivers that are part of this action group.
136	VoiceReceivers *[]VoiceReceiver `json:"voiceReceivers,omitempty"`
137	// LogicAppReceivers - The list of logic app receivers that are part of this action group.
138	LogicAppReceivers *[]LogicAppReceiver `json:"logicAppReceivers,omitempty"`
139	// AzureFunctionReceivers - The list of azure function receivers that are part of this action group.
140	AzureFunctionReceivers *[]AzureFunctionReceiver `json:"azureFunctionReceivers,omitempty"`
141	// 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.
142	ArmRoleReceivers *[]ArmRoleReceiver `json:"armRoleReceivers,omitempty"`
143}
144
145// ActionGroupList a list of action groups.
146type ActionGroupList struct {
147	autorest.Response `json:"-"`
148	// Value - The list of action groups.
149	Value *[]ActionGroupResource `json:"value,omitempty"`
150	// NextLink - Provides the link to retrieve the next set of elements.
151	NextLink *string `json:"nextLink,omitempty"`
152}
153
154// ActionGroupPatch an Azure action group for patch operations.
155type ActionGroupPatch struct {
156	// Enabled - Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated.
157	Enabled *bool `json:"enabled,omitempty"`
158}
159
160// ActionGroupPatchBody an action group object for the body of patch operations.
161type ActionGroupPatchBody struct {
162	// Tags - Resource tags
163	Tags map[string]*string `json:"tags"`
164	// ActionGroupPatch - The action group settings for an update operation.
165	*ActionGroupPatch `json:"properties,omitempty"`
166}
167
168// MarshalJSON is the custom marshaler for ActionGroupPatchBody.
169func (agpb ActionGroupPatchBody) MarshalJSON() ([]byte, error) {
170	objectMap := make(map[string]interface{})
171	if agpb.Tags != nil {
172		objectMap["tags"] = agpb.Tags
173	}
174	if agpb.ActionGroupPatch != nil {
175		objectMap["properties"] = agpb.ActionGroupPatch
176	}
177	return json.Marshal(objectMap)
178}
179
180// UnmarshalJSON is the custom unmarshaler for ActionGroupPatchBody struct.
181func (agpb *ActionGroupPatchBody) UnmarshalJSON(body []byte) error {
182	var m map[string]*json.RawMessage
183	err := json.Unmarshal(body, &m)
184	if err != nil {
185		return err
186	}
187	for k, v := range m {
188		switch k {
189		case "tags":
190			if v != nil {
191				var tags map[string]*string
192				err = json.Unmarshal(*v, &tags)
193				if err != nil {
194					return err
195				}
196				agpb.Tags = tags
197			}
198		case "properties":
199			if v != nil {
200				var actionGroupPatch ActionGroupPatch
201				err = json.Unmarshal(*v, &actionGroupPatch)
202				if err != nil {
203					return err
204				}
205				agpb.ActionGroupPatch = &actionGroupPatch
206			}
207		}
208	}
209
210	return nil
211}
212
213// ActionGroupResource an action group resource.
214type ActionGroupResource struct {
215	autorest.Response `json:"-"`
216	// ActionGroup - The action groups properties of the resource.
217	*ActionGroup `json:"properties,omitempty"`
218	// ID - READ-ONLY; Azure resource Id
219	ID *string `json:"id,omitempty"`
220	// Name - READ-ONLY; Azure resource name
221	Name *string `json:"name,omitempty"`
222	// Type - READ-ONLY; Azure resource type
223	Type *string `json:"type,omitempty"`
224	// Location - Resource location
225	Location *string `json:"location,omitempty"`
226	// Tags - Resource tags
227	Tags map[string]*string `json:"tags"`
228}
229
230// MarshalJSON is the custom marshaler for ActionGroupResource.
231func (agr ActionGroupResource) MarshalJSON() ([]byte, error) {
232	objectMap := make(map[string]interface{})
233	if agr.ActionGroup != nil {
234		objectMap["properties"] = agr.ActionGroup
235	}
236	if agr.Location != nil {
237		objectMap["location"] = agr.Location
238	}
239	if agr.Tags != nil {
240		objectMap["tags"] = agr.Tags
241	}
242	return json.Marshal(objectMap)
243}
244
245// UnmarshalJSON is the custom unmarshaler for ActionGroupResource struct.
246func (agr *ActionGroupResource) UnmarshalJSON(body []byte) error {
247	var m map[string]*json.RawMessage
248	err := json.Unmarshal(body, &m)
249	if err != nil {
250		return err
251	}
252	for k, v := range m {
253		switch k {
254		case "properties":
255			if v != nil {
256				var actionGroup ActionGroup
257				err = json.Unmarshal(*v, &actionGroup)
258				if err != nil {
259					return err
260				}
261				agr.ActionGroup = &actionGroup
262			}
263		case "id":
264			if v != nil {
265				var ID string
266				err = json.Unmarshal(*v, &ID)
267				if err != nil {
268					return err
269				}
270				agr.ID = &ID
271			}
272		case "name":
273			if v != nil {
274				var name string
275				err = json.Unmarshal(*v, &name)
276				if err != nil {
277					return err
278				}
279				agr.Name = &name
280			}
281		case "type":
282			if v != nil {
283				var typeVar string
284				err = json.Unmarshal(*v, &typeVar)
285				if err != nil {
286					return err
287				}
288				agr.Type = &typeVar
289			}
290		case "location":
291			if v != nil {
292				var location string
293				err = json.Unmarshal(*v, &location)
294				if err != nil {
295					return err
296				}
297				agr.Location = &location
298			}
299		case "tags":
300			if v != nil {
301				var tags map[string]*string
302				err = json.Unmarshal(*v, &tags)
303				if err != nil {
304					return err
305				}
306				agr.Tags = tags
307			}
308		}
309	}
310
311	return nil
312}
313
314// ActivityLogAlert an Azure activity log alert.
315type ActivityLogAlert struct {
316	// Scopes - A list of resourceIds that will be used as prefixes. The alert will only apply to activityLogs with resourceIds that fall under one of these prefixes. This list must include at least one item.
317	Scopes *[]string `json:"scopes,omitempty"`
318	// Enabled - Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated.
319	Enabled *bool `json:"enabled,omitempty"`
320	// Condition - The condition that will cause this alert to activate.
321	Condition *ActivityLogAlertAllOfCondition `json:"condition,omitempty"`
322	// Actions - The actions that will activate when the condition is met.
323	Actions *ActivityLogAlertActionList `json:"actions,omitempty"`
324	// Description - A description of this activity log alert.
325	Description *string `json:"description,omitempty"`
326}
327
328// ActivityLogAlertActionGroup a pointer to an Azure Action Group.
329type ActivityLogAlertActionGroup struct {
330	// ActionGroupID - The resourceId of the action group. This cannot be null or empty.
331	ActionGroupID *string `json:"actionGroupId,omitempty"`
332	// WebhookProperties - the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload.
333	WebhookProperties map[string]*string `json:"webhookProperties"`
334}
335
336// MarshalJSON is the custom marshaler for ActivityLogAlertActionGroup.
337func (alaag ActivityLogAlertActionGroup) MarshalJSON() ([]byte, error) {
338	objectMap := make(map[string]interface{})
339	if alaag.ActionGroupID != nil {
340		objectMap["actionGroupId"] = alaag.ActionGroupID
341	}
342	if alaag.WebhookProperties != nil {
343		objectMap["webhookProperties"] = alaag.WebhookProperties
344	}
345	return json.Marshal(objectMap)
346}
347
348// ActivityLogAlertActionList a list of activity log alert actions.
349type ActivityLogAlertActionList struct {
350	// ActionGroups - The list of activity log alerts.
351	ActionGroups *[]ActivityLogAlertActionGroup `json:"actionGroups,omitempty"`
352}
353
354// ActivityLogAlertAllOfCondition an Activity Log alert condition that is met when all its member
355// conditions are met.
356type ActivityLogAlertAllOfCondition struct {
357	// AllOf - The list of activity log alert conditions.
358	AllOf *[]ActivityLogAlertLeafCondition `json:"allOf,omitempty"`
359}
360
361// ActivityLogAlertLeafCondition an Activity Log alert condition that is met by comparing an activity log
362// field and value.
363type ActivityLogAlertLeafCondition struct {
364	// Field - The name of the field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'.
365	Field *string `json:"field,omitempty"`
366	// Equals - The field value will be compared to this value (case-insensitive) to determine if the condition is met.
367	Equals *string `json:"equals,omitempty"`
368}
369
370// ActivityLogAlertList a list of activity log alerts.
371type ActivityLogAlertList struct {
372	autorest.Response `json:"-"`
373	// Value - The list of activity log alerts.
374	Value *[]ActivityLogAlertResource `json:"value,omitempty"`
375	// NextLink - Provides the link to retrieve the next set of elements.
376	NextLink *string `json:"nextLink,omitempty"`
377}
378
379// ActivityLogAlertPatch an Azure activity log alert for patch operations.
380type ActivityLogAlertPatch struct {
381	// Enabled - Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated.
382	Enabled *bool `json:"enabled,omitempty"`
383}
384
385// ActivityLogAlertPatchBody an activity log alert object for the body of patch operations.
386type ActivityLogAlertPatchBody struct {
387	// Tags - Resource tags
388	Tags map[string]*string `json:"tags"`
389	// ActivityLogAlertPatch - The activity log alert settings for an update operation.
390	*ActivityLogAlertPatch `json:"properties,omitempty"`
391}
392
393// MarshalJSON is the custom marshaler for ActivityLogAlertPatchBody.
394func (alapb ActivityLogAlertPatchBody) MarshalJSON() ([]byte, error) {
395	objectMap := make(map[string]interface{})
396	if alapb.Tags != nil {
397		objectMap["tags"] = alapb.Tags
398	}
399	if alapb.ActivityLogAlertPatch != nil {
400		objectMap["properties"] = alapb.ActivityLogAlertPatch
401	}
402	return json.Marshal(objectMap)
403}
404
405// UnmarshalJSON is the custom unmarshaler for ActivityLogAlertPatchBody struct.
406func (alapb *ActivityLogAlertPatchBody) UnmarshalJSON(body []byte) error {
407	var m map[string]*json.RawMessage
408	err := json.Unmarshal(body, &m)
409	if err != nil {
410		return err
411	}
412	for k, v := range m {
413		switch k {
414		case "tags":
415			if v != nil {
416				var tags map[string]*string
417				err = json.Unmarshal(*v, &tags)
418				if err != nil {
419					return err
420				}
421				alapb.Tags = tags
422			}
423		case "properties":
424			if v != nil {
425				var activityLogAlertPatch ActivityLogAlertPatch
426				err = json.Unmarshal(*v, &activityLogAlertPatch)
427				if err != nil {
428					return err
429				}
430				alapb.ActivityLogAlertPatch = &activityLogAlertPatch
431			}
432		}
433	}
434
435	return nil
436}
437
438// ActivityLogAlertResource an activity log alert resource.
439type ActivityLogAlertResource struct {
440	autorest.Response `json:"-"`
441	// ActivityLogAlert - The activity log alert properties of the resource.
442	*ActivityLogAlert `json:"properties,omitempty"`
443	// ID - READ-ONLY; Azure resource Id
444	ID *string `json:"id,omitempty"`
445	// Name - READ-ONLY; Azure resource name
446	Name *string `json:"name,omitempty"`
447	// Type - READ-ONLY; Azure resource type
448	Type *string `json:"type,omitempty"`
449	// Location - Resource location
450	Location *string `json:"location,omitempty"`
451	// Tags - Resource tags
452	Tags map[string]*string `json:"tags"`
453}
454
455// MarshalJSON is the custom marshaler for ActivityLogAlertResource.
456func (alar ActivityLogAlertResource) MarshalJSON() ([]byte, error) {
457	objectMap := make(map[string]interface{})
458	if alar.ActivityLogAlert != nil {
459		objectMap["properties"] = alar.ActivityLogAlert
460	}
461	if alar.Location != nil {
462		objectMap["location"] = alar.Location
463	}
464	if alar.Tags != nil {
465		objectMap["tags"] = alar.Tags
466	}
467	return json.Marshal(objectMap)
468}
469
470// UnmarshalJSON is the custom unmarshaler for ActivityLogAlertResource struct.
471func (alar *ActivityLogAlertResource) UnmarshalJSON(body []byte) error {
472	var m map[string]*json.RawMessage
473	err := json.Unmarshal(body, &m)
474	if err != nil {
475		return err
476	}
477	for k, v := range m {
478		switch k {
479		case "properties":
480			if v != nil {
481				var activityLogAlert ActivityLogAlert
482				err = json.Unmarshal(*v, &activityLogAlert)
483				if err != nil {
484					return err
485				}
486				alar.ActivityLogAlert = &activityLogAlert
487			}
488		case "id":
489			if v != nil {
490				var ID string
491				err = json.Unmarshal(*v, &ID)
492				if err != nil {
493					return err
494				}
495				alar.ID = &ID
496			}
497		case "name":
498			if v != nil {
499				var name string
500				err = json.Unmarshal(*v, &name)
501				if err != nil {
502					return err
503				}
504				alar.Name = &name
505			}
506		case "type":
507			if v != nil {
508				var typeVar string
509				err = json.Unmarshal(*v, &typeVar)
510				if err != nil {
511					return err
512				}
513				alar.Type = &typeVar
514			}
515		case "location":
516			if v != nil {
517				var location string
518				err = json.Unmarshal(*v, &location)
519				if err != nil {
520					return err
521				}
522				alar.Location = &location
523			}
524		case "tags":
525			if v != nil {
526				var tags map[string]*string
527				err = json.Unmarshal(*v, &tags)
528				if err != nil {
529					return err
530				}
531				alar.Tags = tags
532			}
533		}
534	}
535
536	return nil
537}
538
539// AlertingAction specify action need to be taken when rule type is Alert
540type AlertingAction struct {
541	// Severity - Severity of the alert. Possible values include: 'Zero', 'One', 'Two', 'Three', 'Four'
542	Severity AlertSeverity `json:"severity,omitempty"`
543	// AznsAction - Azure action group reference.
544	AznsAction *AzNsActionGroup `json:"aznsAction,omitempty"`
545	// ThrottlingInMin - time (in minutes) for which Alerts should be throttled or suppressed.
546	ThrottlingInMin *int32 `json:"throttlingInMin,omitempty"`
547	// Trigger - The trigger condition that results in the alert rule being.
548	Trigger *TriggerCondition `json:"trigger,omitempty"`
549	// OdataType - Possible values include: 'OdataTypeAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction'
550	OdataType OdataTypeBasicAction `json:"odata.type,omitempty"`
551}
552
553// MarshalJSON is the custom marshaler for AlertingAction.
554func (aa AlertingAction) MarshalJSON() ([]byte, error) {
555	aa.OdataType = OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction
556	objectMap := make(map[string]interface{})
557	if aa.Severity != "" {
558		objectMap["severity"] = aa.Severity
559	}
560	if aa.AznsAction != nil {
561		objectMap["aznsAction"] = aa.AznsAction
562	}
563	if aa.ThrottlingInMin != nil {
564		objectMap["throttlingInMin"] = aa.ThrottlingInMin
565	}
566	if aa.Trigger != nil {
567		objectMap["trigger"] = aa.Trigger
568	}
569	if aa.OdataType != "" {
570		objectMap["odata.type"] = aa.OdataType
571	}
572	return json.Marshal(objectMap)
573}
574
575// AsAlertingAction is the BasicAction implementation for AlertingAction.
576func (aa AlertingAction) AsAlertingAction() (*AlertingAction, bool) {
577	return &aa, true
578}
579
580// AsLogToMetricAction is the BasicAction implementation for AlertingAction.
581func (aa AlertingAction) AsLogToMetricAction() (*LogToMetricAction, bool) {
582	return nil, false
583}
584
585// AsAction is the BasicAction implementation for AlertingAction.
586func (aa AlertingAction) AsAction() (*Action, bool) {
587	return nil, false
588}
589
590// AsBasicAction is the BasicAction implementation for AlertingAction.
591func (aa AlertingAction) AsBasicAction() (BasicAction, bool) {
592	return &aa, true
593}
594
595// AlertRule an alert rule.
596type AlertRule struct {
597	// Name - the name of the alert rule.
598	Name *string `json:"name,omitempty"`
599	// Description - the description of the alert rule that will be included in the alert email.
600	Description *string `json:"description,omitempty"`
601	// IsEnabled - the flag that indicates whether the alert rule is enabled.
602	IsEnabled *bool `json:"isEnabled,omitempty"`
603	// Condition - the condition that results in the alert rule being activated.
604	Condition BasicRuleCondition `json:"condition,omitempty"`
605	// Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
606	Actions *[]BasicRuleAction `json:"actions,omitempty"`
607	// LastUpdatedTime - READ-ONLY; Last time the rule was updated in ISO8601 format.
608	LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
609}
610
611// MarshalJSON is the custom marshaler for AlertRule.
612func (ar AlertRule) MarshalJSON() ([]byte, error) {
613	objectMap := make(map[string]interface{})
614	if ar.Name != nil {
615		objectMap["name"] = ar.Name
616	}
617	if ar.Description != nil {
618		objectMap["description"] = ar.Description
619	}
620	if ar.IsEnabled != nil {
621		objectMap["isEnabled"] = ar.IsEnabled
622	}
623	objectMap["condition"] = ar.Condition
624	if ar.Actions != nil {
625		objectMap["actions"] = ar.Actions
626	}
627	return json.Marshal(objectMap)
628}
629
630// UnmarshalJSON is the custom unmarshaler for AlertRule struct.
631func (ar *AlertRule) UnmarshalJSON(body []byte) error {
632	var m map[string]*json.RawMessage
633	err := json.Unmarshal(body, &m)
634	if err != nil {
635		return err
636	}
637	for k, v := range m {
638		switch k {
639		case "name":
640			if v != nil {
641				var name string
642				err = json.Unmarshal(*v, &name)
643				if err != nil {
644					return err
645				}
646				ar.Name = &name
647			}
648		case "description":
649			if v != nil {
650				var description string
651				err = json.Unmarshal(*v, &description)
652				if err != nil {
653					return err
654				}
655				ar.Description = &description
656			}
657		case "isEnabled":
658			if v != nil {
659				var isEnabled bool
660				err = json.Unmarshal(*v, &isEnabled)
661				if err != nil {
662					return err
663				}
664				ar.IsEnabled = &isEnabled
665			}
666		case "condition":
667			if v != nil {
668				condition, err := unmarshalBasicRuleCondition(*v)
669				if err != nil {
670					return err
671				}
672				ar.Condition = condition
673			}
674		case "actions":
675			if v != nil {
676				actions, err := unmarshalBasicRuleActionArray(*v)
677				if err != nil {
678					return err
679				}
680				ar.Actions = &actions
681			}
682		case "lastUpdatedTime":
683			if v != nil {
684				var lastUpdatedTime date.Time
685				err = json.Unmarshal(*v, &lastUpdatedTime)
686				if err != nil {
687					return err
688				}
689				ar.LastUpdatedTime = &lastUpdatedTime
690			}
691		}
692	}
693
694	return nil
695}
696
697// AlertRuleResource the alert rule resource.
698type AlertRuleResource struct {
699	autorest.Response `json:"-"`
700	// AlertRule - The alert rule properties of the resource.
701	*AlertRule `json:"properties,omitempty"`
702	// ID - READ-ONLY; Azure resource Id
703	ID *string `json:"id,omitempty"`
704	// Name - READ-ONLY; Azure resource name
705	Name *string `json:"name,omitempty"`
706	// Type - READ-ONLY; Azure resource type
707	Type *string `json:"type,omitempty"`
708	// Location - Resource location
709	Location *string `json:"location,omitempty"`
710	// Tags - Resource tags
711	Tags map[string]*string `json:"tags"`
712}
713
714// MarshalJSON is the custom marshaler for AlertRuleResource.
715func (arr AlertRuleResource) MarshalJSON() ([]byte, error) {
716	objectMap := make(map[string]interface{})
717	if arr.AlertRule != nil {
718		objectMap["properties"] = arr.AlertRule
719	}
720	if arr.Location != nil {
721		objectMap["location"] = arr.Location
722	}
723	if arr.Tags != nil {
724		objectMap["tags"] = arr.Tags
725	}
726	return json.Marshal(objectMap)
727}
728
729// UnmarshalJSON is the custom unmarshaler for AlertRuleResource struct.
730func (arr *AlertRuleResource) UnmarshalJSON(body []byte) error {
731	var m map[string]*json.RawMessage
732	err := json.Unmarshal(body, &m)
733	if err != nil {
734		return err
735	}
736	for k, v := range m {
737		switch k {
738		case "properties":
739			if v != nil {
740				var alertRule AlertRule
741				err = json.Unmarshal(*v, &alertRule)
742				if err != nil {
743					return err
744				}
745				arr.AlertRule = &alertRule
746			}
747		case "id":
748			if v != nil {
749				var ID string
750				err = json.Unmarshal(*v, &ID)
751				if err != nil {
752					return err
753				}
754				arr.ID = &ID
755			}
756		case "name":
757			if v != nil {
758				var name string
759				err = json.Unmarshal(*v, &name)
760				if err != nil {
761					return err
762				}
763				arr.Name = &name
764			}
765		case "type":
766			if v != nil {
767				var typeVar string
768				err = json.Unmarshal(*v, &typeVar)
769				if err != nil {
770					return err
771				}
772				arr.Type = &typeVar
773			}
774		case "location":
775			if v != nil {
776				var location string
777				err = json.Unmarshal(*v, &location)
778				if err != nil {
779					return err
780				}
781				arr.Location = &location
782			}
783		case "tags":
784			if v != nil {
785				var tags map[string]*string
786				err = json.Unmarshal(*v, &tags)
787				if err != nil {
788					return err
789				}
790				arr.Tags = tags
791			}
792		}
793	}
794
795	return nil
796}
797
798// AlertRuleResourceCollection represents a collection of alert rule resources.
799type AlertRuleResourceCollection struct {
800	autorest.Response `json:"-"`
801	// Value - the values for the alert rule resources.
802	Value *[]AlertRuleResource `json:"value,omitempty"`
803}
804
805// AlertRuleResourcePatch the alert rule object for patch operations.
806type AlertRuleResourcePatch struct {
807	// Tags - Resource tags
808	Tags map[string]*string `json:"tags"`
809	// AlertRule - The properties of an alert rule.
810	*AlertRule `json:"properties,omitempty"`
811}
812
813// MarshalJSON is the custom marshaler for AlertRuleResourcePatch.
814func (arrp AlertRuleResourcePatch) MarshalJSON() ([]byte, error) {
815	objectMap := make(map[string]interface{})
816	if arrp.Tags != nil {
817		objectMap["tags"] = arrp.Tags
818	}
819	if arrp.AlertRule != nil {
820		objectMap["properties"] = arrp.AlertRule
821	}
822	return json.Marshal(objectMap)
823}
824
825// UnmarshalJSON is the custom unmarshaler for AlertRuleResourcePatch struct.
826func (arrp *AlertRuleResourcePatch) UnmarshalJSON(body []byte) error {
827	var m map[string]*json.RawMessage
828	err := json.Unmarshal(body, &m)
829	if err != nil {
830		return err
831	}
832	for k, v := range m {
833		switch k {
834		case "tags":
835			if v != nil {
836				var tags map[string]*string
837				err = json.Unmarshal(*v, &tags)
838				if err != nil {
839					return err
840				}
841				arrp.Tags = tags
842			}
843		case "properties":
844			if v != nil {
845				var alertRule AlertRule
846				err = json.Unmarshal(*v, &alertRule)
847				if err != nil {
848					return err
849				}
850				arrp.AlertRule = &alertRule
851			}
852		}
853	}
854
855	return nil
856}
857
858// ArmRoleReceiver an arm role receiver.
859type ArmRoleReceiver struct {
860	// Name - The name of the arm role receiver. Names must be unique across all receivers within an action group.
861	Name *string `json:"name,omitempty"`
862	// RoleID - The arm role id.
863	RoleID *string `json:"roleId,omitempty"`
864}
865
866// AutomationRunbookReceiver the Azure Automation Runbook notification receiver.
867type AutomationRunbookReceiver struct {
868	// AutomationAccountID - The Azure automation account Id which holds this runbook and authenticate to Azure resource.
869	AutomationAccountID *string `json:"automationAccountId,omitempty"`
870	// RunbookName - The name for this runbook.
871	RunbookName *string `json:"runbookName,omitempty"`
872	// WebhookResourceID - The resource id for webhook linked to this runbook.
873	WebhookResourceID *string `json:"webhookResourceId,omitempty"`
874	// IsGlobalRunbook - Indicates whether this instance is global runbook.
875	IsGlobalRunbook *bool `json:"isGlobalRunbook,omitempty"`
876	// Name - Indicates name of the webhook.
877	Name *string `json:"name,omitempty"`
878	// ServiceURI - The URI where webhooks should be sent.
879	ServiceURI *string `json:"serviceUri,omitempty"`
880}
881
882// AutoscaleNotification autoscale notification.
883type AutoscaleNotification struct {
884	// Operation - the operation associated with the notification and its value must be "scale"
885	Operation *string `json:"operation,omitempty"`
886	// Email - the email notification.
887	Email *EmailNotification `json:"email,omitempty"`
888	// Webhooks - the collection of webhook notifications.
889	Webhooks *[]WebhookNotification `json:"webhooks,omitempty"`
890}
891
892// AutoscaleProfile autoscale profile.
893type AutoscaleProfile struct {
894	// Name - the name of the profile.
895	Name *string `json:"name,omitempty"`
896	// Capacity - the number of instances that can be used during this profile.
897	Capacity *ScaleCapacity `json:"capacity,omitempty"`
898	// Rules - the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified.
899	Rules *[]ScaleRule `json:"rules,omitempty"`
900	// FixedDate - the specific date-time for the profile. This element is not used if the Recurrence element is used.
901	FixedDate *TimeWindow `json:"fixedDate,omitempty"`
902	// Recurrence - the repeating times at which this profile begins. This element is not used if the FixedDate element is used.
903	Recurrence *Recurrence `json:"recurrence,omitempty"`
904}
905
906// AutoscaleSetting a setting that contains all of the configuration for the automatic scaling of a
907// resource.
908type AutoscaleSetting struct {
909	// Profiles - the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified.
910	Profiles *[]AutoscaleProfile `json:"profiles,omitempty"`
911	// Notifications - the collection of notifications.
912	Notifications *[]AutoscaleNotification `json:"notifications,omitempty"`
913	// Enabled - the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'true'.
914	Enabled *bool `json:"enabled,omitempty"`
915	// Name - the name of the autoscale setting.
916	Name *string `json:"name,omitempty"`
917	// TargetResourceURI - the resource identifier of the resource that the autoscale setting should be added to.
918	TargetResourceURI *string `json:"targetResourceUri,omitempty"`
919}
920
921// AutoscaleSettingResource the autoscale setting resource.
922type AutoscaleSettingResource struct {
923	autorest.Response `json:"-"`
924	// AutoscaleSetting - The autoscale setting of the resource.
925	*AutoscaleSetting `json:"properties,omitempty"`
926	// ID - READ-ONLY; Azure resource Id
927	ID *string `json:"id,omitempty"`
928	// Name - READ-ONLY; Azure resource name
929	Name *string `json:"name,omitempty"`
930	// Type - READ-ONLY; Azure resource type
931	Type *string `json:"type,omitempty"`
932	// Location - Resource location
933	Location *string `json:"location,omitempty"`
934	// Tags - Resource tags
935	Tags map[string]*string `json:"tags"`
936}
937
938// MarshalJSON is the custom marshaler for AutoscaleSettingResource.
939func (asr AutoscaleSettingResource) MarshalJSON() ([]byte, error) {
940	objectMap := make(map[string]interface{})
941	if asr.AutoscaleSetting != nil {
942		objectMap["properties"] = asr.AutoscaleSetting
943	}
944	if asr.Location != nil {
945		objectMap["location"] = asr.Location
946	}
947	if asr.Tags != nil {
948		objectMap["tags"] = asr.Tags
949	}
950	return json.Marshal(objectMap)
951}
952
953// UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResource struct.
954func (asr *AutoscaleSettingResource) UnmarshalJSON(body []byte) error {
955	var m map[string]*json.RawMessage
956	err := json.Unmarshal(body, &m)
957	if err != nil {
958		return err
959	}
960	for k, v := range m {
961		switch k {
962		case "properties":
963			if v != nil {
964				var autoscaleSetting AutoscaleSetting
965				err = json.Unmarshal(*v, &autoscaleSetting)
966				if err != nil {
967					return err
968				}
969				asr.AutoscaleSetting = &autoscaleSetting
970			}
971		case "id":
972			if v != nil {
973				var ID string
974				err = json.Unmarshal(*v, &ID)
975				if err != nil {
976					return err
977				}
978				asr.ID = &ID
979			}
980		case "name":
981			if v != nil {
982				var name string
983				err = json.Unmarshal(*v, &name)
984				if err != nil {
985					return err
986				}
987				asr.Name = &name
988			}
989		case "type":
990			if v != nil {
991				var typeVar string
992				err = json.Unmarshal(*v, &typeVar)
993				if err != nil {
994					return err
995				}
996				asr.Type = &typeVar
997			}
998		case "location":
999			if v != nil {
1000				var location string
1001				err = json.Unmarshal(*v, &location)
1002				if err != nil {
1003					return err
1004				}
1005				asr.Location = &location
1006			}
1007		case "tags":
1008			if v != nil {
1009				var tags map[string]*string
1010				err = json.Unmarshal(*v, &tags)
1011				if err != nil {
1012					return err
1013				}
1014				asr.Tags = tags
1015			}
1016		}
1017	}
1018
1019	return nil
1020}
1021
1022// AutoscaleSettingResourceCollection represents a collection of autoscale setting resources.
1023type AutoscaleSettingResourceCollection struct {
1024	autorest.Response `json:"-"`
1025	// Value - the values for the autoscale setting resources.
1026	Value *[]AutoscaleSettingResource `json:"value,omitempty"`
1027	// NextLink - URL to get the next set of results.
1028	NextLink *string `json:"nextLink,omitempty"`
1029}
1030
1031// AutoscaleSettingResourceCollectionIterator provides access to a complete listing of
1032// AutoscaleSettingResource values.
1033type AutoscaleSettingResourceCollectionIterator struct {
1034	i    int
1035	page AutoscaleSettingResourceCollectionPage
1036}
1037
1038// NextWithContext advances to the next value.  If there was an error making
1039// the request the iterator does not advance and the error is returned.
1040func (iter *AutoscaleSettingResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
1041	if tracing.IsEnabled() {
1042		ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionIterator.NextWithContext")
1043		defer func() {
1044			sc := -1
1045			if iter.Response().Response.Response != nil {
1046				sc = iter.Response().Response.Response.StatusCode
1047			}
1048			tracing.EndSpan(ctx, sc, err)
1049		}()
1050	}
1051	iter.i++
1052	if iter.i < len(iter.page.Values()) {
1053		return nil
1054	}
1055	err = iter.page.NextWithContext(ctx)
1056	if err != nil {
1057		iter.i--
1058		return err
1059	}
1060	iter.i = 0
1061	return nil
1062}
1063
1064// Next advances to the next value.  If there was an error making
1065// the request the iterator does not advance and the error is returned.
1066// Deprecated: Use NextWithContext() instead.
1067func (iter *AutoscaleSettingResourceCollectionIterator) Next() error {
1068	return iter.NextWithContext(context.Background())
1069}
1070
1071// NotDone returns true if the enumeration should be started or is not yet complete.
1072func (iter AutoscaleSettingResourceCollectionIterator) NotDone() bool {
1073	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1074}
1075
1076// Response returns the raw server response from the last page request.
1077func (iter AutoscaleSettingResourceCollectionIterator) Response() AutoscaleSettingResourceCollection {
1078	return iter.page.Response()
1079}
1080
1081// Value returns the current value or a zero-initialized value if the
1082// iterator has advanced beyond the end of the collection.
1083func (iter AutoscaleSettingResourceCollectionIterator) Value() AutoscaleSettingResource {
1084	if !iter.page.NotDone() {
1085		return AutoscaleSettingResource{}
1086	}
1087	return iter.page.Values()[iter.i]
1088}
1089
1090// Creates a new instance of the AutoscaleSettingResourceCollectionIterator type.
1091func NewAutoscaleSettingResourceCollectionIterator(page AutoscaleSettingResourceCollectionPage) AutoscaleSettingResourceCollectionIterator {
1092	return AutoscaleSettingResourceCollectionIterator{page: page}
1093}
1094
1095// IsEmpty returns true if the ListResult contains no values.
1096func (asrc AutoscaleSettingResourceCollection) IsEmpty() bool {
1097	return asrc.Value == nil || len(*asrc.Value) == 0
1098}
1099
1100// hasNextLink returns true if the NextLink is not empty.
1101func (asrc AutoscaleSettingResourceCollection) hasNextLink() bool {
1102	return asrc.NextLink != nil && len(*asrc.NextLink) != 0
1103}
1104
1105// autoscaleSettingResourceCollectionPreparer prepares a request to retrieve the next set of results.
1106// It returns nil if no more results exist.
1107func (asrc AutoscaleSettingResourceCollection) autoscaleSettingResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
1108	if !asrc.hasNextLink() {
1109		return nil, nil
1110	}
1111	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1112		autorest.AsJSON(),
1113		autorest.AsGet(),
1114		autorest.WithBaseURL(to.String(asrc.NextLink)))
1115}
1116
1117// AutoscaleSettingResourceCollectionPage contains a page of AutoscaleSettingResource values.
1118type AutoscaleSettingResourceCollectionPage struct {
1119	fn   func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error)
1120	asrc AutoscaleSettingResourceCollection
1121}
1122
1123// NextWithContext advances to the next page of values.  If there was an error making
1124// the request the page does not advance and the error is returned.
1125func (page *AutoscaleSettingResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
1126	if tracing.IsEnabled() {
1127		ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionPage.NextWithContext")
1128		defer func() {
1129			sc := -1
1130			if page.Response().Response.Response != nil {
1131				sc = page.Response().Response.Response.StatusCode
1132			}
1133			tracing.EndSpan(ctx, sc, err)
1134		}()
1135	}
1136	for {
1137		next, err := page.fn(ctx, page.asrc)
1138		if err != nil {
1139			return err
1140		}
1141		page.asrc = next
1142		if !next.hasNextLink() || !next.IsEmpty() {
1143			break
1144		}
1145	}
1146	return nil
1147}
1148
1149// Next advances to the next page of values.  If there was an error making
1150// the request the page does not advance and the error is returned.
1151// Deprecated: Use NextWithContext() instead.
1152func (page *AutoscaleSettingResourceCollectionPage) Next() error {
1153	return page.NextWithContext(context.Background())
1154}
1155
1156// NotDone returns true if the page enumeration should be started or is not yet complete.
1157func (page AutoscaleSettingResourceCollectionPage) NotDone() bool {
1158	return !page.asrc.IsEmpty()
1159}
1160
1161// Response returns the raw server response from the last page request.
1162func (page AutoscaleSettingResourceCollectionPage) Response() AutoscaleSettingResourceCollection {
1163	return page.asrc
1164}
1165
1166// Values returns the slice of values for the current page or nil if there are no values.
1167func (page AutoscaleSettingResourceCollectionPage) Values() []AutoscaleSettingResource {
1168	if page.asrc.IsEmpty() {
1169		return nil
1170	}
1171	return *page.asrc.Value
1172}
1173
1174// Creates a new instance of the AutoscaleSettingResourceCollectionPage type.
1175func NewAutoscaleSettingResourceCollectionPage(cur AutoscaleSettingResourceCollection, getNextPage func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error)) AutoscaleSettingResourceCollectionPage {
1176	return AutoscaleSettingResourceCollectionPage{
1177		fn:   getNextPage,
1178		asrc: cur,
1179	}
1180}
1181
1182// AutoscaleSettingResourcePatch the autoscale setting object for patch operations.
1183type AutoscaleSettingResourcePatch struct {
1184	// Tags - Resource tags
1185	Tags map[string]*string `json:"tags"`
1186	// AutoscaleSetting - The autoscale setting properties of the update operation.
1187	*AutoscaleSetting `json:"properties,omitempty"`
1188}
1189
1190// MarshalJSON is the custom marshaler for AutoscaleSettingResourcePatch.
1191func (asrp AutoscaleSettingResourcePatch) MarshalJSON() ([]byte, error) {
1192	objectMap := make(map[string]interface{})
1193	if asrp.Tags != nil {
1194		objectMap["tags"] = asrp.Tags
1195	}
1196	if asrp.AutoscaleSetting != nil {
1197		objectMap["properties"] = asrp.AutoscaleSetting
1198	}
1199	return json.Marshal(objectMap)
1200}
1201
1202// UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResourcePatch struct.
1203func (asrp *AutoscaleSettingResourcePatch) UnmarshalJSON(body []byte) error {
1204	var m map[string]*json.RawMessage
1205	err := json.Unmarshal(body, &m)
1206	if err != nil {
1207		return err
1208	}
1209	for k, v := range m {
1210		switch k {
1211		case "tags":
1212			if v != nil {
1213				var tags map[string]*string
1214				err = json.Unmarshal(*v, &tags)
1215				if err != nil {
1216					return err
1217				}
1218				asrp.Tags = tags
1219			}
1220		case "properties":
1221			if v != nil {
1222				var autoscaleSetting AutoscaleSetting
1223				err = json.Unmarshal(*v, &autoscaleSetting)
1224				if err != nil {
1225					return err
1226				}
1227				asrp.AutoscaleSetting = &autoscaleSetting
1228			}
1229		}
1230	}
1231
1232	return nil
1233}
1234
1235// AzNsActionGroup azure action group
1236type AzNsActionGroup struct {
1237	// ActionGroup - Azure Action Group reference.
1238	ActionGroup *[]string `json:"actionGroup,omitempty"`
1239	// EmailSubject - Custom subject override for all email ids in Azure action group
1240	EmailSubject *string `json:"emailSubject,omitempty"`
1241	// CustomWebhookPayload - Custom payload to be sent for all webhook URI in Azure action group
1242	CustomWebhookPayload *string `json:"customWebhookPayload,omitempty"`
1243}
1244
1245// AzureAppPushReceiver the Azure mobile App push notification receiver.
1246type AzureAppPushReceiver struct {
1247	// Name - The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group.
1248	Name *string `json:"name,omitempty"`
1249	// EmailAddress - The email address registered for the Azure mobile app.
1250	EmailAddress *string `json:"emailAddress,omitempty"`
1251}
1252
1253// AzureFunctionReceiver an azure function receiver.
1254type AzureFunctionReceiver struct {
1255	// Name - The name of the azure function receiver. Names must be unique across all receivers within an action group.
1256	Name *string `json:"name,omitempty"`
1257	// FunctionAppResourceID - The azure resource id of the function app.
1258	FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"`
1259	// FunctionName - The function name in the function app.
1260	FunctionName *string `json:"functionName,omitempty"`
1261	// HTTPTriggerURL - The http trigger url where http request sent to.
1262	HTTPTriggerURL *string `json:"httpTriggerUrl,omitempty"`
1263}
1264
1265// Baseline the baseline values for a single sensitivity value.
1266type Baseline struct {
1267	// Sensitivity - the sensitivity of the baseline. Possible values include: 'SensitivityLow', 'SensitivityMedium', 'SensitivityHigh'
1268	Sensitivity Sensitivity `json:"sensitivity,omitempty"`
1269	// LowThresholds - The low thresholds of the baseline.
1270	LowThresholds *[]float64 `json:"lowThresholds,omitempty"`
1271	// HighThresholds - The high thresholds of the baseline.
1272	HighThresholds *[]float64 `json:"highThresholds,omitempty"`
1273}
1274
1275// BaselineMetadataValue represents a baseline metadata value.
1276type BaselineMetadataValue struct {
1277	// Name - the name of the metadata.
1278	Name *LocalizableString `json:"name,omitempty"`
1279	// Value - the value of the metadata.
1280	Value *string `json:"value,omitempty"`
1281}
1282
1283// BaselineProperties the baseline properties class.
1284type BaselineProperties struct {
1285	// 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.
1286	Timespan *string `json:"timespan,omitempty"`
1287	// 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.
1288	Interval *string `json:"interval,omitempty"`
1289	// Aggregation - The aggregation type of the metric.
1290	Aggregation *string `json:"aggregation,omitempty"`
1291	// Timestamps - the array of timestamps of the baselines.
1292	Timestamps *[]date.Time `json:"timestamps,omitempty"`
1293	// Baseline - the baseline values for each sensitivity.
1294	Baseline *[]Baseline `json:"baseline,omitempty"`
1295	// Metadata - the baseline metadata values.
1296	Metadata *[]BaselineMetadataValue `json:"metadata,omitempty"`
1297}
1298
1299// BaselineResponse the response to a baseline query.
1300type BaselineResponse struct {
1301	autorest.Response `json:"-"`
1302	// ID - READ-ONLY; the metric baseline Id.
1303	ID *string `json:"id,omitempty"`
1304	// Type - READ-ONLY; the resource type of the baseline resource.
1305	Type *string `json:"type,omitempty"`
1306	// Name - READ-ONLY; the name and the display name of the metric, i.e. it is localizable string.
1307	Name *LocalizableString `json:"name,omitempty"`
1308	// BaselineProperties - the properties of the baseline.
1309	*BaselineProperties `json:"properties,omitempty"`
1310}
1311
1312// MarshalJSON is the custom marshaler for BaselineResponse.
1313func (br BaselineResponse) MarshalJSON() ([]byte, error) {
1314	objectMap := make(map[string]interface{})
1315	if br.BaselineProperties != nil {
1316		objectMap["properties"] = br.BaselineProperties
1317	}
1318	return json.Marshal(objectMap)
1319}
1320
1321// UnmarshalJSON is the custom unmarshaler for BaselineResponse struct.
1322func (br *BaselineResponse) UnmarshalJSON(body []byte) error {
1323	var m map[string]*json.RawMessage
1324	err := json.Unmarshal(body, &m)
1325	if err != nil {
1326		return err
1327	}
1328	for k, v := range m {
1329		switch k {
1330		case "id":
1331			if v != nil {
1332				var ID string
1333				err = json.Unmarshal(*v, &ID)
1334				if err != nil {
1335					return err
1336				}
1337				br.ID = &ID
1338			}
1339		case "type":
1340			if v != nil {
1341				var typeVar string
1342				err = json.Unmarshal(*v, &typeVar)
1343				if err != nil {
1344					return err
1345				}
1346				br.Type = &typeVar
1347			}
1348		case "name":
1349			if v != nil {
1350				var name LocalizableString
1351				err = json.Unmarshal(*v, &name)
1352				if err != nil {
1353					return err
1354				}
1355				br.Name = &name
1356			}
1357		case "properties":
1358			if v != nil {
1359				var baselineProperties BaselineProperties
1360				err = json.Unmarshal(*v, &baselineProperties)
1361				if err != nil {
1362					return err
1363				}
1364				br.BaselineProperties = &baselineProperties
1365			}
1366		}
1367	}
1368
1369	return nil
1370}
1371
1372// CalculateBaselineResponse the response to a calculate baseline call.
1373type CalculateBaselineResponse struct {
1374	autorest.Response `json:"-"`
1375	// Type - the resource type of the baseline resource.
1376	Type *string `json:"type,omitempty"`
1377	// Timestamps - the array of timestamps of the baselines.
1378	Timestamps *[]date.Time `json:"timestamps,omitempty"`
1379	// Baseline - the baseline values for each sensitivity.
1380	Baseline *[]Baseline `json:"baseline,omitempty"`
1381}
1382
1383// Criteria specifies the criteria for converting log to metric.
1384type Criteria struct {
1385	// MetricName - Name of the metric
1386	MetricName *string `json:"metricName,omitempty"`
1387	// Dimensions - List of Dimensions for creating metric
1388	Dimensions *[]Dimension `json:"dimensions,omitempty"`
1389}
1390
1391// DiagnosticSettings the diagnostic settings.
1392type DiagnosticSettings struct {
1393	// StorageAccountID - The resource ID of the storage account to which you would like to send Diagnostic Logs.
1394	StorageAccountID *string `json:"storageAccountId,omitempty"`
1395	// ServiceBusRuleID - The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
1396	ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"`
1397	// EventHubAuthorizationRuleID - The resource Id for the event hub authorization rule.
1398	EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"`
1399	// EventHubName - The name of the event hub. If none is specified, the default event hub will be selected.
1400	EventHubName *string `json:"eventHubName,omitempty"`
1401	// Metrics - The list of metric settings.
1402	Metrics *[]MetricSettings `json:"metrics,omitempty"`
1403	// Logs - The list of logs settings.
1404	Logs *[]LogSettings `json:"logs,omitempty"`
1405	// 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
1406	WorkspaceID *string `json:"workspaceId,omitempty"`
1407	// 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.)
1408	LogAnalyticsDestinationType *string `json:"logAnalyticsDestinationType,omitempty"`
1409}
1410
1411// DiagnosticSettingsCategory the diagnostic settings Category.
1412type DiagnosticSettingsCategory struct {
1413	// CategoryType - The type of the diagnostic settings category. Possible values include: 'Metrics', 'Logs'
1414	CategoryType CategoryType `json:"categoryType,omitempty"`
1415}
1416
1417// DiagnosticSettingsCategoryResource the diagnostic settings category resource.
1418type DiagnosticSettingsCategoryResource struct {
1419	autorest.Response `json:"-"`
1420	// DiagnosticSettingsCategory - The properties of a Diagnostic Settings Category.
1421	*DiagnosticSettingsCategory `json:"properties,omitempty"`
1422	// ID - READ-ONLY; Azure resource Id
1423	ID *string `json:"id,omitempty"`
1424	// Name - READ-ONLY; Azure resource name
1425	Name *string `json:"name,omitempty"`
1426	// Type - READ-ONLY; Azure resource type
1427	Type *string `json:"type,omitempty"`
1428}
1429
1430// MarshalJSON is the custom marshaler for DiagnosticSettingsCategoryResource.
1431func (dscr DiagnosticSettingsCategoryResource) MarshalJSON() ([]byte, error) {
1432	objectMap := make(map[string]interface{})
1433	if dscr.DiagnosticSettingsCategory != nil {
1434		objectMap["properties"] = dscr.DiagnosticSettingsCategory
1435	}
1436	return json.Marshal(objectMap)
1437}
1438
1439// UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsCategoryResource struct.
1440func (dscr *DiagnosticSettingsCategoryResource) UnmarshalJSON(body []byte) error {
1441	var m map[string]*json.RawMessage
1442	err := json.Unmarshal(body, &m)
1443	if err != nil {
1444		return err
1445	}
1446	for k, v := range m {
1447		switch k {
1448		case "properties":
1449			if v != nil {
1450				var diagnosticSettingsCategory DiagnosticSettingsCategory
1451				err = json.Unmarshal(*v, &diagnosticSettingsCategory)
1452				if err != nil {
1453					return err
1454				}
1455				dscr.DiagnosticSettingsCategory = &diagnosticSettingsCategory
1456			}
1457		case "id":
1458			if v != nil {
1459				var ID string
1460				err = json.Unmarshal(*v, &ID)
1461				if err != nil {
1462					return err
1463				}
1464				dscr.ID = &ID
1465			}
1466		case "name":
1467			if v != nil {
1468				var name string
1469				err = json.Unmarshal(*v, &name)
1470				if err != nil {
1471					return err
1472				}
1473				dscr.Name = &name
1474			}
1475		case "type":
1476			if v != nil {
1477				var typeVar string
1478				err = json.Unmarshal(*v, &typeVar)
1479				if err != nil {
1480					return err
1481				}
1482				dscr.Type = &typeVar
1483			}
1484		}
1485	}
1486
1487	return nil
1488}
1489
1490// DiagnosticSettingsCategoryResourceCollection represents a collection of diagnostic setting category
1491// resources.
1492type DiagnosticSettingsCategoryResourceCollection struct {
1493	autorest.Response `json:"-"`
1494	// Value - The collection of diagnostic settings category resources.
1495	Value *[]DiagnosticSettingsCategoryResource `json:"value,omitempty"`
1496}
1497
1498// DiagnosticSettingsResource the diagnostic setting resource.
1499type DiagnosticSettingsResource struct {
1500	autorest.Response `json:"-"`
1501	// DiagnosticSettings - Properties of a Diagnostic Settings Resource.
1502	*DiagnosticSettings `json:"properties,omitempty"`
1503	// ID - READ-ONLY; Azure resource Id
1504	ID *string `json:"id,omitempty"`
1505	// Name - READ-ONLY; Azure resource name
1506	Name *string `json:"name,omitempty"`
1507	// Type - READ-ONLY; Azure resource type
1508	Type *string `json:"type,omitempty"`
1509}
1510
1511// MarshalJSON is the custom marshaler for DiagnosticSettingsResource.
1512func (dsr DiagnosticSettingsResource) MarshalJSON() ([]byte, error) {
1513	objectMap := make(map[string]interface{})
1514	if dsr.DiagnosticSettings != nil {
1515		objectMap["properties"] = dsr.DiagnosticSettings
1516	}
1517	return json.Marshal(objectMap)
1518}
1519
1520// UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsResource struct.
1521func (dsr *DiagnosticSettingsResource) UnmarshalJSON(body []byte) error {
1522	var m map[string]*json.RawMessage
1523	err := json.Unmarshal(body, &m)
1524	if err != nil {
1525		return err
1526	}
1527	for k, v := range m {
1528		switch k {
1529		case "properties":
1530			if v != nil {
1531				var diagnosticSettings DiagnosticSettings
1532				err = json.Unmarshal(*v, &diagnosticSettings)
1533				if err != nil {
1534					return err
1535				}
1536				dsr.DiagnosticSettings = &diagnosticSettings
1537			}
1538		case "id":
1539			if v != nil {
1540				var ID string
1541				err = json.Unmarshal(*v, &ID)
1542				if err != nil {
1543					return err
1544				}
1545				dsr.ID = &ID
1546			}
1547		case "name":
1548			if v != nil {
1549				var name string
1550				err = json.Unmarshal(*v, &name)
1551				if err != nil {
1552					return err
1553				}
1554				dsr.Name = &name
1555			}
1556		case "type":
1557			if v != nil {
1558				var typeVar string
1559				err = json.Unmarshal(*v, &typeVar)
1560				if err != nil {
1561					return err
1562				}
1563				dsr.Type = &typeVar
1564			}
1565		}
1566	}
1567
1568	return nil
1569}
1570
1571// DiagnosticSettingsResourceCollection represents a collection of alert rule resources.
1572type DiagnosticSettingsResourceCollection struct {
1573	autorest.Response `json:"-"`
1574	// Value - The collection of diagnostic settings resources;.
1575	Value *[]DiagnosticSettingsResource `json:"value,omitempty"`
1576}
1577
1578// Dimension specifies the criteria for converting log to metric.
1579type Dimension struct {
1580	// Name - Name of the dimension
1581	Name *string `json:"name,omitempty"`
1582	// Operator - Operator for dimension values
1583	Operator *string `json:"operator,omitempty"`
1584	// Values - List of dimension values
1585	Values *[]string `json:"values,omitempty"`
1586}
1587
1588// DynamicMetricCriteria criterion for dynamic threshold.
1589type DynamicMetricCriteria struct {
1590	// Operator - The operator used to compare the metric value against the threshold. Possible values include: 'DynamicThresholdOperatorGreaterThan', 'DynamicThresholdOperatorLessThan', 'DynamicThresholdOperatorGreaterOrLessThan'
1591	Operator DynamicThresholdOperator `json:"operator,omitempty"`
1592	// 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: 'Low', 'Medium', 'High'
1593	AlertSensitivity DynamicThresholdSensitivity `json:"alertSensitivity,omitempty"`
1594	// FailingPeriods - The minimum number of violations required within the selected lookback time window required to raise an alert.
1595	FailingPeriods *DynamicThresholdFailingPeriods `json:"failingPeriods,omitempty"`
1596	// 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)
1597	IgnoreDataBefore *date.Time `json:"ignoreDataBefore,omitempty"`
1598	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
1599	AdditionalProperties map[string]interface{} `json:""`
1600	// Name - Name of the criteria.
1601	Name *string `json:"name,omitempty"`
1602	// MetricName - Name of the metric.
1603	MetricName *string `json:"metricName,omitempty"`
1604	// MetricNamespace - Namespace of the metric.
1605	MetricNamespace *string `json:"metricNamespace,omitempty"`
1606	// TimeAggregation - the criteria time aggregation types.
1607	TimeAggregation interface{} `json:"timeAggregation,omitempty"`
1608	// Dimensions - List of dimension conditions.
1609	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
1610	// SkipMetricValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
1611	SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"`
1612	// CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion'
1613	CriterionType CriterionType `json:"criterionType,omitempty"`
1614}
1615
1616// MarshalJSON is the custom marshaler for DynamicMetricCriteria.
1617func (dmc DynamicMetricCriteria) MarshalJSON() ([]byte, error) {
1618	dmc.CriterionType = CriterionTypeDynamicThresholdCriterion
1619	objectMap := make(map[string]interface{})
1620	if dmc.Operator != "" {
1621		objectMap["operator"] = dmc.Operator
1622	}
1623	if dmc.AlertSensitivity != "" {
1624		objectMap["alertSensitivity"] = dmc.AlertSensitivity
1625	}
1626	if dmc.FailingPeriods != nil {
1627		objectMap["failingPeriods"] = dmc.FailingPeriods
1628	}
1629	if dmc.IgnoreDataBefore != nil {
1630		objectMap["ignoreDataBefore"] = dmc.IgnoreDataBefore
1631	}
1632	if dmc.Name != nil {
1633		objectMap["name"] = dmc.Name
1634	}
1635	if dmc.MetricName != nil {
1636		objectMap["metricName"] = dmc.MetricName
1637	}
1638	if dmc.MetricNamespace != nil {
1639		objectMap["metricNamespace"] = dmc.MetricNamespace
1640	}
1641	if dmc.TimeAggregation != nil {
1642		objectMap["timeAggregation"] = dmc.TimeAggregation
1643	}
1644	if dmc.Dimensions != nil {
1645		objectMap["dimensions"] = dmc.Dimensions
1646	}
1647	if dmc.SkipMetricValidation != nil {
1648		objectMap["skipMetricValidation"] = dmc.SkipMetricValidation
1649	}
1650	if dmc.CriterionType != "" {
1651		objectMap["criterionType"] = dmc.CriterionType
1652	}
1653	for k, v := range dmc.AdditionalProperties {
1654		objectMap[k] = v
1655	}
1656	return json.Marshal(objectMap)
1657}
1658
1659// AsMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria.
1660func (dmc DynamicMetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) {
1661	return nil, false
1662}
1663
1664// AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria.
1665func (dmc DynamicMetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) {
1666	return &dmc, true
1667}
1668
1669// AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria.
1670func (dmc DynamicMetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) {
1671	return nil, false
1672}
1673
1674// AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria.
1675func (dmc DynamicMetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) {
1676	return &dmc, true
1677}
1678
1679// UnmarshalJSON is the custom unmarshaler for DynamicMetricCriteria struct.
1680func (dmc *DynamicMetricCriteria) UnmarshalJSON(body []byte) error {
1681	var m map[string]*json.RawMessage
1682	err := json.Unmarshal(body, &m)
1683	if err != nil {
1684		return err
1685	}
1686	for k, v := range m {
1687		switch k {
1688		case "operator":
1689			if v != nil {
1690				var operator DynamicThresholdOperator
1691				err = json.Unmarshal(*v, &operator)
1692				if err != nil {
1693					return err
1694				}
1695				dmc.Operator = operator
1696			}
1697		case "alertSensitivity":
1698			if v != nil {
1699				var alertSensitivity DynamicThresholdSensitivity
1700				err = json.Unmarshal(*v, &alertSensitivity)
1701				if err != nil {
1702					return err
1703				}
1704				dmc.AlertSensitivity = alertSensitivity
1705			}
1706		case "failingPeriods":
1707			if v != nil {
1708				var failingPeriods DynamicThresholdFailingPeriods
1709				err = json.Unmarshal(*v, &failingPeriods)
1710				if err != nil {
1711					return err
1712				}
1713				dmc.FailingPeriods = &failingPeriods
1714			}
1715		case "ignoreDataBefore":
1716			if v != nil {
1717				var ignoreDataBefore date.Time
1718				err = json.Unmarshal(*v, &ignoreDataBefore)
1719				if err != nil {
1720					return err
1721				}
1722				dmc.IgnoreDataBefore = &ignoreDataBefore
1723			}
1724		default:
1725			if v != nil {
1726				var additionalProperties interface{}
1727				err = json.Unmarshal(*v, &additionalProperties)
1728				if err != nil {
1729					return err
1730				}
1731				if dmc.AdditionalProperties == nil {
1732					dmc.AdditionalProperties = make(map[string]interface{})
1733				}
1734				dmc.AdditionalProperties[k] = additionalProperties
1735			}
1736		case "name":
1737			if v != nil {
1738				var name string
1739				err = json.Unmarshal(*v, &name)
1740				if err != nil {
1741					return err
1742				}
1743				dmc.Name = &name
1744			}
1745		case "metricName":
1746			if v != nil {
1747				var metricName string
1748				err = json.Unmarshal(*v, &metricName)
1749				if err != nil {
1750					return err
1751				}
1752				dmc.MetricName = &metricName
1753			}
1754		case "metricNamespace":
1755			if v != nil {
1756				var metricNamespace string
1757				err = json.Unmarshal(*v, &metricNamespace)
1758				if err != nil {
1759					return err
1760				}
1761				dmc.MetricNamespace = &metricNamespace
1762			}
1763		case "timeAggregation":
1764			if v != nil {
1765				var timeAggregation interface{}
1766				err = json.Unmarshal(*v, &timeAggregation)
1767				if err != nil {
1768					return err
1769				}
1770				dmc.TimeAggregation = timeAggregation
1771			}
1772		case "dimensions":
1773			if v != nil {
1774				var dimensions []MetricDimension
1775				err = json.Unmarshal(*v, &dimensions)
1776				if err != nil {
1777					return err
1778				}
1779				dmc.Dimensions = &dimensions
1780			}
1781		case "skipMetricValidation":
1782			if v != nil {
1783				var skipMetricValidation bool
1784				err = json.Unmarshal(*v, &skipMetricValidation)
1785				if err != nil {
1786					return err
1787				}
1788				dmc.SkipMetricValidation = &skipMetricValidation
1789			}
1790		case "criterionType":
1791			if v != nil {
1792				var criterionType CriterionType
1793				err = json.Unmarshal(*v, &criterionType)
1794				if err != nil {
1795					return err
1796				}
1797				dmc.CriterionType = criterionType
1798			}
1799		}
1800	}
1801
1802	return nil
1803}
1804
1805// DynamicThresholdFailingPeriods the minimum number of violations required within the selected lookback
1806// time window required to raise an alert.
1807type DynamicThresholdFailingPeriods struct {
1808	// 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.
1809	NumberOfEvaluationPeriods *float64 `json:"numberOfEvaluationPeriods,omitempty"`
1810	// MinFailingPeriodsToAlert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
1811	MinFailingPeriodsToAlert *float64 `json:"minFailingPeriodsToAlert,omitempty"`
1812}
1813
1814// EmailNotification email notification of an autoscale event.
1815type EmailNotification struct {
1816	// SendToSubscriptionAdministrator - a value indicating whether to send email to subscription administrator.
1817	SendToSubscriptionAdministrator *bool `json:"sendToSubscriptionAdministrator,omitempty"`
1818	// SendToSubscriptionCoAdministrators - a value indicating whether to send email to subscription co-administrators.
1819	SendToSubscriptionCoAdministrators *bool `json:"sendToSubscriptionCoAdministrators,omitempty"`
1820	// CustomEmails - the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored.
1821	CustomEmails *[]string `json:"customEmails,omitempty"`
1822}
1823
1824// EmailReceiver an email receiver.
1825type EmailReceiver struct {
1826	// Name - The name of the email receiver. Names must be unique across all receivers within an action group.
1827	Name *string `json:"name,omitempty"`
1828	// EmailAddress - The email address of this receiver.
1829	EmailAddress *string `json:"emailAddress,omitempty"`
1830	// Status - READ-ONLY; The receiver status of the e-mail. Possible values include: 'ReceiverStatusNotSpecified', 'ReceiverStatusEnabled', 'ReceiverStatusDisabled'
1831	Status ReceiverStatus `json:"status,omitempty"`
1832}
1833
1834// MarshalJSON is the custom marshaler for EmailReceiver.
1835func (er EmailReceiver) MarshalJSON() ([]byte, error) {
1836	objectMap := make(map[string]interface{})
1837	if er.Name != nil {
1838		objectMap["name"] = er.Name
1839	}
1840	if er.EmailAddress != nil {
1841		objectMap["emailAddress"] = er.EmailAddress
1842	}
1843	return json.Marshal(objectMap)
1844}
1845
1846// EnableRequest describes a receiver that should be resubscribed.
1847type EnableRequest struct {
1848	// ReceiverName - The name of the receiver to resubscribe.
1849	ReceiverName *string `json:"receiverName,omitempty"`
1850}
1851
1852// ErrorResponse describes the format of Error response.
1853type ErrorResponse struct {
1854	// Code - Error code
1855	Code *string `json:"code,omitempty"`
1856	// Message - Error message indicating why the operation failed.
1857	Message *string `json:"message,omitempty"`
1858}
1859
1860// EventCategoryCollection a collection of event categories. Currently possible values are: Administrative,
1861// Security, ServiceHealth, Alert, Recommendation, Policy.
1862type EventCategoryCollection struct {
1863	autorest.Response `json:"-"`
1864	// Value - the list that includes the Azure event categories.
1865	Value *[]LocalizableString `json:"value,omitempty"`
1866}
1867
1868// EventData the Azure event log entries are of type EventData
1869type EventData struct {
1870	// Authorization - READ-ONLY; The sender authorization information.
1871	Authorization *SenderAuthorization `json:"authorization,omitempty"`
1872	// Claims - READ-ONLY; key value pairs to identify ARM permissions.
1873	Claims map[string]*string `json:"claims"`
1874	// Caller - READ-ONLY; the email address of the user who has performed the operation, the UPN claim or SPN claim based on availability.
1875	Caller *string `json:"caller,omitempty"`
1876	// Description - READ-ONLY; the description of the event.
1877	Description *string `json:"description,omitempty"`
1878	// ID - READ-ONLY; the Id of this event as required by ARM for RBAC. It contains the EventDataID and a timestamp information.
1879	ID *string `json:"id,omitempty"`
1880	// EventDataID - READ-ONLY; the event data Id. This is a unique identifier for an event.
1881	EventDataID *string `json:"eventDataId,omitempty"`
1882	// 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.
1883	CorrelationID *string `json:"correlationId,omitempty"`
1884	// 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.
1885	EventName *LocalizableString `json:"eventName,omitempty"`
1886	// Category - READ-ONLY; the event category.
1887	Category *LocalizableString `json:"category,omitempty"`
1888	// 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).
1889	HTTPRequest *HTTPRequestInfo `json:"httpRequest,omitempty"`
1890	// Level - READ-ONLY; the event level. Possible values include: 'Critical', 'Error', 'Warning', 'Informational', 'Verbose'
1891	Level EventLevel `json:"level,omitempty"`
1892	// ResourceGroupName - READ-ONLY; the resource group name of the impacted resource.
1893	ResourceGroupName *string `json:"resourceGroupName,omitempty"`
1894	// ResourceProviderName - READ-ONLY; the resource provider name of the impacted resource.
1895	ResourceProviderName *LocalizableString `json:"resourceProviderName,omitempty"`
1896	// ResourceID - READ-ONLY; the resource uri that uniquely identifies the resource that caused this event.
1897	ResourceID *string `json:"resourceId,omitempty"`
1898	// ResourceType - READ-ONLY; the resource type
1899	ResourceType *LocalizableString `json:"resourceType,omitempty"`
1900	// OperationID - READ-ONLY; It is usually a GUID shared among the events corresponding to single operation. This value should not be confused with EventName.
1901	OperationID *string `json:"operationId,omitempty"`
1902	// OperationName - READ-ONLY; the operation name.
1903	OperationName *LocalizableString `json:"operationName,omitempty"`
1904	// Properties - READ-ONLY; the set of <Key, Value> pairs (usually a Dictionary<String, String>) that includes details about the event.
1905	Properties map[string]*string `json:"properties"`
1906	// Status - READ-ONLY; a string describing the status of the operation. Some typical values are: Started, In progress, Succeeded, Failed, Resolved.
1907	Status *LocalizableString `json:"status,omitempty"`
1908	// 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)
1909	SubStatus *LocalizableString `json:"subStatus,omitempty"`
1910	// 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.
1911	EventTimestamp *date.Time `json:"eventTimestamp,omitempty"`
1912	// 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.
1913	SubmissionTimestamp *date.Time `json:"submissionTimestamp,omitempty"`
1914	// SubscriptionID - READ-ONLY; the Azure subscription Id usually a GUID.
1915	SubscriptionID *string `json:"subscriptionId,omitempty"`
1916	// TenantID - READ-ONLY; the Azure tenant Id
1917	TenantID *string `json:"tenantId,omitempty"`
1918}
1919
1920// MarshalJSON is the custom marshaler for EventData.
1921func (ed EventData) MarshalJSON() ([]byte, error) {
1922	objectMap := make(map[string]interface{})
1923	return json.Marshal(objectMap)
1924}
1925
1926// EventDataCollection represents collection of events.
1927type EventDataCollection struct {
1928	autorest.Response `json:"-"`
1929	// Value - this list that includes the Azure audit logs.
1930	Value *[]EventData `json:"value,omitempty"`
1931	// NextLink - Provides the link to retrieve the next set of events.
1932	NextLink *string `json:"nextLink,omitempty"`
1933}
1934
1935// EventDataCollectionIterator provides access to a complete listing of EventData values.
1936type EventDataCollectionIterator struct {
1937	i    int
1938	page EventDataCollectionPage
1939}
1940
1941// NextWithContext advances to the next value.  If there was an error making
1942// the request the iterator does not advance and the error is returned.
1943func (iter *EventDataCollectionIterator) NextWithContext(ctx context.Context) (err error) {
1944	if tracing.IsEnabled() {
1945		ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionIterator.NextWithContext")
1946		defer func() {
1947			sc := -1
1948			if iter.Response().Response.Response != nil {
1949				sc = iter.Response().Response.Response.StatusCode
1950			}
1951			tracing.EndSpan(ctx, sc, err)
1952		}()
1953	}
1954	iter.i++
1955	if iter.i < len(iter.page.Values()) {
1956		return nil
1957	}
1958	err = iter.page.NextWithContext(ctx)
1959	if err != nil {
1960		iter.i--
1961		return err
1962	}
1963	iter.i = 0
1964	return nil
1965}
1966
1967// Next advances to the next value.  If there was an error making
1968// the request the iterator does not advance and the error is returned.
1969// Deprecated: Use NextWithContext() instead.
1970func (iter *EventDataCollectionIterator) Next() error {
1971	return iter.NextWithContext(context.Background())
1972}
1973
1974// NotDone returns true if the enumeration should be started or is not yet complete.
1975func (iter EventDataCollectionIterator) NotDone() bool {
1976	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1977}
1978
1979// Response returns the raw server response from the last page request.
1980func (iter EventDataCollectionIterator) Response() EventDataCollection {
1981	return iter.page.Response()
1982}
1983
1984// Value returns the current value or a zero-initialized value if the
1985// iterator has advanced beyond the end of the collection.
1986func (iter EventDataCollectionIterator) Value() EventData {
1987	if !iter.page.NotDone() {
1988		return EventData{}
1989	}
1990	return iter.page.Values()[iter.i]
1991}
1992
1993// Creates a new instance of the EventDataCollectionIterator type.
1994func NewEventDataCollectionIterator(page EventDataCollectionPage) EventDataCollectionIterator {
1995	return EventDataCollectionIterator{page: page}
1996}
1997
1998// IsEmpty returns true if the ListResult contains no values.
1999func (edc EventDataCollection) IsEmpty() bool {
2000	return edc.Value == nil || len(*edc.Value) == 0
2001}
2002
2003// hasNextLink returns true if the NextLink is not empty.
2004func (edc EventDataCollection) hasNextLink() bool {
2005	return edc.NextLink != nil && len(*edc.NextLink) != 0
2006}
2007
2008// eventDataCollectionPreparer prepares a request to retrieve the next set of results.
2009// It returns nil if no more results exist.
2010func (edc EventDataCollection) eventDataCollectionPreparer(ctx context.Context) (*http.Request, error) {
2011	if !edc.hasNextLink() {
2012		return nil, nil
2013	}
2014	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2015		autorest.AsJSON(),
2016		autorest.AsGet(),
2017		autorest.WithBaseURL(to.String(edc.NextLink)))
2018}
2019
2020// EventDataCollectionPage contains a page of EventData values.
2021type EventDataCollectionPage struct {
2022	fn  func(context.Context, EventDataCollection) (EventDataCollection, error)
2023	edc EventDataCollection
2024}
2025
2026// NextWithContext advances to the next page of values.  If there was an error making
2027// the request the page does not advance and the error is returned.
2028func (page *EventDataCollectionPage) NextWithContext(ctx context.Context) (err error) {
2029	if tracing.IsEnabled() {
2030		ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionPage.NextWithContext")
2031		defer func() {
2032			sc := -1
2033			if page.Response().Response.Response != nil {
2034				sc = page.Response().Response.Response.StatusCode
2035			}
2036			tracing.EndSpan(ctx, sc, err)
2037		}()
2038	}
2039	for {
2040		next, err := page.fn(ctx, page.edc)
2041		if err != nil {
2042			return err
2043		}
2044		page.edc = next
2045		if !next.hasNextLink() || !next.IsEmpty() {
2046			break
2047		}
2048	}
2049	return nil
2050}
2051
2052// Next advances to the next page of values.  If there was an error making
2053// the request the page does not advance and the error is returned.
2054// Deprecated: Use NextWithContext() instead.
2055func (page *EventDataCollectionPage) Next() error {
2056	return page.NextWithContext(context.Background())
2057}
2058
2059// NotDone returns true if the page enumeration should be started or is not yet complete.
2060func (page EventDataCollectionPage) NotDone() bool {
2061	return !page.edc.IsEmpty()
2062}
2063
2064// Response returns the raw server response from the last page request.
2065func (page EventDataCollectionPage) Response() EventDataCollection {
2066	return page.edc
2067}
2068
2069// Values returns the slice of values for the current page or nil if there are no values.
2070func (page EventDataCollectionPage) Values() []EventData {
2071	if page.edc.IsEmpty() {
2072		return nil
2073	}
2074	return *page.edc.Value
2075}
2076
2077// Creates a new instance of the EventDataCollectionPage type.
2078func NewEventDataCollectionPage(cur EventDataCollection, getNextPage func(context.Context, EventDataCollection) (EventDataCollection, error)) EventDataCollectionPage {
2079	return EventDataCollectionPage{
2080		fn:  getNextPage,
2081		edc: cur,
2082	}
2083}
2084
2085// HTTPRequestInfo the Http request info.
2086type HTTPRequestInfo struct {
2087	// ClientRequestID - the client request id.
2088	ClientRequestID *string `json:"clientRequestId,omitempty"`
2089	// ClientIPAddress - the client Ip Address
2090	ClientIPAddress *string `json:"clientIpAddress,omitempty"`
2091	// Method - the Http request method.
2092	Method *string `json:"method,omitempty"`
2093	// URI - the Uri.
2094	URI *string `json:"uri,omitempty"`
2095}
2096
2097// Incident an alert incident indicates the activation status of an alert rule.
2098type Incident struct {
2099	autorest.Response `json:"-"`
2100	// Name - READ-ONLY; Incident name.
2101	Name *string `json:"name,omitempty"`
2102	// RuleName - READ-ONLY; Rule name that is associated with the incident.
2103	RuleName *string `json:"ruleName,omitempty"`
2104	// IsActive - READ-ONLY; A boolean to indicate whether the incident is active or resolved.
2105	IsActive *bool `json:"isActive,omitempty"`
2106	// ActivatedTime - READ-ONLY; The time at which the incident was activated in ISO8601 format.
2107	ActivatedTime *date.Time `json:"activatedTime,omitempty"`
2108	// ResolvedTime - READ-ONLY; The time at which the incident was resolved in ISO8601 format. If null, it means the incident is still active.
2109	ResolvedTime *date.Time `json:"resolvedTime,omitempty"`
2110}
2111
2112// IncidentListResult the List incidents operation response.
2113type IncidentListResult struct {
2114	autorest.Response `json:"-"`
2115	// Value - the incident collection.
2116	Value *[]Incident `json:"value,omitempty"`
2117}
2118
2119// ItsmReceiver an Itsm receiver.
2120type ItsmReceiver struct {
2121	// Name - The name of the Itsm receiver. Names must be unique across all receivers within an action group.
2122	Name *string `json:"name,omitempty"`
2123	// WorkspaceID - OMS LA instance identifier.
2124	WorkspaceID *string `json:"workspaceId,omitempty"`
2125	// ConnectionID - Unique identification of ITSM connection among multiple defined in above workspace.
2126	ConnectionID *string `json:"connectionId,omitempty"`
2127	// TicketConfiguration - JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well.
2128	TicketConfiguration *string `json:"ticketConfiguration,omitempty"`
2129	// Region - Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope'
2130	Region *string `json:"region,omitempty"`
2131}
2132
2133// LocalizableString the localizable string class.
2134type LocalizableString struct {
2135	// Value - the invariant value.
2136	Value *string `json:"value,omitempty"`
2137	// LocalizedValue - the locale specific value.
2138	LocalizedValue *string `json:"localizedValue,omitempty"`
2139}
2140
2141// LocationThresholdRuleCondition a rule condition based on a certain number of locations failing.
2142type LocationThresholdRuleCondition struct {
2143	// 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.
2144	WindowSize *string `json:"windowSize,omitempty"`
2145	// FailedLocationCount - the number of locations that must fail to activate the alert.
2146	FailedLocationCount *int32 `json:"failedLocationCount,omitempty"`
2147	// DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource.
2148	DataSource BasicRuleDataSource `json:"dataSource,omitempty"`
2149	// OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition'
2150	OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"`
2151}
2152
2153// MarshalJSON is the custom marshaler for LocationThresholdRuleCondition.
2154func (ltrc LocationThresholdRuleCondition) MarshalJSON() ([]byte, error) {
2155	ltrc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition
2156	objectMap := make(map[string]interface{})
2157	if ltrc.WindowSize != nil {
2158		objectMap["windowSize"] = ltrc.WindowSize
2159	}
2160	if ltrc.FailedLocationCount != nil {
2161		objectMap["failedLocationCount"] = ltrc.FailedLocationCount
2162	}
2163	objectMap["dataSource"] = ltrc.DataSource
2164	if ltrc.OdataType != "" {
2165		objectMap["odata.type"] = ltrc.OdataType
2166	}
2167	return json.Marshal(objectMap)
2168}
2169
2170// AsThresholdRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition.
2171func (ltrc LocationThresholdRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) {
2172	return nil, false
2173}
2174
2175// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition.
2176func (ltrc LocationThresholdRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) {
2177	return &ltrc, true
2178}
2179
2180// AsManagementEventRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition.
2181func (ltrc LocationThresholdRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) {
2182	return nil, false
2183}
2184
2185// AsRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition.
2186func (ltrc LocationThresholdRuleCondition) AsRuleCondition() (*RuleCondition, bool) {
2187	return nil, false
2188}
2189
2190// AsBasicRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition.
2191func (ltrc LocationThresholdRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) {
2192	return &ltrc, true
2193}
2194
2195// UnmarshalJSON is the custom unmarshaler for LocationThresholdRuleCondition struct.
2196func (ltrc *LocationThresholdRuleCondition) UnmarshalJSON(body []byte) error {
2197	var m map[string]*json.RawMessage
2198	err := json.Unmarshal(body, &m)
2199	if err != nil {
2200		return err
2201	}
2202	for k, v := range m {
2203		switch k {
2204		case "windowSize":
2205			if v != nil {
2206				var windowSize string
2207				err = json.Unmarshal(*v, &windowSize)
2208				if err != nil {
2209					return err
2210				}
2211				ltrc.WindowSize = &windowSize
2212			}
2213		case "failedLocationCount":
2214			if v != nil {
2215				var failedLocationCount int32
2216				err = json.Unmarshal(*v, &failedLocationCount)
2217				if err != nil {
2218					return err
2219				}
2220				ltrc.FailedLocationCount = &failedLocationCount
2221			}
2222		case "dataSource":
2223			if v != nil {
2224				dataSource, err := unmarshalBasicRuleDataSource(*v)
2225				if err != nil {
2226					return err
2227				}
2228				ltrc.DataSource = dataSource
2229			}
2230		case "odata.type":
2231			if v != nil {
2232				var odataType OdataTypeBasicRuleCondition
2233				err = json.Unmarshal(*v, &odataType)
2234				if err != nil {
2235					return err
2236				}
2237				ltrc.OdataType = odataType
2238			}
2239		}
2240	}
2241
2242	return nil
2243}
2244
2245// LogicAppReceiver a logic app receiver.
2246type LogicAppReceiver struct {
2247	// Name - The name of the logic app receiver. Names must be unique across all receivers within an action group.
2248	Name *string `json:"name,omitempty"`
2249	// ResourceID - The azure resource id of the logic app receiver.
2250	ResourceID *string `json:"resourceId,omitempty"`
2251	// CallbackURL - The callback url where http request sent to.
2252	CallbackURL *string `json:"callbackUrl,omitempty"`
2253}
2254
2255// LogMetricTrigger a log metrics trigger descriptor.
2256type LogMetricTrigger struct {
2257	// ThresholdOperator - Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. Possible values include: 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual'
2258	ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"`
2259	// Threshold - The threshold of the metric trigger.
2260	Threshold *float64 `json:"threshold,omitempty"`
2261	// MetricTriggerType - Metric Trigger Type - 'Consecutive' or 'Total'. Possible values include: 'MetricTriggerTypeConsecutive', 'MetricTriggerTypeTotal'
2262	MetricTriggerType MetricTriggerType `json:"metricTriggerType,omitempty"`
2263	// MetricColumn - Evaluation of metric on a particular column
2264	MetricColumn *string `json:"metricColumn,omitempty"`
2265}
2266
2267// LogProfileCollection represents a collection of log profiles.
2268type LogProfileCollection struct {
2269	autorest.Response `json:"-"`
2270	// Value - the values of the log profiles.
2271	Value *[]LogProfileResource `json:"value,omitempty"`
2272}
2273
2274// LogProfileProperties the log profile properties.
2275type LogProfileProperties struct {
2276	// StorageAccountID - the resource id of the storage account to which you would like to send the Activity Log.
2277	StorageAccountID *string `json:"storageAccountId,omitempty"`
2278	// 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}'.
2279	ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"`
2280	// 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.
2281	Locations *[]string `json:"locations,omitempty"`
2282	// Categories - the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
2283	Categories *[]string `json:"categories,omitempty"`
2284	// RetentionPolicy - the retention policy for the events in the log.
2285	RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
2286}
2287
2288// LogProfileResource the log profile resource.
2289type LogProfileResource struct {
2290	autorest.Response `json:"-"`
2291	// LogProfileProperties - The log profile properties of the resource.
2292	*LogProfileProperties `json:"properties,omitempty"`
2293	// ID - READ-ONLY; Azure resource Id
2294	ID *string `json:"id,omitempty"`
2295	// Name - READ-ONLY; Azure resource name
2296	Name *string `json:"name,omitempty"`
2297	// Type - READ-ONLY; Azure resource type
2298	Type *string `json:"type,omitempty"`
2299	// Location - Resource location
2300	Location *string `json:"location,omitempty"`
2301	// Tags - Resource tags
2302	Tags map[string]*string `json:"tags"`
2303}
2304
2305// MarshalJSON is the custom marshaler for LogProfileResource.
2306func (lpr LogProfileResource) MarshalJSON() ([]byte, error) {
2307	objectMap := make(map[string]interface{})
2308	if lpr.LogProfileProperties != nil {
2309		objectMap["properties"] = lpr.LogProfileProperties
2310	}
2311	if lpr.Location != nil {
2312		objectMap["location"] = lpr.Location
2313	}
2314	if lpr.Tags != nil {
2315		objectMap["tags"] = lpr.Tags
2316	}
2317	return json.Marshal(objectMap)
2318}
2319
2320// UnmarshalJSON is the custom unmarshaler for LogProfileResource struct.
2321func (lpr *LogProfileResource) UnmarshalJSON(body []byte) error {
2322	var m map[string]*json.RawMessage
2323	err := json.Unmarshal(body, &m)
2324	if err != nil {
2325		return err
2326	}
2327	for k, v := range m {
2328		switch k {
2329		case "properties":
2330			if v != nil {
2331				var logProfileProperties LogProfileProperties
2332				err = json.Unmarshal(*v, &logProfileProperties)
2333				if err != nil {
2334					return err
2335				}
2336				lpr.LogProfileProperties = &logProfileProperties
2337			}
2338		case "id":
2339			if v != nil {
2340				var ID string
2341				err = json.Unmarshal(*v, &ID)
2342				if err != nil {
2343					return err
2344				}
2345				lpr.ID = &ID
2346			}
2347		case "name":
2348			if v != nil {
2349				var name string
2350				err = json.Unmarshal(*v, &name)
2351				if err != nil {
2352					return err
2353				}
2354				lpr.Name = &name
2355			}
2356		case "type":
2357			if v != nil {
2358				var typeVar string
2359				err = json.Unmarshal(*v, &typeVar)
2360				if err != nil {
2361					return err
2362				}
2363				lpr.Type = &typeVar
2364			}
2365		case "location":
2366			if v != nil {
2367				var location string
2368				err = json.Unmarshal(*v, &location)
2369				if err != nil {
2370					return err
2371				}
2372				lpr.Location = &location
2373			}
2374		case "tags":
2375			if v != nil {
2376				var tags map[string]*string
2377				err = json.Unmarshal(*v, &tags)
2378				if err != nil {
2379					return err
2380				}
2381				lpr.Tags = tags
2382			}
2383		}
2384	}
2385
2386	return nil
2387}
2388
2389// LogProfileResourcePatch the log profile resource for patch operations.
2390type LogProfileResourcePatch struct {
2391	// Tags - Resource tags
2392	Tags map[string]*string `json:"tags"`
2393	// LogProfileProperties - The log profile properties for an update operation.
2394	*LogProfileProperties `json:"properties,omitempty"`
2395}
2396
2397// MarshalJSON is the custom marshaler for LogProfileResourcePatch.
2398func (lprp LogProfileResourcePatch) MarshalJSON() ([]byte, error) {
2399	objectMap := make(map[string]interface{})
2400	if lprp.Tags != nil {
2401		objectMap["tags"] = lprp.Tags
2402	}
2403	if lprp.LogProfileProperties != nil {
2404		objectMap["properties"] = lprp.LogProfileProperties
2405	}
2406	return json.Marshal(objectMap)
2407}
2408
2409// UnmarshalJSON is the custom unmarshaler for LogProfileResourcePatch struct.
2410func (lprp *LogProfileResourcePatch) UnmarshalJSON(body []byte) error {
2411	var m map[string]*json.RawMessage
2412	err := json.Unmarshal(body, &m)
2413	if err != nil {
2414		return err
2415	}
2416	for k, v := range m {
2417		switch k {
2418		case "tags":
2419			if v != nil {
2420				var tags map[string]*string
2421				err = json.Unmarshal(*v, &tags)
2422				if err != nil {
2423					return err
2424				}
2425				lprp.Tags = tags
2426			}
2427		case "properties":
2428			if v != nil {
2429				var logProfileProperties LogProfileProperties
2430				err = json.Unmarshal(*v, &logProfileProperties)
2431				if err != nil {
2432					return err
2433				}
2434				lprp.LogProfileProperties = &logProfileProperties
2435			}
2436		}
2437	}
2438
2439	return nil
2440}
2441
2442// LogSearchRule log Search Rule Definition
2443type LogSearchRule struct {
2444	// Description - The description of the Log Search rule.
2445	Description *string `json:"description,omitempty"`
2446	// Enabled - The flag which indicates whether the Log Search rule is enabled. Value should be true or false. Possible values include: 'True', 'False'
2447	Enabled Enabled `json:"enabled,omitempty"`
2448	// LastUpdatedTime - READ-ONLY; Last time the rule was updated in IS08601 format.
2449	LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
2450	// ProvisioningState - READ-ONLY; Provisioning state of the scheduled query rule. Possible values include: 'Succeeded', 'Deploying', 'Canceled', 'Failed'
2451	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2452	// Source - Data Source against which rule will Query Data
2453	Source *Source `json:"source,omitempty"`
2454	// Schedule - Schedule (Frequency, Time Window) for rule. Required for action type - AlertingAction
2455	Schedule *Schedule `json:"schedule,omitempty"`
2456	// Action - Action needs to be taken on rule execution.
2457	Action BasicAction `json:"action,omitempty"`
2458}
2459
2460// MarshalJSON is the custom marshaler for LogSearchRule.
2461func (lsr LogSearchRule) MarshalJSON() ([]byte, error) {
2462	objectMap := make(map[string]interface{})
2463	if lsr.Description != nil {
2464		objectMap["description"] = lsr.Description
2465	}
2466	if lsr.Enabled != "" {
2467		objectMap["enabled"] = lsr.Enabled
2468	}
2469	if lsr.Source != nil {
2470		objectMap["source"] = lsr.Source
2471	}
2472	if lsr.Schedule != nil {
2473		objectMap["schedule"] = lsr.Schedule
2474	}
2475	objectMap["action"] = lsr.Action
2476	return json.Marshal(objectMap)
2477}
2478
2479// UnmarshalJSON is the custom unmarshaler for LogSearchRule struct.
2480func (lsr *LogSearchRule) UnmarshalJSON(body []byte) error {
2481	var m map[string]*json.RawMessage
2482	err := json.Unmarshal(body, &m)
2483	if err != nil {
2484		return err
2485	}
2486	for k, v := range m {
2487		switch k {
2488		case "description":
2489			if v != nil {
2490				var description string
2491				err = json.Unmarshal(*v, &description)
2492				if err != nil {
2493					return err
2494				}
2495				lsr.Description = &description
2496			}
2497		case "enabled":
2498			if v != nil {
2499				var enabled Enabled
2500				err = json.Unmarshal(*v, &enabled)
2501				if err != nil {
2502					return err
2503				}
2504				lsr.Enabled = enabled
2505			}
2506		case "lastUpdatedTime":
2507			if v != nil {
2508				var lastUpdatedTime date.Time
2509				err = json.Unmarshal(*v, &lastUpdatedTime)
2510				if err != nil {
2511					return err
2512				}
2513				lsr.LastUpdatedTime = &lastUpdatedTime
2514			}
2515		case "provisioningState":
2516			if v != nil {
2517				var provisioningState ProvisioningState
2518				err = json.Unmarshal(*v, &provisioningState)
2519				if err != nil {
2520					return err
2521				}
2522				lsr.ProvisioningState = provisioningState
2523			}
2524		case "source":
2525			if v != nil {
2526				var source Source
2527				err = json.Unmarshal(*v, &source)
2528				if err != nil {
2529					return err
2530				}
2531				lsr.Source = &source
2532			}
2533		case "schedule":
2534			if v != nil {
2535				var schedule Schedule
2536				err = json.Unmarshal(*v, &schedule)
2537				if err != nil {
2538					return err
2539				}
2540				lsr.Schedule = &schedule
2541			}
2542		case "action":
2543			if v != nil {
2544				action, err := unmarshalBasicAction(*v)
2545				if err != nil {
2546					return err
2547				}
2548				lsr.Action = action
2549			}
2550		}
2551	}
2552
2553	return nil
2554}
2555
2556// LogSearchRulePatch log Search Rule Definition for Patching
2557type LogSearchRulePatch struct {
2558	// Enabled - The flag which indicates whether the Log Search rule is enabled. Value should be true or false. Possible values include: 'True', 'False'
2559	Enabled Enabled `json:"enabled,omitempty"`
2560}
2561
2562// LogSearchRuleResource the Log Search Rule resource.
2563type LogSearchRuleResource struct {
2564	autorest.Response `json:"-"`
2565	// LogSearchRule - The rule properties of the resource.
2566	*LogSearchRule `json:"properties,omitempty"`
2567	// ID - READ-ONLY; Azure resource Id
2568	ID *string `json:"id,omitempty"`
2569	// Name - READ-ONLY; Azure resource name
2570	Name *string `json:"name,omitempty"`
2571	// Type - READ-ONLY; Azure resource type
2572	Type *string `json:"type,omitempty"`
2573	// Location - Resource location
2574	Location *string `json:"location,omitempty"`
2575	// Tags - Resource tags
2576	Tags map[string]*string `json:"tags"`
2577}
2578
2579// MarshalJSON is the custom marshaler for LogSearchRuleResource.
2580func (lsrr LogSearchRuleResource) MarshalJSON() ([]byte, error) {
2581	objectMap := make(map[string]interface{})
2582	if lsrr.LogSearchRule != nil {
2583		objectMap["properties"] = lsrr.LogSearchRule
2584	}
2585	if lsrr.Location != nil {
2586		objectMap["location"] = lsrr.Location
2587	}
2588	if lsrr.Tags != nil {
2589		objectMap["tags"] = lsrr.Tags
2590	}
2591	return json.Marshal(objectMap)
2592}
2593
2594// UnmarshalJSON is the custom unmarshaler for LogSearchRuleResource struct.
2595func (lsrr *LogSearchRuleResource) UnmarshalJSON(body []byte) error {
2596	var m map[string]*json.RawMessage
2597	err := json.Unmarshal(body, &m)
2598	if err != nil {
2599		return err
2600	}
2601	for k, v := range m {
2602		switch k {
2603		case "properties":
2604			if v != nil {
2605				var logSearchRule LogSearchRule
2606				err = json.Unmarshal(*v, &logSearchRule)
2607				if err != nil {
2608					return err
2609				}
2610				lsrr.LogSearchRule = &logSearchRule
2611			}
2612		case "id":
2613			if v != nil {
2614				var ID string
2615				err = json.Unmarshal(*v, &ID)
2616				if err != nil {
2617					return err
2618				}
2619				lsrr.ID = &ID
2620			}
2621		case "name":
2622			if v != nil {
2623				var name string
2624				err = json.Unmarshal(*v, &name)
2625				if err != nil {
2626					return err
2627				}
2628				lsrr.Name = &name
2629			}
2630		case "type":
2631			if v != nil {
2632				var typeVar string
2633				err = json.Unmarshal(*v, &typeVar)
2634				if err != nil {
2635					return err
2636				}
2637				lsrr.Type = &typeVar
2638			}
2639		case "location":
2640			if v != nil {
2641				var location string
2642				err = json.Unmarshal(*v, &location)
2643				if err != nil {
2644					return err
2645				}
2646				lsrr.Location = &location
2647			}
2648		case "tags":
2649			if v != nil {
2650				var tags map[string]*string
2651				err = json.Unmarshal(*v, &tags)
2652				if err != nil {
2653					return err
2654				}
2655				lsrr.Tags = tags
2656			}
2657		}
2658	}
2659
2660	return nil
2661}
2662
2663// LogSearchRuleResourceCollection represents a collection of Log Search rule resources.
2664type LogSearchRuleResourceCollection struct {
2665	autorest.Response `json:"-"`
2666	// Value - The values for the Log Search Rule resources.
2667	Value *[]LogSearchRuleResource `json:"value,omitempty"`
2668}
2669
2670// LogSearchRuleResourcePatch the log search rule resource for patch operations.
2671type LogSearchRuleResourcePatch struct {
2672	// Tags - Resource tags
2673	Tags map[string]*string `json:"tags"`
2674	// LogSearchRulePatch - The log search rule properties of the resource.
2675	*LogSearchRulePatch `json:"properties,omitempty"`
2676}
2677
2678// MarshalJSON is the custom marshaler for LogSearchRuleResourcePatch.
2679func (lsrrp LogSearchRuleResourcePatch) MarshalJSON() ([]byte, error) {
2680	objectMap := make(map[string]interface{})
2681	if lsrrp.Tags != nil {
2682		objectMap["tags"] = lsrrp.Tags
2683	}
2684	if lsrrp.LogSearchRulePatch != nil {
2685		objectMap["properties"] = lsrrp.LogSearchRulePatch
2686	}
2687	return json.Marshal(objectMap)
2688}
2689
2690// UnmarshalJSON is the custom unmarshaler for LogSearchRuleResourcePatch struct.
2691func (lsrrp *LogSearchRuleResourcePatch) UnmarshalJSON(body []byte) error {
2692	var m map[string]*json.RawMessage
2693	err := json.Unmarshal(body, &m)
2694	if err != nil {
2695		return err
2696	}
2697	for k, v := range m {
2698		switch k {
2699		case "tags":
2700			if v != nil {
2701				var tags map[string]*string
2702				err = json.Unmarshal(*v, &tags)
2703				if err != nil {
2704					return err
2705				}
2706				lsrrp.Tags = tags
2707			}
2708		case "properties":
2709			if v != nil {
2710				var logSearchRulePatch LogSearchRulePatch
2711				err = json.Unmarshal(*v, &logSearchRulePatch)
2712				if err != nil {
2713					return err
2714				}
2715				lsrrp.LogSearchRulePatch = &logSearchRulePatch
2716			}
2717		}
2718	}
2719
2720	return nil
2721}
2722
2723// LogSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log.
2724type LogSettings struct {
2725	// 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.
2726	Category *string `json:"category,omitempty"`
2727	// Enabled - a value indicating whether this log is enabled.
2728	Enabled *bool `json:"enabled,omitempty"`
2729	// RetentionPolicy - the retention policy for this log.
2730	RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
2731}
2732
2733// LogToMetricAction specify action need to be taken when rule type is converting log to metric
2734type LogToMetricAction struct {
2735	// Criteria - Criteria of Metric
2736	Criteria *[]Criteria `json:"criteria,omitempty"`
2737	// OdataType - Possible values include: 'OdataTypeAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction'
2738	OdataType OdataTypeBasicAction `json:"odata.type,omitempty"`
2739}
2740
2741// MarshalJSON is the custom marshaler for LogToMetricAction.
2742func (ltma LogToMetricAction) MarshalJSON() ([]byte, error) {
2743	ltma.OdataType = OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction
2744	objectMap := make(map[string]interface{})
2745	if ltma.Criteria != nil {
2746		objectMap["criteria"] = ltma.Criteria
2747	}
2748	if ltma.OdataType != "" {
2749		objectMap["odata.type"] = ltma.OdataType
2750	}
2751	return json.Marshal(objectMap)
2752}
2753
2754// AsAlertingAction is the BasicAction implementation for LogToMetricAction.
2755func (ltma LogToMetricAction) AsAlertingAction() (*AlertingAction, bool) {
2756	return nil, false
2757}
2758
2759// AsLogToMetricAction is the BasicAction implementation for LogToMetricAction.
2760func (ltma LogToMetricAction) AsLogToMetricAction() (*LogToMetricAction, bool) {
2761	return &ltma, true
2762}
2763
2764// AsAction is the BasicAction implementation for LogToMetricAction.
2765func (ltma LogToMetricAction) AsAction() (*Action, bool) {
2766	return nil, false
2767}
2768
2769// AsBasicAction is the BasicAction implementation for LogToMetricAction.
2770func (ltma LogToMetricAction) AsBasicAction() (BasicAction, bool) {
2771	return &ltma, true
2772}
2773
2774// ManagementEventAggregationCondition how the data that is collected should be combined over time.
2775type ManagementEventAggregationCondition struct {
2776	// Operator - the condition operator. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual'
2777	Operator ConditionOperator `json:"operator,omitempty"`
2778	// Threshold - The threshold value that activates the alert.
2779	Threshold *float64 `json:"threshold,omitempty"`
2780	// 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.
2781	WindowSize *string `json:"windowSize,omitempty"`
2782}
2783
2784// ManagementEventRuleCondition a management event rule condition.
2785type ManagementEventRuleCondition struct {
2786	// 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.
2787	Aggregation *ManagementEventAggregationCondition `json:"aggregation,omitempty"`
2788	// DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource.
2789	DataSource BasicRuleDataSource `json:"dataSource,omitempty"`
2790	// OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition'
2791	OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"`
2792}
2793
2794// MarshalJSON is the custom marshaler for ManagementEventRuleCondition.
2795func (merc ManagementEventRuleCondition) MarshalJSON() ([]byte, error) {
2796	merc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition
2797	objectMap := make(map[string]interface{})
2798	if merc.Aggregation != nil {
2799		objectMap["aggregation"] = merc.Aggregation
2800	}
2801	objectMap["dataSource"] = merc.DataSource
2802	if merc.OdataType != "" {
2803		objectMap["odata.type"] = merc.OdataType
2804	}
2805	return json.Marshal(objectMap)
2806}
2807
2808// AsThresholdRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition.
2809func (merc ManagementEventRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) {
2810	return nil, false
2811}
2812
2813// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition.
2814func (merc ManagementEventRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) {
2815	return nil, false
2816}
2817
2818// AsManagementEventRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition.
2819func (merc ManagementEventRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) {
2820	return &merc, true
2821}
2822
2823// AsRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition.
2824func (merc ManagementEventRuleCondition) AsRuleCondition() (*RuleCondition, bool) {
2825	return nil, false
2826}
2827
2828// AsBasicRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition.
2829func (merc ManagementEventRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) {
2830	return &merc, true
2831}
2832
2833// UnmarshalJSON is the custom unmarshaler for ManagementEventRuleCondition struct.
2834func (merc *ManagementEventRuleCondition) UnmarshalJSON(body []byte) error {
2835	var m map[string]*json.RawMessage
2836	err := json.Unmarshal(body, &m)
2837	if err != nil {
2838		return err
2839	}
2840	for k, v := range m {
2841		switch k {
2842		case "aggregation":
2843			if v != nil {
2844				var aggregation ManagementEventAggregationCondition
2845				err = json.Unmarshal(*v, &aggregation)
2846				if err != nil {
2847					return err
2848				}
2849				merc.Aggregation = &aggregation
2850			}
2851		case "dataSource":
2852			if v != nil {
2853				dataSource, err := unmarshalBasicRuleDataSource(*v)
2854				if err != nil {
2855					return err
2856				}
2857				merc.DataSource = dataSource
2858			}
2859		case "odata.type":
2860			if v != nil {
2861				var odataType OdataTypeBasicRuleCondition
2862				err = json.Unmarshal(*v, &odataType)
2863				if err != nil {
2864					return err
2865				}
2866				merc.OdataType = odataType
2867			}
2868		}
2869	}
2870
2871	return nil
2872}
2873
2874// MetadataValue represents a metric metadata value.
2875type MetadataValue struct {
2876	// Name - the name of the metadata.
2877	Name *LocalizableString `json:"name,omitempty"`
2878	// Value - the value of the metadata.
2879	Value *string `json:"value,omitempty"`
2880}
2881
2882// Metric the result data of a query.
2883type Metric struct {
2884	// ID - the metric Id.
2885	ID *string `json:"id,omitempty"`
2886	// Type - the resource type of the metric resource.
2887	Type *string `json:"type,omitempty"`
2888	// Name - the name and the display name of the metric, i.e. it is localizable string.
2889	Name *LocalizableString `json:"name,omitempty"`
2890	// Unit - the unit of the metric. Possible values include: 'UnitCount', 'UnitBytes', 'UnitSeconds', 'UnitCountPerSecond', 'UnitBytesPerSecond', 'UnitPercent', 'UnitMilliSeconds', 'UnitByteSeconds', 'UnitUnspecified', 'UnitCores', 'UnitMilliCores', 'UnitNanoCores', 'UnitBitsPerSecond'
2891	Unit Unit `json:"unit,omitempty"`
2892	// Timeseries - the time series returned when a data query is performed.
2893	Timeseries *[]TimeSeriesElement `json:"timeseries,omitempty"`
2894}
2895
2896// MetricAlertAction an alert action.
2897type MetricAlertAction struct {
2898	// ActionGroupID - the id of the action group to use.
2899	ActionGroupID *string `json:"actionGroupId,omitempty"`
2900	// WebHookProperties - The properties of a webhook object.
2901	WebHookProperties map[string]*string `json:"webHookProperties"`
2902}
2903
2904// MarshalJSON is the custom marshaler for MetricAlertAction.
2905func (maa MetricAlertAction) MarshalJSON() ([]byte, error) {
2906	objectMap := make(map[string]interface{})
2907	if maa.ActionGroupID != nil {
2908		objectMap["actionGroupId"] = maa.ActionGroupID
2909	}
2910	if maa.WebHookProperties != nil {
2911		objectMap["webHookProperties"] = maa.WebHookProperties
2912	}
2913	return json.Marshal(objectMap)
2914}
2915
2916// BasicMetricAlertCriteria the rule criteria that defines the conditions of the alert rule.
2917type BasicMetricAlertCriteria interface {
2918	AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool)
2919	AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool)
2920	AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool)
2921	AsMetricAlertCriteria() (*MetricAlertCriteria, bool)
2922}
2923
2924// MetricAlertCriteria the rule criteria that defines the conditions of the alert rule.
2925type MetricAlertCriteria struct {
2926	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
2927	AdditionalProperties map[string]interface{} `json:""`
2928	// OdataType - Possible values include: 'OdataTypeMetricAlertCriteria', 'OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria'
2929	OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"`
2930}
2931
2932func unmarshalBasicMetricAlertCriteria(body []byte) (BasicMetricAlertCriteria, error) {
2933	var m map[string]interface{}
2934	err := json.Unmarshal(body, &m)
2935	if err != nil {
2936		return nil, err
2937	}
2938
2939	switch m["odata.type"] {
2940	case string(OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria):
2941		var masrmmc MetricAlertSingleResourceMultipleMetricCriteria
2942		err := json.Unmarshal(body, &masrmmc)
2943		return masrmmc, err
2944	case string(OdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria):
2945		var wlac WebtestLocationAvailabilityCriteria
2946		err := json.Unmarshal(body, &wlac)
2947		return wlac, err
2948	case string(OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria):
2949		var mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria
2950		err := json.Unmarshal(body, &mamrmmc)
2951		return mamrmmc, err
2952	default:
2953		var mac MetricAlertCriteria
2954		err := json.Unmarshal(body, &mac)
2955		return mac, err
2956	}
2957}
2958func unmarshalBasicMetricAlertCriteriaArray(body []byte) ([]BasicMetricAlertCriteria, error) {
2959	var rawMessages []*json.RawMessage
2960	err := json.Unmarshal(body, &rawMessages)
2961	if err != nil {
2962		return nil, err
2963	}
2964
2965	macArray := make([]BasicMetricAlertCriteria, len(rawMessages))
2966
2967	for index, rawMessage := range rawMessages {
2968		mac, err := unmarshalBasicMetricAlertCriteria(*rawMessage)
2969		if err != nil {
2970			return nil, err
2971		}
2972		macArray[index] = mac
2973	}
2974	return macArray, nil
2975}
2976
2977// MarshalJSON is the custom marshaler for MetricAlertCriteria.
2978func (mac MetricAlertCriteria) MarshalJSON() ([]byte, error) {
2979	mac.OdataType = OdataTypeMetricAlertCriteria
2980	objectMap := make(map[string]interface{})
2981	if mac.OdataType != "" {
2982		objectMap["odata.type"] = mac.OdataType
2983	}
2984	for k, v := range mac.AdditionalProperties {
2985		objectMap[k] = v
2986	}
2987	return json.Marshal(objectMap)
2988}
2989
2990// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
2991func (mac MetricAlertCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) {
2992	return nil, false
2993}
2994
2995// AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
2996func (mac MetricAlertCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) {
2997	return nil, false
2998}
2999
3000// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
3001func (mac MetricAlertCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) {
3002	return nil, false
3003}
3004
3005// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
3006func (mac MetricAlertCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) {
3007	return &mac, true
3008}
3009
3010// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
3011func (mac MetricAlertCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) {
3012	return &mac, true
3013}
3014
3015// UnmarshalJSON is the custom unmarshaler for MetricAlertCriteria struct.
3016func (mac *MetricAlertCriteria) UnmarshalJSON(body []byte) error {
3017	var m map[string]*json.RawMessage
3018	err := json.Unmarshal(body, &m)
3019	if err != nil {
3020		return err
3021	}
3022	for k, v := range m {
3023		switch k {
3024		default:
3025			if v != nil {
3026				var additionalProperties interface{}
3027				err = json.Unmarshal(*v, &additionalProperties)
3028				if err != nil {
3029					return err
3030				}
3031				if mac.AdditionalProperties == nil {
3032					mac.AdditionalProperties = make(map[string]interface{})
3033				}
3034				mac.AdditionalProperties[k] = additionalProperties
3035			}
3036		case "odata.type":
3037			if v != nil {
3038				var odataType OdataTypeBasicMetricAlertCriteria
3039				err = json.Unmarshal(*v, &odataType)
3040				if err != nil {
3041					return err
3042				}
3043				mac.OdataType = odataType
3044			}
3045		}
3046	}
3047
3048	return nil
3049}
3050
3051// MetricAlertMultipleResourceMultipleMetricCriteria specifies the metric alert criteria for multiple
3052// resource that has multiple metric criteria.
3053type MetricAlertMultipleResourceMultipleMetricCriteria struct {
3054	// AllOf - the list of multiple metric criteria for this 'all of' operation.
3055	AllOf *[]BasicMultiMetricCriteria `json:"allOf,omitempty"`
3056	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
3057	AdditionalProperties map[string]interface{} `json:""`
3058	// OdataType - Possible values include: 'OdataTypeMetricAlertCriteria', 'OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria'
3059	OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"`
3060}
3061
3062// MarshalJSON is the custom marshaler for MetricAlertMultipleResourceMultipleMetricCriteria.
3063func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) {
3064	mamrmmc.OdataType = OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria
3065	objectMap := make(map[string]interface{})
3066	if mamrmmc.AllOf != nil {
3067		objectMap["allOf"] = mamrmmc.AllOf
3068	}
3069	if mamrmmc.OdataType != "" {
3070		objectMap["odata.type"] = mamrmmc.OdataType
3071	}
3072	for k, v := range mamrmmc.AdditionalProperties {
3073		objectMap[k] = v
3074	}
3075	return json.Marshal(objectMap)
3076}
3077
3078// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
3079func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) {
3080	return nil, false
3081}
3082
3083// AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
3084func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) {
3085	return nil, false
3086}
3087
3088// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
3089func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) {
3090	return &mamrmmc, true
3091}
3092
3093// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
3094func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) {
3095	return nil, false
3096}
3097
3098// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
3099func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) {
3100	return &mamrmmc, true
3101}
3102
3103// UnmarshalJSON is the custom unmarshaler for MetricAlertMultipleResourceMultipleMetricCriteria struct.
3104func (mamrmmc *MetricAlertMultipleResourceMultipleMetricCriteria) UnmarshalJSON(body []byte) error {
3105	var m map[string]*json.RawMessage
3106	err := json.Unmarshal(body, &m)
3107	if err != nil {
3108		return err
3109	}
3110	for k, v := range m {
3111		switch k {
3112		case "allOf":
3113			if v != nil {
3114				allOf, err := unmarshalBasicMultiMetricCriteriaArray(*v)
3115				if err != nil {
3116					return err
3117				}
3118				mamrmmc.AllOf = &allOf
3119			}
3120		default:
3121			if v != nil {
3122				var additionalProperties interface{}
3123				err = json.Unmarshal(*v, &additionalProperties)
3124				if err != nil {
3125					return err
3126				}
3127				if mamrmmc.AdditionalProperties == nil {
3128					mamrmmc.AdditionalProperties = make(map[string]interface{})
3129				}
3130				mamrmmc.AdditionalProperties[k] = additionalProperties
3131			}
3132		case "odata.type":
3133			if v != nil {
3134				var odataType OdataTypeBasicMetricAlertCriteria
3135				err = json.Unmarshal(*v, &odataType)
3136				if err != nil {
3137					return err
3138				}
3139				mamrmmc.OdataType = odataType
3140			}
3141		}
3142	}
3143
3144	return nil
3145}
3146
3147// MetricAlertProperties an alert rule.
3148type MetricAlertProperties struct {
3149	// Description - the description of the metric alert that will be included in the alert email.
3150	Description *string `json:"description,omitempty"`
3151	// Severity - Alert severity {0, 1, 2, 3, 4}
3152	Severity *int32 `json:"severity,omitempty"`
3153	// Enabled - the flag that indicates whether the metric alert is enabled.
3154	Enabled *bool `json:"enabled,omitempty"`
3155	// Scopes - the list of resource id's that this metric alert is scoped to.
3156	Scopes *[]string `json:"scopes,omitempty"`
3157	// EvaluationFrequency - how often the metric alert is evaluated represented in ISO 8601 duration format.
3158	EvaluationFrequency *string `json:"evaluationFrequency,omitempty"`
3159	// WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
3160	WindowSize *string `json:"windowSize,omitempty"`
3161	// TargetResourceType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
3162	TargetResourceType *string `json:"targetResourceType,omitempty"`
3163	// TargetResourceRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
3164	TargetResourceRegion *string `json:"targetResourceRegion,omitempty"`
3165	// Criteria - defines the specific alert criteria information.
3166	Criteria BasicMetricAlertCriteria `json:"criteria,omitempty"`
3167	// AutoMitigate - the flag that indicates whether the alert should be auto resolved or not. The default is true.
3168	AutoMitigate *bool `json:"autoMitigate,omitempty"`
3169	// Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
3170	Actions *[]MetricAlertAction `json:"actions,omitempty"`
3171	// LastUpdatedTime - READ-ONLY; Last time the rule was updated in ISO8601 format.
3172	LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
3173}
3174
3175// MarshalJSON is the custom marshaler for MetricAlertProperties.
3176func (mapVar MetricAlertProperties) MarshalJSON() ([]byte, error) {
3177	objectMap := make(map[string]interface{})
3178	if mapVar.Description != nil {
3179		objectMap["description"] = mapVar.Description
3180	}
3181	if mapVar.Severity != nil {
3182		objectMap["severity"] = mapVar.Severity
3183	}
3184	if mapVar.Enabled != nil {
3185		objectMap["enabled"] = mapVar.Enabled
3186	}
3187	if mapVar.Scopes != nil {
3188		objectMap["scopes"] = mapVar.Scopes
3189	}
3190	if mapVar.EvaluationFrequency != nil {
3191		objectMap["evaluationFrequency"] = mapVar.EvaluationFrequency
3192	}
3193	if mapVar.WindowSize != nil {
3194		objectMap["windowSize"] = mapVar.WindowSize
3195	}
3196	if mapVar.TargetResourceType != nil {
3197		objectMap["targetResourceType"] = mapVar.TargetResourceType
3198	}
3199	if mapVar.TargetResourceRegion != nil {
3200		objectMap["targetResourceRegion"] = mapVar.TargetResourceRegion
3201	}
3202	objectMap["criteria"] = mapVar.Criteria
3203	if mapVar.AutoMitigate != nil {
3204		objectMap["autoMitigate"] = mapVar.AutoMitigate
3205	}
3206	if mapVar.Actions != nil {
3207		objectMap["actions"] = mapVar.Actions
3208	}
3209	return json.Marshal(objectMap)
3210}
3211
3212// UnmarshalJSON is the custom unmarshaler for MetricAlertProperties struct.
3213func (mapVar *MetricAlertProperties) UnmarshalJSON(body []byte) error {
3214	var m map[string]*json.RawMessage
3215	err := json.Unmarshal(body, &m)
3216	if err != nil {
3217		return err
3218	}
3219	for k, v := range m {
3220		switch k {
3221		case "description":
3222			if v != nil {
3223				var description string
3224				err = json.Unmarshal(*v, &description)
3225				if err != nil {
3226					return err
3227				}
3228				mapVar.Description = &description
3229			}
3230		case "severity":
3231			if v != nil {
3232				var severity int32
3233				err = json.Unmarshal(*v, &severity)
3234				if err != nil {
3235					return err
3236				}
3237				mapVar.Severity = &severity
3238			}
3239		case "enabled":
3240			if v != nil {
3241				var enabled bool
3242				err = json.Unmarshal(*v, &enabled)
3243				if err != nil {
3244					return err
3245				}
3246				mapVar.Enabled = &enabled
3247			}
3248		case "scopes":
3249			if v != nil {
3250				var scopes []string
3251				err = json.Unmarshal(*v, &scopes)
3252				if err != nil {
3253					return err
3254				}
3255				mapVar.Scopes = &scopes
3256			}
3257		case "evaluationFrequency":
3258			if v != nil {
3259				var evaluationFrequency string
3260				err = json.Unmarshal(*v, &evaluationFrequency)
3261				if err != nil {
3262					return err
3263				}
3264				mapVar.EvaluationFrequency = &evaluationFrequency
3265			}
3266		case "windowSize":
3267			if v != nil {
3268				var windowSize string
3269				err = json.Unmarshal(*v, &windowSize)
3270				if err != nil {
3271					return err
3272				}
3273				mapVar.WindowSize = &windowSize
3274			}
3275		case "targetResourceType":
3276			if v != nil {
3277				var targetResourceType string
3278				err = json.Unmarshal(*v, &targetResourceType)
3279				if err != nil {
3280					return err
3281				}
3282				mapVar.TargetResourceType = &targetResourceType
3283			}
3284		case "targetResourceRegion":
3285			if v != nil {
3286				var targetResourceRegion string
3287				err = json.Unmarshal(*v, &targetResourceRegion)
3288				if err != nil {
3289					return err
3290				}
3291				mapVar.TargetResourceRegion = &targetResourceRegion
3292			}
3293		case "criteria":
3294			if v != nil {
3295				criteria, err := unmarshalBasicMetricAlertCriteria(*v)
3296				if err != nil {
3297					return err
3298				}
3299				mapVar.Criteria = criteria
3300			}
3301		case "autoMitigate":
3302			if v != nil {
3303				var autoMitigate bool
3304				err = json.Unmarshal(*v, &autoMitigate)
3305				if err != nil {
3306					return err
3307				}
3308				mapVar.AutoMitigate = &autoMitigate
3309			}
3310		case "actions":
3311			if v != nil {
3312				var actions []MetricAlertAction
3313				err = json.Unmarshal(*v, &actions)
3314				if err != nil {
3315					return err
3316				}
3317				mapVar.Actions = &actions
3318			}
3319		case "lastUpdatedTime":
3320			if v != nil {
3321				var lastUpdatedTime date.Time
3322				err = json.Unmarshal(*v, &lastUpdatedTime)
3323				if err != nil {
3324					return err
3325				}
3326				mapVar.LastUpdatedTime = &lastUpdatedTime
3327			}
3328		}
3329	}
3330
3331	return nil
3332}
3333
3334// MetricAlertResource the metric alert resource.
3335type MetricAlertResource struct {
3336	autorest.Response `json:"-"`
3337	// MetricAlertProperties - The alert rule properties of the resource.
3338	*MetricAlertProperties `json:"properties,omitempty"`
3339	// ID - READ-ONLY; Azure resource Id
3340	ID *string `json:"id,omitempty"`
3341	// Name - READ-ONLY; Azure resource name
3342	Name *string `json:"name,omitempty"`
3343	// Type - READ-ONLY; Azure resource type
3344	Type *string `json:"type,omitempty"`
3345	// Location - Resource location
3346	Location *string `json:"location,omitempty"`
3347	// Tags - Resource tags
3348	Tags map[string]*string `json:"tags"`
3349}
3350
3351// MarshalJSON is the custom marshaler for MetricAlertResource.
3352func (mar MetricAlertResource) MarshalJSON() ([]byte, error) {
3353	objectMap := make(map[string]interface{})
3354	if mar.MetricAlertProperties != nil {
3355		objectMap["properties"] = mar.MetricAlertProperties
3356	}
3357	if mar.Location != nil {
3358		objectMap["location"] = mar.Location
3359	}
3360	if mar.Tags != nil {
3361		objectMap["tags"] = mar.Tags
3362	}
3363	return json.Marshal(objectMap)
3364}
3365
3366// UnmarshalJSON is the custom unmarshaler for MetricAlertResource struct.
3367func (mar *MetricAlertResource) UnmarshalJSON(body []byte) error {
3368	var m map[string]*json.RawMessage
3369	err := json.Unmarshal(body, &m)
3370	if err != nil {
3371		return err
3372	}
3373	for k, v := range m {
3374		switch k {
3375		case "properties":
3376			if v != nil {
3377				var metricAlertProperties MetricAlertProperties
3378				err = json.Unmarshal(*v, &metricAlertProperties)
3379				if err != nil {
3380					return err
3381				}
3382				mar.MetricAlertProperties = &metricAlertProperties
3383			}
3384		case "id":
3385			if v != nil {
3386				var ID string
3387				err = json.Unmarshal(*v, &ID)
3388				if err != nil {
3389					return err
3390				}
3391				mar.ID = &ID
3392			}
3393		case "name":
3394			if v != nil {
3395				var name string
3396				err = json.Unmarshal(*v, &name)
3397				if err != nil {
3398					return err
3399				}
3400				mar.Name = &name
3401			}
3402		case "type":
3403			if v != nil {
3404				var typeVar string
3405				err = json.Unmarshal(*v, &typeVar)
3406				if err != nil {
3407					return err
3408				}
3409				mar.Type = &typeVar
3410			}
3411		case "location":
3412			if v != nil {
3413				var location string
3414				err = json.Unmarshal(*v, &location)
3415				if err != nil {
3416					return err
3417				}
3418				mar.Location = &location
3419			}
3420		case "tags":
3421			if v != nil {
3422				var tags map[string]*string
3423				err = json.Unmarshal(*v, &tags)
3424				if err != nil {
3425					return err
3426				}
3427				mar.Tags = tags
3428			}
3429		}
3430	}
3431
3432	return nil
3433}
3434
3435// MetricAlertResourceCollection represents a collection of alert rule resources.
3436type MetricAlertResourceCollection struct {
3437	autorest.Response `json:"-"`
3438	// Value - the values for the alert rule resources.
3439	Value *[]MetricAlertResource `json:"value,omitempty"`
3440}
3441
3442// MetricAlertResourcePatch the metric alert resource for patch operations.
3443type MetricAlertResourcePatch struct {
3444	// Tags - Resource tags
3445	Tags map[string]*string `json:"tags"`
3446	// MetricAlertProperties - The alert rule properties of the resource.
3447	*MetricAlertProperties `json:"properties,omitempty"`
3448}
3449
3450// MarshalJSON is the custom marshaler for MetricAlertResourcePatch.
3451func (marp MetricAlertResourcePatch) MarshalJSON() ([]byte, error) {
3452	objectMap := make(map[string]interface{})
3453	if marp.Tags != nil {
3454		objectMap["tags"] = marp.Tags
3455	}
3456	if marp.MetricAlertProperties != nil {
3457		objectMap["properties"] = marp.MetricAlertProperties
3458	}
3459	return json.Marshal(objectMap)
3460}
3461
3462// UnmarshalJSON is the custom unmarshaler for MetricAlertResourcePatch struct.
3463func (marp *MetricAlertResourcePatch) UnmarshalJSON(body []byte) error {
3464	var m map[string]*json.RawMessage
3465	err := json.Unmarshal(body, &m)
3466	if err != nil {
3467		return err
3468	}
3469	for k, v := range m {
3470		switch k {
3471		case "tags":
3472			if v != nil {
3473				var tags map[string]*string
3474				err = json.Unmarshal(*v, &tags)
3475				if err != nil {
3476					return err
3477				}
3478				marp.Tags = tags
3479			}
3480		case "properties":
3481			if v != nil {
3482				var metricAlertProperties MetricAlertProperties
3483				err = json.Unmarshal(*v, &metricAlertProperties)
3484				if err != nil {
3485					return err
3486				}
3487				marp.MetricAlertProperties = &metricAlertProperties
3488			}
3489		}
3490	}
3491
3492	return nil
3493}
3494
3495// MetricAlertSingleResourceMultipleMetricCriteria specifies the metric alert criteria for a single
3496// resource that has multiple metric criteria.
3497type MetricAlertSingleResourceMultipleMetricCriteria struct {
3498	// AllOf - The list of metric criteria for this 'all of' operation.
3499	AllOf *[]MetricCriteria `json:"allOf,omitempty"`
3500	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
3501	AdditionalProperties map[string]interface{} `json:""`
3502	// OdataType - Possible values include: 'OdataTypeMetricAlertCriteria', 'OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria'
3503	OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"`
3504}
3505
3506// MarshalJSON is the custom marshaler for MetricAlertSingleResourceMultipleMetricCriteria.
3507func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) {
3508	masrmmc.OdataType = OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria
3509	objectMap := make(map[string]interface{})
3510	if masrmmc.AllOf != nil {
3511		objectMap["allOf"] = masrmmc.AllOf
3512	}
3513	if masrmmc.OdataType != "" {
3514		objectMap["odata.type"] = masrmmc.OdataType
3515	}
3516	for k, v := range masrmmc.AdditionalProperties {
3517		objectMap[k] = v
3518	}
3519	return json.Marshal(objectMap)
3520}
3521
3522// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
3523func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) {
3524	return &masrmmc, true
3525}
3526
3527// AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
3528func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) {
3529	return nil, false
3530}
3531
3532// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
3533func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) {
3534	return nil, false
3535}
3536
3537// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
3538func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) {
3539	return nil, false
3540}
3541
3542// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
3543func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) {
3544	return &masrmmc, true
3545}
3546
3547// UnmarshalJSON is the custom unmarshaler for MetricAlertSingleResourceMultipleMetricCriteria struct.
3548func (masrmmc *MetricAlertSingleResourceMultipleMetricCriteria) UnmarshalJSON(body []byte) error {
3549	var m map[string]*json.RawMessage
3550	err := json.Unmarshal(body, &m)
3551	if err != nil {
3552		return err
3553	}
3554	for k, v := range m {
3555		switch k {
3556		case "allOf":
3557			if v != nil {
3558				var allOf []MetricCriteria
3559				err = json.Unmarshal(*v, &allOf)
3560				if err != nil {
3561					return err
3562				}
3563				masrmmc.AllOf = &allOf
3564			}
3565		default:
3566			if v != nil {
3567				var additionalProperties interface{}
3568				err = json.Unmarshal(*v, &additionalProperties)
3569				if err != nil {
3570					return err
3571				}
3572				if masrmmc.AdditionalProperties == nil {
3573					masrmmc.AdditionalProperties = make(map[string]interface{})
3574				}
3575				masrmmc.AdditionalProperties[k] = additionalProperties
3576			}
3577		case "odata.type":
3578			if v != nil {
3579				var odataType OdataTypeBasicMetricAlertCriteria
3580				err = json.Unmarshal(*v, &odataType)
3581				if err != nil {
3582					return err
3583				}
3584				masrmmc.OdataType = odataType
3585			}
3586		}
3587	}
3588
3589	return nil
3590}
3591
3592// MetricAlertStatus an alert status.
3593type MetricAlertStatus struct {
3594	// Name - The status name.
3595	Name *string `json:"name,omitempty"`
3596	// ID - The alert rule arm id.
3597	ID *string `json:"id,omitempty"`
3598	// Type - The extended resource type name.
3599	Type *string `json:"type,omitempty"`
3600	// Properties - The alert status properties of the metric alert status.
3601	Properties *MetricAlertStatusProperties `json:"properties,omitempty"`
3602}
3603
3604// MetricAlertStatusCollection represents a collection of alert rule resources.
3605type MetricAlertStatusCollection struct {
3606	autorest.Response `json:"-"`
3607	// Value - the values for the alert rule resources.
3608	Value *[]MetricAlertStatus `json:"value,omitempty"`
3609}
3610
3611// MetricAlertStatusProperties an alert status properties.
3612type MetricAlertStatusProperties struct {
3613	// Dimensions - An object describing the type of the dimensions.
3614	Dimensions map[string]*string `json:"dimensions"`
3615	// Status - status value
3616	Status *string `json:"status,omitempty"`
3617	// Timestamp - UTC time when the status was checked.
3618	Timestamp *date.Time `json:"timestamp,omitempty"`
3619}
3620
3621// MarshalJSON is the custom marshaler for MetricAlertStatusProperties.
3622func (masp MetricAlertStatusProperties) MarshalJSON() ([]byte, error) {
3623	objectMap := make(map[string]interface{})
3624	if masp.Dimensions != nil {
3625		objectMap["dimensions"] = masp.Dimensions
3626	}
3627	if masp.Status != nil {
3628		objectMap["status"] = masp.Status
3629	}
3630	if masp.Timestamp != nil {
3631		objectMap["timestamp"] = masp.Timestamp
3632	}
3633	return json.Marshal(objectMap)
3634}
3635
3636// MetricAvailability metric availability specifies the time grain (aggregation interval or frequency) and
3637// the retention period for that time grain.
3638type MetricAvailability struct {
3639	// TimeGrain - the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc.
3640	TimeGrain *string `json:"timeGrain,omitempty"`
3641	// Retention - the retention period for the metric at the specified timegrain.  Expressed as a duration 'PT1M', 'P1D', etc.
3642	Retention *string `json:"retention,omitempty"`
3643}
3644
3645// MetricCriteria criterion to filter metrics.
3646type MetricCriteria struct {
3647	// Operator - the criteria operator. Possible values include: 'OperatorEquals', 'OperatorNotEquals', 'OperatorGreaterThan', 'OperatorGreaterThanOrEqual', 'OperatorLessThan', 'OperatorLessThanOrEqual'
3648	Operator Operator `json:"operator,omitempty"`
3649	// Threshold - the criteria threshold value that activates the alert.
3650	Threshold *float64 `json:"threshold,omitempty"`
3651	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
3652	AdditionalProperties map[string]interface{} `json:""`
3653	// Name - Name of the criteria.
3654	Name *string `json:"name,omitempty"`
3655	// MetricName - Name of the metric.
3656	MetricName *string `json:"metricName,omitempty"`
3657	// MetricNamespace - Namespace of the metric.
3658	MetricNamespace *string `json:"metricNamespace,omitempty"`
3659	// TimeAggregation - the criteria time aggregation types.
3660	TimeAggregation interface{} `json:"timeAggregation,omitempty"`
3661	// Dimensions - List of dimension conditions.
3662	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
3663	// SkipMetricValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
3664	SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"`
3665	// CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion'
3666	CriterionType CriterionType `json:"criterionType,omitempty"`
3667}
3668
3669// MarshalJSON is the custom marshaler for MetricCriteria.
3670func (mc MetricCriteria) MarshalJSON() ([]byte, error) {
3671	mc.CriterionType = CriterionTypeStaticThresholdCriterion
3672	objectMap := make(map[string]interface{})
3673	if mc.Operator != "" {
3674		objectMap["operator"] = mc.Operator
3675	}
3676	if mc.Threshold != nil {
3677		objectMap["threshold"] = mc.Threshold
3678	}
3679	if mc.Name != nil {
3680		objectMap["name"] = mc.Name
3681	}
3682	if mc.MetricName != nil {
3683		objectMap["metricName"] = mc.MetricName
3684	}
3685	if mc.MetricNamespace != nil {
3686		objectMap["metricNamespace"] = mc.MetricNamespace
3687	}
3688	if mc.TimeAggregation != nil {
3689		objectMap["timeAggregation"] = mc.TimeAggregation
3690	}
3691	if mc.Dimensions != nil {
3692		objectMap["dimensions"] = mc.Dimensions
3693	}
3694	if mc.SkipMetricValidation != nil {
3695		objectMap["skipMetricValidation"] = mc.SkipMetricValidation
3696	}
3697	if mc.CriterionType != "" {
3698		objectMap["criterionType"] = mc.CriterionType
3699	}
3700	for k, v := range mc.AdditionalProperties {
3701		objectMap[k] = v
3702	}
3703	return json.Marshal(objectMap)
3704}
3705
3706// AsMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria.
3707func (mc MetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) {
3708	return &mc, true
3709}
3710
3711// AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria.
3712func (mc MetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) {
3713	return nil, false
3714}
3715
3716// AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria.
3717func (mc MetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) {
3718	return nil, false
3719}
3720
3721// AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria.
3722func (mc MetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) {
3723	return &mc, true
3724}
3725
3726// UnmarshalJSON is the custom unmarshaler for MetricCriteria struct.
3727func (mc *MetricCriteria) UnmarshalJSON(body []byte) error {
3728	var m map[string]*json.RawMessage
3729	err := json.Unmarshal(body, &m)
3730	if err != nil {
3731		return err
3732	}
3733	for k, v := range m {
3734		switch k {
3735		case "operator":
3736			if v != nil {
3737				var operator Operator
3738				err = json.Unmarshal(*v, &operator)
3739				if err != nil {
3740					return err
3741				}
3742				mc.Operator = operator
3743			}
3744		case "threshold":
3745			if v != nil {
3746				var threshold float64
3747				err = json.Unmarshal(*v, &threshold)
3748				if err != nil {
3749					return err
3750				}
3751				mc.Threshold = &threshold
3752			}
3753		default:
3754			if v != nil {
3755				var additionalProperties interface{}
3756				err = json.Unmarshal(*v, &additionalProperties)
3757				if err != nil {
3758					return err
3759				}
3760				if mc.AdditionalProperties == nil {
3761					mc.AdditionalProperties = make(map[string]interface{})
3762				}
3763				mc.AdditionalProperties[k] = additionalProperties
3764			}
3765		case "name":
3766			if v != nil {
3767				var name string
3768				err = json.Unmarshal(*v, &name)
3769				if err != nil {
3770					return err
3771				}
3772				mc.Name = &name
3773			}
3774		case "metricName":
3775			if v != nil {
3776				var metricName string
3777				err = json.Unmarshal(*v, &metricName)
3778				if err != nil {
3779					return err
3780				}
3781				mc.MetricName = &metricName
3782			}
3783		case "metricNamespace":
3784			if v != nil {
3785				var metricNamespace string
3786				err = json.Unmarshal(*v, &metricNamespace)
3787				if err != nil {
3788					return err
3789				}
3790				mc.MetricNamespace = &metricNamespace
3791			}
3792		case "timeAggregation":
3793			if v != nil {
3794				var timeAggregation interface{}
3795				err = json.Unmarshal(*v, &timeAggregation)
3796				if err != nil {
3797					return err
3798				}
3799				mc.TimeAggregation = timeAggregation
3800			}
3801		case "dimensions":
3802			if v != nil {
3803				var dimensions []MetricDimension
3804				err = json.Unmarshal(*v, &dimensions)
3805				if err != nil {
3806					return err
3807				}
3808				mc.Dimensions = &dimensions
3809			}
3810		case "skipMetricValidation":
3811			if v != nil {
3812				var skipMetricValidation bool
3813				err = json.Unmarshal(*v, &skipMetricValidation)
3814				if err != nil {
3815					return err
3816				}
3817				mc.SkipMetricValidation = &skipMetricValidation
3818			}
3819		case "criterionType":
3820			if v != nil {
3821				var criterionType CriterionType
3822				err = json.Unmarshal(*v, &criterionType)
3823				if err != nil {
3824					return err
3825				}
3826				mc.CriterionType = criterionType
3827			}
3828		}
3829	}
3830
3831	return nil
3832}
3833
3834// MetricDefinition metric definition class specifies the metadata for a metric.
3835type MetricDefinition struct {
3836	// IsDimensionRequired - Flag to indicate whether the dimension is required.
3837	IsDimensionRequired *bool `json:"isDimensionRequired,omitempty"`
3838	// ResourceID - the resource identifier of the resource that emitted the metric.
3839	ResourceID *string `json:"resourceId,omitempty"`
3840	// Namespace - the namespace the metric belongs to.
3841	Namespace *string `json:"namespace,omitempty"`
3842	// Name - the name and the display name of the metric, i.e. it is a localizable string.
3843	Name *LocalizableString `json:"name,omitempty"`
3844	// Unit - the unit of the metric. Possible values include: 'UnitCount', 'UnitBytes', 'UnitSeconds', 'UnitCountPerSecond', 'UnitBytesPerSecond', 'UnitPercent', 'UnitMilliSeconds', 'UnitByteSeconds', 'UnitUnspecified', 'UnitCores', 'UnitMilliCores', 'UnitNanoCores', 'UnitBitsPerSecond'
3845	Unit Unit `json:"unit,omitempty"`
3846	// PrimaryAggregationType - the primary aggregation type value defining how to use the values for display. Possible values include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total'
3847	PrimaryAggregationType AggregationType `json:"primaryAggregationType,omitempty"`
3848	// SupportedAggregationTypes - the collection of what aggregation types are supported.
3849	SupportedAggregationTypes *[]AggregationType `json:"supportedAggregationTypes,omitempty"`
3850	// MetricAvailabilities - the collection of what aggregation intervals are available to be queried.
3851	MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
3852	// ID - the resource identifier of the metric definition.
3853	ID *string `json:"id,omitempty"`
3854	// Dimensions - the name and the display name of the dimension, i.e. it is a localizable string.
3855	Dimensions *[]LocalizableString `json:"dimensions,omitempty"`
3856}
3857
3858// MetricDefinitionCollection represents collection of metric definitions.
3859type MetricDefinitionCollection struct {
3860	autorest.Response `json:"-"`
3861	// Value - the values for the metric definitions.
3862	Value *[]MetricDefinition `json:"value,omitempty"`
3863}
3864
3865// MetricDimension specifies a metric dimension.
3866type MetricDimension struct {
3867	// Name - Name of the dimension.
3868	Name *string `json:"name,omitempty"`
3869	// Operator - the dimension operator. Only 'Include' and 'Exclude' are supported
3870	Operator *string `json:"operator,omitempty"`
3871	// Values - list of dimension values.
3872	Values *[]string `json:"values,omitempty"`
3873}
3874
3875// MetricNamespace metric namespace class specifies the metadata for a metric namespace.
3876type MetricNamespace struct {
3877	// ID - The ID of the metricNamespace.
3878	ID *string `json:"id,omitempty"`
3879	// Type - The type of the namespace.
3880	Type *string `json:"type,omitempty"`
3881	// Name - The name of the namespace.
3882	Name *string `json:"name,omitempty"`
3883	// Properties - Properties which include the fully qualified namespace name.
3884	Properties *MetricNamespaceName `json:"properties,omitempty"`
3885}
3886
3887// MetricNamespaceCollection represents collection of metric namespaces.
3888type MetricNamespaceCollection struct {
3889	autorest.Response `json:"-"`
3890	// Value - The values for the metric namespaces.
3891	Value *[]MetricNamespace `json:"value,omitempty"`
3892}
3893
3894// MetricNamespaceName the fully qualified metric namespace name.
3895type MetricNamespaceName struct {
3896	// MetricNamespaceName - The metric namespace name.
3897	MetricNamespaceName *string `json:"metricNamespaceName,omitempty"`
3898}
3899
3900// MetricSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric.
3901type MetricSettings struct {
3902	// TimeGrain - the timegrain of the metric in ISO8601 format.
3903	TimeGrain *string `json:"timeGrain,omitempty"`
3904	// 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.
3905	Category *string `json:"category,omitempty"`
3906	// Enabled - a value indicating whether this category is enabled.
3907	Enabled *bool `json:"enabled,omitempty"`
3908	// RetentionPolicy - the retention policy for this category.
3909	RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
3910}
3911
3912// MetricTrigger the trigger that results in a scaling action.
3913type MetricTrigger struct {
3914	// MetricName - the name of the metric that defines what the rule monitors.
3915	MetricName *string `json:"metricName,omitempty"`
3916	// MetricNamespace - the namespace of the metric that defines what the rule monitors.
3917	MetricNamespace *string `json:"metricNamespace,omitempty"`
3918	// MetricResourceURI - the resource identifier of the resource the rule monitors.
3919	MetricResourceURI *string `json:"metricResourceUri,omitempty"`
3920	// 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.
3921	TimeGrain *string `json:"timeGrain,omitempty"`
3922	// Statistic - the metric statistic type. How the metrics from multiple instances are combined. Possible values include: 'MetricStatisticTypeAverage', 'MetricStatisticTypeMin', 'MetricStatisticTypeMax', 'MetricStatisticTypeSum'
3923	Statistic MetricStatisticType `json:"statistic,omitempty"`
3924	// 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.
3925	TimeWindow *string `json:"timeWindow,omitempty"`
3926	// 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'
3927	TimeAggregation TimeAggregationType `json:"timeAggregation,omitempty"`
3928	// Operator - the operator that is used to compare the metric data and the threshold. Possible values include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'
3929	Operator ComparisonOperationType `json:"operator,omitempty"`
3930	// Threshold - the threshold of the metric that triggers the scale action.
3931	Threshold *float64 `json:"threshold,omitempty"`
3932	// Dimensions - List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}].
3933	Dimensions *[]ScaleRuleMetricDimension `json:"dimensions,omitempty"`
3934}
3935
3936// MetricValue represents a metric value.
3937type MetricValue struct {
3938	// TimeStamp - the timestamp for the metric value in ISO 8601 format.
3939	TimeStamp *date.Time `json:"timeStamp,omitempty"`
3940	// Average - the average value in the time range.
3941	Average *float64 `json:"average,omitempty"`
3942	// Minimum - the least value in the time range.
3943	Minimum *float64 `json:"minimum,omitempty"`
3944	// Maximum - the greatest value in the time range.
3945	Maximum *float64 `json:"maximum,omitempty"`
3946	// Total - the sum of all of the values in the time range.
3947	Total *float64 `json:"total,omitempty"`
3948	// Count - the number of samples in the time range. Can be used to determine the number of values that contributed to the average value.
3949	Count *float64 `json:"count,omitempty"`
3950}
3951
3952// BasicMultiMetricCriteria the types of conditions for a multi resource alert.
3953type BasicMultiMetricCriteria interface {
3954	AsMetricCriteria() (*MetricCriteria, bool)
3955	AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool)
3956	AsMultiMetricCriteria() (*MultiMetricCriteria, bool)
3957}
3958
3959// MultiMetricCriteria the types of conditions for a multi resource alert.
3960type MultiMetricCriteria struct {
3961	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
3962	AdditionalProperties map[string]interface{} `json:""`
3963	// Name - Name of the criteria.
3964	Name *string `json:"name,omitempty"`
3965	// MetricName - Name of the metric.
3966	MetricName *string `json:"metricName,omitempty"`
3967	// MetricNamespace - Namespace of the metric.
3968	MetricNamespace *string `json:"metricNamespace,omitempty"`
3969	// TimeAggregation - the criteria time aggregation types.
3970	TimeAggregation interface{} `json:"timeAggregation,omitempty"`
3971	// Dimensions - List of dimension conditions.
3972	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
3973	// SkipMetricValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
3974	SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"`
3975	// CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion'
3976	CriterionType CriterionType `json:"criterionType,omitempty"`
3977}
3978
3979func unmarshalBasicMultiMetricCriteria(body []byte) (BasicMultiMetricCriteria, error) {
3980	var m map[string]interface{}
3981	err := json.Unmarshal(body, &m)
3982	if err != nil {
3983		return nil, err
3984	}
3985
3986	switch m["criterionType"] {
3987	case string(CriterionTypeStaticThresholdCriterion):
3988		var mc MetricCriteria
3989		err := json.Unmarshal(body, &mc)
3990		return mc, err
3991	case string(CriterionTypeDynamicThresholdCriterion):
3992		var dmc DynamicMetricCriteria
3993		err := json.Unmarshal(body, &dmc)
3994		return dmc, err
3995	default:
3996		var mmc MultiMetricCriteria
3997		err := json.Unmarshal(body, &mmc)
3998		return mmc, err
3999	}
4000}
4001func unmarshalBasicMultiMetricCriteriaArray(body []byte) ([]BasicMultiMetricCriteria, error) {
4002	var rawMessages []*json.RawMessage
4003	err := json.Unmarshal(body, &rawMessages)
4004	if err != nil {
4005		return nil, err
4006	}
4007
4008	mmcArray := make([]BasicMultiMetricCriteria, len(rawMessages))
4009
4010	for index, rawMessage := range rawMessages {
4011		mmc, err := unmarshalBasicMultiMetricCriteria(*rawMessage)
4012		if err != nil {
4013			return nil, err
4014		}
4015		mmcArray[index] = mmc
4016	}
4017	return mmcArray, nil
4018}
4019
4020// MarshalJSON is the custom marshaler for MultiMetricCriteria.
4021func (mmc MultiMetricCriteria) MarshalJSON() ([]byte, error) {
4022	mmc.CriterionType = CriterionTypeMultiMetricCriteria
4023	objectMap := make(map[string]interface{})
4024	if mmc.Name != nil {
4025		objectMap["name"] = mmc.Name
4026	}
4027	if mmc.MetricName != nil {
4028		objectMap["metricName"] = mmc.MetricName
4029	}
4030	if mmc.MetricNamespace != nil {
4031		objectMap["metricNamespace"] = mmc.MetricNamespace
4032	}
4033	if mmc.TimeAggregation != nil {
4034		objectMap["timeAggregation"] = mmc.TimeAggregation
4035	}
4036	if mmc.Dimensions != nil {
4037		objectMap["dimensions"] = mmc.Dimensions
4038	}
4039	if mmc.SkipMetricValidation != nil {
4040		objectMap["skipMetricValidation"] = mmc.SkipMetricValidation
4041	}
4042	if mmc.CriterionType != "" {
4043		objectMap["criterionType"] = mmc.CriterionType
4044	}
4045	for k, v := range mmc.AdditionalProperties {
4046		objectMap[k] = v
4047	}
4048	return json.Marshal(objectMap)
4049}
4050
4051// AsMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria.
4052func (mmc MultiMetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) {
4053	return nil, false
4054}
4055
4056// AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria.
4057func (mmc MultiMetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) {
4058	return nil, false
4059}
4060
4061// AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria.
4062func (mmc MultiMetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) {
4063	return &mmc, true
4064}
4065
4066// AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria.
4067func (mmc MultiMetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) {
4068	return &mmc, true
4069}
4070
4071// UnmarshalJSON is the custom unmarshaler for MultiMetricCriteria struct.
4072func (mmc *MultiMetricCriteria) UnmarshalJSON(body []byte) error {
4073	var m map[string]*json.RawMessage
4074	err := json.Unmarshal(body, &m)
4075	if err != nil {
4076		return err
4077	}
4078	for k, v := range m {
4079		switch k {
4080		default:
4081			if v != nil {
4082				var additionalProperties interface{}
4083				err = json.Unmarshal(*v, &additionalProperties)
4084				if err != nil {
4085					return err
4086				}
4087				if mmc.AdditionalProperties == nil {
4088					mmc.AdditionalProperties = make(map[string]interface{})
4089				}
4090				mmc.AdditionalProperties[k] = additionalProperties
4091			}
4092		case "name":
4093			if v != nil {
4094				var name string
4095				err = json.Unmarshal(*v, &name)
4096				if err != nil {
4097					return err
4098				}
4099				mmc.Name = &name
4100			}
4101		case "metricName":
4102			if v != nil {
4103				var metricName string
4104				err = json.Unmarshal(*v, &metricName)
4105				if err != nil {
4106					return err
4107				}
4108				mmc.MetricName = &metricName
4109			}
4110		case "metricNamespace":
4111			if v != nil {
4112				var metricNamespace string
4113				err = json.Unmarshal(*v, &metricNamespace)
4114				if err != nil {
4115					return err
4116				}
4117				mmc.MetricNamespace = &metricNamespace
4118			}
4119		case "timeAggregation":
4120			if v != nil {
4121				var timeAggregation interface{}
4122				err = json.Unmarshal(*v, &timeAggregation)
4123				if err != nil {
4124					return err
4125				}
4126				mmc.TimeAggregation = timeAggregation
4127			}
4128		case "dimensions":
4129			if v != nil {
4130				var dimensions []MetricDimension
4131				err = json.Unmarshal(*v, &dimensions)
4132				if err != nil {
4133					return err
4134				}
4135				mmc.Dimensions = &dimensions
4136			}
4137		case "skipMetricValidation":
4138			if v != nil {
4139				var skipMetricValidation bool
4140				err = json.Unmarshal(*v, &skipMetricValidation)
4141				if err != nil {
4142					return err
4143				}
4144				mmc.SkipMetricValidation = &skipMetricValidation
4145			}
4146		case "criterionType":
4147			if v != nil {
4148				var criterionType CriterionType
4149				err = json.Unmarshal(*v, &criterionType)
4150				if err != nil {
4151					return err
4152				}
4153				mmc.CriterionType = criterionType
4154			}
4155		}
4156	}
4157
4158	return nil
4159}
4160
4161// Operation microsoft Insights API operation definition.
4162type Operation struct {
4163	// Name - Operation name: {provider}/{resource}/{operation}
4164	Name *string `json:"name,omitempty"`
4165	// Display - Display metadata associated with the operation.
4166	Display *OperationDisplay `json:"display,omitempty"`
4167}
4168
4169// OperationDisplay display metadata associated with the operation.
4170type OperationDisplay struct {
4171	// Provider - Service provider: Microsoft.Insights
4172	Provider *string `json:"provider,omitempty"`
4173	// Resource - Resource on which the operation is performed: AlertRules, Autoscale, etc.
4174	Resource *string `json:"resource,omitempty"`
4175	// Operation - Operation type: Read, write, delete, etc.
4176	Operation *string `json:"operation,omitempty"`
4177}
4178
4179// OperationListResult result of the request to list Microsoft.Insights operations. It contains a list of
4180// operations and a URL link to get the next set of results.
4181type OperationListResult struct {
4182	autorest.Response `json:"-"`
4183	// Value - List of operations supported by the Microsoft.Insights provider.
4184	Value *[]Operation `json:"value,omitempty"`
4185	// NextLink - URL to get the next set of operation list results if there are any.
4186	NextLink *string `json:"nextLink,omitempty"`
4187}
4188
4189// ProxyOnlyResource a proxy only azure resource object
4190type ProxyOnlyResource struct {
4191	// ID - READ-ONLY; Azure resource Id
4192	ID *string `json:"id,omitempty"`
4193	// Name - READ-ONLY; Azure resource name
4194	Name *string `json:"name,omitempty"`
4195	// Type - READ-ONLY; Azure resource type
4196	Type *string `json:"type,omitempty"`
4197}
4198
4199// Recurrence the repeating times at which this profile begins. This element is not used if the FixedDate
4200// element is used.
4201type Recurrence struct {
4202	// 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'
4203	Frequency RecurrenceFrequency `json:"frequency,omitempty"`
4204	// Schedule - the scheduling constraints for when the profile begins.
4205	Schedule *RecurrentSchedule `json:"schedule,omitempty"`
4206}
4207
4208// RecurrentSchedule the scheduling constraints for when the profile begins.
4209type RecurrentSchedule struct {
4210	// 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
4211	TimeZone *string `json:"timeZone,omitempty"`
4212	// Days - the collection of days that the profile takes effect on. Possible values are Sunday through Saturday.
4213	Days *[]string `json:"days,omitempty"`
4214	// 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).
4215	Hours *[]int32 `json:"hours,omitempty"`
4216	// Minutes - A collection of minutes at which the profile takes effect at.
4217	Minutes *[]int32 `json:"minutes,omitempty"`
4218}
4219
4220// Resource an azure resource object
4221type Resource struct {
4222	// ID - READ-ONLY; Azure resource Id
4223	ID *string `json:"id,omitempty"`
4224	// Name - READ-ONLY; Azure resource name
4225	Name *string `json:"name,omitempty"`
4226	// Type - READ-ONLY; Azure resource type
4227	Type *string `json:"type,omitempty"`
4228	// Location - Resource location
4229	Location *string `json:"location,omitempty"`
4230	// Tags - Resource tags
4231	Tags map[string]*string `json:"tags"`
4232}
4233
4234// MarshalJSON is the custom marshaler for Resource.
4235func (r Resource) MarshalJSON() ([]byte, error) {
4236	objectMap := make(map[string]interface{})
4237	if r.Location != nil {
4238		objectMap["location"] = r.Location
4239	}
4240	if r.Tags != nil {
4241		objectMap["tags"] = r.Tags
4242	}
4243	return json.Marshal(objectMap)
4244}
4245
4246// Response the response to a metrics query.
4247type Response struct {
4248	autorest.Response `json:"-"`
4249	// Cost - The integer value representing the cost of the query, for data case.
4250	Cost *float64 `json:"cost,omitempty"`
4251	// 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.
4252	Timespan *string `json:"timespan,omitempty"`
4253	// 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.
4254	Interval *string `json:"interval,omitempty"`
4255	// Namespace - The namespace of the metrics been queried
4256	Namespace *string `json:"namespace,omitempty"`
4257	// Resourceregion - The region of the resource been queried for metrics.
4258	Resourceregion *string `json:"resourceregion,omitempty"`
4259	// Value - the value of the collection.
4260	Value *[]Metric `json:"value,omitempty"`
4261}
4262
4263// RetentionPolicy specifies the retention policy for the log.
4264type RetentionPolicy struct {
4265	// Enabled - a value indicating whether the retention policy is enabled.
4266	Enabled *bool `json:"enabled,omitempty"`
4267	// Days - the number of days for the retention in days. A value of 0 will retain the events indefinitely.
4268	Days *int32 `json:"days,omitempty"`
4269}
4270
4271// BasicRuleAction the action that is performed when the alert rule becomes active, and when an alert condition is
4272// resolved.
4273type BasicRuleAction interface {
4274	AsRuleEmailAction() (*RuleEmailAction, bool)
4275	AsRuleWebhookAction() (*RuleWebhookAction, bool)
4276	AsRuleAction() (*RuleAction, bool)
4277}
4278
4279// RuleAction the action that is performed when the alert rule becomes active, and when an alert condition is
4280// resolved.
4281type RuleAction struct {
4282	// OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction'
4283	OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"`
4284}
4285
4286func unmarshalBasicRuleAction(body []byte) (BasicRuleAction, error) {
4287	var m map[string]interface{}
4288	err := json.Unmarshal(body, &m)
4289	if err != nil {
4290		return nil, err
4291	}
4292
4293	switch m["odata.type"] {
4294	case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction):
4295		var rea RuleEmailAction
4296		err := json.Unmarshal(body, &rea)
4297		return rea, err
4298	case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction):
4299		var rwa RuleWebhookAction
4300		err := json.Unmarshal(body, &rwa)
4301		return rwa, err
4302	default:
4303		var ra RuleAction
4304		err := json.Unmarshal(body, &ra)
4305		return ra, err
4306	}
4307}
4308func unmarshalBasicRuleActionArray(body []byte) ([]BasicRuleAction, error) {
4309	var rawMessages []*json.RawMessage
4310	err := json.Unmarshal(body, &rawMessages)
4311	if err != nil {
4312		return nil, err
4313	}
4314
4315	raArray := make([]BasicRuleAction, len(rawMessages))
4316
4317	for index, rawMessage := range rawMessages {
4318		ra, err := unmarshalBasicRuleAction(*rawMessage)
4319		if err != nil {
4320			return nil, err
4321		}
4322		raArray[index] = ra
4323	}
4324	return raArray, nil
4325}
4326
4327// MarshalJSON is the custom marshaler for RuleAction.
4328func (ra RuleAction) MarshalJSON() ([]byte, error) {
4329	ra.OdataType = OdataTypeRuleAction
4330	objectMap := make(map[string]interface{})
4331	if ra.OdataType != "" {
4332		objectMap["odata.type"] = ra.OdataType
4333	}
4334	return json.Marshal(objectMap)
4335}
4336
4337// AsRuleEmailAction is the BasicRuleAction implementation for RuleAction.
4338func (ra RuleAction) AsRuleEmailAction() (*RuleEmailAction, bool) {
4339	return nil, false
4340}
4341
4342// AsRuleWebhookAction is the BasicRuleAction implementation for RuleAction.
4343func (ra RuleAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) {
4344	return nil, false
4345}
4346
4347// AsRuleAction is the BasicRuleAction implementation for RuleAction.
4348func (ra RuleAction) AsRuleAction() (*RuleAction, bool) {
4349	return &ra, true
4350}
4351
4352// AsBasicRuleAction is the BasicRuleAction implementation for RuleAction.
4353func (ra RuleAction) AsBasicRuleAction() (BasicRuleAction, bool) {
4354	return &ra, true
4355}
4356
4357// BasicRuleCondition the condition that results in the alert rule being activated.
4358type BasicRuleCondition interface {
4359	AsThresholdRuleCondition() (*ThresholdRuleCondition, bool)
4360	AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool)
4361	AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool)
4362	AsRuleCondition() (*RuleCondition, bool)
4363}
4364
4365// RuleCondition the condition that results in the alert rule being activated.
4366type RuleCondition struct {
4367	// DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource.
4368	DataSource BasicRuleDataSource `json:"dataSource,omitempty"`
4369	// OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition'
4370	OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"`
4371}
4372
4373func unmarshalBasicRuleCondition(body []byte) (BasicRuleCondition, error) {
4374	var m map[string]interface{}
4375	err := json.Unmarshal(body, &m)
4376	if err != nil {
4377		return nil, err
4378	}
4379
4380	switch m["odata.type"] {
4381	case string(OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition):
4382		var trc ThresholdRuleCondition
4383		err := json.Unmarshal(body, &trc)
4384		return trc, err
4385	case string(OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition):
4386		var ltrc LocationThresholdRuleCondition
4387		err := json.Unmarshal(body, &ltrc)
4388		return ltrc, err
4389	case string(OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition):
4390		var merc ManagementEventRuleCondition
4391		err := json.Unmarshal(body, &merc)
4392		return merc, err
4393	default:
4394		var rc RuleCondition
4395		err := json.Unmarshal(body, &rc)
4396		return rc, err
4397	}
4398}
4399func unmarshalBasicRuleConditionArray(body []byte) ([]BasicRuleCondition, error) {
4400	var rawMessages []*json.RawMessage
4401	err := json.Unmarshal(body, &rawMessages)
4402	if err != nil {
4403		return nil, err
4404	}
4405
4406	rcArray := make([]BasicRuleCondition, len(rawMessages))
4407
4408	for index, rawMessage := range rawMessages {
4409		rc, err := unmarshalBasicRuleCondition(*rawMessage)
4410		if err != nil {
4411			return nil, err
4412		}
4413		rcArray[index] = rc
4414	}
4415	return rcArray, nil
4416}
4417
4418// MarshalJSON is the custom marshaler for RuleCondition.
4419func (rc RuleCondition) MarshalJSON() ([]byte, error) {
4420	rc.OdataType = OdataTypeRuleCondition
4421	objectMap := make(map[string]interface{})
4422	objectMap["dataSource"] = rc.DataSource
4423	if rc.OdataType != "" {
4424		objectMap["odata.type"] = rc.OdataType
4425	}
4426	return json.Marshal(objectMap)
4427}
4428
4429// AsThresholdRuleCondition is the BasicRuleCondition implementation for RuleCondition.
4430func (rc RuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) {
4431	return nil, false
4432}
4433
4434// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for RuleCondition.
4435func (rc RuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) {
4436	return nil, false
4437}
4438
4439// AsManagementEventRuleCondition is the BasicRuleCondition implementation for RuleCondition.
4440func (rc RuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) {
4441	return nil, false
4442}
4443
4444// AsRuleCondition is the BasicRuleCondition implementation for RuleCondition.
4445func (rc RuleCondition) AsRuleCondition() (*RuleCondition, bool) {
4446	return &rc, true
4447}
4448
4449// AsBasicRuleCondition is the BasicRuleCondition implementation for RuleCondition.
4450func (rc RuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) {
4451	return &rc, true
4452}
4453
4454// UnmarshalJSON is the custom unmarshaler for RuleCondition struct.
4455func (rc *RuleCondition) UnmarshalJSON(body []byte) error {
4456	var m map[string]*json.RawMessage
4457	err := json.Unmarshal(body, &m)
4458	if err != nil {
4459		return err
4460	}
4461	for k, v := range m {
4462		switch k {
4463		case "dataSource":
4464			if v != nil {
4465				dataSource, err := unmarshalBasicRuleDataSource(*v)
4466				if err != nil {
4467					return err
4468				}
4469				rc.DataSource = dataSource
4470			}
4471		case "odata.type":
4472			if v != nil {
4473				var odataType OdataTypeBasicRuleCondition
4474				err = json.Unmarshal(*v, &odataType)
4475				if err != nil {
4476					return err
4477				}
4478				rc.OdataType = odataType
4479			}
4480		}
4481	}
4482
4483	return nil
4484}
4485
4486// BasicRuleDataSource the resource from which the rule collects its data.
4487type BasicRuleDataSource interface {
4488	AsRuleMetricDataSource() (*RuleMetricDataSource, bool)
4489	AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool)
4490	AsRuleDataSource() (*RuleDataSource, bool)
4491}
4492
4493// RuleDataSource the resource from which the rule collects its data.
4494type RuleDataSource struct {
4495	// ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
4496	ResourceURI *string `json:"resourceUri,omitempty"`
4497	// OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource'
4498	OdataType OdataType `json:"odata.type,omitempty"`
4499}
4500
4501func unmarshalBasicRuleDataSource(body []byte) (BasicRuleDataSource, error) {
4502	var m map[string]interface{}
4503	err := json.Unmarshal(body, &m)
4504	if err != nil {
4505		return nil, err
4506	}
4507
4508	switch m["odata.type"] {
4509	case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource):
4510		var rmds RuleMetricDataSource
4511		err := json.Unmarshal(body, &rmds)
4512		return rmds, err
4513	case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource):
4514		var rmeds RuleManagementEventDataSource
4515		err := json.Unmarshal(body, &rmeds)
4516		return rmeds, err
4517	default:
4518		var rds RuleDataSource
4519		err := json.Unmarshal(body, &rds)
4520		return rds, err
4521	}
4522}
4523func unmarshalBasicRuleDataSourceArray(body []byte) ([]BasicRuleDataSource, error) {
4524	var rawMessages []*json.RawMessage
4525	err := json.Unmarshal(body, &rawMessages)
4526	if err != nil {
4527		return nil, err
4528	}
4529
4530	rdsArray := make([]BasicRuleDataSource, len(rawMessages))
4531
4532	for index, rawMessage := range rawMessages {
4533		rds, err := unmarshalBasicRuleDataSource(*rawMessage)
4534		if err != nil {
4535			return nil, err
4536		}
4537		rdsArray[index] = rds
4538	}
4539	return rdsArray, nil
4540}
4541
4542// MarshalJSON is the custom marshaler for RuleDataSource.
4543func (rds RuleDataSource) MarshalJSON() ([]byte, error) {
4544	rds.OdataType = OdataTypeRuleDataSource
4545	objectMap := make(map[string]interface{})
4546	if rds.ResourceURI != nil {
4547		objectMap["resourceUri"] = rds.ResourceURI
4548	}
4549	if rds.OdataType != "" {
4550		objectMap["odata.type"] = rds.OdataType
4551	}
4552	return json.Marshal(objectMap)
4553}
4554
4555// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleDataSource.
4556func (rds RuleDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) {
4557	return nil, false
4558}
4559
4560// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleDataSource.
4561func (rds RuleDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) {
4562	return nil, false
4563}
4564
4565// AsRuleDataSource is the BasicRuleDataSource implementation for RuleDataSource.
4566func (rds RuleDataSource) AsRuleDataSource() (*RuleDataSource, bool) {
4567	return &rds, true
4568}
4569
4570// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleDataSource.
4571func (rds RuleDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) {
4572	return &rds, true
4573}
4574
4575// RuleEmailAction specifies the action to send email when the rule condition is evaluated. The
4576// discriminator is always RuleEmailAction in this case.
4577type RuleEmailAction struct {
4578	// SendToServiceOwners - Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated.
4579	SendToServiceOwners *bool `json:"sendToServiceOwners,omitempty"`
4580	// CustomEmails - the list of administrator's custom email addresses to notify of the activation of the alert.
4581	CustomEmails *[]string `json:"customEmails,omitempty"`
4582	// OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction'
4583	OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"`
4584}
4585
4586// MarshalJSON is the custom marshaler for RuleEmailAction.
4587func (rea RuleEmailAction) MarshalJSON() ([]byte, error) {
4588	rea.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction
4589	objectMap := make(map[string]interface{})
4590	if rea.SendToServiceOwners != nil {
4591		objectMap["sendToServiceOwners"] = rea.SendToServiceOwners
4592	}
4593	if rea.CustomEmails != nil {
4594		objectMap["customEmails"] = rea.CustomEmails
4595	}
4596	if rea.OdataType != "" {
4597		objectMap["odata.type"] = rea.OdataType
4598	}
4599	return json.Marshal(objectMap)
4600}
4601
4602// AsRuleEmailAction is the BasicRuleAction implementation for RuleEmailAction.
4603func (rea RuleEmailAction) AsRuleEmailAction() (*RuleEmailAction, bool) {
4604	return &rea, true
4605}
4606
4607// AsRuleWebhookAction is the BasicRuleAction implementation for RuleEmailAction.
4608func (rea RuleEmailAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) {
4609	return nil, false
4610}
4611
4612// AsRuleAction is the BasicRuleAction implementation for RuleEmailAction.
4613func (rea RuleEmailAction) AsRuleAction() (*RuleAction, bool) {
4614	return nil, false
4615}
4616
4617// AsBasicRuleAction is the BasicRuleAction implementation for RuleEmailAction.
4618func (rea RuleEmailAction) AsBasicRuleAction() (BasicRuleAction, bool) {
4619	return &rea, true
4620}
4621
4622// RuleManagementEventClaimsDataSource the claims for a rule management event data source.
4623type RuleManagementEventClaimsDataSource struct {
4624	// EmailAddress - the email address.
4625	EmailAddress *string `json:"emailAddress,omitempty"`
4626}
4627
4628// RuleManagementEventDataSource a rule management event data source. The discriminator fields is always
4629// RuleManagementEventDataSource in this case.
4630type RuleManagementEventDataSource struct {
4631	// EventName - the event name.
4632	EventName *string `json:"eventName,omitempty"`
4633	// EventSource - the event source.
4634	EventSource *string `json:"eventSource,omitempty"`
4635	// Level - the level.
4636	Level *string `json:"level,omitempty"`
4637	// OperationName - The name of the operation that should be checked for. If no name is provided, any operation will match.
4638	OperationName *string `json:"operationName,omitempty"`
4639	// ResourceGroupName - the resource group name.
4640	ResourceGroupName *string `json:"resourceGroupName,omitempty"`
4641	// ResourceProviderName - the resource provider name.
4642	ResourceProviderName *string `json:"resourceProviderName,omitempty"`
4643	// Status - The status of the operation that should be checked for. If no status is provided, any status will match.
4644	Status *string `json:"status,omitempty"`
4645	// SubStatus - the substatus.
4646	SubStatus *string `json:"subStatus,omitempty"`
4647	// Claims - the claims.
4648	Claims *RuleManagementEventClaimsDataSource `json:"claims,omitempty"`
4649	// ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
4650	ResourceURI *string `json:"resourceUri,omitempty"`
4651	// OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource'
4652	OdataType OdataType `json:"odata.type,omitempty"`
4653}
4654
4655// MarshalJSON is the custom marshaler for RuleManagementEventDataSource.
4656func (rmeds RuleManagementEventDataSource) MarshalJSON() ([]byte, error) {
4657	rmeds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource
4658	objectMap := make(map[string]interface{})
4659	if rmeds.EventName != nil {
4660		objectMap["eventName"] = rmeds.EventName
4661	}
4662	if rmeds.EventSource != nil {
4663		objectMap["eventSource"] = rmeds.EventSource
4664	}
4665	if rmeds.Level != nil {
4666		objectMap["level"] = rmeds.Level
4667	}
4668	if rmeds.OperationName != nil {
4669		objectMap["operationName"] = rmeds.OperationName
4670	}
4671	if rmeds.ResourceGroupName != nil {
4672		objectMap["resourceGroupName"] = rmeds.ResourceGroupName
4673	}
4674	if rmeds.ResourceProviderName != nil {
4675		objectMap["resourceProviderName"] = rmeds.ResourceProviderName
4676	}
4677	if rmeds.Status != nil {
4678		objectMap["status"] = rmeds.Status
4679	}
4680	if rmeds.SubStatus != nil {
4681		objectMap["subStatus"] = rmeds.SubStatus
4682	}
4683	if rmeds.Claims != nil {
4684		objectMap["claims"] = rmeds.Claims
4685	}
4686	if rmeds.ResourceURI != nil {
4687		objectMap["resourceUri"] = rmeds.ResourceURI
4688	}
4689	if rmeds.OdataType != "" {
4690		objectMap["odata.type"] = rmeds.OdataType
4691	}
4692	return json.Marshal(objectMap)
4693}
4694
4695// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource.
4696func (rmeds RuleManagementEventDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) {
4697	return nil, false
4698}
4699
4700// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource.
4701func (rmeds RuleManagementEventDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) {
4702	return &rmeds, true
4703}
4704
4705// AsRuleDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource.
4706func (rmeds RuleManagementEventDataSource) AsRuleDataSource() (*RuleDataSource, bool) {
4707	return nil, false
4708}
4709
4710// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource.
4711func (rmeds RuleManagementEventDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) {
4712	return &rmeds, true
4713}
4714
4715// RuleMetricDataSource a rule metric data source. The discriminator value is always RuleMetricDataSource
4716// in this case.
4717type RuleMetricDataSource struct {
4718	// MetricName - the name of the metric that defines what the rule monitors.
4719	MetricName *string `json:"metricName,omitempty"`
4720	// ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
4721	ResourceURI *string `json:"resourceUri,omitempty"`
4722	// OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource'
4723	OdataType OdataType `json:"odata.type,omitempty"`
4724}
4725
4726// MarshalJSON is the custom marshaler for RuleMetricDataSource.
4727func (rmds RuleMetricDataSource) MarshalJSON() ([]byte, error) {
4728	rmds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource
4729	objectMap := make(map[string]interface{})
4730	if rmds.MetricName != nil {
4731		objectMap["metricName"] = rmds.MetricName
4732	}
4733	if rmds.ResourceURI != nil {
4734		objectMap["resourceUri"] = rmds.ResourceURI
4735	}
4736	if rmds.OdataType != "" {
4737		objectMap["odata.type"] = rmds.OdataType
4738	}
4739	return json.Marshal(objectMap)
4740}
4741
4742// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource.
4743func (rmds RuleMetricDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) {
4744	return &rmds, true
4745}
4746
4747// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource.
4748func (rmds RuleMetricDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) {
4749	return nil, false
4750}
4751
4752// AsRuleDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource.
4753func (rmds RuleMetricDataSource) AsRuleDataSource() (*RuleDataSource, bool) {
4754	return nil, false
4755}
4756
4757// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource.
4758func (rmds RuleMetricDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) {
4759	return &rmds, true
4760}
4761
4762// RuleWebhookAction specifies the action to post to service when the rule condition is evaluated. The
4763// discriminator is always RuleWebhookAction in this case.
4764type RuleWebhookAction struct {
4765	// ServiceURI - the service uri to Post the notification when the alert activates or resolves.
4766	ServiceURI *string `json:"serviceUri,omitempty"`
4767	// Properties - the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload.
4768	Properties map[string]*string `json:"properties"`
4769	// OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction'
4770	OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"`
4771}
4772
4773// MarshalJSON is the custom marshaler for RuleWebhookAction.
4774func (rwa RuleWebhookAction) MarshalJSON() ([]byte, error) {
4775	rwa.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction
4776	objectMap := make(map[string]interface{})
4777	if rwa.ServiceURI != nil {
4778		objectMap["serviceUri"] = rwa.ServiceURI
4779	}
4780	if rwa.Properties != nil {
4781		objectMap["properties"] = rwa.Properties
4782	}
4783	if rwa.OdataType != "" {
4784		objectMap["odata.type"] = rwa.OdataType
4785	}
4786	return json.Marshal(objectMap)
4787}
4788
4789// AsRuleEmailAction is the BasicRuleAction implementation for RuleWebhookAction.
4790func (rwa RuleWebhookAction) AsRuleEmailAction() (*RuleEmailAction, bool) {
4791	return nil, false
4792}
4793
4794// AsRuleWebhookAction is the BasicRuleAction implementation for RuleWebhookAction.
4795func (rwa RuleWebhookAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) {
4796	return &rwa, true
4797}
4798
4799// AsRuleAction is the BasicRuleAction implementation for RuleWebhookAction.
4800func (rwa RuleWebhookAction) AsRuleAction() (*RuleAction, bool) {
4801	return nil, false
4802}
4803
4804// AsBasicRuleAction is the BasicRuleAction implementation for RuleWebhookAction.
4805func (rwa RuleWebhookAction) AsBasicRuleAction() (BasicRuleAction, bool) {
4806	return &rwa, true
4807}
4808
4809// ScaleAction the parameters for the scaling action.
4810type ScaleAction struct {
4811	// Direction - the scale direction. Whether the scaling action increases or decreases the number of instances. Possible values include: 'ScaleDirectionNone', 'ScaleDirectionIncrease', 'ScaleDirectionDecrease'
4812	Direction ScaleDirection `json:"direction,omitempty"`
4813	// Type - the type of action that should occur when the scale rule fires. Possible values include: 'ChangeCount', 'PercentChangeCount', 'ExactCount'
4814	Type ScaleType `json:"type,omitempty"`
4815	// Value - the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.
4816	Value *string `json:"value,omitempty"`
4817	// 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.
4818	Cooldown *string `json:"cooldown,omitempty"`
4819}
4820
4821// ScaleCapacity the number of instances that can be used during this profile.
4822type ScaleCapacity struct {
4823	// Minimum - the minimum number of instances for the resource.
4824	Minimum *string `json:"minimum,omitempty"`
4825	// 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.
4826	Maximum *string `json:"maximum,omitempty"`
4827	// 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.
4828	Default *string `json:"default,omitempty"`
4829}
4830
4831// ScaleRule a rule that provide the triggers and parameters for the scaling action.
4832type ScaleRule struct {
4833	// MetricTrigger - the trigger that results in a scaling action.
4834	MetricTrigger *MetricTrigger `json:"metricTrigger,omitempty"`
4835	// ScaleAction - the parameters for the scaling action.
4836	ScaleAction *ScaleAction `json:"scaleAction,omitempty"`
4837}
4838
4839// ScaleRuleMetricDimension specifies an auto scale rule metric dimension.
4840type ScaleRuleMetricDimension struct {
4841	// DimensionName - Name of the dimension.
4842	DimensionName *string `json:"DimensionName,omitempty"`
4843	// 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'
4844	Operator ScaleRuleMetricDimensionOperationType `json:"Operator,omitempty"`
4845	// Values - list of dimension values. For example: ["App1","App2"].
4846	Values *[]string `json:"Values,omitempty"`
4847}
4848
4849// Schedule defines how often to run the search and the time interval.
4850type Schedule struct {
4851	// FrequencyInMinutes - frequency (in minutes) at which rule condition should be evaluated.
4852	FrequencyInMinutes *int32 `json:"frequencyInMinutes,omitempty"`
4853	// TimeWindowInMinutes - Time window for which data needs to be fetched for query (should be greater than or equal to frequencyInMinutes).
4854	TimeWindowInMinutes *int32 `json:"timeWindowInMinutes,omitempty"`
4855}
4856
4857// SenderAuthorization the authorization used by the user who has performed the operation that led to this
4858// event. This captures the RBAC properties of the event. These usually include the 'action', 'role' and
4859// the 'scope'
4860type SenderAuthorization struct {
4861	// Action - the permissible actions. For instance: microsoft.support/supporttickets/write
4862	Action *string `json:"action,omitempty"`
4863	// Role - the role of the user. For instance: Subscription Admin
4864	Role *string `json:"role,omitempty"`
4865	// Scope - the scope.
4866	Scope *string `json:"scope,omitempty"`
4867}
4868
4869// SmsReceiver an SMS receiver.
4870type SmsReceiver struct {
4871	// Name - The name of the SMS receiver. Names must be unique across all receivers within an action group.
4872	Name *string `json:"name,omitempty"`
4873	// CountryCode - The country code of the SMS receiver.
4874	CountryCode *string `json:"countryCode,omitempty"`
4875	// PhoneNumber - The phone number of the SMS receiver.
4876	PhoneNumber *string `json:"phoneNumber,omitempty"`
4877	// Status - READ-ONLY; The status of the receiver. Possible values include: 'ReceiverStatusNotSpecified', 'ReceiverStatusEnabled', 'ReceiverStatusDisabled'
4878	Status ReceiverStatus `json:"status,omitempty"`
4879}
4880
4881// MarshalJSON is the custom marshaler for SmsReceiver.
4882func (sr SmsReceiver) MarshalJSON() ([]byte, error) {
4883	objectMap := make(map[string]interface{})
4884	if sr.Name != nil {
4885		objectMap["name"] = sr.Name
4886	}
4887	if sr.CountryCode != nil {
4888		objectMap["countryCode"] = sr.CountryCode
4889	}
4890	if sr.PhoneNumber != nil {
4891		objectMap["phoneNumber"] = sr.PhoneNumber
4892	}
4893	return json.Marshal(objectMap)
4894}
4895
4896// Source specifies the log search query.
4897type Source struct {
4898	// Query - Log search query. Required for action type - AlertingAction
4899	Query *string `json:"query,omitempty"`
4900	// AuthorizedResources - List of  Resource referred into query
4901	AuthorizedResources *[]string `json:"authorizedResources,omitempty"`
4902	// DataSourceID - The resource uri over which log search query is to be run.
4903	DataSourceID *string `json:"dataSourceId,omitempty"`
4904	// QueryType - Set value to 'ResultCount'. Possible values include: 'ResultCount'
4905	QueryType QueryType `json:"queryType,omitempty"`
4906}
4907
4908// ThresholdRuleCondition a rule condition based on a metric crossing a threshold.
4909type ThresholdRuleCondition struct {
4910	// Operator - the operator used to compare the data and the threshold. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual'
4911	Operator ConditionOperator `json:"operator,omitempty"`
4912	// Threshold - the threshold value that activates the alert.
4913	Threshold *float64 `json:"threshold,omitempty"`
4914	// 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.
4915	WindowSize *string `json:"windowSize,omitempty"`
4916	// 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'
4917	TimeAggregation TimeAggregationOperator `json:"timeAggregation,omitempty"`
4918	// DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource.
4919	DataSource BasicRuleDataSource `json:"dataSource,omitempty"`
4920	// OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition'
4921	OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"`
4922}
4923
4924// MarshalJSON is the custom marshaler for ThresholdRuleCondition.
4925func (trc ThresholdRuleCondition) MarshalJSON() ([]byte, error) {
4926	trc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition
4927	objectMap := make(map[string]interface{})
4928	if trc.Operator != "" {
4929		objectMap["operator"] = trc.Operator
4930	}
4931	if trc.Threshold != nil {
4932		objectMap["threshold"] = trc.Threshold
4933	}
4934	if trc.WindowSize != nil {
4935		objectMap["windowSize"] = trc.WindowSize
4936	}
4937	if trc.TimeAggregation != "" {
4938		objectMap["timeAggregation"] = trc.TimeAggregation
4939	}
4940	objectMap["dataSource"] = trc.DataSource
4941	if trc.OdataType != "" {
4942		objectMap["odata.type"] = trc.OdataType
4943	}
4944	return json.Marshal(objectMap)
4945}
4946
4947// AsThresholdRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition.
4948func (trc ThresholdRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) {
4949	return &trc, true
4950}
4951
4952// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition.
4953func (trc ThresholdRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) {
4954	return nil, false
4955}
4956
4957// AsManagementEventRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition.
4958func (trc ThresholdRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) {
4959	return nil, false
4960}
4961
4962// AsRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition.
4963func (trc ThresholdRuleCondition) AsRuleCondition() (*RuleCondition, bool) {
4964	return nil, false
4965}
4966
4967// AsBasicRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition.
4968func (trc ThresholdRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) {
4969	return &trc, true
4970}
4971
4972// UnmarshalJSON is the custom unmarshaler for ThresholdRuleCondition struct.
4973func (trc *ThresholdRuleCondition) UnmarshalJSON(body []byte) error {
4974	var m map[string]*json.RawMessage
4975	err := json.Unmarshal(body, &m)
4976	if err != nil {
4977		return err
4978	}
4979	for k, v := range m {
4980		switch k {
4981		case "operator":
4982			if v != nil {
4983				var operator ConditionOperator
4984				err = json.Unmarshal(*v, &operator)
4985				if err != nil {
4986					return err
4987				}
4988				trc.Operator = operator
4989			}
4990		case "threshold":
4991			if v != nil {
4992				var threshold float64
4993				err = json.Unmarshal(*v, &threshold)
4994				if err != nil {
4995					return err
4996				}
4997				trc.Threshold = &threshold
4998			}
4999		case "windowSize":
5000			if v != nil {
5001				var windowSize string
5002				err = json.Unmarshal(*v, &windowSize)
5003				if err != nil {
5004					return err
5005				}
5006				trc.WindowSize = &windowSize
5007			}
5008		case "timeAggregation":
5009			if v != nil {
5010				var timeAggregation TimeAggregationOperator
5011				err = json.Unmarshal(*v, &timeAggregation)
5012				if err != nil {
5013					return err
5014				}
5015				trc.TimeAggregation = timeAggregation
5016			}
5017		case "dataSource":
5018			if v != nil {
5019				dataSource, err := unmarshalBasicRuleDataSource(*v)
5020				if err != nil {
5021					return err
5022				}
5023				trc.DataSource = dataSource
5024			}
5025		case "odata.type":
5026			if v != nil {
5027				var odataType OdataTypeBasicRuleCondition
5028				err = json.Unmarshal(*v, &odataType)
5029				if err != nil {
5030					return err
5031				}
5032				trc.OdataType = odataType
5033			}
5034		}
5035	}
5036
5037	return nil
5038}
5039
5040// TimeSeriesElement a time series result type. The discriminator value is always TimeSeries in this case.
5041type TimeSeriesElement struct {
5042	// Metadatavalues - the metadata values returned if $filter was specified in the call.
5043	Metadatavalues *[]MetadataValue `json:"metadatavalues,omitempty"`
5044	// Data - An array of data points representing the metric values.  This is only returned if a result type of data is specified.
5045	Data *[]MetricValue `json:"data,omitempty"`
5046}
5047
5048// TimeSeriesInformation the time series info needed for calculating the baseline.
5049type TimeSeriesInformation struct {
5050	// Sensitivities - the list of sensitivities for calculating the baseline.
5051	Sensitivities *[]string `json:"sensitivities,omitempty"`
5052	// Values - The metric values to calculate the baseline.
5053	Values *[]float64 `json:"values,omitempty"`
5054	// Timestamps - the array of timestamps of the baselines.
5055	Timestamps *[]date.Time `json:"timestamps,omitempty"`
5056}
5057
5058// TimeWindow a specific date-time for the profile.
5059type TimeWindow struct {
5060	// 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
5061	TimeZone *string `json:"timeZone,omitempty"`
5062	// Start - the start time for the profile in ISO 8601 format.
5063	Start *date.Time `json:"start,omitempty"`
5064	// End - the end time for the profile in ISO 8601 format.
5065	End *date.Time `json:"end,omitempty"`
5066}
5067
5068// TriggerCondition the condition that results in the Log Search rule.
5069type TriggerCondition struct {
5070	// ThresholdOperator - Evaluation operation for rule - 'GreaterThan' or 'LessThan. Possible values include: 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual'
5071	ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"`
5072	// Threshold - Result or count threshold based on which rule should be triggered.
5073	Threshold *float64 `json:"threshold,omitempty"`
5074	// MetricTrigger - Trigger condition for metric query rule
5075	MetricTrigger *LogMetricTrigger `json:"metricTrigger,omitempty"`
5076}
5077
5078// VoiceReceiver a voice receiver.
5079type VoiceReceiver struct {
5080	// Name - The name of the voice receiver. Names must be unique across all receivers within an action group.
5081	Name *string `json:"name,omitempty"`
5082	// CountryCode - The country code of the voice receiver.
5083	CountryCode *string `json:"countryCode,omitempty"`
5084	// PhoneNumber - The phone number of the voice receiver.
5085	PhoneNumber *string `json:"phoneNumber,omitempty"`
5086}
5087
5088// WebhookNotification webhook notification of an autoscale event.
5089type WebhookNotification struct {
5090	// ServiceURI - the service address to receive the notification.
5091	ServiceURI *string `json:"serviceUri,omitempty"`
5092	// Properties - a property bag of settings. This value can be empty.
5093	Properties map[string]*string `json:"properties"`
5094}
5095
5096// MarshalJSON is the custom marshaler for WebhookNotification.
5097func (wn WebhookNotification) MarshalJSON() ([]byte, error) {
5098	objectMap := make(map[string]interface{})
5099	if wn.ServiceURI != nil {
5100		objectMap["serviceUri"] = wn.ServiceURI
5101	}
5102	if wn.Properties != nil {
5103		objectMap["properties"] = wn.Properties
5104	}
5105	return json.Marshal(objectMap)
5106}
5107
5108// WebhookReceiver a webhook receiver.
5109type WebhookReceiver struct {
5110	// Name - The name of the webhook receiver. Names must be unique across all receivers within an action group.
5111	Name *string `json:"name,omitempty"`
5112	// ServiceURI - The URI where webhooks should be sent.
5113	ServiceURI *string `json:"serviceUri,omitempty"`
5114}
5115
5116// WebtestLocationAvailabilityCriteria specifies the metric alert rule criteria for a web test resource.
5117type WebtestLocationAvailabilityCriteria struct {
5118	// WebTestID - The Application Insights web test Id.
5119	WebTestID *string `json:"webTestId,omitempty"`
5120	// ComponentID - The Application Insights resource Id.
5121	ComponentID *string `json:"componentId,omitempty"`
5122	// FailedLocationCount - The number of failed locations.
5123	FailedLocationCount *float64 `json:"failedLocationCount,omitempty"`
5124	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
5125	AdditionalProperties map[string]interface{} `json:""`
5126	// OdataType - Possible values include: 'OdataTypeMetricAlertCriteria', 'OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria'
5127	OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"`
5128}
5129
5130// MarshalJSON is the custom marshaler for WebtestLocationAvailabilityCriteria.
5131func (wlac WebtestLocationAvailabilityCriteria) MarshalJSON() ([]byte, error) {
5132	wlac.OdataType = OdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria
5133	objectMap := make(map[string]interface{})
5134	if wlac.WebTestID != nil {
5135		objectMap["webTestId"] = wlac.WebTestID
5136	}
5137	if wlac.ComponentID != nil {
5138		objectMap["componentId"] = wlac.ComponentID
5139	}
5140	if wlac.FailedLocationCount != nil {
5141		objectMap["failedLocationCount"] = wlac.FailedLocationCount
5142	}
5143	if wlac.OdataType != "" {
5144		objectMap["odata.type"] = wlac.OdataType
5145	}
5146	for k, v := range wlac.AdditionalProperties {
5147		objectMap[k] = v
5148	}
5149	return json.Marshal(objectMap)
5150}
5151
5152// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria.
5153func (wlac WebtestLocationAvailabilityCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) {
5154	return nil, false
5155}
5156
5157// AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria.
5158func (wlac WebtestLocationAvailabilityCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) {
5159	return &wlac, true
5160}
5161
5162// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria.
5163func (wlac WebtestLocationAvailabilityCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) {
5164	return nil, false
5165}
5166
5167// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria.
5168func (wlac WebtestLocationAvailabilityCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) {
5169	return nil, false
5170}
5171
5172// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria.
5173func (wlac WebtestLocationAvailabilityCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) {
5174	return &wlac, true
5175}
5176
5177// UnmarshalJSON is the custom unmarshaler for WebtestLocationAvailabilityCriteria struct.
5178func (wlac *WebtestLocationAvailabilityCriteria) UnmarshalJSON(body []byte) error {
5179	var m map[string]*json.RawMessage
5180	err := json.Unmarshal(body, &m)
5181	if err != nil {
5182		return err
5183	}
5184	for k, v := range m {
5185		switch k {
5186		case "webTestId":
5187			if v != nil {
5188				var webTestID string
5189				err = json.Unmarshal(*v, &webTestID)
5190				if err != nil {
5191					return err
5192				}
5193				wlac.WebTestID = &webTestID
5194			}
5195		case "componentId":
5196			if v != nil {
5197				var componentID string
5198				err = json.Unmarshal(*v, &componentID)
5199				if err != nil {
5200					return err
5201				}
5202				wlac.ComponentID = &componentID
5203			}
5204		case "failedLocationCount":
5205			if v != nil {
5206				var failedLocationCount float64
5207				err = json.Unmarshal(*v, &failedLocationCount)
5208				if err != nil {
5209					return err
5210				}
5211				wlac.FailedLocationCount = &failedLocationCount
5212			}
5213		default:
5214			if v != nil {
5215				var additionalProperties interface{}
5216				err = json.Unmarshal(*v, &additionalProperties)
5217				if err != nil {
5218					return err
5219				}
5220				if wlac.AdditionalProperties == nil {
5221					wlac.AdditionalProperties = make(map[string]interface{})
5222				}
5223				wlac.AdditionalProperties[k] = additionalProperties
5224			}
5225		case "odata.type":
5226			if v != nil {
5227				var odataType OdataTypeBasicMetricAlertCriteria
5228				err = json.Unmarshal(*v, &odataType)
5229				if err != nil {
5230					return err
5231				}
5232				wlac.OdataType = odataType
5233			}
5234		}
5235	}
5236
5237	return nil
5238}
5239