/
models.go
5874 lines (5065 loc) · 232 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package mobileengagement
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"net/http"
)
// AudienceOperators enumerates the values for audience operators.
type AudienceOperators string
const (
// EQ ...
EQ AudienceOperators = "EQ"
// GE ...
GE AudienceOperators = "GE"
// GT ...
GT AudienceOperators = "GT"
// LE ...
LE AudienceOperators = "LE"
// LT ...
LT AudienceOperators = "LT"
)
// PossibleAudienceOperatorsValues returns an array of possible values for the AudienceOperators const type.
func PossibleAudienceOperatorsValues() []AudienceOperators {
return []AudienceOperators{EQ, GE, GT, LE, LT}
}
// CampaignFeedbacks enumerates the values for campaign feedbacks.
type CampaignFeedbacks string
const (
// Actioned ...
Actioned CampaignFeedbacks = "actioned"
// Exited ...
Exited CampaignFeedbacks = "exited"
// Pushed ...
Pushed CampaignFeedbacks = "pushed"
// Replied ...
Replied CampaignFeedbacks = "replied"
)
// PossibleCampaignFeedbacksValues returns an array of possible values for the CampaignFeedbacks const type.
func PossibleCampaignFeedbacksValues() []CampaignFeedbacks {
return []CampaignFeedbacks{Actioned, Exited, Pushed, Replied}
}
// CampaignKinds enumerates the values for campaign kinds.
type CampaignKinds string
const (
// Announcements ...
Announcements CampaignKinds = "announcements"
// DataPushes ...
DataPushes CampaignKinds = "dataPushes"
// NativePushes ...
NativePushes CampaignKinds = "nativePushes"
// Polls ...
Polls CampaignKinds = "polls"
)
// PossibleCampaignKindsValues returns an array of possible values for the CampaignKinds const type.
func PossibleCampaignKindsValues() []CampaignKinds {
return []CampaignKinds{Announcements, DataPushes, NativePushes, Polls}
}
// CampaignStates enumerates the values for campaign states.
type CampaignStates string
const (
// Draft ...
Draft CampaignStates = "draft"
// Finished ...
Finished CampaignStates = "finished"
// InProgress ...
InProgress CampaignStates = "in-progress"
// Queued ...
Queued CampaignStates = "queued"
// Scheduled ...
Scheduled CampaignStates = "scheduled"
)
// PossibleCampaignStatesValues returns an array of possible values for the CampaignStates const type.
func PossibleCampaignStatesValues() []CampaignStates {
return []CampaignStates{Draft, Finished, InProgress, Queued, Scheduled}
}
// CampaignType enumerates the values for campaign type.
type CampaignType string
const (
// Announcement ...
Announcement CampaignType = "Announcement"
// DataPush ...
DataPush CampaignType = "DataPush"
// NativePush ...
NativePush CampaignType = "NativePush"
// Poll ...
Poll CampaignType = "Poll"
)
// PossibleCampaignTypeValues returns an array of possible values for the CampaignType const type.
func PossibleCampaignTypeValues() []CampaignType {
return []CampaignType{Announcement, DataPush, NativePush, Poll}
}
// CampaignTypes enumerates the values for campaign types.
type CampaignTypes string
const (
// OnlyNotif ...
OnlyNotif CampaignTypes = "only_notif"
// Textbase64 ...
Textbase64 CampaignTypes = "text/base64"
// Texthtml ...
Texthtml CampaignTypes = "text/html"
// Textplain ...
Textplain CampaignTypes = "text/plain"
)
// PossibleCampaignTypesValues returns an array of possible values for the CampaignTypes const type.
func PossibleCampaignTypesValues() []CampaignTypes {
return []CampaignTypes{OnlyNotif, Textbase64, Texthtml, Textplain}
}
// DeliveryTimes enumerates the values for delivery times.
type DeliveryTimes string
const (
// Any ...
Any DeliveryTimes = "any"
// Background ...
Background DeliveryTimes = "background"
// Session ...
Session DeliveryTimes = "session"
)
// PossibleDeliveryTimesValues returns an array of possible values for the DeliveryTimes const type.
func PossibleDeliveryTimesValues() []DeliveryTimes {
return []DeliveryTimes{Any, Background, Session}
}
// ExportFormat enumerates the values for export format.
type ExportFormat string
const (
// CsvBlob ...
CsvBlob ExportFormat = "CsvBlob"
// JSONBlob ...
JSONBlob ExportFormat = "JsonBlob"
)
// PossibleExportFormatValues returns an array of possible values for the ExportFormat const type.
func PossibleExportFormatValues() []ExportFormat {
return []ExportFormat{CsvBlob, JSONBlob}
}
// ExportState enumerates the values for export state.
type ExportState string
const (
// ExportStateFailed ...
ExportStateFailed ExportState = "Failed"
// ExportStateQueued ...
ExportStateQueued ExportState = "Queued"
// ExportStateStarted ...
ExportStateStarted ExportState = "Started"
// ExportStateSucceeded ...
ExportStateSucceeded ExportState = "Succeeded"
)
// PossibleExportStateValues returns an array of possible values for the ExportState const type.
func PossibleExportStateValues() []ExportState {
return []ExportState{ExportStateFailed, ExportStateQueued, ExportStateStarted, ExportStateSucceeded}
}
// ExportType enumerates the values for export type.
type ExportType string
const (
// ExportTypeActivity ...
ExportTypeActivity ExportType = "Activity"
// ExportTypeCrash ...
ExportTypeCrash ExportType = "Crash"
// ExportTypeError ...
ExportTypeError ExportType = "Error"
// ExportTypeEvent ...
ExportTypeEvent ExportType = "Event"
// ExportTypeJob ...
ExportTypeJob ExportType = "Job"
// ExportTypePush ...
ExportTypePush ExportType = "Push"
// ExportTypeSession ...
ExportTypeSession ExportType = "Session"
// ExportTypeTag ...
ExportTypeTag ExportType = "Tag"
// ExportTypeToken ...
ExportTypeToken ExportType = "Token"
)
// PossibleExportTypeValues returns an array of possible values for the ExportType const type.
func PossibleExportTypeValues() []ExportType {
return []ExportType{ExportTypeActivity, ExportTypeCrash, ExportTypeError, ExportTypeEvent, ExportTypeJob, ExportTypePush, ExportTypeSession, ExportTypeTag, ExportTypeToken}
}
// JobStates enumerates the values for job states.
type JobStates string
const (
// JobStatesFailed ...
JobStatesFailed JobStates = "Failed"
// JobStatesQueued ...
JobStatesQueued JobStates = "Queued"
// JobStatesStarted ...
JobStatesStarted JobStates = "Started"
// JobStatesSucceeded ...
JobStatesSucceeded JobStates = "Succeeded"
)
// PossibleJobStatesValues returns an array of possible values for the JobStates const type.
func PossibleJobStatesValues() []JobStates {
return []JobStates{JobStatesFailed, JobStatesQueued, JobStatesStarted, JobStatesSucceeded}
}
// NotificationTypes enumerates the values for notification types.
type NotificationTypes string
const (
// Popup ...
Popup NotificationTypes = "popup"
// System ...
System NotificationTypes = "system"
)
// PossibleNotificationTypesValues returns an array of possible values for the NotificationTypes const type.
func PossibleNotificationTypesValues() []NotificationTypes {
return []NotificationTypes{Popup, System}
}
// ProvisioningStates enumerates the values for provisioning states.
type ProvisioningStates string
const (
// Creating ...
Creating ProvisioningStates = "Creating"
// Succeeded ...
Succeeded ProvisioningStates = "Succeeded"
)
// PossibleProvisioningStatesValues returns an array of possible values for the ProvisioningStates const type.
func PossibleProvisioningStatesValues() []ProvisioningStates {
return []ProvisioningStates{Creating, Succeeded}
}
// PushModes enumerates the values for push modes.
type PushModes string
const (
// Manual ...
Manual PushModes = "manual"
// OneShot ...
OneShot PushModes = "one-shot"
// RealTime ...
RealTime PushModes = "real-time"
)
// PossiblePushModesValues returns an array of possible values for the PushModes const type.
func PossiblePushModesValues() []PushModes {
return []PushModes{Manual, OneShot, RealTime}
}
// Type enumerates the values for type.
type Type string
const (
// TypeAnnouncementFeedback ...
TypeAnnouncementFeedback Type = "announcement-feedback"
// TypeApplicationVersion ...
TypeApplicationVersion Type = "application-version"
// TypeBooleanTag ...
TypeBooleanTag Type = "boolean-tag"
// TypeCarrierCountry ...
TypeCarrierCountry Type = "carrier-country"
// TypeCarrierName ...
TypeCarrierName Type = "carrier-name"
// TypeCriterion ...
TypeCriterion Type = "Criterion"
// TypeDatapushFeedback ...
TypeDatapushFeedback Type = "datapush-feedback"
// TypeDateTag ...
TypeDateTag Type = "date-tag"
// TypeDeviceManufacturer ...
TypeDeviceManufacturer Type = "device-manufacturer"
// TypeDeviceModel ...
TypeDeviceModel Type = "device-model"
// TypeFirmwareVersion ...
TypeFirmwareVersion Type = "firmware-version"
// TypeGeoFencing ...
TypeGeoFencing Type = "geo-fencing"
// TypeIntegerTag ...
TypeIntegerTag Type = "integer-tag"
// TypeLanguage ...
TypeLanguage Type = "language"
// TypeLocation ...
TypeLocation Type = "location"
// TypeNetworkType ...
TypeNetworkType Type = "network-type"
// TypePollAnswerFeedback ...
TypePollAnswerFeedback Type = "poll-answer-feedback"
// TypePollFeedback ...
TypePollFeedback Type = "poll-feedback"
// TypeScreenSize ...
TypeScreenSize Type = "screen-size"
// TypeSegment ...
TypeSegment Type = "segment"
// TypeStringTag ...
TypeStringTag Type = "string-tag"
)
// PossibleTypeValues returns an array of possible values for the Type const type.
func PossibleTypeValues() []Type {
return []Type{TypeAnnouncementFeedback, TypeApplicationVersion, TypeBooleanTag, TypeCarrierCountry, TypeCarrierName, TypeCriterion, TypeDatapushFeedback, TypeDateTag, TypeDeviceManufacturer, TypeDeviceModel, TypeFirmwareVersion, TypeGeoFencing, TypeIntegerTag, TypeLanguage, TypeLocation, TypeNetworkType, TypePollAnswerFeedback, TypePollFeedback, TypeScreenSize, TypeSegment, TypeStringTag}
}
// TypeBasicFilter enumerates the values for type basic filter.
type TypeBasicFilter string
const (
// TypeAppInfo ...
TypeAppInfo TypeBasicFilter = "app-info"
// TypeEngageActiveUsers ...
TypeEngageActiveUsers TypeBasicFilter = "engage-active-users"
// TypeEngageIdleUsers ...
TypeEngageIdleUsers TypeBasicFilter = "engage-idle-users"
// TypeEngageNewUsers ...
TypeEngageNewUsers TypeBasicFilter = "engage-new-users"
// TypeEngageOldUsers ...
TypeEngageOldUsers TypeBasicFilter = "engage-old-users"
// TypeEngageSubset ...
TypeEngageSubset TypeBasicFilter = "engage-subset"
// TypeFilter ...
TypeFilter TypeBasicFilter = "Filter"
// TypeNativePushEnabled ...
TypeNativePushEnabled TypeBasicFilter = "native-push-enabled"
// TypePushQuota ...
TypePushQuota TypeBasicFilter = "push-quota"
)
// PossibleTypeBasicFilterValues returns an array of possible values for the TypeBasicFilter const type.
func PossibleTypeBasicFilterValues() []TypeBasicFilter {
return []TypeBasicFilter{TypeAppInfo, TypeEngageActiveUsers, TypeEngageIdleUsers, TypeEngageNewUsers, TypeEngageOldUsers, TypeEngageSubset, TypeFilter, TypeNativePushEnabled, TypePushQuota}
}
// AnnouncementFeedbackCriterion used to target devices who received an announcement.
type AnnouncementFeedbackCriterion struct {
// ContentID - The unique identifier of the announcement.
ContentID *int32 `json:"content-id,omitempty"`
// Action - Action that was performed on the announcement. Possible values include: 'Pushed', 'Replied', 'Actioned', 'Exited'
Action CampaignFeedbacks `json:"action,omitempty"`
// Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag'
Type Type `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) MarshalJSON() ([]byte, error) {
afc.Type = TypeAnnouncementFeedback
objectMap := make(map[string]interface{})
if afc.ContentID != nil {
objectMap["content-id"] = afc.ContentID
}
if afc.Action != "" {
objectMap["action"] = afc.Action
}
if afc.Type != "" {
objectMap["type"] = afc.Type
}
return json.Marshal(objectMap)
}
// AsCarrierNameCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) {
return nil, false
}
// AsCarrierCountryCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) {
return nil, false
}
// AsFirmwareVersionCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) {
return nil, false
}
// AsDeviceManufacturerCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) {
return nil, false
}
// AsDeviceModelCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) {
return nil, false
}
// AsApplicationVersionCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) {
return nil, false
}
// AsNetworkTypeCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) {
return nil, false
}
// AsLanguageCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) {
return nil, false
}
// AsScreenSizeCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) {
return nil, false
}
// AsLocationCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsLocationCriterion() (*LocationCriterion, bool) {
return nil, false
}
// AsGeoFencingCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsGeoFencingCriterion() (*GeoFencingCriterion, bool) {
return nil, false
}
// AsAnnouncementFeedbackCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsAnnouncementFeedbackCriterion() (*AnnouncementFeedbackCriterion, bool) {
return &afc, true
}
// AsPollFeedbackCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsPollFeedbackCriterion() (*PollFeedbackCriterion, bool) {
return nil, false
}
// AsPollAnswerFeedbackCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsPollAnswerFeedbackCriterion() (*PollAnswerFeedbackCriterion, bool) {
return nil, false
}
// AsDatapushFeedbackCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsDatapushFeedbackCriterion() (*DatapushFeedbackCriterion, bool) {
return nil, false
}
// AsSegmentCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsSegmentCriterion() (*SegmentCriterion, bool) {
return nil, false
}
// AsStringTagCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsStringTagCriterion() (*StringTagCriterion, bool) {
return nil, false
}
// AsDateTagCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsDateTagCriterion() (*DateTagCriterion, bool) {
return nil, false
}
// AsIntegerTagCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsIntegerTagCriterion() (*IntegerTagCriterion, bool) {
return nil, false
}
// AsBooleanTagCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsBooleanTagCriterion() (*BooleanTagCriterion, bool) {
return nil, false
}
// AsCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsCriterion() (*Criterion, bool) {
return nil, false
}
// AsBasicCriterion is the BasicCriterion implementation for AnnouncementFeedbackCriterion.
func (afc AnnouncementFeedbackCriterion) AsBasicCriterion() (BasicCriterion, bool) {
return &afc, true
}
// APIError ...
type APIError struct {
Error *APIErrorError `json:"error,omitempty"`
}
// APIErrorError ...
type APIErrorError struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
}
// App the Mobile Engagement App resource.
type App struct {
*AppProperties `json:"properties,omitempty"`
// ID - Resource Id
ID *string `json:"id,omitempty"`
// Name - Resource name
Name *string `json:"name,omitempty"`
// Type - Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
// Tags - Resource tags
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for App.
func (a App) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if a.AppProperties != nil {
objectMap["properties"] = a.AppProperties
}
if a.ID != nil {
objectMap["id"] = a.ID
}
if a.Name != nil {
objectMap["name"] = a.Name
}
if a.Type != nil {
objectMap["type"] = a.Type
}
if a.Location != nil {
objectMap["location"] = a.Location
}
if a.Tags != nil {
objectMap["tags"] = a.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for App struct.
func (a *App) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var appProperties AppProperties
err = json.Unmarshal(*v, &appProperties)
if err != nil {
return err
}
a.AppProperties = &appProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
a.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
a.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
a.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
a.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
a.Tags = tags
}
}
}
return nil
}
// AppCollection the AppCollection resource.
type AppCollection struct {
*AppCollectionProperties `json:"properties,omitempty"`
// ID - Resource Id
ID *string `json:"id,omitempty"`
// Name - Resource name
Name *string `json:"name,omitempty"`
// Type - Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
// Tags - Resource tags
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for AppCollection.
func (ac AppCollection) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ac.AppCollectionProperties != nil {
objectMap["properties"] = ac.AppCollectionProperties
}
if ac.ID != nil {
objectMap["id"] = ac.ID
}
if ac.Name != nil {
objectMap["name"] = ac.Name
}
if ac.Type != nil {
objectMap["type"] = ac.Type
}
if ac.Location != nil {
objectMap["location"] = ac.Location
}
if ac.Tags != nil {
objectMap["tags"] = ac.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for AppCollection struct.
func (ac *AppCollection) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var appCollectionProperties AppCollectionProperties
err = json.Unmarshal(*v, &appCollectionProperties)
if err != nil {
return err
}
ac.AppCollectionProperties = &appCollectionProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ac.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ac.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ac.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
ac.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
ac.Tags = tags
}
}
}
return nil
}
// AppCollectionListResult the list AppCollections operation response.
type AppCollectionListResult struct {
autorest.Response `json:"-"`
// Value - The list of AppCollections and their properties.
Value *[]AppCollection `json:"value,omitempty"`
// NextLink - When the results are paged, the nextLink is the URI for the next page of results. This property is empty when there are no additional pages.
NextLink *string `json:"nextLink,omitempty"`
}
// AppCollectionListResultIterator provides access to a complete listing of AppCollection values.
type AppCollectionListResultIterator struct {
i int
page AppCollectionListResultPage
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *AppCollectionListResultIterator) Next() error {
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err := iter.page.Next()
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter AppCollectionListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter AppCollectionListResultIterator) Response() AppCollectionListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter AppCollectionListResultIterator) Value() AppCollection {
if !iter.page.NotDone() {
return AppCollection{}
}
return iter.page.Values()[iter.i]
}
// IsEmpty returns true if the ListResult contains no values.
func (aclr AppCollectionListResult) IsEmpty() bool {
return aclr.Value == nil || len(*aclr.Value) == 0
}
// appCollectionListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (aclr AppCollectionListResult) appCollectionListResultPreparer() (*http.Request, error) {
if aclr.NextLink == nil || len(to.String(aclr.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(aclr.NextLink)))
}
// AppCollectionListResultPage contains a page of AppCollection values.
type AppCollectionListResultPage struct {
fn func(AppCollectionListResult) (AppCollectionListResult, error)
aclr AppCollectionListResult
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *AppCollectionListResultPage) Next() error {
next, err := page.fn(page.aclr)
if err != nil {
return err
}
page.aclr = next
return nil
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page AppCollectionListResultPage) NotDone() bool {
return !page.aclr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page AppCollectionListResultPage) Response() AppCollectionListResult {
return page.aclr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page AppCollectionListResultPage) Values() []AppCollection {
if page.aclr.IsEmpty() {
return nil
}
return *page.aclr.Value
}
// AppCollectionNameAvailability ...
type AppCollectionNameAvailability struct {
autorest.Response `json:"-"`
// Name - Name.
Name *string `json:"name,omitempty"`
// Available - Available.
Available *bool `json:"available,omitempty"`
// UnavailabilityReason - UnavailabilityReason.
UnavailabilityReason *string `json:"unavailabilityReason,omitempty"`
}
// AppCollectionProperties ...
type AppCollectionProperties struct {
// ProvisioningState - Mobile Engagement AppCollection Properties. Possible values include: 'Creating', 'Succeeded'
ProvisioningState ProvisioningStates `json:"provisioningState,omitempty"`
}
// AppInfoFilter send only to users who have some app info set. This is a special filter that is automatically
// added if your campaign contains appInfo parameters. It is not intended to be public and should not be used as it
// could be removed or replaced by the API.
type AppInfoFilter struct {
// AppInfo - An array containing all the required appInfo.
AppInfo *[]string `json:"appInfo,omitempty"`
// Type - Possible values include: 'TypeFilter', 'TypeEngageSubset', 'TypeEngageOldUsers', 'TypeEngageNewUsers', 'TypeEngageActiveUsers', 'TypeEngageIdleUsers', 'TypeNativePushEnabled', 'TypePushQuota', 'TypeAppInfo'
Type TypeBasicFilter `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for AppInfoFilter.
func (aif AppInfoFilter) MarshalJSON() ([]byte, error) {
aif.Type = TypeAppInfo
objectMap := make(map[string]interface{})
if aif.AppInfo != nil {
objectMap["appInfo"] = aif.AppInfo
}
if aif.Type != "" {
objectMap["type"] = aif.Type
}
return json.Marshal(objectMap)
}
// AsEngageSubsetFilter is the BasicFilter implementation for AppInfoFilter.
func (aif AppInfoFilter) AsEngageSubsetFilter() (*EngageSubsetFilter, bool) {
return nil, false
}
// AsEngageOldUsersFilter is the BasicFilter implementation for AppInfoFilter.
func (aif AppInfoFilter) AsEngageOldUsersFilter() (*EngageOldUsersFilter, bool) {
return nil, false
}
// AsEngageNewUsersFilter is the BasicFilter implementation for AppInfoFilter.
func (aif AppInfoFilter) AsEngageNewUsersFilter() (*EngageNewUsersFilter, bool) {
return nil, false
}
// AsEngageActiveUsersFilter is the BasicFilter implementation for AppInfoFilter.
func (aif AppInfoFilter) AsEngageActiveUsersFilter() (*EngageActiveUsersFilter, bool) {
return nil, false
}
// AsEngageIdleUsersFilter is the BasicFilter implementation for AppInfoFilter.
func (aif AppInfoFilter) AsEngageIdleUsersFilter() (*EngageIdleUsersFilter, bool) {
return nil, false
}
// AsNativePushEnabledFilter is the BasicFilter implementation for AppInfoFilter.
func (aif AppInfoFilter) AsNativePushEnabledFilter() (*NativePushEnabledFilter, bool) {
return nil, false
}
// AsPushQuotaFilter is the BasicFilter implementation for AppInfoFilter.
func (aif AppInfoFilter) AsPushQuotaFilter() (*PushQuotaFilter, bool) {
return nil, false
}
// AsAppInfoFilter is the BasicFilter implementation for AppInfoFilter.
func (aif AppInfoFilter) AsAppInfoFilter() (*AppInfoFilter, bool) {
return &aif, true
}
// AsFilter is the BasicFilter implementation for AppInfoFilter.
func (aif AppInfoFilter) AsFilter() (*Filter, bool) {
return nil, false
}
// AsBasicFilter is the BasicFilter implementation for AppInfoFilter.
func (aif AppInfoFilter) AsBasicFilter() (BasicFilter, bool) {
return &aif, true
}
// ApplicationVersionCriterion used to target devices based on the version of the application they are using.
type ApplicationVersionCriterion struct {
// Name - The application version.
Name *string `json:"name,omitempty"`
// Type - Possible values include: 'TypeCriterion', 'TypeCarrierName', 'TypeCarrierCountry', 'TypeFirmwareVersion', 'TypeDeviceManufacturer', 'TypeDeviceModel', 'TypeApplicationVersion', 'TypeNetworkType', 'TypeLanguage', 'TypeScreenSize', 'TypeLocation', 'TypeGeoFencing', 'TypeAnnouncementFeedback', 'TypePollFeedback', 'TypePollAnswerFeedback', 'TypeDatapushFeedback', 'TypeSegment', 'TypeStringTag', 'TypeDateTag', 'TypeIntegerTag', 'TypeBooleanTag'
Type Type `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for ApplicationVersionCriterion.
func (avc ApplicationVersionCriterion) MarshalJSON() ([]byte, error) {
avc.Type = TypeApplicationVersion
objectMap := make(map[string]interface{})
if avc.Name != nil {
objectMap["name"] = avc.Name
}
if avc.Type != "" {
objectMap["type"] = avc.Type
}
return json.Marshal(objectMap)
}
// AsCarrierNameCriterion is the BasicCriterion implementation for ApplicationVersionCriterion.
func (avc ApplicationVersionCriterion) AsCarrierNameCriterion() (*CarrierNameCriterion, bool) {
return nil, false
}
// AsCarrierCountryCriterion is the BasicCriterion implementation for ApplicationVersionCriterion.
func (avc ApplicationVersionCriterion) AsCarrierCountryCriterion() (*CarrierCountryCriterion, bool) {
return nil, false
}
// AsFirmwareVersionCriterion is the BasicCriterion implementation for ApplicationVersionCriterion.
func (avc ApplicationVersionCriterion) AsFirmwareVersionCriterion() (*FirmwareVersionCriterion, bool) {
return nil, false
}
// AsDeviceManufacturerCriterion is the BasicCriterion implementation for ApplicationVersionCriterion.
func (avc ApplicationVersionCriterion) AsDeviceManufacturerCriterion() (*DeviceManufacturerCriterion, bool) {
return nil, false
}
// AsDeviceModelCriterion is the BasicCriterion implementation for ApplicationVersionCriterion.
func (avc ApplicationVersionCriterion) AsDeviceModelCriterion() (*DeviceModelCriterion, bool) {
return nil, false
}
// AsApplicationVersionCriterion is the BasicCriterion implementation for ApplicationVersionCriterion.
func (avc ApplicationVersionCriterion) AsApplicationVersionCriterion() (*ApplicationVersionCriterion, bool) {
return &avc, true
}
// AsNetworkTypeCriterion is the BasicCriterion implementation for ApplicationVersionCriterion.
func (avc ApplicationVersionCriterion) AsNetworkTypeCriterion() (*NetworkTypeCriterion, bool) {
return nil, false
}
// AsLanguageCriterion is the BasicCriterion implementation for ApplicationVersionCriterion.
func (avc ApplicationVersionCriterion) AsLanguageCriterion() (*LanguageCriterion, bool) {
return nil, false
}
// AsScreenSizeCriterion is the BasicCriterion implementation for ApplicationVersionCriterion.
func (avc ApplicationVersionCriterion) AsScreenSizeCriterion() (*ScreenSizeCriterion, bool) {
return nil, false
}
// AsLocationCriterion is the BasicCriterion implementation for ApplicationVersionCriterion.
func (avc ApplicationVersionCriterion) AsLocationCriterion() (*LocationCriterion, bool) {
return nil, false
}
// AsGeoFencingCriterion is the BasicCriterion implementation for ApplicationVersionCriterion.