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/date"
14 "github.com/Azure/go-autorest/autorest/to"
15 "github.com/Azure/go-autorest/tracing"
16 "net/http"
17 )
18
19
20 const fqdn = "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights"
21
22
23 type Annotation struct {
24
25 AnnotationName *string `json:"AnnotationName,omitempty"`
26
27 Category *string `json:"Category,omitempty"`
28
29 EventTime *date.Time `json:"EventTime,omitempty"`
30
31 ID *string `json:"Id,omitempty"`
32
33 Properties *string `json:"Properties,omitempty"`
34
35 RelatedAnnotation *string `json:"RelatedAnnotation,omitempty"`
36 }
37
38
39 type AnnotationError struct {
40
41 Code *string `json:"code,omitempty"`
42
43 Message *string `json:"message,omitempty"`
44 Innererror *InnerError `json:"innererror,omitempty"`
45 }
46
47
48 type AnnotationsListResult struct {
49 autorest.Response `json:"-"`
50
51 Value *[]Annotation `json:"value,omitempty"`
52 }
53
54
55 func (alr AnnotationsListResult) MarshalJSON() ([]byte, error) {
56 objectMap := make(map[string]interface{})
57 return json.Marshal(objectMap)
58 }
59
60
61 type APIKeyRequest struct {
62
63 Name *string `json:"name,omitempty"`
64
65 LinkedReadProperties *[]string `json:"linkedReadProperties,omitempty"`
66
67 LinkedWriteProperties *[]string `json:"linkedWriteProperties,omitempty"`
68 }
69
70
71 type ApplicationInsightsComponent struct {
72 autorest.Response `json:"-"`
73
74 Kind *string `json:"kind,omitempty"`
75
76 Etag *string `json:"etag,omitempty"`
77
78 *ApplicationInsightsComponentProperties `json:"properties,omitempty"`
79
80 ID *string `json:"id,omitempty"`
81
82 Name *string `json:"name,omitempty"`
83
84 Type *string `json:"type,omitempty"`
85
86 Location *string `json:"location,omitempty"`
87
88 Tags map[string]*string `json:"tags"`
89 }
90
91
92 func (aic ApplicationInsightsComponent) MarshalJSON() ([]byte, error) {
93 objectMap := make(map[string]interface{})
94 if aic.Kind != nil {
95 objectMap["kind"] = aic.Kind
96 }
97 if aic.Etag != nil {
98 objectMap["etag"] = aic.Etag
99 }
100 if aic.ApplicationInsightsComponentProperties != nil {
101 objectMap["properties"] = aic.ApplicationInsightsComponentProperties
102 }
103 if aic.Location != nil {
104 objectMap["location"] = aic.Location
105 }
106 if aic.Tags != nil {
107 objectMap["tags"] = aic.Tags
108 }
109 return json.Marshal(objectMap)
110 }
111
112
113 func (aic *ApplicationInsightsComponent) UnmarshalJSON(body []byte) error {
114 var m map[string]*json.RawMessage
115 err := json.Unmarshal(body, &m)
116 if err != nil {
117 return err
118 }
119 for k, v := range m {
120 switch k {
121 case "kind":
122 if v != nil {
123 var kind string
124 err = json.Unmarshal(*v, &kind)
125 if err != nil {
126 return err
127 }
128 aic.Kind = &kind
129 }
130 case "etag":
131 if v != nil {
132 var etag string
133 err = json.Unmarshal(*v, &etag)
134 if err != nil {
135 return err
136 }
137 aic.Etag = &etag
138 }
139 case "properties":
140 if v != nil {
141 var applicationInsightsComponentProperties ApplicationInsightsComponentProperties
142 err = json.Unmarshal(*v, &applicationInsightsComponentProperties)
143 if err != nil {
144 return err
145 }
146 aic.ApplicationInsightsComponentProperties = &applicationInsightsComponentProperties
147 }
148 case "id":
149 if v != nil {
150 var ID string
151 err = json.Unmarshal(*v, &ID)
152 if err != nil {
153 return err
154 }
155 aic.ID = &ID
156 }
157 case "name":
158 if v != nil {
159 var name string
160 err = json.Unmarshal(*v, &name)
161 if err != nil {
162 return err
163 }
164 aic.Name = &name
165 }
166 case "type":
167 if v != nil {
168 var typeVar string
169 err = json.Unmarshal(*v, &typeVar)
170 if err != nil {
171 return err
172 }
173 aic.Type = &typeVar
174 }
175 case "location":
176 if v != nil {
177 var location string
178 err = json.Unmarshal(*v, &location)
179 if err != nil {
180 return err
181 }
182 aic.Location = &location
183 }
184 case "tags":
185 if v != nil {
186 var tags map[string]*string
187 err = json.Unmarshal(*v, &tags)
188 if err != nil {
189 return err
190 }
191 aic.Tags = tags
192 }
193 }
194 }
195
196 return nil
197 }
198
199
200
201 type ApplicationInsightsComponentAnalyticsItem struct {
202 autorest.Response `json:"-"`
203
204 ID *string `json:"Id,omitempty"`
205
206 Name *string `json:"Name,omitempty"`
207
208 Content *string `json:"Content,omitempty"`
209
210 Version *string `json:"Version,omitempty"`
211
212 Scope ItemScope `json:"Scope,omitempty"`
213
214 Type ItemType `json:"Type,omitempty"`
215
216 TimeCreated *string `json:"TimeCreated,omitempty"`
217
218 TimeModified *string `json:"TimeModified,omitempty"`
219 Properties *ApplicationInsightsComponentAnalyticsItemProperties `json:"Properties,omitempty"`
220 }
221
222
223 func (aicai ApplicationInsightsComponentAnalyticsItem) MarshalJSON() ([]byte, error) {
224 objectMap := make(map[string]interface{})
225 if aicai.ID != nil {
226 objectMap["Id"] = aicai.ID
227 }
228 if aicai.Name != nil {
229 objectMap["Name"] = aicai.Name
230 }
231 if aicai.Content != nil {
232 objectMap["Content"] = aicai.Content
233 }
234 if aicai.Scope != "" {
235 objectMap["Scope"] = aicai.Scope
236 }
237 if aicai.Type != "" {
238 objectMap["Type"] = aicai.Type
239 }
240 if aicai.Properties != nil {
241 objectMap["Properties"] = aicai.Properties
242 }
243 return json.Marshal(objectMap)
244 }
245
246
247
248 type ApplicationInsightsComponentAnalyticsItemProperties struct {
249
250 FunctionAlias *string `json:"functionAlias,omitempty"`
251 }
252
253
254
255 type ApplicationInsightsComponentAPIKey struct {
256 autorest.Response `json:"-"`
257
258 ID *string `json:"id,omitempty"`
259
260 APIKey *string `json:"apiKey,omitempty"`
261
262 CreatedDate *string `json:"createdDate,omitempty"`
263
264 Name *string `json:"name,omitempty"`
265
266 LinkedReadProperties *[]string `json:"linkedReadProperties,omitempty"`
267
268 LinkedWriteProperties *[]string `json:"linkedWriteProperties,omitempty"`
269 }
270
271
272 func (aicak ApplicationInsightsComponentAPIKey) MarshalJSON() ([]byte, error) {
273 objectMap := make(map[string]interface{})
274 if aicak.CreatedDate != nil {
275 objectMap["createdDate"] = aicak.CreatedDate
276 }
277 if aicak.Name != nil {
278 objectMap["name"] = aicak.Name
279 }
280 if aicak.LinkedReadProperties != nil {
281 objectMap["linkedReadProperties"] = aicak.LinkedReadProperties
282 }
283 if aicak.LinkedWriteProperties != nil {
284 objectMap["linkedWriteProperties"] = aicak.LinkedWriteProperties
285 }
286 return json.Marshal(objectMap)
287 }
288
289
290
291 type ApplicationInsightsComponentAPIKeyListResult struct {
292 autorest.Response `json:"-"`
293
294 Value *[]ApplicationInsightsComponentAPIKey `json:"value,omitempty"`
295 }
296
297
298 type ApplicationInsightsComponentAvailableFeatures struct {
299 autorest.Response `json:"-"`
300
301 Result *[]ApplicationInsightsComponentFeature `json:"Result,omitempty"`
302 }
303
304
305 func (aicaf ApplicationInsightsComponentAvailableFeatures) MarshalJSON() ([]byte, error) {
306 objectMap := make(map[string]interface{})
307 return json.Marshal(objectMap)
308 }
309
310
311 type ApplicationInsightsComponentBillingFeatures struct {
312 autorest.Response `json:"-"`
313
314 DataVolumeCap *ApplicationInsightsComponentDataVolumeCap `json:"DataVolumeCap,omitempty"`
315
316 CurrentBillingFeatures *[]string `json:"CurrentBillingFeatures,omitempty"`
317 }
318
319
320 type ApplicationInsightsComponentDataVolumeCap struct {
321
322 Cap *float64 `json:"Cap,omitempty"`
323
324 ResetTime *int32 `json:"ResetTime,omitempty"`
325
326 WarningThreshold *int32 `json:"WarningThreshold,omitempty"`
327
328 StopSendNotificationWhenHitThreshold *bool `json:"StopSendNotificationWhenHitThreshold,omitempty"`
329
330 StopSendNotificationWhenHitCap *bool `json:"StopSendNotificationWhenHitCap,omitempty"`
331
332 MaxHistoryCap *float64 `json:"MaxHistoryCap,omitempty"`
333 }
334
335
336 func (aicdvc ApplicationInsightsComponentDataVolumeCap) MarshalJSON() ([]byte, error) {
337 objectMap := make(map[string]interface{})
338 if aicdvc.Cap != nil {
339 objectMap["Cap"] = aicdvc.Cap
340 }
341 if aicdvc.WarningThreshold != nil {
342 objectMap["WarningThreshold"] = aicdvc.WarningThreshold
343 }
344 if aicdvc.StopSendNotificationWhenHitThreshold != nil {
345 objectMap["StopSendNotificationWhenHitThreshold"] = aicdvc.StopSendNotificationWhenHitThreshold
346 }
347 if aicdvc.StopSendNotificationWhenHitCap != nil {
348 objectMap["StopSendNotificationWhenHitCap"] = aicdvc.StopSendNotificationWhenHitCap
349 }
350 return json.Marshal(objectMap)
351 }
352
353
354
355 type ApplicationInsightsComponentExportConfiguration struct {
356 autorest.Response `json:"-"`
357
358 ExportID *string `json:"ExportId,omitempty"`
359
360 InstrumentationKey *string `json:"InstrumentationKey,omitempty"`
361
362 RecordTypes *string `json:"RecordTypes,omitempty"`
363
364 ApplicationName *string `json:"ApplicationName,omitempty"`
365
366 SubscriptionID *string `json:"SubscriptionId,omitempty"`
367
368 ResourceGroup *string `json:"ResourceGroup,omitempty"`
369
370 DestinationStorageSubscriptionID *string `json:"DestinationStorageSubscriptionId,omitempty"`
371
372 DestinationStorageLocationID *string `json:"DestinationStorageLocationId,omitempty"`
373
374 DestinationAccountID *string `json:"DestinationAccountId,omitempty"`
375
376 DestinationType *string `json:"DestinationType,omitempty"`
377
378 IsUserEnabled *string `json:"IsUserEnabled,omitempty"`
379
380 LastUserUpdate *string `json:"LastUserUpdate,omitempty"`
381
382 NotificationQueueEnabled *string `json:"NotificationQueueEnabled,omitempty"`
383
384 ExportStatus *string `json:"ExportStatus,omitempty"`
385
386 LastSuccessTime *string `json:"LastSuccessTime,omitempty"`
387
388 LastGapTime *string `json:"LastGapTime,omitempty"`
389
390 PermanentErrorReason *string `json:"PermanentErrorReason,omitempty"`
391
392 StorageName *string `json:"StorageName,omitempty"`
393
394 ContainerName *string `json:"ContainerName,omitempty"`
395 }
396
397
398 func (aicec ApplicationInsightsComponentExportConfiguration) MarshalJSON() ([]byte, error) {
399 objectMap := make(map[string]interface{})
400 if aicec.RecordTypes != nil {
401 objectMap["RecordTypes"] = aicec.RecordTypes
402 }
403 if aicec.NotificationQueueEnabled != nil {
404 objectMap["NotificationQueueEnabled"] = aicec.NotificationQueueEnabled
405 }
406 return json.Marshal(objectMap)
407 }
408
409
410
411 type ApplicationInsightsComponentExportRequest struct {
412
413 RecordTypes *string `json:"RecordTypes,omitempty"`
414
415 DestinationType *string `json:"DestinationType,omitempty"`
416
417 DestinationAddress *string `json:"DestinationAddress,omitempty"`
418
419 IsEnabled *string `json:"IsEnabled,omitempty"`
420
421 NotificationQueueEnabled *string `json:"NotificationQueueEnabled,omitempty"`
422
423 NotificationQueueURI *string `json:"NotificationQueueUri,omitempty"`
424
425 DestinationStorageSubscriptionID *string `json:"DestinationStorageSubscriptionId,omitempty"`
426
427 DestinationStorageLocationID *string `json:"DestinationStorageLocationId,omitempty"`
428
429 DestinationAccountID *string `json:"DestinationAccountId,omitempty"`
430 }
431
432
433
434 type ApplicationInsightsComponentFavorite struct {
435 autorest.Response `json:"-"`
436
437 Name *string `json:"Name,omitempty"`
438
439 Config *string `json:"Config,omitempty"`
440
441 Version *string `json:"Version,omitempty"`
442
443 FavoriteID *string `json:"FavoriteId,omitempty"`
444
445 FavoriteType FavoriteType `json:"FavoriteType,omitempty"`
446
447 SourceType *string `json:"SourceType,omitempty"`
448
449 TimeModified *string `json:"TimeModified,omitempty"`
450
451 Tags *[]string `json:"Tags,omitempty"`
452
453 Category *string `json:"Category,omitempty"`
454
455 IsGeneratedFromTemplate *bool `json:"IsGeneratedFromTemplate,omitempty"`
456
457 UserID *string `json:"UserId,omitempty"`
458 }
459
460
461 func (aicf ApplicationInsightsComponentFavorite) MarshalJSON() ([]byte, error) {
462 objectMap := make(map[string]interface{})
463 if aicf.Name != nil {
464 objectMap["Name"] = aicf.Name
465 }
466 if aicf.Config != nil {
467 objectMap["Config"] = aicf.Config
468 }
469 if aicf.Version != nil {
470 objectMap["Version"] = aicf.Version
471 }
472 if aicf.FavoriteType != "" {
473 objectMap["FavoriteType"] = aicf.FavoriteType
474 }
475 if aicf.SourceType != nil {
476 objectMap["SourceType"] = aicf.SourceType
477 }
478 if aicf.Tags != nil {
479 objectMap["Tags"] = aicf.Tags
480 }
481 if aicf.Category != nil {
482 objectMap["Category"] = aicf.Category
483 }
484 if aicf.IsGeneratedFromTemplate != nil {
485 objectMap["IsGeneratedFromTemplate"] = aicf.IsGeneratedFromTemplate
486 }
487 return json.Marshal(objectMap)
488 }
489
490
491 type ApplicationInsightsComponentFeature struct {
492
493 FeatureName *string `json:"FeatureName,omitempty"`
494
495 MeterID *string `json:"MeterId,omitempty"`
496
497 MeterRateFrequency *string `json:"MeterRateFrequency,omitempty"`
498
499 ResouceID *string `json:"ResouceId,omitempty"`
500
501 IsHidden *bool `json:"IsHidden,omitempty"`
502
503 Capabilities *[]ApplicationInsightsComponentFeatureCapability `json:"Capabilities,omitempty"`
504
505 Title *string `json:"Title,omitempty"`
506
507 IsMainFeature *bool `json:"IsMainFeature,omitempty"`
508
509 SupportedAddonFeatures *string `json:"SupportedAddonFeatures,omitempty"`
510 }
511
512
513 func (aicf ApplicationInsightsComponentFeature) MarshalJSON() ([]byte, error) {
514 objectMap := make(map[string]interface{})
515 return json.Marshal(objectMap)
516 }
517
518
519 type ApplicationInsightsComponentFeatureCapabilities struct {
520 autorest.Response `json:"-"`
521
522 SupportExportData *bool `json:"SupportExportData,omitempty"`
523
524 BurstThrottlePolicy *string `json:"BurstThrottlePolicy,omitempty"`
525
526 MetadataClass *string `json:"MetadataClass,omitempty"`
527
528 LiveStreamMetrics *bool `json:"LiveStreamMetrics,omitempty"`
529
530 ApplicationMap *bool `json:"ApplicationMap,omitempty"`
531
532 WorkItemIntegration *bool `json:"WorkItemIntegration,omitempty"`
533
534 PowerBIIntegration *bool `json:"PowerBIIntegration,omitempty"`
535
536 OpenSchema *bool `json:"OpenSchema,omitempty"`
537
538 ProactiveDetection *bool `json:"ProactiveDetection,omitempty"`
539
540 AnalyticsIntegration *bool `json:"AnalyticsIntegration,omitempty"`
541
542 MultipleStepWebTest *bool `json:"MultipleStepWebTest,omitempty"`
543
544 APIAccessLevel *string `json:"ApiAccessLevel,omitempty"`
545
546 TrackingType *string `json:"TrackingType,omitempty"`
547
548 DailyCap *float64 `json:"DailyCap,omitempty"`
549
550 DailyCapResetTime *float64 `json:"DailyCapResetTime,omitempty"`
551
552 ThrottleRate *float64 `json:"ThrottleRate,omitempty"`
553 }
554
555
556 func (aicfc ApplicationInsightsComponentFeatureCapabilities) MarshalJSON() ([]byte, error) {
557 objectMap := make(map[string]interface{})
558 return json.Marshal(objectMap)
559 }
560
561
562 type ApplicationInsightsComponentFeatureCapability struct {
563
564 Name *string `json:"Name,omitempty"`
565
566 Description *string `json:"Description,omitempty"`
567
568 Value *string `json:"Value,omitempty"`
569
570 Unit *string `json:"Unit,omitempty"`
571
572 MeterID *string `json:"MeterId,omitempty"`
573
574 MeterRateFrequency *string `json:"MeterRateFrequency,omitempty"`
575 }
576
577
578 func (aicfc ApplicationInsightsComponentFeatureCapability) MarshalJSON() ([]byte, error) {
579 objectMap := make(map[string]interface{})
580 return json.Marshal(objectMap)
581 }
582
583
584 type ApplicationInsightsComponentListResult struct {
585 autorest.Response `json:"-"`
586
587 Value *[]ApplicationInsightsComponent `json:"value,omitempty"`
588
589 NextLink *string `json:"nextLink,omitempty"`
590 }
591
592
593
594 type ApplicationInsightsComponentListResultIterator struct {
595 i int
596 page ApplicationInsightsComponentListResultPage
597 }
598
599
600
601 func (iter *ApplicationInsightsComponentListResultIterator) NextWithContext(ctx context.Context) (err error) {
602 if tracing.IsEnabled() {
603 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationInsightsComponentListResultIterator.NextWithContext")
604 defer func() {
605 sc := -1
606 if iter.Response().Response.Response != nil {
607 sc = iter.Response().Response.Response.StatusCode
608 }
609 tracing.EndSpan(ctx, sc, err)
610 }()
611 }
612 iter.i++
613 if iter.i < len(iter.page.Values()) {
614 return nil
615 }
616 err = iter.page.NextWithContext(ctx)
617 if err != nil {
618 iter.i--
619 return err
620 }
621 iter.i = 0
622 return nil
623 }
624
625
626
627
628 func (iter *ApplicationInsightsComponentListResultIterator) Next() error {
629 return iter.NextWithContext(context.Background())
630 }
631
632
633 func (iter ApplicationInsightsComponentListResultIterator) NotDone() bool {
634 return iter.page.NotDone() && iter.i < len(iter.page.Values())
635 }
636
637
638 func (iter ApplicationInsightsComponentListResultIterator) Response() ApplicationInsightsComponentListResult {
639 return iter.page.Response()
640 }
641
642
643
644 func (iter ApplicationInsightsComponentListResultIterator) Value() ApplicationInsightsComponent {
645 if !iter.page.NotDone() {
646 return ApplicationInsightsComponent{}
647 }
648 return iter.page.Values()[iter.i]
649 }
650
651
652 func NewApplicationInsightsComponentListResultIterator(page ApplicationInsightsComponentListResultPage) ApplicationInsightsComponentListResultIterator {
653 return ApplicationInsightsComponentListResultIterator{page: page}
654 }
655
656
657 func (aiclr ApplicationInsightsComponentListResult) IsEmpty() bool {
658 return aiclr.Value == nil || len(*aiclr.Value) == 0
659 }
660
661
662 func (aiclr ApplicationInsightsComponentListResult) hasNextLink() bool {
663 return aiclr.NextLink != nil && len(*aiclr.NextLink) != 0
664 }
665
666
667
668 func (aiclr ApplicationInsightsComponentListResult) applicationInsightsComponentListResultPreparer(ctx context.Context) (*http.Request, error) {
669 if !aiclr.hasNextLink() {
670 return nil, nil
671 }
672 return autorest.Prepare((&http.Request{}).WithContext(ctx),
673 autorest.AsJSON(),
674 autorest.AsGet(),
675 autorest.WithBaseURL(to.String(aiclr.NextLink)))
676 }
677
678
679 type ApplicationInsightsComponentListResultPage struct {
680 fn func(context.Context, ApplicationInsightsComponentListResult) (ApplicationInsightsComponentListResult, error)
681 aiclr ApplicationInsightsComponentListResult
682 }
683
684
685
686 func (page *ApplicationInsightsComponentListResultPage) NextWithContext(ctx context.Context) (err error) {
687 if tracing.IsEnabled() {
688 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationInsightsComponentListResultPage.NextWithContext")
689 defer func() {
690 sc := -1
691 if page.Response().Response.Response != nil {
692 sc = page.Response().Response.Response.StatusCode
693 }
694 tracing.EndSpan(ctx, sc, err)
695 }()
696 }
697 for {
698 next, err := page.fn(ctx, page.aiclr)
699 if err != nil {
700 return err
701 }
702 page.aiclr = next
703 if !next.hasNextLink() || !next.IsEmpty() {
704 break
705 }
706 }
707 return nil
708 }
709
710
711
712
713 func (page *ApplicationInsightsComponentListResultPage) Next() error {
714 return page.NextWithContext(context.Background())
715 }
716
717
718 func (page ApplicationInsightsComponentListResultPage) NotDone() bool {
719 return !page.aiclr.IsEmpty()
720 }
721
722
723 func (page ApplicationInsightsComponentListResultPage) Response() ApplicationInsightsComponentListResult {
724 return page.aiclr
725 }
726
727
728 func (page ApplicationInsightsComponentListResultPage) Values() []ApplicationInsightsComponent {
729 if page.aiclr.IsEmpty() {
730 return nil
731 }
732 return *page.aiclr.Value
733 }
734
735
736 func NewApplicationInsightsComponentListResultPage(cur ApplicationInsightsComponentListResult, getNextPage func(context.Context, ApplicationInsightsComponentListResult) (ApplicationInsightsComponentListResult, error)) ApplicationInsightsComponentListResultPage {
737 return ApplicationInsightsComponentListResultPage{
738 fn: getNextPage,
739 aiclr: cur,
740 }
741 }
742
743
744
745 type ApplicationInsightsComponentProactiveDetectionConfiguration struct {
746 autorest.Response `json:"-"`
747
748 Name *string `json:"Name,omitempty"`
749
750 Enabled *bool `json:"Enabled,omitempty"`
751
752 SendEmailsToSubscriptionOwners *bool `json:"SendEmailsToSubscriptionOwners,omitempty"`
753
754 CustomEmails *[]string `json:"CustomEmails,omitempty"`
755
756 LastUpdatedTime *string `json:"LastUpdatedTime,omitempty"`
757
758 RuleDefinitions *ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions `json:"RuleDefinitions,omitempty"`
759 }
760
761
762
763 type ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions struct {
764
765 Name *string `json:"Name,omitempty"`
766
767 DisplayName *string `json:"DisplayName,omitempty"`
768
769 Description *string `json:"Description,omitempty"`
770
771 HelpURL *string `json:"HelpUrl,omitempty"`
772
773 IsHidden *bool `json:"IsHidden,omitempty"`
774
775 IsEnabledByDefault *bool `json:"IsEnabledByDefault,omitempty"`
776
777 IsInPreview *bool `json:"IsInPreview,omitempty"`
778
779 SupportsEmailNotifications *bool `json:"SupportsEmailNotifications,omitempty"`
780 }
781
782
783
784 type ApplicationInsightsComponentProperties struct {
785
786 ApplicationID *string `json:"ApplicationId,omitempty"`
787
788 AppID *string `json:"AppId,omitempty"`
789
790 Name *string `json:"Name,omitempty"`
791
792 ApplicationType ApplicationType `json:"Application_Type,omitempty"`
793
794 FlowType FlowType `json:"Flow_Type,omitempty"`
795
796 RequestSource RequestSource `json:"Request_Source,omitempty"`
797
798 InstrumentationKey *string `json:"InstrumentationKey,omitempty"`
799
800 CreationDate *date.Time `json:"CreationDate,omitempty"`
801
802 TenantID *string `json:"TenantId,omitempty"`
803
804 HockeyAppID *string `json:"HockeyAppId,omitempty"`
805
806 HockeyAppToken *string `json:"HockeyAppToken,omitempty"`
807
808 ProvisioningState *string `json:"provisioningState,omitempty"`
809
810 SamplingPercentage *float64 `json:"SamplingPercentage,omitempty"`
811
812 ConnectionString *string `json:"ConnectionString,omitempty"`
813
814 RetentionInDays *int32 `json:"RetentionInDays,omitempty"`
815
816 DisableIPMasking *bool `json:"DisableIpMasking,omitempty"`
817
818 ImmediatePurgeDataOn30Days *bool `json:"ImmediatePurgeDataOn30Days,omitempty"`
819
820 WorkspaceResourceID *string `json:"WorkspaceResourceId,omitempty"`
821
822 LaMigrationDate *date.Time `json:"LaMigrationDate,omitempty"`
823
824 PrivateLinkScopedResources *[]PrivateLinkScopedResource `json:"PrivateLinkScopedResources,omitempty"`
825
826 PublicNetworkAccessForIngestion PublicNetworkAccessType `json:"publicNetworkAccessForIngestion,omitempty"`
827
828 PublicNetworkAccessForQuery PublicNetworkAccessType `json:"publicNetworkAccessForQuery,omitempty"`
829
830 IngestionMode IngestionMode `json:"IngestionMode,omitempty"`
831
832 DisableLocalAuth *bool `json:"DisableLocalAuth,omitempty"`
833
834 ForceCustomerStorageForProfiler *bool `json:"ForceCustomerStorageForProfiler,omitempty"`
835 }
836
837
838 func (aicp ApplicationInsightsComponentProperties) MarshalJSON() ([]byte, error) {
839 objectMap := make(map[string]interface{})
840 if aicp.ApplicationType != "" {
841 objectMap["Application_Type"] = aicp.ApplicationType
842 }
843 if aicp.FlowType != "" {
844 objectMap["Flow_Type"] = aicp.FlowType
845 }
846 if aicp.RequestSource != "" {
847 objectMap["Request_Source"] = aicp.RequestSource
848 }
849 if aicp.HockeyAppID != nil {
850 objectMap["HockeyAppId"] = aicp.HockeyAppID
851 }
852 if aicp.SamplingPercentage != nil {
853 objectMap["SamplingPercentage"] = aicp.SamplingPercentage
854 }
855 if aicp.RetentionInDays != nil {
856 objectMap["RetentionInDays"] = aicp.RetentionInDays
857 }
858 if aicp.DisableIPMasking != nil {
859 objectMap["DisableIpMasking"] = aicp.DisableIPMasking
860 }
861 if aicp.ImmediatePurgeDataOn30Days != nil {
862 objectMap["ImmediatePurgeDataOn30Days"] = aicp.ImmediatePurgeDataOn30Days
863 }
864 if aicp.WorkspaceResourceID != nil {
865 objectMap["WorkspaceResourceId"] = aicp.WorkspaceResourceID
866 }
867 if aicp.PublicNetworkAccessForIngestion != "" {
868 objectMap["publicNetworkAccessForIngestion"] = aicp.PublicNetworkAccessForIngestion
869 }
870 if aicp.PublicNetworkAccessForQuery != "" {
871 objectMap["publicNetworkAccessForQuery"] = aicp.PublicNetworkAccessForQuery
872 }
873 if aicp.IngestionMode != "" {
874 objectMap["IngestionMode"] = aicp.IngestionMode
875 }
876 if aicp.DisableLocalAuth != nil {
877 objectMap["DisableLocalAuth"] = aicp.DisableLocalAuth
878 }
879 if aicp.ForceCustomerStorageForProfiler != nil {
880 objectMap["ForceCustomerStorageForProfiler"] = aicp.ForceCustomerStorageForProfiler
881 }
882 return json.Marshal(objectMap)
883 }
884
885
886 type ApplicationInsightsComponentQuotaStatus struct {
887 autorest.Response `json:"-"`
888
889 AppID *string `json:"AppId,omitempty"`
890
891 ShouldBeThrottled *bool `json:"ShouldBeThrottled,omitempty"`
892
893 ExpirationTime *string `json:"ExpirationTime,omitempty"`
894 }
895
896
897 func (aicqs ApplicationInsightsComponentQuotaStatus) MarshalJSON() ([]byte, error) {
898 objectMap := make(map[string]interface{})
899 return json.Marshal(objectMap)
900 }
901
902
903
904 type ApplicationInsightsComponentWebTestLocation struct {
905
906 DisplayName *string `json:"DisplayName,omitempty"`
907
908 Tag *string `json:"Tag,omitempty"`
909 }
910
911
912 func (aicwtl ApplicationInsightsComponentWebTestLocation) MarshalJSON() ([]byte, error) {
913 objectMap := make(map[string]interface{})
914 return json.Marshal(objectMap)
915 }
916
917
918
919 type ApplicationInsightsWebTestLocationsListResult struct {
920 autorest.Response `json:"-"`
921
922 Value *[]ApplicationInsightsComponentWebTestLocation `json:"value,omitempty"`
923 }
924
925
926 type ComponentPurgeBody struct {
927
928 Table *string `json:"table,omitempty"`
929
930 Filters *[]ComponentPurgeBodyFilters `json:"filters,omitempty"`
931 }
932
933
934 type ComponentPurgeBodyFilters struct {
935
936 Column *string `json:"column,omitempty"`
937
938 Operator *string `json:"operator,omitempty"`
939
940 Value interface{} `json:"value,omitempty"`
941
942 Key *string `json:"key,omitempty"`
943 }
944
945
946 type ComponentPurgeResponse struct {
947 autorest.Response `json:"-"`
948
949 OperationID *string `json:"operationId,omitempty"`
950 }
951
952
953 type ComponentPurgeStatusResponse struct {
954 autorest.Response `json:"-"`
955
956 Status PurgeState `json:"status,omitempty"`
957 }
958
959
960 type ComponentsResource struct {
961
962 ID *string `json:"id,omitempty"`
963
964 Name *string `json:"name,omitempty"`
965
966 Type *string `json:"type,omitempty"`
967
968 Location *string `json:"location,omitempty"`
969
970 Tags map[string]*string `json:"tags"`
971 }
972
973
974 func (cr ComponentsResource) MarshalJSON() ([]byte, error) {
975 objectMap := make(map[string]interface{})
976 if cr.Location != nil {
977 objectMap["location"] = cr.Location
978 }
979 if cr.Tags != nil {
980 objectMap["tags"] = cr.Tags
981 }
982 return json.Marshal(objectMap)
983 }
984
985
986 type ErrorFieldContract struct {
987
988 Code *string `json:"code,omitempty"`
989
990 Message *string `json:"message,omitempty"`
991
992 Target *string `json:"target,omitempty"`
993 }
994
995
996
997 type ErrorResponse struct {
998
999 Code *string `json:"code,omitempty"`
1000
1001 Message *string `json:"message,omitempty"`
1002 }
1003
1004
1005 type ErrorResponseComponents struct {
1006
1007 Error *ErrorResponseComponentsError `json:"error,omitempty"`
1008 }
1009
1010
1011
1012 type ErrorResponseComponentsError struct {
1013
1014 Code *string `json:"code,omitempty"`
1015
1016 Message *string `json:"message,omitempty"`
1017 }
1018
1019
1020 func (erc ErrorResponseComponentsError) MarshalJSON() ([]byte, error) {
1021 objectMap := make(map[string]interface{})
1022 return json.Marshal(objectMap)
1023 }
1024
1025
1026 type InnerError struct {
1027
1028 Diagnosticcontext *string `json:"diagnosticcontext,omitempty"`
1029
1030 Time *date.Time `json:"time,omitempty"`
1031 }
1032
1033
1034 type LinkProperties struct {
1035
1036 SourceID *string `json:"sourceId,omitempty"`
1037
1038 TargetID *string `json:"targetId,omitempty"`
1039
1040 Category *string `json:"category,omitempty"`
1041 }
1042
1043
1044 type ListAnnotation struct {
1045 autorest.Response `json:"-"`
1046 Value *[]Annotation `json:"value,omitempty"`
1047 }
1048
1049
1050 type ListApplicationInsightsComponentAnalyticsItem struct {
1051 autorest.Response `json:"-"`
1052 Value *[]ApplicationInsightsComponentAnalyticsItem `json:"value,omitempty"`
1053 }
1054
1055
1056 type ListApplicationInsightsComponentExportConfiguration struct {
1057 autorest.Response `json:"-"`
1058 Value *[]ApplicationInsightsComponentExportConfiguration `json:"value,omitempty"`
1059 }
1060
1061
1062 type ListApplicationInsightsComponentFavorite struct {
1063 autorest.Response `json:"-"`
1064 Value *[]ApplicationInsightsComponentFavorite `json:"value,omitempty"`
1065 }
1066
1067
1068 type ListApplicationInsightsComponentProactiveDetectionConfiguration struct {
1069 autorest.Response `json:"-"`
1070 Value *[]ApplicationInsightsComponentProactiveDetectionConfiguration `json:"value,omitempty"`
1071 }
1072
1073
1074 type MyWorkbook struct {
1075 autorest.Response `json:"-"`
1076
1077 Kind SharedTypeKind `json:"kind,omitempty"`
1078
1079 *MyWorkbookProperties `json:"properties,omitempty"`
1080
1081 ID *string `json:"id,omitempty"`
1082
1083 Name *string `json:"name,omitempty"`
1084
1085 Type *string `json:"type,omitempty"`
1086
1087 Location *string `json:"location,omitempty"`
1088
1089 Tags map[string]*string `json:"tags"`
1090 }
1091
1092
1093 func (mw MyWorkbook) MarshalJSON() ([]byte, error) {
1094 objectMap := make(map[string]interface{})
1095 if mw.Kind != "" {
1096 objectMap["kind"] = mw.Kind
1097 }
1098 if mw.MyWorkbookProperties != nil {
1099 objectMap["properties"] = mw.MyWorkbookProperties
1100 }
1101 if mw.ID != nil {
1102 objectMap["id"] = mw.ID
1103 }
1104 if mw.Name != nil {
1105 objectMap["name"] = mw.Name
1106 }
1107 if mw.Type != nil {
1108 objectMap["type"] = mw.Type
1109 }
1110 if mw.Location != nil {
1111 objectMap["location"] = mw.Location
1112 }
1113 if mw.Tags != nil {
1114 objectMap["tags"] = mw.Tags
1115 }
1116 return json.Marshal(objectMap)
1117 }
1118
1119
1120 func (mw *MyWorkbook) UnmarshalJSON(body []byte) error {
1121 var m map[string]*json.RawMessage
1122 err := json.Unmarshal(body, &m)
1123 if err != nil {
1124 return err
1125 }
1126 for k, v := range m {
1127 switch k {
1128 case "kind":
1129 if v != nil {
1130 var kind SharedTypeKind
1131 err = json.Unmarshal(*v, &kind)
1132 if err != nil {
1133 return err
1134 }
1135 mw.Kind = kind
1136 }
1137 case "properties":
1138 if v != nil {
1139 var myWorkbookProperties MyWorkbookProperties
1140 err = json.Unmarshal(*v, &myWorkbookProperties)
1141 if err != nil {
1142 return err
1143 }
1144 mw.MyWorkbookProperties = &myWorkbookProperties
1145 }
1146 case "id":
1147 if v != nil {
1148 var ID string
1149 err = json.Unmarshal(*v, &ID)
1150 if err != nil {
1151 return err
1152 }
1153 mw.ID = &ID
1154 }
1155 case "name":
1156 if v != nil {
1157 var name string
1158 err = json.Unmarshal(*v, &name)
1159 if err != nil {
1160 return err
1161 }
1162 mw.Name = &name
1163 }
1164 case "type":
1165 if v != nil {
1166 var typeVar string
1167 err = json.Unmarshal(*v, &typeVar)
1168 if err != nil {
1169 return err
1170 }
1171 mw.Type = &typeVar
1172 }
1173 case "location":
1174 if v != nil {
1175 var location string
1176 err = json.Unmarshal(*v, &location)
1177 if err != nil {
1178 return err
1179 }
1180 mw.Location = &location
1181 }
1182 case "tags":
1183 if v != nil {
1184 var tags map[string]*string
1185 err = json.Unmarshal(*v, &tags)
1186 if err != nil {
1187 return err
1188 }
1189 mw.Tags = tags
1190 }
1191 }
1192 }
1193
1194 return nil
1195 }
1196
1197
1198 type MyWorkbookError struct {
1199
1200 Code *string `json:"code,omitempty"`
1201
1202 Message *string `json:"message,omitempty"`
1203
1204 Details *[]ErrorFieldContract `json:"details,omitempty"`
1205 }
1206
1207
1208 type MyWorkbookProperties struct {
1209
1210 DisplayName *string `json:"displayName,omitempty"`
1211
1212 SerializedData *string `json:"serializedData,omitempty"`
1213
1214 Version *string `json:"version,omitempty"`
1215
1216 TimeModified *string `json:"timeModified,omitempty"`
1217
1218 Category *string `json:"category,omitempty"`
1219
1220 Tags *[]string `json:"tags,omitempty"`
1221
1222 UserID *string `json:"userId,omitempty"`
1223
1224 SourceID *string `json:"sourceId,omitempty"`
1225 }
1226
1227
1228 func (mwp MyWorkbookProperties) MarshalJSON() ([]byte, error) {
1229 objectMap := make(map[string]interface{})
1230 if mwp.DisplayName != nil {
1231 objectMap["displayName"] = mwp.DisplayName
1232 }
1233 if mwp.SerializedData != nil {
1234 objectMap["serializedData"] = mwp.SerializedData
1235 }
1236 if mwp.Version != nil {
1237 objectMap["version"] = mwp.Version
1238 }
1239 if mwp.Category != nil {
1240 objectMap["category"] = mwp.Category
1241 }
1242 if mwp.Tags != nil {
1243 objectMap["tags"] = mwp.Tags
1244 }
1245 if mwp.SourceID != nil {
1246 objectMap["sourceId"] = mwp.SourceID
1247 }
1248 return json.Marshal(objectMap)
1249 }
1250
1251
1252 type MyWorkbookResource struct {
1253
1254 ID *string `json:"id,omitempty"`
1255
1256 Name *string `json:"name,omitempty"`
1257
1258 Type *string `json:"type,omitempty"`
1259
1260 Location *string `json:"location,omitempty"`
1261
1262 Tags map[string]*string `json:"tags"`
1263 }
1264
1265
1266 func (mwr MyWorkbookResource) MarshalJSON() ([]byte, error) {
1267 objectMap := make(map[string]interface{})
1268 if mwr.ID != nil {
1269 objectMap["id"] = mwr.ID
1270 }
1271 if mwr.Name != nil {
1272 objectMap["name"] = mwr.Name
1273 }
1274 if mwr.Type != nil {
1275 objectMap["type"] = mwr.Type
1276 }
1277 if mwr.Location != nil {
1278 objectMap["location"] = mwr.Location
1279 }
1280 if mwr.Tags != nil {
1281 objectMap["tags"] = mwr.Tags
1282 }
1283 return json.Marshal(objectMap)
1284 }
1285
1286
1287 type MyWorkbooksListResult struct {
1288 autorest.Response `json:"-"`
1289
1290 Value *[]MyWorkbook `json:"value,omitempty"`
1291 }
1292
1293
1294 func (mwlr MyWorkbooksListResult) MarshalJSON() ([]byte, error) {
1295 objectMap := make(map[string]interface{})
1296 return json.Marshal(objectMap)
1297 }
1298
1299
1300 type Operation struct {
1301
1302 Name *string `json:"name,omitempty"`
1303
1304 Display *OperationDisplay `json:"display,omitempty"`
1305 }
1306
1307
1308 type OperationDisplay struct {
1309
1310 Provider *string `json:"provider,omitempty"`
1311
1312 Resource *string `json:"resource,omitempty"`
1313
1314 Operation *string `json:"operation,omitempty"`
1315 }
1316
1317
1318
1319 type OperationListResult struct {
1320 autorest.Response `json:"-"`
1321
1322 Value *[]Operation `json:"value,omitempty"`
1323
1324 NextLink *string `json:"nextLink,omitempty"`
1325 }
1326
1327
1328 type OperationListResultIterator struct {
1329 i int
1330 page OperationListResultPage
1331 }
1332
1333
1334
1335 func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1336 if tracing.IsEnabled() {
1337 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
1338 defer func() {
1339 sc := -1
1340 if iter.Response().Response.Response != nil {
1341 sc = iter.Response().Response.Response.StatusCode
1342 }
1343 tracing.EndSpan(ctx, sc, err)
1344 }()
1345 }
1346 iter.i++
1347 if iter.i < len(iter.page.Values()) {
1348 return nil
1349 }
1350 err = iter.page.NextWithContext(ctx)
1351 if err != nil {
1352 iter.i--
1353 return err
1354 }
1355 iter.i = 0
1356 return nil
1357 }
1358
1359
1360
1361
1362 func (iter *OperationListResultIterator) Next() error {
1363 return iter.NextWithContext(context.Background())
1364 }
1365
1366
1367 func (iter OperationListResultIterator) NotDone() bool {
1368 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1369 }
1370
1371
1372 func (iter OperationListResultIterator) Response() OperationListResult {
1373 return iter.page.Response()
1374 }
1375
1376
1377
1378 func (iter OperationListResultIterator) Value() Operation {
1379 if !iter.page.NotDone() {
1380 return Operation{}
1381 }
1382 return iter.page.Values()[iter.i]
1383 }
1384
1385
1386 func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
1387 return OperationListResultIterator{page: page}
1388 }
1389
1390
1391 func (olr OperationListResult) IsEmpty() bool {
1392 return olr.Value == nil || len(*olr.Value) == 0
1393 }
1394
1395
1396 func (olr OperationListResult) hasNextLink() bool {
1397 return olr.NextLink != nil && len(*olr.NextLink) != 0
1398 }
1399
1400
1401
1402 func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
1403 if !olr.hasNextLink() {
1404 return nil, nil
1405 }
1406 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1407 autorest.AsJSON(),
1408 autorest.AsGet(),
1409 autorest.WithBaseURL(to.String(olr.NextLink)))
1410 }
1411
1412
1413 type OperationListResultPage struct {
1414 fn func(context.Context, OperationListResult) (OperationListResult, error)
1415 olr OperationListResult
1416 }
1417
1418
1419
1420 func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
1421 if tracing.IsEnabled() {
1422 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
1423 defer func() {
1424 sc := -1
1425 if page.Response().Response.Response != nil {
1426 sc = page.Response().Response.Response.StatusCode
1427 }
1428 tracing.EndSpan(ctx, sc, err)
1429 }()
1430 }
1431 for {
1432 next, err := page.fn(ctx, page.olr)
1433 if err != nil {
1434 return err
1435 }
1436 page.olr = next
1437 if !next.hasNextLink() || !next.IsEmpty() {
1438 break
1439 }
1440 }
1441 return nil
1442 }
1443
1444
1445
1446
1447 func (page *OperationListResultPage) Next() error {
1448 return page.NextWithContext(context.Background())
1449 }
1450
1451
1452 func (page OperationListResultPage) NotDone() bool {
1453 return !page.olr.IsEmpty()
1454 }
1455
1456
1457 func (page OperationListResultPage) Response() OperationListResult {
1458 return page.olr
1459 }
1460
1461
1462 func (page OperationListResultPage) Values() []Operation {
1463 if page.olr.IsEmpty() {
1464 return nil
1465 }
1466 return *page.olr.Value
1467 }
1468
1469
1470 func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
1471 return OperationListResultPage{
1472 fn: getNextPage,
1473 olr: cur,
1474 }
1475 }
1476
1477
1478 type PrivateLinkScopedResource struct {
1479
1480 ResourceID *string `json:"ResourceId,omitempty"`
1481
1482 ScopeID *string `json:"ScopeId,omitempty"`
1483 }
1484
1485
1486
1487 type TagsResource struct {
1488
1489 Tags map[string]*string `json:"tags"`
1490 }
1491
1492
1493 func (tr TagsResource) MarshalJSON() ([]byte, error) {
1494 objectMap := make(map[string]interface{})
1495 if tr.Tags != nil {
1496 objectMap["tags"] = tr.Tags
1497 }
1498 return json.Marshal(objectMap)
1499 }
1500
1501
1502 type WebTest struct {
1503 autorest.Response `json:"-"`
1504
1505 Kind WebTestKind `json:"kind,omitempty"`
1506
1507 *WebTestProperties `json:"properties,omitempty"`
1508
1509 ID *string `json:"id,omitempty"`
1510
1511 Name *string `json:"name,omitempty"`
1512
1513 Type *string `json:"type,omitempty"`
1514
1515 Location *string `json:"location,omitempty"`
1516
1517 Tags map[string]*string `json:"tags"`
1518 }
1519
1520
1521 func (wt WebTest) MarshalJSON() ([]byte, error) {
1522 objectMap := make(map[string]interface{})
1523 if wt.Kind != "" {
1524 objectMap["kind"] = wt.Kind
1525 }
1526 if wt.WebTestProperties != nil {
1527 objectMap["properties"] = wt.WebTestProperties
1528 }
1529 if wt.Location != nil {
1530 objectMap["location"] = wt.Location
1531 }
1532 if wt.Tags != nil {
1533 objectMap["tags"] = wt.Tags
1534 }
1535 return json.Marshal(objectMap)
1536 }
1537
1538
1539 func (wt *WebTest) UnmarshalJSON(body []byte) error {
1540 var m map[string]*json.RawMessage
1541 err := json.Unmarshal(body, &m)
1542 if err != nil {
1543 return err
1544 }
1545 for k, v := range m {
1546 switch k {
1547 case "kind":
1548 if v != nil {
1549 var kind WebTestKind
1550 err = json.Unmarshal(*v, &kind)
1551 if err != nil {
1552 return err
1553 }
1554 wt.Kind = kind
1555 }
1556 case "properties":
1557 if v != nil {
1558 var webTestProperties WebTestProperties
1559 err = json.Unmarshal(*v, &webTestProperties)
1560 if err != nil {
1561 return err
1562 }
1563 wt.WebTestProperties = &webTestProperties
1564 }
1565 case "id":
1566 if v != nil {
1567 var ID string
1568 err = json.Unmarshal(*v, &ID)
1569 if err != nil {
1570 return err
1571 }
1572 wt.ID = &ID
1573 }
1574 case "name":
1575 if v != nil {
1576 var name string
1577 err = json.Unmarshal(*v, &name)
1578 if err != nil {
1579 return err
1580 }
1581 wt.Name = &name
1582 }
1583 case "type":
1584 if v != nil {
1585 var typeVar string
1586 err = json.Unmarshal(*v, &typeVar)
1587 if err != nil {
1588 return err
1589 }
1590 wt.Type = &typeVar
1591 }
1592 case "location":
1593 if v != nil {
1594 var location string
1595 err = json.Unmarshal(*v, &location)
1596 if err != nil {
1597 return err
1598 }
1599 wt.Location = &location
1600 }
1601 case "tags":
1602 if v != nil {
1603 var tags map[string]*string
1604 err = json.Unmarshal(*v, &tags)
1605 if err != nil {
1606 return err
1607 }
1608 wt.Tags = tags
1609 }
1610 }
1611 }
1612
1613 return nil
1614 }
1615
1616
1617
1618 type WebTestGeolocation struct {
1619
1620 Location *string `json:"Id,omitempty"`
1621 }
1622
1623
1624 type WebTestListResult struct {
1625 autorest.Response `json:"-"`
1626
1627 Value *[]WebTest `json:"value,omitempty"`
1628
1629 NextLink *string `json:"nextLink,omitempty"`
1630 }
1631
1632
1633 type WebTestListResultIterator struct {
1634 i int
1635 page WebTestListResultPage
1636 }
1637
1638
1639
1640 func (iter *WebTestListResultIterator) NextWithContext(ctx context.Context) (err error) {
1641 if tracing.IsEnabled() {
1642 ctx = tracing.StartSpan(ctx, fqdn+"/WebTestListResultIterator.NextWithContext")
1643 defer func() {
1644 sc := -1
1645 if iter.Response().Response.Response != nil {
1646 sc = iter.Response().Response.Response.StatusCode
1647 }
1648 tracing.EndSpan(ctx, sc, err)
1649 }()
1650 }
1651 iter.i++
1652 if iter.i < len(iter.page.Values()) {
1653 return nil
1654 }
1655 err = iter.page.NextWithContext(ctx)
1656 if err != nil {
1657 iter.i--
1658 return err
1659 }
1660 iter.i = 0
1661 return nil
1662 }
1663
1664
1665
1666
1667 func (iter *WebTestListResultIterator) Next() error {
1668 return iter.NextWithContext(context.Background())
1669 }
1670
1671
1672 func (iter WebTestListResultIterator) NotDone() bool {
1673 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1674 }
1675
1676
1677 func (iter WebTestListResultIterator) Response() WebTestListResult {
1678 return iter.page.Response()
1679 }
1680
1681
1682
1683 func (iter WebTestListResultIterator) Value() WebTest {
1684 if !iter.page.NotDone() {
1685 return WebTest{}
1686 }
1687 return iter.page.Values()[iter.i]
1688 }
1689
1690
1691 func NewWebTestListResultIterator(page WebTestListResultPage) WebTestListResultIterator {
1692 return WebTestListResultIterator{page: page}
1693 }
1694
1695
1696 func (wtlr WebTestListResult) IsEmpty() bool {
1697 return wtlr.Value == nil || len(*wtlr.Value) == 0
1698 }
1699
1700
1701 func (wtlr WebTestListResult) hasNextLink() bool {
1702 return wtlr.NextLink != nil && len(*wtlr.NextLink) != 0
1703 }
1704
1705
1706
1707 func (wtlr WebTestListResult) webTestListResultPreparer(ctx context.Context) (*http.Request, error) {
1708 if !wtlr.hasNextLink() {
1709 return nil, nil
1710 }
1711 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1712 autorest.AsJSON(),
1713 autorest.AsGet(),
1714 autorest.WithBaseURL(to.String(wtlr.NextLink)))
1715 }
1716
1717
1718 type WebTestListResultPage struct {
1719 fn func(context.Context, WebTestListResult) (WebTestListResult, error)
1720 wtlr WebTestListResult
1721 }
1722
1723
1724
1725 func (page *WebTestListResultPage) NextWithContext(ctx context.Context) (err error) {
1726 if tracing.IsEnabled() {
1727 ctx = tracing.StartSpan(ctx, fqdn+"/WebTestListResultPage.NextWithContext")
1728 defer func() {
1729 sc := -1
1730 if page.Response().Response.Response != nil {
1731 sc = page.Response().Response.Response.StatusCode
1732 }
1733 tracing.EndSpan(ctx, sc, err)
1734 }()
1735 }
1736 for {
1737 next, err := page.fn(ctx, page.wtlr)
1738 if err != nil {
1739 return err
1740 }
1741 page.wtlr = next
1742 if !next.hasNextLink() || !next.IsEmpty() {
1743 break
1744 }
1745 }
1746 return nil
1747 }
1748
1749
1750
1751
1752 func (page *WebTestListResultPage) Next() error {
1753 return page.NextWithContext(context.Background())
1754 }
1755
1756
1757 func (page WebTestListResultPage) NotDone() bool {
1758 return !page.wtlr.IsEmpty()
1759 }
1760
1761
1762 func (page WebTestListResultPage) Response() WebTestListResult {
1763 return page.wtlr
1764 }
1765
1766
1767 func (page WebTestListResultPage) Values() []WebTest {
1768 if page.wtlr.IsEmpty() {
1769 return nil
1770 }
1771 return *page.wtlr.Value
1772 }
1773
1774
1775 func NewWebTestListResultPage(cur WebTestListResult, getNextPage func(context.Context, WebTestListResult) (WebTestListResult, error)) WebTestListResultPage {
1776 return WebTestListResultPage{
1777 fn: getNextPage,
1778 wtlr: cur,
1779 }
1780 }
1781
1782
1783 type WebTestProperties struct {
1784
1785 SyntheticMonitorID *string `json:"SyntheticMonitorId,omitempty"`
1786
1787 WebTestName *string `json:"Name,omitempty"`
1788
1789 Description *string `json:"Description,omitempty"`
1790
1791 Enabled *bool `json:"Enabled,omitempty"`
1792
1793 Frequency *int32 `json:"Frequency,omitempty"`
1794
1795 Timeout *int32 `json:"Timeout,omitempty"`
1796
1797 WebTestKind WebTestKind `json:"Kind,omitempty"`
1798
1799 RetryEnabled *bool `json:"RetryEnabled,omitempty"`
1800
1801 Locations *[]WebTestGeolocation `json:"Locations,omitempty"`
1802
1803 Configuration *WebTestPropertiesConfiguration `json:"Configuration,omitempty"`
1804
1805 ProvisioningState *string `json:"provisioningState,omitempty"`
1806 }
1807
1808
1809 func (wtp WebTestProperties) MarshalJSON() ([]byte, error) {
1810 objectMap := make(map[string]interface{})
1811 if wtp.SyntheticMonitorID != nil {
1812 objectMap["SyntheticMonitorId"] = wtp.SyntheticMonitorID
1813 }
1814 if wtp.WebTestName != nil {
1815 objectMap["Name"] = wtp.WebTestName
1816 }
1817 if wtp.Description != nil {
1818 objectMap["Description"] = wtp.Description
1819 }
1820 if wtp.Enabled != nil {
1821 objectMap["Enabled"] = wtp.Enabled
1822 }
1823 if wtp.Frequency != nil {
1824 objectMap["Frequency"] = wtp.Frequency
1825 }
1826 if wtp.Timeout != nil {
1827 objectMap["Timeout"] = wtp.Timeout
1828 }
1829 if wtp.WebTestKind != "" {
1830 objectMap["Kind"] = wtp.WebTestKind
1831 }
1832 if wtp.RetryEnabled != nil {
1833 objectMap["RetryEnabled"] = wtp.RetryEnabled
1834 }
1835 if wtp.Locations != nil {
1836 objectMap["Locations"] = wtp.Locations
1837 }
1838 if wtp.Configuration != nil {
1839 objectMap["Configuration"] = wtp.Configuration
1840 }
1841 return json.Marshal(objectMap)
1842 }
1843
1844
1845 type WebTestPropertiesConfiguration struct {
1846
1847 WebTest *string `json:"WebTest,omitempty"`
1848 }
1849
1850
1851 type WebtestsResource struct {
1852
1853 ID *string `json:"id,omitempty"`
1854
1855 Name *string `json:"name,omitempty"`
1856
1857 Type *string `json:"type,omitempty"`
1858
1859 Location *string `json:"location,omitempty"`
1860
1861 Tags map[string]*string `json:"tags"`
1862 }
1863
1864
1865 func (wr WebtestsResource) MarshalJSON() ([]byte, error) {
1866 objectMap := make(map[string]interface{})
1867 if wr.Location != nil {
1868 objectMap["location"] = wr.Location
1869 }
1870 if wr.Tags != nil {
1871 objectMap["tags"] = wr.Tags
1872 }
1873 return json.Marshal(objectMap)
1874 }
1875
1876
1877 type Workbook struct {
1878 autorest.Response `json:"-"`
1879
1880 Kind SharedTypeKind `json:"kind,omitempty"`
1881
1882 *WorkbookProperties `json:"properties,omitempty"`
1883
1884 ID *string `json:"id,omitempty"`
1885
1886 Name *string `json:"name,omitempty"`
1887
1888 Type *string `json:"type,omitempty"`
1889
1890 Location *string `json:"location,omitempty"`
1891
1892 Tags map[string]*string `json:"tags"`
1893 }
1894
1895
1896 func (w Workbook) MarshalJSON() ([]byte, error) {
1897 objectMap := make(map[string]interface{})
1898 if w.Kind != "" {
1899 objectMap["kind"] = w.Kind
1900 }
1901 if w.WorkbookProperties != nil {
1902 objectMap["properties"] = w.WorkbookProperties
1903 }
1904 if w.Location != nil {
1905 objectMap["location"] = w.Location
1906 }
1907 if w.Tags != nil {
1908 objectMap["tags"] = w.Tags
1909 }
1910 return json.Marshal(objectMap)
1911 }
1912
1913
1914 func (w *Workbook) UnmarshalJSON(body []byte) error {
1915 var m map[string]*json.RawMessage
1916 err := json.Unmarshal(body, &m)
1917 if err != nil {
1918 return err
1919 }
1920 for k, v := range m {
1921 switch k {
1922 case "kind":
1923 if v != nil {
1924 var kind SharedTypeKind
1925 err = json.Unmarshal(*v, &kind)
1926 if err != nil {
1927 return err
1928 }
1929 w.Kind = kind
1930 }
1931 case "properties":
1932 if v != nil {
1933 var workbookProperties WorkbookProperties
1934 err = json.Unmarshal(*v, &workbookProperties)
1935 if err != nil {
1936 return err
1937 }
1938 w.WorkbookProperties = &workbookProperties
1939 }
1940 case "id":
1941 if v != nil {
1942 var ID string
1943 err = json.Unmarshal(*v, &ID)
1944 if err != nil {
1945 return err
1946 }
1947 w.ID = &ID
1948 }
1949 case "name":
1950 if v != nil {
1951 var name string
1952 err = json.Unmarshal(*v, &name)
1953 if err != nil {
1954 return err
1955 }
1956 w.Name = &name
1957 }
1958 case "type":
1959 if v != nil {
1960 var typeVar string
1961 err = json.Unmarshal(*v, &typeVar)
1962 if err != nil {
1963 return err
1964 }
1965 w.Type = &typeVar
1966 }
1967 case "location":
1968 if v != nil {
1969 var location string
1970 err = json.Unmarshal(*v, &location)
1971 if err != nil {
1972 return err
1973 }
1974 w.Location = &location
1975 }
1976 case "tags":
1977 if v != nil {
1978 var tags map[string]*string
1979 err = json.Unmarshal(*v, &tags)
1980 if err != nil {
1981 return err
1982 }
1983 w.Tags = tags
1984 }
1985 }
1986 }
1987
1988 return nil
1989 }
1990
1991
1992 type WorkbookError struct {
1993
1994 Code *string `json:"code,omitempty"`
1995
1996 Message *string `json:"message,omitempty"`
1997
1998 Details *[]ErrorFieldContract `json:"details,omitempty"`
1999 }
2000
2001
2002 type WorkbookProperties struct {
2003
2004 Name *string `json:"name,omitempty"`
2005
2006 SerializedData *string `json:"serializedData,omitempty"`
2007
2008 Version *string `json:"version,omitempty"`
2009
2010 WorkbookID *string `json:"workbookId,omitempty"`
2011
2012 SharedTypeKind SharedTypeKind `json:"kind,omitempty"`
2013
2014 TimeModified *string `json:"timeModified,omitempty"`
2015
2016 Category *string `json:"category,omitempty"`
2017
2018 Tags *[]string `json:"tags,omitempty"`
2019
2020 UserID *string `json:"userId,omitempty"`
2021
2022 SourceResourceID *string `json:"sourceResourceId,omitempty"`
2023 }
2024
2025
2026 func (wp WorkbookProperties) MarshalJSON() ([]byte, error) {
2027 objectMap := make(map[string]interface{})
2028 if wp.Name != nil {
2029 objectMap["name"] = wp.Name
2030 }
2031 if wp.SerializedData != nil {
2032 objectMap["serializedData"] = wp.SerializedData
2033 }
2034 if wp.Version != nil {
2035 objectMap["version"] = wp.Version
2036 }
2037 if wp.WorkbookID != nil {
2038 objectMap["workbookId"] = wp.WorkbookID
2039 }
2040 if wp.SharedTypeKind != "" {
2041 objectMap["kind"] = wp.SharedTypeKind
2042 }
2043 if wp.Category != nil {
2044 objectMap["category"] = wp.Category
2045 }
2046 if wp.Tags != nil {
2047 objectMap["tags"] = wp.Tags
2048 }
2049 if wp.UserID != nil {
2050 objectMap["userId"] = wp.UserID
2051 }
2052 if wp.SourceResourceID != nil {
2053 objectMap["sourceResourceId"] = wp.SourceResourceID
2054 }
2055 return json.Marshal(objectMap)
2056 }
2057
2058
2059 type WorkbookResource struct {
2060
2061 ID *string `json:"id,omitempty"`
2062
2063 Name *string `json:"name,omitempty"`
2064
2065 Type *string `json:"type,omitempty"`
2066
2067 Location *string `json:"location,omitempty"`
2068
2069 Tags map[string]*string `json:"tags"`
2070 }
2071
2072
2073 func (wr WorkbookResource) MarshalJSON() ([]byte, error) {
2074 objectMap := make(map[string]interface{})
2075 if wr.Location != nil {
2076 objectMap["location"] = wr.Location
2077 }
2078 if wr.Tags != nil {
2079 objectMap["tags"] = wr.Tags
2080 }
2081 return json.Marshal(objectMap)
2082 }
2083
2084
2085 type WorkbooksListResult struct {
2086 autorest.Response `json:"-"`
2087
2088 Value *[]Workbook `json:"value,omitempty"`
2089 }
2090
2091
2092 func (wlr WorkbooksListResult) MarshalJSON() ([]byte, error) {
2093 objectMap := make(map[string]interface{})
2094 return json.Marshal(objectMap)
2095 }
2096
2097
2098 type WorkItemConfiguration struct {
2099 autorest.Response `json:"-"`
2100
2101 ConnectorID *string `json:"ConnectorId,omitempty"`
2102
2103 ConfigDisplayName *string `json:"ConfigDisplayName,omitempty"`
2104
2105 IsDefault *bool `json:"IsDefault,omitempty"`
2106
2107 ID *string `json:"Id,omitempty"`
2108
2109 ConfigProperties *string `json:"ConfigProperties,omitempty"`
2110 }
2111
2112
2113 type WorkItemConfigurationError struct {
2114
2115 Code *string `json:"code,omitempty"`
2116
2117 Message *string `json:"message,omitempty"`
2118 Innererror *InnerError `json:"innererror,omitempty"`
2119 }
2120
2121
2122 type WorkItemConfigurationsListResult struct {
2123 autorest.Response `json:"-"`
2124
2125 Value *[]WorkItemConfiguration `json:"value,omitempty"`
2126 }
2127
2128
2129 func (wiclr WorkItemConfigurationsListResult) MarshalJSON() ([]byte, error) {
2130 objectMap := make(map[string]interface{})
2131 return json.Marshal(objectMap)
2132 }
2133
2134
2135 type WorkItemCreateConfiguration struct {
2136
2137 ConnectorID *string `json:"ConnectorId,omitempty"`
2138
2139 ConnectorDataConfiguration *string `json:"ConnectorDataConfiguration,omitempty"`
2140
2141 ValidateOnly *bool `json:"ValidateOnly,omitempty"`
2142
2143 WorkItemProperties map[string]*string `json:"WorkItemProperties"`
2144 }
2145
2146
2147 func (wicc WorkItemCreateConfiguration) MarshalJSON() ([]byte, error) {
2148 objectMap := make(map[string]interface{})
2149 if wicc.ConnectorID != nil {
2150 objectMap["ConnectorId"] = wicc.ConnectorID
2151 }
2152 if wicc.ConnectorDataConfiguration != nil {
2153 objectMap["ConnectorDataConfiguration"] = wicc.ConnectorDataConfiguration
2154 }
2155 if wicc.ValidateOnly != nil {
2156 objectMap["ValidateOnly"] = wicc.ValidateOnly
2157 }
2158 if wicc.WorkItemProperties != nil {
2159 objectMap["WorkItemProperties"] = wicc.WorkItemProperties
2160 }
2161 return json.Marshal(objectMap)
2162 }
2163
View as plain text