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