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