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