1 package diagnostics
2
3
4
5
6
7
8
9 import (
10 "context"
11 "encoding/json"
12 "github.com/Azure/go-autorest/autorest"
13 "github.com/Azure/go-autorest/autorest/azure"
14 "github.com/Azure/go-autorest/autorest/date"
15 "github.com/Azure/go-autorest/autorest/to"
16 "github.com/Azure/go-autorest/tracing"
17 "net/http"
18 )
19
20
21 const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-05-01-preview/diagnostics"
22
23
24 type AccessModeSettings struct {
25
26 QueryAccessMode AccessMode `json:"queryAccessMode,omitempty"`
27
28 IngestionAccessMode AccessMode `json:"ingestionAccessMode,omitempty"`
29
30 Exclusions *[]AccessModeSettingsExclusion `json:"exclusions,omitempty"`
31 }
32
33
34
35
36 type AccessModeSettingsExclusion struct {
37
38 PrivateEndpointConnectionName *string `json:"privateEndpointConnectionName,omitempty"`
39
40 QueryAccessMode AccessMode `json:"queryAccessMode,omitempty"`
41
42 IngestionAccessMode AccessMode `json:"ingestionAccessMode,omitempty"`
43 }
44
45
46 type ActionDetail struct {
47
48 MechanismType *string `json:"MechanismType,omitempty"`
49
50 Name *string `json:"Name,omitempty"`
51
52 Status *string `json:"Status,omitempty"`
53
54 SubState *string `json:"SubState,omitempty"`
55
56 SendTime *string `json:"SendTime,omitempty"`
57
58 Detail *string `json:"Detail,omitempty"`
59 }
60
61
62 type ActionGroup struct {
63
64 GroupShortName *string `json:"groupShortName,omitempty"`
65
66 Enabled *bool `json:"enabled,omitempty"`
67
68 EmailReceivers *[]EmailReceiver `json:"emailReceivers,omitempty"`
69
70 SmsReceivers *[]SmsReceiver `json:"smsReceivers,omitempty"`
71
72 WebhookReceivers *[]WebhookReceiver `json:"webhookReceivers,omitempty"`
73
74 ItsmReceivers *[]ItsmReceiver `json:"itsmReceivers,omitempty"`
75
76 AzureAppPushReceivers *[]AzureAppPushReceiver `json:"azureAppPushReceivers,omitempty"`
77
78 AutomationRunbookReceivers *[]AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"`
79
80 VoiceReceivers *[]VoiceReceiver `json:"voiceReceivers,omitempty"`
81
82 LogicAppReceivers *[]LogicAppReceiver `json:"logicAppReceivers,omitempty"`
83
84 AzureFunctionReceivers *[]AzureFunctionReceiver `json:"azureFunctionReceivers,omitempty"`
85
86 ArmRoleReceivers *[]ArmRoleReceiver `json:"armRoleReceivers,omitempty"`
87
88 EventHubReceivers *[]EventHubReceiver `json:"eventHubReceivers,omitempty"`
89 }
90
91
92 type ActionGroupList struct {
93 autorest.Response `json:"-"`
94
95 Value *[]ActionGroupResource `json:"value,omitempty"`
96
97 NextLink *string `json:"nextLink,omitempty"`
98 }
99
100
101 type ActionGroupPatch struct {
102
103 Enabled *bool `json:"enabled,omitempty"`
104 }
105
106
107 type ActionGroupPatchBody struct {
108
109 Tags map[string]*string `json:"tags"`
110
111 *ActionGroupPatch `json:"properties,omitempty"`
112 }
113
114
115 func (agpb ActionGroupPatchBody) MarshalJSON() ([]byte, error) {
116 objectMap := make(map[string]interface{})
117 if agpb.Tags != nil {
118 objectMap["tags"] = agpb.Tags
119 }
120 if agpb.ActionGroupPatch != nil {
121 objectMap["properties"] = agpb.ActionGroupPatch
122 }
123 return json.Marshal(objectMap)
124 }
125
126
127 func (agpb *ActionGroupPatchBody) UnmarshalJSON(body []byte) error {
128 var m map[string]*json.RawMessage
129 err := json.Unmarshal(body, &m)
130 if err != nil {
131 return err
132 }
133 for k, v := range m {
134 switch k {
135 case "tags":
136 if v != nil {
137 var tags map[string]*string
138 err = json.Unmarshal(*v, &tags)
139 if err != nil {
140 return err
141 }
142 agpb.Tags = tags
143 }
144 case "properties":
145 if v != nil {
146 var actionGroupPatch ActionGroupPatch
147 err = json.Unmarshal(*v, &actionGroupPatch)
148 if err != nil {
149 return err
150 }
151 agpb.ActionGroupPatch = &actionGroupPatch
152 }
153 }
154 }
155
156 return nil
157 }
158
159
160 type ActionGroupResource struct {
161 autorest.Response `json:"-"`
162
163 *ActionGroup `json:"properties,omitempty"`
164
165 ID *string `json:"id,omitempty"`
166
167 Name *string `json:"name,omitempty"`
168
169 Type *string `json:"type,omitempty"`
170
171 Location *string `json:"location,omitempty"`
172
173 Tags map[string]*string `json:"tags"`
174 }
175
176
177 func (agr ActionGroupResource) MarshalJSON() ([]byte, error) {
178 objectMap := make(map[string]interface{})
179 if agr.ActionGroup != nil {
180 objectMap["properties"] = agr.ActionGroup
181 }
182 if agr.Location != nil {
183 objectMap["location"] = agr.Location
184 }
185 if agr.Tags != nil {
186 objectMap["tags"] = agr.Tags
187 }
188 return json.Marshal(objectMap)
189 }
190
191
192 func (agr *ActionGroupResource) UnmarshalJSON(body []byte) error {
193 var m map[string]*json.RawMessage
194 err := json.Unmarshal(body, &m)
195 if err != nil {
196 return err
197 }
198 for k, v := range m {
199 switch k {
200 case "properties":
201 if v != nil {
202 var actionGroup ActionGroup
203 err = json.Unmarshal(*v, &actionGroup)
204 if err != nil {
205 return err
206 }
207 agr.ActionGroup = &actionGroup
208 }
209 case "id":
210 if v != nil {
211 var ID string
212 err = json.Unmarshal(*v, &ID)
213 if err != nil {
214 return err
215 }
216 agr.ID = &ID
217 }
218 case "name":
219 if v != nil {
220 var name string
221 err = json.Unmarshal(*v, &name)
222 if err != nil {
223 return err
224 }
225 agr.Name = &name
226 }
227 case "type":
228 if v != nil {
229 var typeVar string
230 err = json.Unmarshal(*v, &typeVar)
231 if err != nil {
232 return err
233 }
234 agr.Type = &typeVar
235 }
236 case "location":
237 if v != nil {
238 var location string
239 err = json.Unmarshal(*v, &location)
240 if err != nil {
241 return err
242 }
243 agr.Location = &location
244 }
245 case "tags":
246 if v != nil {
247 var tags map[string]*string
248 err = json.Unmarshal(*v, &tags)
249 if err != nil {
250 return err
251 }
252 agr.Tags = tags
253 }
254 }
255 }
256
257 return nil
258 }
259
260
261
262 type ActionGroupsCreateNotificationsAtActionGroupResourceLevelFuture struct {
263 azure.FutureAPI
264
265
266 Result func(ActionGroupsClient) (TestNotificationDetailsResponse, error)
267 }
268
269
270 func (future *ActionGroupsCreateNotificationsAtActionGroupResourceLevelFuture) UnmarshalJSON(body []byte) error {
271 var azFuture azure.Future
272 if err := json.Unmarshal(body, &azFuture); err != nil {
273 return err
274 }
275 future.FutureAPI = &azFuture
276 future.Result = future.result
277 return nil
278 }
279
280
281 func (future *ActionGroupsCreateNotificationsAtActionGroupResourceLevelFuture) result(client ActionGroupsClient) (tndr TestNotificationDetailsResponse, err error) {
282 var done bool
283 done, err = future.DoneWithContext(context.Background(), client)
284 if err != nil {
285 err = autorest.NewErrorWithError(err, "diagnostics.ActionGroupsCreateNotificationsAtActionGroupResourceLevelFuture", "Result", future.Response(), "Polling failure")
286 return
287 }
288 if !done {
289 tndr.Response.Response = future.Response()
290 err = azure.NewAsyncOpIncompleteError("diagnostics.ActionGroupsCreateNotificationsAtActionGroupResourceLevelFuture")
291 return
292 }
293 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
294 if tndr.Response.Response, err = future.GetResult(sender); err == nil && tndr.Response.Response.StatusCode != http.StatusNoContent {
295 tndr, err = client.CreateNotificationsAtActionGroupResourceLevelResponder(tndr.Response.Response)
296 if err != nil {
297 err = autorest.NewErrorWithError(err, "diagnostics.ActionGroupsCreateNotificationsAtActionGroupResourceLevelFuture", "Result", tndr.Response.Response, "Failure responding to request")
298 }
299 }
300 return
301 }
302
303
304
305 type ActionGroupsCreateNotificationsAtResourceGroupLevelFuture struct {
306 azure.FutureAPI
307
308
309 Result func(ActionGroupsClient) (TestNotificationDetailsResponse, error)
310 }
311
312
313 func (future *ActionGroupsCreateNotificationsAtResourceGroupLevelFuture) UnmarshalJSON(body []byte) error {
314 var azFuture azure.Future
315 if err := json.Unmarshal(body, &azFuture); err != nil {
316 return err
317 }
318 future.FutureAPI = &azFuture
319 future.Result = future.result
320 return nil
321 }
322
323
324 func (future *ActionGroupsCreateNotificationsAtResourceGroupLevelFuture) result(client ActionGroupsClient) (tndr TestNotificationDetailsResponse, err error) {
325 var done bool
326 done, err = future.DoneWithContext(context.Background(), client)
327 if err != nil {
328 err = autorest.NewErrorWithError(err, "diagnostics.ActionGroupsCreateNotificationsAtResourceGroupLevelFuture", "Result", future.Response(), "Polling failure")
329 return
330 }
331 if !done {
332 tndr.Response.Response = future.Response()
333 err = azure.NewAsyncOpIncompleteError("diagnostics.ActionGroupsCreateNotificationsAtResourceGroupLevelFuture")
334 return
335 }
336 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
337 if tndr.Response.Response, err = future.GetResult(sender); err == nil && tndr.Response.Response.StatusCode != http.StatusNoContent {
338 tndr, err = client.CreateNotificationsAtResourceGroupLevelResponder(tndr.Response.Response)
339 if err != nil {
340 err = autorest.NewErrorWithError(err, "diagnostics.ActionGroupsCreateNotificationsAtResourceGroupLevelFuture", "Result", tndr.Response.Response, "Failure responding to request")
341 }
342 }
343 return
344 }
345
346
347
348 type ActionGroupsPostTestNotificationsFuture struct {
349 azure.FutureAPI
350
351
352 Result func(ActionGroupsClient) (TestNotificationDetailsResponse, error)
353 }
354
355
356 func (future *ActionGroupsPostTestNotificationsFuture) UnmarshalJSON(body []byte) error {
357 var azFuture azure.Future
358 if err := json.Unmarshal(body, &azFuture); err != nil {
359 return err
360 }
361 future.FutureAPI = &azFuture
362 future.Result = future.result
363 return nil
364 }
365
366
367 func (future *ActionGroupsPostTestNotificationsFuture) result(client ActionGroupsClient) (tndr TestNotificationDetailsResponse, err error) {
368 var done bool
369 done, err = future.DoneWithContext(context.Background(), client)
370 if err != nil {
371 err = autorest.NewErrorWithError(err, "diagnostics.ActionGroupsPostTestNotificationsFuture", "Result", future.Response(), "Polling failure")
372 return
373 }
374 if !done {
375 tndr.Response.Response = future.Response()
376 err = azure.NewAsyncOpIncompleteError("diagnostics.ActionGroupsPostTestNotificationsFuture")
377 return
378 }
379 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
380 if tndr.Response.Response, err = future.GetResult(sender); err == nil && tndr.Response.Response.StatusCode != http.StatusNoContent {
381 tndr, err = client.PostTestNotificationsResponder(tndr.Response.Response)
382 if err != nil {
383 err = autorest.NewErrorWithError(err, "diagnostics.ActionGroupsPostTestNotificationsFuture", "Result", tndr.Response.Response, "Failure responding to request")
384 }
385 }
386 return
387 }
388
389
390 type ArmRoleReceiver struct {
391
392 Name *string `json:"name,omitempty"`
393
394 RoleID *string `json:"roleId,omitempty"`
395
396 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
397 }
398
399
400 type AutomationRunbookReceiver struct {
401
402 AutomationAccountID *string `json:"automationAccountId,omitempty"`
403
404 RunbookName *string `json:"runbookName,omitempty"`
405
406 WebhookResourceID *string `json:"webhookResourceId,omitempty"`
407
408 IsGlobalRunbook *bool `json:"isGlobalRunbook,omitempty"`
409
410 Name *string `json:"name,omitempty"`
411
412 ServiceURI *string `json:"serviceUri,omitempty"`
413
414 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
415 }
416
417
418 type AutoscaleErrorResponse struct {
419
420 Error *AutoscaleErrorResponseError `json:"error,omitempty"`
421
422 SystemData *SystemData `json:"systemData,omitempty"`
423 }
424
425
426 func (aer AutoscaleErrorResponse) MarshalJSON() ([]byte, error) {
427 objectMap := make(map[string]interface{})
428 if aer.Error != nil {
429 objectMap["error"] = aer.Error
430 }
431 return json.Marshal(objectMap)
432 }
433
434
435 type AutoscaleErrorResponseError struct {
436
437 Code *string `json:"code,omitempty"`
438
439 Message *string `json:"message,omitempty"`
440
441 Target *string `json:"target,omitempty"`
442
443 Details *string `json:"details,omitempty"`
444 }
445
446
447 type AutoscaleNotification struct {
448
449 Operation *string `json:"operation,omitempty"`
450
451 Email *EmailNotification `json:"email,omitempty"`
452
453 Webhooks *[]WebhookNotification `json:"webhooks,omitempty"`
454 }
455
456
457 type AutoscaleProfile struct {
458
459 Name *string `json:"name,omitempty"`
460
461 Capacity *ScaleCapacity `json:"capacity,omitempty"`
462
463 Rules *[]ScaleRule `json:"rules,omitempty"`
464
465 FixedDate *TimeWindow `json:"fixedDate,omitempty"`
466
467 Recurrence *Recurrence `json:"recurrence,omitempty"`
468 }
469
470
471
472 type AutoscaleSetting struct {
473
474 Profiles *[]AutoscaleProfile `json:"profiles,omitempty"`
475
476 Notifications *[]AutoscaleNotification `json:"notifications,omitempty"`
477
478 Enabled *bool `json:"enabled,omitempty"`
479
480 PredictiveAutoscalePolicy *PredictiveAutoscalePolicy `json:"predictiveAutoscalePolicy,omitempty"`
481
482 Name *string `json:"name,omitempty"`
483
484 TargetResourceURI *string `json:"targetResourceUri,omitempty"`
485
486 TargetResourceLocation *string `json:"targetResourceLocation,omitempty"`
487 }
488
489
490 type AutoscaleSettingResource struct {
491 autorest.Response `json:"-"`
492
493 ID *string `json:"id,omitempty"`
494
495 Name *string `json:"name,omitempty"`
496
497 Type *string `json:"type,omitempty"`
498
499 Location *string `json:"location,omitempty"`
500
501 Tags map[string]*string `json:"tags"`
502
503 *AutoscaleSetting `json:"properties,omitempty"`
504
505 SystemData *SystemData `json:"systemData,omitempty"`
506 }
507
508
509 func (asr AutoscaleSettingResource) MarshalJSON() ([]byte, error) {
510 objectMap := make(map[string]interface{})
511 if asr.Location != nil {
512 objectMap["location"] = asr.Location
513 }
514 if asr.Tags != nil {
515 objectMap["tags"] = asr.Tags
516 }
517 if asr.AutoscaleSetting != nil {
518 objectMap["properties"] = asr.AutoscaleSetting
519 }
520 return json.Marshal(objectMap)
521 }
522
523
524 func (asr *AutoscaleSettingResource) UnmarshalJSON(body []byte) error {
525 var m map[string]*json.RawMessage
526 err := json.Unmarshal(body, &m)
527 if err != nil {
528 return err
529 }
530 for k, v := range m {
531 switch k {
532 case "id":
533 if v != nil {
534 var ID string
535 err = json.Unmarshal(*v, &ID)
536 if err != nil {
537 return err
538 }
539 asr.ID = &ID
540 }
541 case "name":
542 if v != nil {
543 var name string
544 err = json.Unmarshal(*v, &name)
545 if err != nil {
546 return err
547 }
548 asr.Name = &name
549 }
550 case "type":
551 if v != nil {
552 var typeVar string
553 err = json.Unmarshal(*v, &typeVar)
554 if err != nil {
555 return err
556 }
557 asr.Type = &typeVar
558 }
559 case "location":
560 if v != nil {
561 var location string
562 err = json.Unmarshal(*v, &location)
563 if err != nil {
564 return err
565 }
566 asr.Location = &location
567 }
568 case "tags":
569 if v != nil {
570 var tags map[string]*string
571 err = json.Unmarshal(*v, &tags)
572 if err != nil {
573 return err
574 }
575 asr.Tags = tags
576 }
577 case "properties":
578 if v != nil {
579 var autoscaleSetting AutoscaleSetting
580 err = json.Unmarshal(*v, &autoscaleSetting)
581 if err != nil {
582 return err
583 }
584 asr.AutoscaleSetting = &autoscaleSetting
585 }
586 case "systemData":
587 if v != nil {
588 var systemData SystemData
589 err = json.Unmarshal(*v, &systemData)
590 if err != nil {
591 return err
592 }
593 asr.SystemData = &systemData
594 }
595 }
596 }
597
598 return nil
599 }
600
601
602 type AutoscaleSettingResourceCollection struct {
603 autorest.Response `json:"-"`
604
605 Value *[]AutoscaleSettingResource `json:"value,omitempty"`
606
607 NextLink *string `json:"nextLink,omitempty"`
608 }
609
610
611
612 type AutoscaleSettingResourceCollectionIterator struct {
613 i int
614 page AutoscaleSettingResourceCollectionPage
615 }
616
617
618
619 func (iter *AutoscaleSettingResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
620 if tracing.IsEnabled() {
621 ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionIterator.NextWithContext")
622 defer func() {
623 sc := -1
624 if iter.Response().Response.Response != nil {
625 sc = iter.Response().Response.Response.StatusCode
626 }
627 tracing.EndSpan(ctx, sc, err)
628 }()
629 }
630 iter.i++
631 if iter.i < len(iter.page.Values()) {
632 return nil
633 }
634 err = iter.page.NextWithContext(ctx)
635 if err != nil {
636 iter.i--
637 return err
638 }
639 iter.i = 0
640 return nil
641 }
642
643
644
645
646 func (iter *AutoscaleSettingResourceCollectionIterator) Next() error {
647 return iter.NextWithContext(context.Background())
648 }
649
650
651 func (iter AutoscaleSettingResourceCollectionIterator) NotDone() bool {
652 return iter.page.NotDone() && iter.i < len(iter.page.Values())
653 }
654
655
656 func (iter AutoscaleSettingResourceCollectionIterator) Response() AutoscaleSettingResourceCollection {
657 return iter.page.Response()
658 }
659
660
661
662 func (iter AutoscaleSettingResourceCollectionIterator) Value() AutoscaleSettingResource {
663 if !iter.page.NotDone() {
664 return AutoscaleSettingResource{}
665 }
666 return iter.page.Values()[iter.i]
667 }
668
669
670 func NewAutoscaleSettingResourceCollectionIterator(page AutoscaleSettingResourceCollectionPage) AutoscaleSettingResourceCollectionIterator {
671 return AutoscaleSettingResourceCollectionIterator{page: page}
672 }
673
674
675 func (asrc AutoscaleSettingResourceCollection) IsEmpty() bool {
676 return asrc.Value == nil || len(*asrc.Value) == 0
677 }
678
679
680 func (asrc AutoscaleSettingResourceCollection) hasNextLink() bool {
681 return asrc.NextLink != nil && len(*asrc.NextLink) != 0
682 }
683
684
685
686 func (asrc AutoscaleSettingResourceCollection) autoscaleSettingResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
687 if !asrc.hasNextLink() {
688 return nil, nil
689 }
690 return autorest.Prepare((&http.Request{}).WithContext(ctx),
691 autorest.AsJSON(),
692 autorest.AsGet(),
693 autorest.WithBaseURL(to.String(asrc.NextLink)))
694 }
695
696
697 type AutoscaleSettingResourceCollectionPage struct {
698 fn func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error)
699 asrc AutoscaleSettingResourceCollection
700 }
701
702
703
704 func (page *AutoscaleSettingResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
705 if tracing.IsEnabled() {
706 ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionPage.NextWithContext")
707 defer func() {
708 sc := -1
709 if page.Response().Response.Response != nil {
710 sc = page.Response().Response.Response.StatusCode
711 }
712 tracing.EndSpan(ctx, sc, err)
713 }()
714 }
715 for {
716 next, err := page.fn(ctx, page.asrc)
717 if err != nil {
718 return err
719 }
720 page.asrc = next
721 if !next.hasNextLink() || !next.IsEmpty() {
722 break
723 }
724 }
725 return nil
726 }
727
728
729
730
731 func (page *AutoscaleSettingResourceCollectionPage) Next() error {
732 return page.NextWithContext(context.Background())
733 }
734
735
736 func (page AutoscaleSettingResourceCollectionPage) NotDone() bool {
737 return !page.asrc.IsEmpty()
738 }
739
740
741 func (page AutoscaleSettingResourceCollectionPage) Response() AutoscaleSettingResourceCollection {
742 return page.asrc
743 }
744
745
746 func (page AutoscaleSettingResourceCollectionPage) Values() []AutoscaleSettingResource {
747 if page.asrc.IsEmpty() {
748 return nil
749 }
750 return *page.asrc.Value
751 }
752
753
754 func NewAutoscaleSettingResourceCollectionPage(cur AutoscaleSettingResourceCollection, getNextPage func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error)) AutoscaleSettingResourceCollectionPage {
755 return AutoscaleSettingResourceCollectionPage{
756 fn: getNextPage,
757 asrc: cur,
758 }
759 }
760
761
762 type AutoscaleSettingResourcePatch struct {
763
764 Tags map[string]*string `json:"tags"`
765
766 *AutoscaleSetting `json:"properties,omitempty"`
767 }
768
769
770 func (asrp AutoscaleSettingResourcePatch) MarshalJSON() ([]byte, error) {
771 objectMap := make(map[string]interface{})
772 if asrp.Tags != nil {
773 objectMap["tags"] = asrp.Tags
774 }
775 if asrp.AutoscaleSetting != nil {
776 objectMap["properties"] = asrp.AutoscaleSetting
777 }
778 return json.Marshal(objectMap)
779 }
780
781
782 func (asrp *AutoscaleSettingResourcePatch) UnmarshalJSON(body []byte) error {
783 var m map[string]*json.RawMessage
784 err := json.Unmarshal(body, &m)
785 if err != nil {
786 return err
787 }
788 for k, v := range m {
789 switch k {
790 case "tags":
791 if v != nil {
792 var tags map[string]*string
793 err = json.Unmarshal(*v, &tags)
794 if err != nil {
795 return err
796 }
797 asrp.Tags = tags
798 }
799 case "properties":
800 if v != nil {
801 var autoscaleSetting AutoscaleSetting
802 err = json.Unmarshal(*v, &autoscaleSetting)
803 if err != nil {
804 return err
805 }
806 asrp.AutoscaleSetting = &autoscaleSetting
807 }
808 }
809 }
810
811 return nil
812 }
813
814
815 type AzureAppPushReceiver struct {
816
817 Name *string `json:"name,omitempty"`
818
819 EmailAddress *string `json:"emailAddress,omitempty"`
820 }
821
822
823 type AzureEntityResource struct {
824
825 Etag *string `json:"etag,omitempty"`
826
827 ID *string `json:"id,omitempty"`
828
829 Name *string `json:"name,omitempty"`
830
831 Type *string `json:"type,omitempty"`
832 }
833
834
835 func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
836 objectMap := make(map[string]interface{})
837 return json.Marshal(objectMap)
838 }
839
840
841 type AzureFunctionReceiver struct {
842
843 Name *string `json:"name,omitempty"`
844
845 FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"`
846
847 FunctionName *string `json:"functionName,omitempty"`
848
849 HTTPTriggerURL *string `json:"httpTriggerUrl,omitempty"`
850
851 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
852 }
853
854
855 type AzureMonitorPrivateLinkScope struct {
856 autorest.Response `json:"-"`
857
858 *AzureMonitorPrivateLinkScopeProperties `json:"properties,omitempty"`
859
860 SystemData *SystemData `json:"systemData,omitempty"`
861
862 Tags map[string]*string `json:"tags"`
863
864 Location *string `json:"location,omitempty"`
865
866 ID *string `json:"id,omitempty"`
867
868 Name *string `json:"name,omitempty"`
869
870 Type *string `json:"type,omitempty"`
871 }
872
873
874 func (ampls AzureMonitorPrivateLinkScope) MarshalJSON() ([]byte, error) {
875 objectMap := make(map[string]interface{})
876 if ampls.AzureMonitorPrivateLinkScopeProperties != nil {
877 objectMap["properties"] = ampls.AzureMonitorPrivateLinkScopeProperties
878 }
879 if ampls.Tags != nil {
880 objectMap["tags"] = ampls.Tags
881 }
882 if ampls.Location != nil {
883 objectMap["location"] = ampls.Location
884 }
885 return json.Marshal(objectMap)
886 }
887
888
889 func (ampls *AzureMonitorPrivateLinkScope) UnmarshalJSON(body []byte) error {
890 var m map[string]*json.RawMessage
891 err := json.Unmarshal(body, &m)
892 if err != nil {
893 return err
894 }
895 for k, v := range m {
896 switch k {
897 case "properties":
898 if v != nil {
899 var azureMonitorPrivateLinkScopeProperties AzureMonitorPrivateLinkScopeProperties
900 err = json.Unmarshal(*v, &azureMonitorPrivateLinkScopeProperties)
901 if err != nil {
902 return err
903 }
904 ampls.AzureMonitorPrivateLinkScopeProperties = &azureMonitorPrivateLinkScopeProperties
905 }
906 case "systemData":
907 if v != nil {
908 var systemData SystemData
909 err = json.Unmarshal(*v, &systemData)
910 if err != nil {
911 return err
912 }
913 ampls.SystemData = &systemData
914 }
915 case "tags":
916 if v != nil {
917 var tags map[string]*string
918 err = json.Unmarshal(*v, &tags)
919 if err != nil {
920 return err
921 }
922 ampls.Tags = tags
923 }
924 case "location":
925 if v != nil {
926 var location string
927 err = json.Unmarshal(*v, &location)
928 if err != nil {
929 return err
930 }
931 ampls.Location = &location
932 }
933 case "id":
934 if v != nil {
935 var ID string
936 err = json.Unmarshal(*v, &ID)
937 if err != nil {
938 return err
939 }
940 ampls.ID = &ID
941 }
942 case "name":
943 if v != nil {
944 var name string
945 err = json.Unmarshal(*v, &name)
946 if err != nil {
947 return err
948 }
949 ampls.Name = &name
950 }
951 case "type":
952 if v != nil {
953 var typeVar string
954 err = json.Unmarshal(*v, &typeVar)
955 if err != nil {
956 return err
957 }
958 ampls.Type = &typeVar
959 }
960 }
961 }
962
963 return nil
964 }
965
966
967 type AzureMonitorPrivateLinkScopeListResult struct {
968 autorest.Response `json:"-"`
969
970 Value *[]AzureMonitorPrivateLinkScope `json:"value,omitempty"`
971
972 NextLink *string `json:"nextLink,omitempty"`
973 }
974
975
976
977 type AzureMonitorPrivateLinkScopeListResultIterator struct {
978 i int
979 page AzureMonitorPrivateLinkScopeListResultPage
980 }
981
982
983
984 func (iter *AzureMonitorPrivateLinkScopeListResultIterator) NextWithContext(ctx context.Context) (err error) {
985 if tracing.IsEnabled() {
986 ctx = tracing.StartSpan(ctx, fqdn+"/AzureMonitorPrivateLinkScopeListResultIterator.NextWithContext")
987 defer func() {
988 sc := -1
989 if iter.Response().Response.Response != nil {
990 sc = iter.Response().Response.Response.StatusCode
991 }
992 tracing.EndSpan(ctx, sc, err)
993 }()
994 }
995 iter.i++
996 if iter.i < len(iter.page.Values()) {
997 return nil
998 }
999 err = iter.page.NextWithContext(ctx)
1000 if err != nil {
1001 iter.i--
1002 return err
1003 }
1004 iter.i = 0
1005 return nil
1006 }
1007
1008
1009
1010
1011 func (iter *AzureMonitorPrivateLinkScopeListResultIterator) Next() error {
1012 return iter.NextWithContext(context.Background())
1013 }
1014
1015
1016 func (iter AzureMonitorPrivateLinkScopeListResultIterator) NotDone() bool {
1017 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1018 }
1019
1020
1021 func (iter AzureMonitorPrivateLinkScopeListResultIterator) Response() AzureMonitorPrivateLinkScopeListResult {
1022 return iter.page.Response()
1023 }
1024
1025
1026
1027 func (iter AzureMonitorPrivateLinkScopeListResultIterator) Value() AzureMonitorPrivateLinkScope {
1028 if !iter.page.NotDone() {
1029 return AzureMonitorPrivateLinkScope{}
1030 }
1031 return iter.page.Values()[iter.i]
1032 }
1033
1034
1035 func NewAzureMonitorPrivateLinkScopeListResultIterator(page AzureMonitorPrivateLinkScopeListResultPage) AzureMonitorPrivateLinkScopeListResultIterator {
1036 return AzureMonitorPrivateLinkScopeListResultIterator{page: page}
1037 }
1038
1039
1040 func (amplslr AzureMonitorPrivateLinkScopeListResult) IsEmpty() bool {
1041 return amplslr.Value == nil || len(*amplslr.Value) == 0
1042 }
1043
1044
1045 func (amplslr AzureMonitorPrivateLinkScopeListResult) hasNextLink() bool {
1046 return amplslr.NextLink != nil && len(*amplslr.NextLink) != 0
1047 }
1048
1049
1050
1051 func (amplslr AzureMonitorPrivateLinkScopeListResult) azureMonitorPrivateLinkScopeListResultPreparer(ctx context.Context) (*http.Request, error) {
1052 if !amplslr.hasNextLink() {
1053 return nil, nil
1054 }
1055 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1056 autorest.AsJSON(),
1057 autorest.AsGet(),
1058 autorest.WithBaseURL(to.String(amplslr.NextLink)))
1059 }
1060
1061
1062 type AzureMonitorPrivateLinkScopeListResultPage struct {
1063 fn func(context.Context, AzureMonitorPrivateLinkScopeListResult) (AzureMonitorPrivateLinkScopeListResult, error)
1064 amplslr AzureMonitorPrivateLinkScopeListResult
1065 }
1066
1067
1068
1069 func (page *AzureMonitorPrivateLinkScopeListResultPage) NextWithContext(ctx context.Context) (err error) {
1070 if tracing.IsEnabled() {
1071 ctx = tracing.StartSpan(ctx, fqdn+"/AzureMonitorPrivateLinkScopeListResultPage.NextWithContext")
1072 defer func() {
1073 sc := -1
1074 if page.Response().Response.Response != nil {
1075 sc = page.Response().Response.Response.StatusCode
1076 }
1077 tracing.EndSpan(ctx, sc, err)
1078 }()
1079 }
1080 for {
1081 next, err := page.fn(ctx, page.amplslr)
1082 if err != nil {
1083 return err
1084 }
1085 page.amplslr = next
1086 if !next.hasNextLink() || !next.IsEmpty() {
1087 break
1088 }
1089 }
1090 return nil
1091 }
1092
1093
1094
1095
1096 func (page *AzureMonitorPrivateLinkScopeListResultPage) Next() error {
1097 return page.NextWithContext(context.Background())
1098 }
1099
1100
1101 func (page AzureMonitorPrivateLinkScopeListResultPage) NotDone() bool {
1102 return !page.amplslr.IsEmpty()
1103 }
1104
1105
1106 func (page AzureMonitorPrivateLinkScopeListResultPage) Response() AzureMonitorPrivateLinkScopeListResult {
1107 return page.amplslr
1108 }
1109
1110
1111 func (page AzureMonitorPrivateLinkScopeListResultPage) Values() []AzureMonitorPrivateLinkScope {
1112 if page.amplslr.IsEmpty() {
1113 return nil
1114 }
1115 return *page.amplslr.Value
1116 }
1117
1118
1119 func NewAzureMonitorPrivateLinkScopeListResultPage(cur AzureMonitorPrivateLinkScopeListResult, getNextPage func(context.Context, AzureMonitorPrivateLinkScopeListResult) (AzureMonitorPrivateLinkScopeListResult, error)) AzureMonitorPrivateLinkScopeListResultPage {
1120 return AzureMonitorPrivateLinkScopeListResultPage{
1121 fn: getNextPage,
1122 amplslr: cur,
1123 }
1124 }
1125
1126
1127 type AzureMonitorPrivateLinkScopeProperties struct {
1128
1129 ProvisioningState *string `json:"provisioningState,omitempty"`
1130
1131 PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
1132
1133 AccessModeSettings *AccessModeSettings `json:"accessModeSettings,omitempty"`
1134 }
1135
1136
1137 func (amplsp AzureMonitorPrivateLinkScopeProperties) MarshalJSON() ([]byte, error) {
1138 objectMap := make(map[string]interface{})
1139 if amplsp.AccessModeSettings != nil {
1140 objectMap["accessModeSettings"] = amplsp.AccessModeSettings
1141 }
1142 return json.Marshal(objectMap)
1143 }
1144
1145
1146 type AzureResource struct {
1147
1148 ID *string `json:"id,omitempty"`
1149
1150 Name *string `json:"name,omitempty"`
1151
1152 Type *string `json:"type,omitempty"`
1153
1154 Location *string `json:"location,omitempty"`
1155
1156 Tags map[string]*string `json:"tags"`
1157 }
1158
1159
1160 func (ar AzureResource) MarshalJSON() ([]byte, error) {
1161 objectMap := make(map[string]interface{})
1162 if ar.Location != nil {
1163 objectMap["location"] = ar.Location
1164 }
1165 if ar.Tags != nil {
1166 objectMap["tags"] = ar.Tags
1167 }
1168 return json.Marshal(objectMap)
1169 }
1170
1171
1172 type Context struct {
1173
1174 NotificationSource *string `json:"notificationSource,omitempty"`
1175
1176 ContextType *string `json:"contextType,omitempty"`
1177 }
1178
1179
1180
1181 type DefaultErrorResponse struct {
1182
1183 Error *ErrorDetail `json:"error,omitempty"`
1184 }
1185
1186
1187 type EmailNotification struct {
1188
1189 SendToSubscriptionAdministrator *bool `json:"sendToSubscriptionAdministrator,omitempty"`
1190
1191 SendToSubscriptionCoAdministrators *bool `json:"sendToSubscriptionCoAdministrators,omitempty"`
1192
1193 CustomEmails *[]string `json:"customEmails,omitempty"`
1194 }
1195
1196
1197 type EmailReceiver struct {
1198
1199 Name *string `json:"name,omitempty"`
1200
1201 EmailAddress *string `json:"emailAddress,omitempty"`
1202
1203 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
1204
1205 Status ReceiverStatus `json:"status,omitempty"`
1206 }
1207
1208
1209 func (er EmailReceiver) MarshalJSON() ([]byte, error) {
1210 objectMap := make(map[string]interface{})
1211 if er.Name != nil {
1212 objectMap["name"] = er.Name
1213 }
1214 if er.EmailAddress != nil {
1215 objectMap["emailAddress"] = er.EmailAddress
1216 }
1217 if er.UseCommonAlertSchema != nil {
1218 objectMap["useCommonAlertSchema"] = er.UseCommonAlertSchema
1219 }
1220 return json.Marshal(objectMap)
1221 }
1222
1223
1224 type EnableRequest struct {
1225
1226 ReceiverName *string `json:"receiverName,omitempty"`
1227 }
1228
1229
1230 type ErrorAdditionalInfo struct {
1231
1232 Type *string `json:"type,omitempty"`
1233
1234 Info interface{} `json:"info,omitempty"`
1235 }
1236
1237
1238 func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
1239 objectMap := make(map[string]interface{})
1240 return json.Marshal(objectMap)
1241 }
1242
1243
1244 type ErrorDetail struct {
1245
1246 Code *string `json:"code,omitempty"`
1247
1248 Message *string `json:"message,omitempty"`
1249
1250 Target *string `json:"target,omitempty"`
1251
1252 Details *[]ErrorDetail `json:"details,omitempty"`
1253
1254 AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
1255 }
1256
1257
1258 func (ed ErrorDetail) MarshalJSON() ([]byte, error) {
1259 objectMap := make(map[string]interface{})
1260 return json.Marshal(objectMap)
1261 }
1262
1263
1264 type ErrorResponse struct {
1265
1266 Code *string `json:"code,omitempty"`
1267
1268 Message *string `json:"message,omitempty"`
1269 }
1270
1271
1272 type EventHubReceiver struct {
1273
1274 Name *string `json:"name,omitempty"`
1275
1276 EventHubNameSpace *string `json:"eventHubNameSpace,omitempty"`
1277
1278 EventHubName *string `json:"eventHubName,omitempty"`
1279
1280 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
1281
1282 TenantID *string `json:"tenantId,omitempty"`
1283
1284 SubscriptionID *string `json:"subscriptionId,omitempty"`
1285 }
1286
1287
1288 type ItsmReceiver struct {
1289
1290 Name *string `json:"name,omitempty"`
1291
1292 WorkspaceID *string `json:"workspaceId,omitempty"`
1293
1294 ConnectionID *string `json:"connectionId,omitempty"`
1295
1296 TicketConfiguration *string `json:"ticketConfiguration,omitempty"`
1297
1298 Region *string `json:"region,omitempty"`
1299 }
1300
1301
1302 type LogicAppReceiver struct {
1303
1304 Name *string `json:"name,omitempty"`
1305
1306 ResourceID *string `json:"resourceId,omitempty"`
1307
1308 CallbackURL *string `json:"callbackUrl,omitempty"`
1309
1310 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
1311 }
1312
1313
1314 type LogSettings struct {
1315
1316 Category *string `json:"category,omitempty"`
1317
1318 CategoryGroup *string `json:"categoryGroup,omitempty"`
1319
1320 Enabled *bool `json:"enabled,omitempty"`
1321
1322 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
1323 }
1324
1325
1326 type ManagementGroupDiagnosticSettings struct {
1327
1328 StorageAccountID *string `json:"storageAccountId,omitempty"`
1329
1330 ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"`
1331
1332 EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"`
1333
1334 EventHubName *string `json:"eventHubName,omitempty"`
1335
1336 Logs *[]ManagementGroupLogSettings `json:"logs,omitempty"`
1337
1338 WorkspaceID *string `json:"workspaceId,omitempty"`
1339
1340 MarketplacePartnerID *string `json:"marketplacePartnerId,omitempty"`
1341 }
1342
1343
1344 type ManagementGroupDiagnosticSettingsResource struct {
1345 autorest.Response `json:"-"`
1346
1347 *ManagementGroupDiagnosticSettings `json:"properties,omitempty"`
1348
1349 SystemData *SystemData `json:"systemData,omitempty"`
1350
1351 ID *string `json:"id,omitempty"`
1352
1353 Name *string `json:"name,omitempty"`
1354
1355 Type *string `json:"type,omitempty"`
1356 }
1357
1358
1359 func (mgdsr ManagementGroupDiagnosticSettingsResource) MarshalJSON() ([]byte, error) {
1360 objectMap := make(map[string]interface{})
1361 if mgdsr.ManagementGroupDiagnosticSettings != nil {
1362 objectMap["properties"] = mgdsr.ManagementGroupDiagnosticSettings
1363 }
1364 return json.Marshal(objectMap)
1365 }
1366
1367
1368 func (mgdsr *ManagementGroupDiagnosticSettingsResource) UnmarshalJSON(body []byte) error {
1369 var m map[string]*json.RawMessage
1370 err := json.Unmarshal(body, &m)
1371 if err != nil {
1372 return err
1373 }
1374 for k, v := range m {
1375 switch k {
1376 case "properties":
1377 if v != nil {
1378 var managementGroupDiagnosticSettings ManagementGroupDiagnosticSettings
1379 err = json.Unmarshal(*v, &managementGroupDiagnosticSettings)
1380 if err != nil {
1381 return err
1382 }
1383 mgdsr.ManagementGroupDiagnosticSettings = &managementGroupDiagnosticSettings
1384 }
1385 case "systemData":
1386 if v != nil {
1387 var systemData SystemData
1388 err = json.Unmarshal(*v, &systemData)
1389 if err != nil {
1390 return err
1391 }
1392 mgdsr.SystemData = &systemData
1393 }
1394 case "id":
1395 if v != nil {
1396 var ID string
1397 err = json.Unmarshal(*v, &ID)
1398 if err != nil {
1399 return err
1400 }
1401 mgdsr.ID = &ID
1402 }
1403 case "name":
1404 if v != nil {
1405 var name string
1406 err = json.Unmarshal(*v, &name)
1407 if err != nil {
1408 return err
1409 }
1410 mgdsr.Name = &name
1411 }
1412 case "type":
1413 if v != nil {
1414 var typeVar string
1415 err = json.Unmarshal(*v, &typeVar)
1416 if err != nil {
1417 return err
1418 }
1419 mgdsr.Type = &typeVar
1420 }
1421 }
1422 }
1423
1424 return nil
1425 }
1426
1427
1428
1429 type ManagementGroupDiagnosticSettingsResourceCollection struct {
1430 autorest.Response `json:"-"`
1431
1432 Value *[]ManagementGroupDiagnosticSettingsResource `json:"value,omitempty"`
1433 }
1434
1435
1436
1437 type ManagementGroupLogSettings struct {
1438
1439 Category *string `json:"category,omitempty"`
1440
1441 CategoryGroup *string `json:"categoryGroup,omitempty"`
1442
1443 Enabled *bool `json:"enabled,omitempty"`
1444 }
1445
1446
1447 type MetricSettings struct {
1448
1449 TimeGrain *string `json:"timeGrain,omitempty"`
1450
1451 Category *string `json:"category,omitempty"`
1452
1453 Enabled *bool `json:"enabled,omitempty"`
1454
1455 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
1456 }
1457
1458
1459 type MetricTrigger struct {
1460
1461 MetricName *string `json:"metricName,omitempty"`
1462
1463 MetricNamespace *string `json:"metricNamespace,omitempty"`
1464
1465 MetricResourceURI *string `json:"metricResourceUri,omitempty"`
1466
1467 MetricResourceLocation *string `json:"metricResourceLocation,omitempty"`
1468
1469 TimeGrain *string `json:"timeGrain,omitempty"`
1470
1471 Statistic MetricStatisticType `json:"statistic,omitempty"`
1472
1473 TimeWindow *string `json:"timeWindow,omitempty"`
1474
1475 TimeAggregation TimeAggregationType `json:"timeAggregation,omitempty"`
1476
1477 Operator ComparisonOperationType `json:"operator,omitempty"`
1478
1479 Threshold *float64 `json:"threshold,omitempty"`
1480
1481 Dimensions *[]ScaleRuleMetricDimension `json:"dimensions,omitempty"`
1482
1483 DividePerInstance *bool `json:"dividePerInstance,omitempty"`
1484 }
1485
1486
1487 type NotificationRequestBody struct {
1488
1489 AlertType *string `json:"alertType,omitempty"`
1490
1491 EmailReceivers *[]EmailReceiver `json:"emailReceivers,omitempty"`
1492
1493 SmsReceivers *[]SmsReceiver `json:"smsReceivers,omitempty"`
1494
1495 WebhookReceivers *[]WebhookReceiver `json:"webhookReceivers,omitempty"`
1496
1497 ItsmReceivers *[]ItsmReceiver `json:"itsmReceivers,omitempty"`
1498
1499 AzureAppPushReceivers *[]AzureAppPushReceiver `json:"azureAppPushReceivers,omitempty"`
1500
1501 AutomationRunbookReceivers *[]AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"`
1502
1503 VoiceReceivers *[]VoiceReceiver `json:"voiceReceivers,omitempty"`
1504
1505 LogicAppReceivers *[]LogicAppReceiver `json:"logicAppReceivers,omitempty"`
1506
1507 AzureFunctionReceivers *[]AzureFunctionReceiver `json:"azureFunctionReceivers,omitempty"`
1508
1509 ArmRoleReceivers *[]ArmRoleReceiver `json:"armRoleReceivers,omitempty"`
1510
1511 EventHubReceivers *[]EventHubReceiver `json:"eventHubReceivers,omitempty"`
1512 }
1513
1514
1515 type OperationStatus struct {
1516 autorest.Response `json:"-"`
1517
1518 ID *string `json:"id,omitempty"`
1519
1520 Name *string `json:"name,omitempty"`
1521
1522 StartTime *date.Time `json:"startTime,omitempty"`
1523
1524 EndTime *date.Time `json:"endTime,omitempty"`
1525
1526 Status *string `json:"status,omitempty"`
1527
1528 Error *ErrorDetail `json:"error,omitempty"`
1529 }
1530
1531
1532 type PredictiveAutoscalePolicy struct {
1533
1534 ScaleMode PredictiveAutoscalePolicyScaleMode `json:"scaleMode,omitempty"`
1535
1536 ScaleLookAheadTime *string `json:"scaleLookAheadTime,omitempty"`
1537 }
1538
1539
1540 type PredictiveResponse struct {
1541 autorest.Response `json:"-"`
1542
1543 Timespan *string `json:"timespan,omitempty"`
1544
1545 Interval *string `json:"interval,omitempty"`
1546
1547 MetricName *string `json:"metricName,omitempty"`
1548
1549 TargetResourceID *string `json:"targetResourceId,omitempty"`
1550
1551 Data *[]PredictiveValue `json:"data,omitempty"`
1552 }
1553
1554
1555 type PredictiveValue struct {
1556
1557 TimeStamp *date.Time `json:"timeStamp,omitempty"`
1558
1559 Value *float64 `json:"value,omitempty"`
1560 }
1561
1562
1563 type PrivateEndpoint struct {
1564
1565 ID *string `json:"id,omitempty"`
1566 }
1567
1568
1569 func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
1570 objectMap := make(map[string]interface{})
1571 return json.Marshal(objectMap)
1572 }
1573
1574
1575 type PrivateEndpointConnection struct {
1576 autorest.Response `json:"-"`
1577
1578 *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
1579
1580 ID *string `json:"id,omitempty"`
1581
1582 Name *string `json:"name,omitempty"`
1583
1584 Type *string `json:"type,omitempty"`
1585 }
1586
1587
1588 func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
1589 objectMap := make(map[string]interface{})
1590 if pec.PrivateEndpointConnectionProperties != nil {
1591 objectMap["properties"] = pec.PrivateEndpointConnectionProperties
1592 }
1593 return json.Marshal(objectMap)
1594 }
1595
1596
1597 func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
1598 var m map[string]*json.RawMessage
1599 err := json.Unmarshal(body, &m)
1600 if err != nil {
1601 return err
1602 }
1603 for k, v := range m {
1604 switch k {
1605 case "properties":
1606 if v != nil {
1607 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
1608 err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
1609 if err != nil {
1610 return err
1611 }
1612 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
1613 }
1614 case "id":
1615 if v != nil {
1616 var ID string
1617 err = json.Unmarshal(*v, &ID)
1618 if err != nil {
1619 return err
1620 }
1621 pec.ID = &ID
1622 }
1623 case "name":
1624 if v != nil {
1625 var name string
1626 err = json.Unmarshal(*v, &name)
1627 if err != nil {
1628 return err
1629 }
1630 pec.Name = &name
1631 }
1632 case "type":
1633 if v != nil {
1634 var typeVar string
1635 err = json.Unmarshal(*v, &typeVar)
1636 if err != nil {
1637 return err
1638 }
1639 pec.Type = &typeVar
1640 }
1641 }
1642 }
1643
1644 return nil
1645 }
1646
1647
1648
1649 type PrivateEndpointConnectionListResult struct {
1650 autorest.Response `json:"-"`
1651
1652 Value *[]PrivateEndpointConnection `json:"value,omitempty"`
1653 }
1654
1655
1656 type PrivateEndpointConnectionProperties struct {
1657
1658 PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
1659
1660 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
1661
1662 ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
1663 }
1664
1665
1666
1667 type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
1668 azure.FutureAPI
1669
1670
1671 Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
1672 }
1673
1674
1675 func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1676 var azFuture azure.Future
1677 if err := json.Unmarshal(body, &azFuture); err != nil {
1678 return err
1679 }
1680 future.FutureAPI = &azFuture
1681 future.Result = future.result
1682 return nil
1683 }
1684
1685
1686 func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
1687 var done bool
1688 done, err = future.DoneWithContext(context.Background(), client)
1689 if err != nil {
1690 err = autorest.NewErrorWithError(err, "diagnostics.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1691 return
1692 }
1693 if !done {
1694 pec.Response.Response = future.Response()
1695 err = azure.NewAsyncOpIncompleteError("diagnostics.PrivateEndpointConnectionsCreateOrUpdateFuture")
1696 return
1697 }
1698 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1699 if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
1700 pec, err = client.CreateOrUpdateResponder(pec.Response.Response)
1701 if err != nil {
1702 err = autorest.NewErrorWithError(err, "diagnostics.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request")
1703 }
1704 }
1705 return
1706 }
1707
1708
1709
1710 type PrivateEndpointConnectionsDeleteFuture struct {
1711 azure.FutureAPI
1712
1713
1714 Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
1715 }
1716
1717
1718 func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
1719 var azFuture azure.Future
1720 if err := json.Unmarshal(body, &azFuture); err != nil {
1721 return err
1722 }
1723 future.FutureAPI = &azFuture
1724 future.Result = future.result
1725 return nil
1726 }
1727
1728
1729 func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
1730 var done bool
1731 done, err = future.DoneWithContext(context.Background(), client)
1732 if err != nil {
1733 err = autorest.NewErrorWithError(err, "diagnostics.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
1734 return
1735 }
1736 if !done {
1737 ar.Response = future.Response()
1738 err = azure.NewAsyncOpIncompleteError("diagnostics.PrivateEndpointConnectionsDeleteFuture")
1739 return
1740 }
1741 ar.Response = future.Response()
1742 return
1743 }
1744
1745
1746 type PrivateLinkResource struct {
1747 autorest.Response `json:"-"`
1748
1749 *PrivateLinkResourceProperties `json:"properties,omitempty"`
1750
1751 ID *string `json:"id,omitempty"`
1752
1753 Name *string `json:"name,omitempty"`
1754
1755 Type *string `json:"type,omitempty"`
1756 }
1757
1758
1759 func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
1760 objectMap := make(map[string]interface{})
1761 if plr.PrivateLinkResourceProperties != nil {
1762 objectMap["properties"] = plr.PrivateLinkResourceProperties
1763 }
1764 return json.Marshal(objectMap)
1765 }
1766
1767
1768 func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
1769 var m map[string]*json.RawMessage
1770 err := json.Unmarshal(body, &m)
1771 if err != nil {
1772 return err
1773 }
1774 for k, v := range m {
1775 switch k {
1776 case "properties":
1777 if v != nil {
1778 var privateLinkResourceProperties PrivateLinkResourceProperties
1779 err = json.Unmarshal(*v, &privateLinkResourceProperties)
1780 if err != nil {
1781 return err
1782 }
1783 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
1784 }
1785 case "id":
1786 if v != nil {
1787 var ID string
1788 err = json.Unmarshal(*v, &ID)
1789 if err != nil {
1790 return err
1791 }
1792 plr.ID = &ID
1793 }
1794 case "name":
1795 if v != nil {
1796 var name string
1797 err = json.Unmarshal(*v, &name)
1798 if err != nil {
1799 return err
1800 }
1801 plr.Name = &name
1802 }
1803 case "type":
1804 if v != nil {
1805 var typeVar string
1806 err = json.Unmarshal(*v, &typeVar)
1807 if err != nil {
1808 return err
1809 }
1810 plr.Type = &typeVar
1811 }
1812 }
1813 }
1814
1815 return nil
1816 }
1817
1818
1819 type PrivateLinkResourceListResult struct {
1820 autorest.Response `json:"-"`
1821
1822 Value *[]PrivateLinkResource `json:"value,omitempty"`
1823 }
1824
1825
1826 type PrivateLinkResourceProperties struct {
1827
1828 GroupID *string `json:"groupId,omitempty"`
1829
1830 RequiredMembers *[]string `json:"requiredMembers,omitempty"`
1831
1832 RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
1833 }
1834
1835
1836 func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
1837 objectMap := make(map[string]interface{})
1838 if plrp.RequiredZoneNames != nil {
1839 objectMap["requiredZoneNames"] = plrp.RequiredZoneNames
1840 }
1841 return json.Marshal(objectMap)
1842 }
1843
1844
1845
1846 type PrivateLinkScopedResourcesCreateOrUpdateFuture struct {
1847 azure.FutureAPI
1848
1849
1850 Result func(PrivateLinkScopedResourcesClient) (ScopedResource, error)
1851 }
1852
1853
1854 func (future *PrivateLinkScopedResourcesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1855 var azFuture azure.Future
1856 if err := json.Unmarshal(body, &azFuture); err != nil {
1857 return err
1858 }
1859 future.FutureAPI = &azFuture
1860 future.Result = future.result
1861 return nil
1862 }
1863
1864
1865 func (future *PrivateLinkScopedResourcesCreateOrUpdateFuture) result(client PrivateLinkScopedResourcesClient) (sr ScopedResource, err error) {
1866 var done bool
1867 done, err = future.DoneWithContext(context.Background(), client)
1868 if err != nil {
1869 err = autorest.NewErrorWithError(err, "diagnostics.PrivateLinkScopedResourcesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1870 return
1871 }
1872 if !done {
1873 sr.Response.Response = future.Response()
1874 err = azure.NewAsyncOpIncompleteError("diagnostics.PrivateLinkScopedResourcesCreateOrUpdateFuture")
1875 return
1876 }
1877 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1878 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
1879 sr, err = client.CreateOrUpdateResponder(sr.Response.Response)
1880 if err != nil {
1881 err = autorest.NewErrorWithError(err, "diagnostics.PrivateLinkScopedResourcesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
1882 }
1883 }
1884 return
1885 }
1886
1887
1888
1889 type PrivateLinkScopedResourcesDeleteFuture struct {
1890 azure.FutureAPI
1891
1892
1893 Result func(PrivateLinkScopedResourcesClient) (autorest.Response, error)
1894 }
1895
1896
1897 func (future *PrivateLinkScopedResourcesDeleteFuture) UnmarshalJSON(body []byte) error {
1898 var azFuture azure.Future
1899 if err := json.Unmarshal(body, &azFuture); err != nil {
1900 return err
1901 }
1902 future.FutureAPI = &azFuture
1903 future.Result = future.result
1904 return nil
1905 }
1906
1907
1908 func (future *PrivateLinkScopedResourcesDeleteFuture) result(client PrivateLinkScopedResourcesClient) (ar autorest.Response, err error) {
1909 var done bool
1910 done, err = future.DoneWithContext(context.Background(), client)
1911 if err != nil {
1912 err = autorest.NewErrorWithError(err, "diagnostics.PrivateLinkScopedResourcesDeleteFuture", "Result", future.Response(), "Polling failure")
1913 return
1914 }
1915 if !done {
1916 ar.Response = future.Response()
1917 err = azure.NewAsyncOpIncompleteError("diagnostics.PrivateLinkScopedResourcesDeleteFuture")
1918 return
1919 }
1920 ar.Response = future.Response()
1921 return
1922 }
1923
1924
1925
1926 type PrivateLinkScopesDeleteFuture struct {
1927 azure.FutureAPI
1928
1929
1930 Result func(PrivateLinkScopesClient) (autorest.Response, error)
1931 }
1932
1933
1934 func (future *PrivateLinkScopesDeleteFuture) UnmarshalJSON(body []byte) error {
1935 var azFuture azure.Future
1936 if err := json.Unmarshal(body, &azFuture); err != nil {
1937 return err
1938 }
1939 future.FutureAPI = &azFuture
1940 future.Result = future.result
1941 return nil
1942 }
1943
1944
1945 func (future *PrivateLinkScopesDeleteFuture) result(client PrivateLinkScopesClient) (ar autorest.Response, err error) {
1946 var done bool
1947 done, err = future.DoneWithContext(context.Background(), client)
1948 if err != nil {
1949 err = autorest.NewErrorWithError(err, "diagnostics.PrivateLinkScopesDeleteFuture", "Result", future.Response(), "Polling failure")
1950 return
1951 }
1952 if !done {
1953 ar.Response = future.Response()
1954 err = azure.NewAsyncOpIncompleteError("diagnostics.PrivateLinkScopesDeleteFuture")
1955 return
1956 }
1957 ar.Response = future.Response()
1958 return
1959 }
1960
1961
1962
1963 type PrivateLinkServiceConnectionState struct {
1964
1965 Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"`
1966
1967 Description *string `json:"description,omitempty"`
1968
1969 ActionsRequired *string `json:"actionsRequired,omitempty"`
1970 }
1971
1972
1973
1974 type ProxyResource struct {
1975
1976 ID *string `json:"id,omitempty"`
1977
1978 Name *string `json:"name,omitempty"`
1979
1980 Type *string `json:"type,omitempty"`
1981 }
1982
1983
1984 func (pr ProxyResource) MarshalJSON() ([]byte, error) {
1985 objectMap := make(map[string]interface{})
1986 return json.Marshal(objectMap)
1987 }
1988
1989
1990
1991 type Recurrence struct {
1992
1993 Frequency RecurrenceFrequency `json:"frequency,omitempty"`
1994
1995 Schedule *RecurrentSchedule `json:"schedule,omitempty"`
1996 }
1997
1998
1999 type RecurrentSchedule struct {
2000
2001 TimeZone *string `json:"timeZone,omitempty"`
2002
2003 Days *[]string `json:"days,omitempty"`
2004
2005 Hours *[]int32 `json:"hours,omitempty"`
2006
2007 Minutes *[]int32 `json:"minutes,omitempty"`
2008 }
2009
2010
2011 type Resource struct {
2012
2013 ID *string `json:"id,omitempty"`
2014
2015 Name *string `json:"name,omitempty"`
2016
2017 Type *string `json:"type,omitempty"`
2018 }
2019
2020
2021 func (r Resource) MarshalJSON() ([]byte, error) {
2022 objectMap := make(map[string]interface{})
2023 return json.Marshal(objectMap)
2024 }
2025
2026
2027 type RetentionPolicy struct {
2028
2029 Enabled *bool `json:"enabled,omitempty"`
2030
2031 Days *int32 `json:"days,omitempty"`
2032 }
2033
2034
2035 type ScaleAction struct {
2036
2037 Direction ScaleDirection `json:"direction,omitempty"`
2038
2039 Type ScaleType `json:"type,omitempty"`
2040
2041 Value *string `json:"value,omitempty"`
2042
2043 Cooldown *string `json:"cooldown,omitempty"`
2044 }
2045
2046
2047 type ScaleCapacity struct {
2048
2049 Minimum *string `json:"minimum,omitempty"`
2050
2051 Maximum *string `json:"maximum,omitempty"`
2052
2053 Default *string `json:"default,omitempty"`
2054 }
2055
2056
2057 type ScaleRule struct {
2058
2059 MetricTrigger *MetricTrigger `json:"metricTrigger,omitempty"`
2060
2061 ScaleAction *ScaleAction `json:"scaleAction,omitempty"`
2062 }
2063
2064
2065 type ScaleRuleMetricDimension struct {
2066
2067 DimensionName *string `json:"DimensionName,omitempty"`
2068
2069 Operator ScaleRuleMetricDimensionOperationType `json:"Operator,omitempty"`
2070
2071 Values *[]string `json:"Values,omitempty"`
2072 }
2073
2074
2075 type ScopedResource struct {
2076 autorest.Response `json:"-"`
2077
2078 *ScopedResourceProperties `json:"properties,omitempty"`
2079
2080 SystemData *SystemData `json:"systemData,omitempty"`
2081
2082 ID *string `json:"id,omitempty"`
2083
2084 Name *string `json:"name,omitempty"`
2085
2086 Type *string `json:"type,omitempty"`
2087 }
2088
2089
2090 func (sr ScopedResource) MarshalJSON() ([]byte, error) {
2091 objectMap := make(map[string]interface{})
2092 if sr.ScopedResourceProperties != nil {
2093 objectMap["properties"] = sr.ScopedResourceProperties
2094 }
2095 return json.Marshal(objectMap)
2096 }
2097
2098
2099 func (sr *ScopedResource) UnmarshalJSON(body []byte) error {
2100 var m map[string]*json.RawMessage
2101 err := json.Unmarshal(body, &m)
2102 if err != nil {
2103 return err
2104 }
2105 for k, v := range m {
2106 switch k {
2107 case "properties":
2108 if v != nil {
2109 var scopedResourceProperties ScopedResourceProperties
2110 err = json.Unmarshal(*v, &scopedResourceProperties)
2111 if err != nil {
2112 return err
2113 }
2114 sr.ScopedResourceProperties = &scopedResourceProperties
2115 }
2116 case "systemData":
2117 if v != nil {
2118 var systemData SystemData
2119 err = json.Unmarshal(*v, &systemData)
2120 if err != nil {
2121 return err
2122 }
2123 sr.SystemData = &systemData
2124 }
2125 case "id":
2126 if v != nil {
2127 var ID string
2128 err = json.Unmarshal(*v, &ID)
2129 if err != nil {
2130 return err
2131 }
2132 sr.ID = &ID
2133 }
2134 case "name":
2135 if v != nil {
2136 var name string
2137 err = json.Unmarshal(*v, &name)
2138 if err != nil {
2139 return err
2140 }
2141 sr.Name = &name
2142 }
2143 case "type":
2144 if v != nil {
2145 var typeVar string
2146 err = json.Unmarshal(*v, &typeVar)
2147 if err != nil {
2148 return err
2149 }
2150 sr.Type = &typeVar
2151 }
2152 }
2153 }
2154
2155 return nil
2156 }
2157
2158
2159 type ScopedResourceListResult struct {
2160 autorest.Response `json:"-"`
2161
2162 Value *[]ScopedResource `json:"value,omitempty"`
2163
2164 NextLink *string `json:"nextLink,omitempty"`
2165 }
2166
2167
2168 func (srlr ScopedResourceListResult) MarshalJSON() ([]byte, error) {
2169 objectMap := make(map[string]interface{})
2170 return json.Marshal(objectMap)
2171 }
2172
2173
2174 type ScopedResourceListResultIterator struct {
2175 i int
2176 page ScopedResourceListResultPage
2177 }
2178
2179
2180
2181 func (iter *ScopedResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
2182 if tracing.IsEnabled() {
2183 ctx = tracing.StartSpan(ctx, fqdn+"/ScopedResourceListResultIterator.NextWithContext")
2184 defer func() {
2185 sc := -1
2186 if iter.Response().Response.Response != nil {
2187 sc = iter.Response().Response.Response.StatusCode
2188 }
2189 tracing.EndSpan(ctx, sc, err)
2190 }()
2191 }
2192 iter.i++
2193 if iter.i < len(iter.page.Values()) {
2194 return nil
2195 }
2196 err = iter.page.NextWithContext(ctx)
2197 if err != nil {
2198 iter.i--
2199 return err
2200 }
2201 iter.i = 0
2202 return nil
2203 }
2204
2205
2206
2207
2208 func (iter *ScopedResourceListResultIterator) Next() error {
2209 return iter.NextWithContext(context.Background())
2210 }
2211
2212
2213 func (iter ScopedResourceListResultIterator) NotDone() bool {
2214 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2215 }
2216
2217
2218 func (iter ScopedResourceListResultIterator) Response() ScopedResourceListResult {
2219 return iter.page.Response()
2220 }
2221
2222
2223
2224 func (iter ScopedResourceListResultIterator) Value() ScopedResource {
2225 if !iter.page.NotDone() {
2226 return ScopedResource{}
2227 }
2228 return iter.page.Values()[iter.i]
2229 }
2230
2231
2232 func NewScopedResourceListResultIterator(page ScopedResourceListResultPage) ScopedResourceListResultIterator {
2233 return ScopedResourceListResultIterator{page: page}
2234 }
2235
2236
2237 func (srlr ScopedResourceListResult) IsEmpty() bool {
2238 return srlr.Value == nil || len(*srlr.Value) == 0
2239 }
2240
2241
2242 func (srlr ScopedResourceListResult) hasNextLink() bool {
2243 return srlr.NextLink != nil && len(*srlr.NextLink) != 0
2244 }
2245
2246
2247
2248 func (srlr ScopedResourceListResult) scopedResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
2249 if !srlr.hasNextLink() {
2250 return nil, nil
2251 }
2252 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2253 autorest.AsJSON(),
2254 autorest.AsGet(),
2255 autorest.WithBaseURL(to.String(srlr.NextLink)))
2256 }
2257
2258
2259 type ScopedResourceListResultPage struct {
2260 fn func(context.Context, ScopedResourceListResult) (ScopedResourceListResult, error)
2261 srlr ScopedResourceListResult
2262 }
2263
2264
2265
2266 func (page *ScopedResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
2267 if tracing.IsEnabled() {
2268 ctx = tracing.StartSpan(ctx, fqdn+"/ScopedResourceListResultPage.NextWithContext")
2269 defer func() {
2270 sc := -1
2271 if page.Response().Response.Response != nil {
2272 sc = page.Response().Response.Response.StatusCode
2273 }
2274 tracing.EndSpan(ctx, sc, err)
2275 }()
2276 }
2277 for {
2278 next, err := page.fn(ctx, page.srlr)
2279 if err != nil {
2280 return err
2281 }
2282 page.srlr = next
2283 if !next.hasNextLink() || !next.IsEmpty() {
2284 break
2285 }
2286 }
2287 return nil
2288 }
2289
2290
2291
2292
2293 func (page *ScopedResourceListResultPage) Next() error {
2294 return page.NextWithContext(context.Background())
2295 }
2296
2297
2298 func (page ScopedResourceListResultPage) NotDone() bool {
2299 return !page.srlr.IsEmpty()
2300 }
2301
2302
2303 func (page ScopedResourceListResultPage) Response() ScopedResourceListResult {
2304 return page.srlr
2305 }
2306
2307
2308 func (page ScopedResourceListResultPage) Values() []ScopedResource {
2309 if page.srlr.IsEmpty() {
2310 return nil
2311 }
2312 return *page.srlr.Value
2313 }
2314
2315
2316 func NewScopedResourceListResultPage(cur ScopedResourceListResult, getNextPage func(context.Context, ScopedResourceListResult) (ScopedResourceListResult, error)) ScopedResourceListResultPage {
2317 return ScopedResourceListResultPage{
2318 fn: getNextPage,
2319 srlr: cur,
2320 }
2321 }
2322
2323
2324 type ScopedResourceProperties struct {
2325
2326 LinkedResourceID *string `json:"linkedResourceId,omitempty"`
2327
2328 ProvisioningState *string `json:"provisioningState,omitempty"`
2329 }
2330
2331
2332 func (srp ScopedResourceProperties) MarshalJSON() ([]byte, error) {
2333 objectMap := make(map[string]interface{})
2334 if srp.LinkedResourceID != nil {
2335 objectMap["linkedResourceId"] = srp.LinkedResourceID
2336 }
2337 return json.Marshal(objectMap)
2338 }
2339
2340
2341 type Settings struct {
2342
2343 StorageAccountID *string `json:"storageAccountId,omitempty"`
2344
2345 ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"`
2346
2347 EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"`
2348
2349 EventHubName *string `json:"eventHubName,omitempty"`
2350
2351 Metrics *[]MetricSettings `json:"metrics,omitempty"`
2352
2353 Logs *[]LogSettings `json:"logs,omitempty"`
2354
2355 WorkspaceID *string `json:"workspaceId,omitempty"`
2356
2357 MarketplacePartnerID *string `json:"marketplacePartnerId,omitempty"`
2358
2359 LogAnalyticsDestinationType *string `json:"logAnalyticsDestinationType,omitempty"`
2360 }
2361
2362
2363 type SettingsCategory struct {
2364
2365 CategoryType CategoryType `json:"categoryType,omitempty"`
2366
2367 CategoryGroups *[]string `json:"categoryGroups,omitempty"`
2368 }
2369
2370
2371 type SettingsCategoryResource struct {
2372 autorest.Response `json:"-"`
2373
2374 *SettingsCategory `json:"properties,omitempty"`
2375
2376 SystemData *SystemData `json:"systemData,omitempty"`
2377
2378 ID *string `json:"id,omitempty"`
2379
2380 Name *string `json:"name,omitempty"`
2381
2382 Type *string `json:"type,omitempty"`
2383 }
2384
2385
2386 func (scr SettingsCategoryResource) MarshalJSON() ([]byte, error) {
2387 objectMap := make(map[string]interface{})
2388 if scr.SettingsCategory != nil {
2389 objectMap["properties"] = scr.SettingsCategory
2390 }
2391 return json.Marshal(objectMap)
2392 }
2393
2394
2395 func (scr *SettingsCategoryResource) UnmarshalJSON(body []byte) error {
2396 var m map[string]*json.RawMessage
2397 err := json.Unmarshal(body, &m)
2398 if err != nil {
2399 return err
2400 }
2401 for k, v := range m {
2402 switch k {
2403 case "properties":
2404 if v != nil {
2405 var settingsCategory SettingsCategory
2406 err = json.Unmarshal(*v, &settingsCategory)
2407 if err != nil {
2408 return err
2409 }
2410 scr.SettingsCategory = &settingsCategory
2411 }
2412 case "systemData":
2413 if v != nil {
2414 var systemData SystemData
2415 err = json.Unmarshal(*v, &systemData)
2416 if err != nil {
2417 return err
2418 }
2419 scr.SystemData = &systemData
2420 }
2421 case "id":
2422 if v != nil {
2423 var ID string
2424 err = json.Unmarshal(*v, &ID)
2425 if err != nil {
2426 return err
2427 }
2428 scr.ID = &ID
2429 }
2430 case "name":
2431 if v != nil {
2432 var name string
2433 err = json.Unmarshal(*v, &name)
2434 if err != nil {
2435 return err
2436 }
2437 scr.Name = &name
2438 }
2439 case "type":
2440 if v != nil {
2441 var typeVar string
2442 err = json.Unmarshal(*v, &typeVar)
2443 if err != nil {
2444 return err
2445 }
2446 scr.Type = &typeVar
2447 }
2448 }
2449 }
2450
2451 return nil
2452 }
2453
2454
2455 type SettingsCategoryResourceCollection struct {
2456 autorest.Response `json:"-"`
2457
2458 Value *[]SettingsCategoryResource `json:"value,omitempty"`
2459 }
2460
2461
2462 type SettingsResource struct {
2463 autorest.Response `json:"-"`
2464
2465 *Settings `json:"properties,omitempty"`
2466
2467 SystemData *SystemData `json:"systemData,omitempty"`
2468
2469 ID *string `json:"id,omitempty"`
2470
2471 Name *string `json:"name,omitempty"`
2472
2473 Type *string `json:"type,omitempty"`
2474 }
2475
2476
2477 func (sr SettingsResource) MarshalJSON() ([]byte, error) {
2478 objectMap := make(map[string]interface{})
2479 if sr.Settings != nil {
2480 objectMap["properties"] = sr.Settings
2481 }
2482 return json.Marshal(objectMap)
2483 }
2484
2485
2486 func (sr *SettingsResource) UnmarshalJSON(body []byte) error {
2487 var m map[string]*json.RawMessage
2488 err := json.Unmarshal(body, &m)
2489 if err != nil {
2490 return err
2491 }
2492 for k, v := range m {
2493 switch k {
2494 case "properties":
2495 if v != nil {
2496 var settings Settings
2497 err = json.Unmarshal(*v, &settings)
2498 if err != nil {
2499 return err
2500 }
2501 sr.Settings = &settings
2502 }
2503 case "systemData":
2504 if v != nil {
2505 var systemData SystemData
2506 err = json.Unmarshal(*v, &systemData)
2507 if err != nil {
2508 return err
2509 }
2510 sr.SystemData = &systemData
2511 }
2512 case "id":
2513 if v != nil {
2514 var ID string
2515 err = json.Unmarshal(*v, &ID)
2516 if err != nil {
2517 return err
2518 }
2519 sr.ID = &ID
2520 }
2521 case "name":
2522 if v != nil {
2523 var name string
2524 err = json.Unmarshal(*v, &name)
2525 if err != nil {
2526 return err
2527 }
2528 sr.Name = &name
2529 }
2530 case "type":
2531 if v != nil {
2532 var typeVar string
2533 err = json.Unmarshal(*v, &typeVar)
2534 if err != nil {
2535 return err
2536 }
2537 sr.Type = &typeVar
2538 }
2539 }
2540 }
2541
2542 return nil
2543 }
2544
2545
2546 type SettingsResourceCollection struct {
2547 autorest.Response `json:"-"`
2548
2549 Value *[]SettingsResource `json:"value,omitempty"`
2550 }
2551
2552
2553 type SmsReceiver struct {
2554
2555 Name *string `json:"name,omitempty"`
2556
2557 CountryCode *string `json:"countryCode,omitempty"`
2558
2559 PhoneNumber *string `json:"phoneNumber,omitempty"`
2560
2561 Status ReceiverStatus `json:"status,omitempty"`
2562 }
2563
2564
2565 func (sr SmsReceiver) MarshalJSON() ([]byte, error) {
2566 objectMap := make(map[string]interface{})
2567 if sr.Name != nil {
2568 objectMap["name"] = sr.Name
2569 }
2570 if sr.CountryCode != nil {
2571 objectMap["countryCode"] = sr.CountryCode
2572 }
2573 if sr.PhoneNumber != nil {
2574 objectMap["phoneNumber"] = sr.PhoneNumber
2575 }
2576 return json.Marshal(objectMap)
2577 }
2578
2579
2580 type SubscriptionDiagnosticSettings struct {
2581
2582 StorageAccountID *string `json:"storageAccountId,omitempty"`
2583
2584 ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"`
2585
2586 EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"`
2587
2588 EventHubName *string `json:"eventHubName,omitempty"`
2589
2590 Logs *[]SubscriptionLogSettings `json:"logs,omitempty"`
2591
2592 WorkspaceID *string `json:"workspaceId,omitempty"`
2593
2594 MarketplacePartnerID *string `json:"marketplacePartnerId,omitempty"`
2595 }
2596
2597
2598 type SubscriptionDiagnosticSettingsResource struct {
2599 autorest.Response `json:"-"`
2600
2601 *SubscriptionDiagnosticSettings `json:"properties,omitempty"`
2602
2603 SystemData *SystemData `json:"systemData,omitempty"`
2604
2605 ID *string `json:"id,omitempty"`
2606
2607 Name *string `json:"name,omitempty"`
2608
2609 Type *string `json:"type,omitempty"`
2610 }
2611
2612
2613 func (sdsr SubscriptionDiagnosticSettingsResource) MarshalJSON() ([]byte, error) {
2614 objectMap := make(map[string]interface{})
2615 if sdsr.SubscriptionDiagnosticSettings != nil {
2616 objectMap["properties"] = sdsr.SubscriptionDiagnosticSettings
2617 }
2618 return json.Marshal(objectMap)
2619 }
2620
2621
2622 func (sdsr *SubscriptionDiagnosticSettingsResource) UnmarshalJSON(body []byte) error {
2623 var m map[string]*json.RawMessage
2624 err := json.Unmarshal(body, &m)
2625 if err != nil {
2626 return err
2627 }
2628 for k, v := range m {
2629 switch k {
2630 case "properties":
2631 if v != nil {
2632 var subscriptionDiagnosticSettings SubscriptionDiagnosticSettings
2633 err = json.Unmarshal(*v, &subscriptionDiagnosticSettings)
2634 if err != nil {
2635 return err
2636 }
2637 sdsr.SubscriptionDiagnosticSettings = &subscriptionDiagnosticSettings
2638 }
2639 case "systemData":
2640 if v != nil {
2641 var systemData SystemData
2642 err = json.Unmarshal(*v, &systemData)
2643 if err != nil {
2644 return err
2645 }
2646 sdsr.SystemData = &systemData
2647 }
2648 case "id":
2649 if v != nil {
2650 var ID string
2651 err = json.Unmarshal(*v, &ID)
2652 if err != nil {
2653 return err
2654 }
2655 sdsr.ID = &ID
2656 }
2657 case "name":
2658 if v != nil {
2659 var name string
2660 err = json.Unmarshal(*v, &name)
2661 if err != nil {
2662 return err
2663 }
2664 sdsr.Name = &name
2665 }
2666 case "type":
2667 if v != nil {
2668 var typeVar string
2669 err = json.Unmarshal(*v, &typeVar)
2670 if err != nil {
2671 return err
2672 }
2673 sdsr.Type = &typeVar
2674 }
2675 }
2676 }
2677
2678 return nil
2679 }
2680
2681
2682
2683 type SubscriptionDiagnosticSettingsResourceCollection struct {
2684 autorest.Response `json:"-"`
2685
2686 Value *[]SubscriptionDiagnosticSettingsResource `json:"value,omitempty"`
2687 }
2688
2689
2690
2691 type SubscriptionLogSettings struct {
2692
2693 Category *string `json:"category,omitempty"`
2694
2695 CategoryGroup *string `json:"categoryGroup,omitempty"`
2696
2697 Enabled *bool `json:"enabled,omitempty"`
2698 }
2699
2700
2701 type SystemData struct {
2702
2703 CreatedBy *string `json:"createdBy,omitempty"`
2704
2705 CreatedByType CreatedByType `json:"createdByType,omitempty"`
2706
2707 CreatedAt *date.Time `json:"createdAt,omitempty"`
2708
2709 LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
2710
2711 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
2712
2713 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
2714 }
2715
2716
2717
2718 type TagsResource struct {
2719
2720 Tags map[string]*string `json:"tags"`
2721 }
2722
2723
2724 func (tr TagsResource) MarshalJSON() ([]byte, error) {
2725 objectMap := make(map[string]interface{})
2726 if tr.Tags != nil {
2727 objectMap["tags"] = tr.Tags
2728 }
2729 return json.Marshal(objectMap)
2730 }
2731
2732
2733 type TestNotificationDetailsResponse struct {
2734 autorest.Response `json:"-"`
2735 Context *Context `json:"context,omitempty"`
2736
2737 State *string `json:"state,omitempty"`
2738
2739 CompletedTime *string `json:"completedTime,omitempty"`
2740
2741 CreatedTime *string `json:"createdTime,omitempty"`
2742
2743 ActionDetails *[]ActionDetail `json:"actionDetails,omitempty"`
2744 }
2745
2746
2747 type TimeWindow struct {
2748
2749 TimeZone *string `json:"timeZone,omitempty"`
2750
2751 Start *date.Time `json:"start,omitempty"`
2752
2753 End *date.Time `json:"end,omitempty"`
2754 }
2755
2756
2757
2758 type TrackedResource struct {
2759
2760 Tags map[string]*string `json:"tags"`
2761
2762 Location *string `json:"location,omitempty"`
2763
2764 ID *string `json:"id,omitempty"`
2765
2766 Name *string `json:"name,omitempty"`
2767
2768 Type *string `json:"type,omitempty"`
2769 }
2770
2771
2772 func (tr TrackedResource) MarshalJSON() ([]byte, error) {
2773 objectMap := make(map[string]interface{})
2774 if tr.Tags != nil {
2775 objectMap["tags"] = tr.Tags
2776 }
2777 if tr.Location != nil {
2778 objectMap["location"] = tr.Location
2779 }
2780 return json.Marshal(objectMap)
2781 }
2782
2783
2784 type VoiceReceiver struct {
2785
2786 Name *string `json:"name,omitempty"`
2787
2788 CountryCode *string `json:"countryCode,omitempty"`
2789
2790 PhoneNumber *string `json:"phoneNumber,omitempty"`
2791 }
2792
2793
2794 type WebhookNotification struct {
2795
2796 ServiceURI *string `json:"serviceUri,omitempty"`
2797
2798 Properties map[string]*string `json:"properties"`
2799 }
2800
2801
2802 func (wn WebhookNotification) MarshalJSON() ([]byte, error) {
2803 objectMap := make(map[string]interface{})
2804 if wn.ServiceURI != nil {
2805 objectMap["serviceUri"] = wn.ServiceURI
2806 }
2807 if wn.Properties != nil {
2808 objectMap["properties"] = wn.Properties
2809 }
2810 return json.Marshal(objectMap)
2811 }
2812
2813
2814 type WebhookReceiver struct {
2815
2816 Name *string `json:"name,omitempty"`
2817
2818 ServiceURI *string `json:"serviceUri,omitempty"`
2819
2820 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
2821
2822 UseAadAuth *bool `json:"useAadAuth,omitempty"`
2823
2824 ObjectID *string `json:"objectId,omitempty"`
2825
2826 IdentifierURI *string `json:"identifierUri,omitempty"`
2827
2828 TenantID *string `json:"tenantId,omitempty"`
2829 }
2830
View as plain text