-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathresources.go
1215 lines (1113 loc) · 48.6 KB
/
resources.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 resources provides mailjet resources properties. This is an helper and
// not a mandatory package.
package resources
import (
"bytes"
"time"
)
//
// Resources Properties
//
// Aggregategraphstatistics: Aggregated campaign statistics grouped over intervals.
type Aggregategraphstatistics struct {
BlockedCount float64 `mailjet:"read_only"`
BlockedStdDev float64 `mailjet:"read_only"`
BouncedCount float64 `mailjet:"read_only"`
BouncedStdDev float64 `mailjet:"read_only"`
CampaignAggregateID int `mailjet:"read_only"`
ClickedCount float64 `mailjet:"read_only"`
ClickedStdDev float64 `mailjet:"read_only"`
OpenedCount float64 `mailjet:"read_only"`
OpenedStdDev float64 `mailjet:"read_only"`
RefTimestamp int `mailjet:"read_only"`
SentCount float64 `mailjet:"read_only"`
SentStdDev float64 `mailjet:"read_only"`
SpamComplaintCount float64 `mailjet:"read_only"`
SpamcomplaintStdDev float64 `mailjet:"read_only"`
UnsubscribedCount float64 `mailjet:"read_only"`
UnsubscribedStdDev float64 `mailjet:"read_only"`
}
// Apikey: Manage your Mailjet API Keys.
// API keys are used as credentials to access the API and SMTP server.
type Apikey struct {
ACL string `json:",omitempty"`
APIKey string `mailjet:"read_only"`
CreatedAt *RFC3339DateTime `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
IsActive bool `json:",omitempty"`
IsMaster bool `mailjet:"read_only"`
Name string
QuarantineValue int `mailjet:"read_only"`
Runlevel RunLevel `mailjet:"read_only"`
SecretKey string `mailjet:"read_only"`
TrackHost string `mailjet:"read_only"`
UserID int64 `mailjet:"read_only"`
}
// Apikeyaccess: Access rights description on API keys for subaccounts/users.
type Apikeyaccess struct {
AllowedAccess string `json:",omitempty"`
APIKeyID int64 `json:",omitempty"`
APIKeyALT string `json:",omitempty"`
CreatedAt *RFC3339DateTime `json:",omitempty"`
CustomName string `json:",omitempty"`
ID int64 `mailjet:"read_only"`
IsActive bool `json:",omitempty"`
LastActivityAt *RFC3339DateTime `json:",omitempty"`
RealUserID int64 `json:",omitempty"`
RealUserALT string `json:",omitempty"`
Subaccount *SubAccount `json:",omitempty"`
UserID int64 `json:",omitempty"`
UserALT string `json:",omitempty"`
}
// Apikeytotals: Global counts for an API Key, since its creation.
type Apikeytotals struct {
BlockedCount int64 `mailjet:"read_only"`
BouncedCount int64 `mailjet:"read_only"`
ClickedCount int64 `mailjet:"read_only"`
DeliveredCount int64 `mailjet:"read_only"`
LastActivity int64 `mailjet:"read_only"`
OpenedCount int64 `mailjet:"read_only"`
ProcessedCount int64 `mailjet:"read_only"`
QueuedCount int64 `mailjet:"read_only"`
SpamcomplaintCount int64 `mailjet:"read_only"`
UnsubscribedCount int64 `mailjet:"read_only"`
}
// Apitoken: Access token for API, used to give access to an API Key in conjunction with our IFrame API.
type Apitoken struct {
ACL string `json:",omitempty"`
AllowedAccess string
APIKeyID int64 `json:",omitempty"`
APIKeyALT string `json:",omitempty"`
CatchedIP string `json:"CatchedIp,omitempty"`
CreatedAt *RFC3339DateTime `json:",omitempty"`
FirstUsedAt *RFC3339DateTime `json:",omitempty"`
ID int64 `mailjet:"read_only"`
IsActive bool `json:",omitempty"`
Lang string `json:",omitempty"`
LastUsedAt *RFC3339DateTime `json:",omitempty"`
SentData string `json:",omitempty"`
Timezone string `json:",omitempty"`
Token string `json:",omitempty"`
TokenType string
ValidFor int `json:",omitempty"`
}
// Axtesting: AX testing object
type Axtesting struct {
ContactListID int64 `json:",omitempty"`
ContactListALT string `json:",omitempty"`
CreatedAt *RFC3339DateTime `json:",omitempty"`
Deleted bool `json:",omitempty"`
ID int64 `mailjet:"read_only"`
Mode AXTestMode `json:",omitempty"`
Name string `json:",omitempty"`
Percentage float64 `json:",omitempty"`
RemainderAt *RFC3339DateTime `json:",omitempty"`
SegmentationID int64 `json:",omitempty"`
SegmentationALT string `json:",omitempty"`
Starred bool `json:",omitempty"`
StartAt *RFC3339DateTime `json:",omitempty"`
Status string `json:",omitempty"`
StatusCode int `mailjet:"read_only"`
StatusString string `json:",omitempty"`
WinnerClickRate float64 `json:",omitempty"`
WinnerID int `json:",omitempty"`
WinnerMethod WinnerMethod `json:",omitempty"`
WinnerOpenRate float64 `json:",omitempty"`
WinnerSpamRate float64 `json:",omitempty"`
WinnerUnsubRate float64 `json:",omitempty"`
}
// Batchjob: Batch jobs running on the Mailjet infrastructure.
type Batchjob struct {
AliveAt int64 `json:",omitempty"`
APIKeyID int64 `json:",omitempty"`
APIKeyALT string `json:",omitempty"`
Blocksize int `json:",omitempty"`
Count int `json:",omitempty"`
Current int `json:",omitempty"`
Data *BaseData
Errcount int `json:",omitempty"`
ErrTreshold int `json:",omitempty"`
ID int64 `mailjet:"read_only"`
JobEnd int64 `json:",omitempty"`
JobStart int64 `json:",omitempty"`
JobType string
Method string `json:",omitempty"`
RefID int64 `json:"RefID,omitempty"`
RequestAt int64 `json:",omitempty"`
Status string `json:",omitempty"`
Throttle int `json:",omitempty"`
}
type Contactsjob struct {
Count int64
Error string
ErrorFile string
Status string
JobStart string
JobEnd string
}
// Bouncestatistics: Statistics on the bounces generated by emails sent on a given API Key.
type Bouncestatistics struct {
BouncedAt *RFC3339DateTime `mailjet:"read_only"`
CampaignID int64 `mailjet:"read_only"`
CampaignALT string `mailjet:"read_only"`
ContactID int64 `mailjet:"read_only"`
ContactALT string `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
IsBlocked bool `mailjet:"read_only"`
IsStatePermanent bool `mailjet:"read_only"`
StateID int64 `mailjet:"read_only"`
}
// Campaign: Historical view of sent emails, both transactional and marketing.
// Each e-mail going through Mailjet is attached to a Campaign.
// This object is automatically generated by Mailjet.
type Campaign struct {
CampaignType int `mailjet:"read_only"`
ClickTracked int64 `mailjet:"read_only"`
CreatedAt *RFC3339DateTime `mailjet:"read_only"`
CustomValue string `mailjet:"read_only"`
FirstMessageID int64 `mailjet:"read_only"`
FromID int64 `mailjet:"read_only"`
FromALT string `mailjet:"read_only"`
FromEmail string `mailjet:"read_only"`
FromName string `mailjet:"read_only"`
HasHtmlCount int64 `mailjet:"read_only"`
HasTxtCount int64 `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
IsDeleted bool `json:",omitempty"`
IsStarred bool `json:",omitempty"`
ListID int64 `mailjet:"read_only"`
ListALT string `mailjet:"read_only"`
NewsLetterID int64 `mailjet:"read_only"`
OpenTracked int64 `mailjet:"read_only"`
SegmentationID int64 `mailjet:"read_only"`
SegmentationALT string `mailjet:"read_only"`
SendEndAt *RFC3339DateTime `mailjet:"read_only"`
SendStartAt *RFC3339DateTime `mailjet:"read_only"`
SpamassScore float64 `mailjet:"read_only"`
Status string `mailjet:"read_only"`
Subject string `mailjet:"read_only"`
UnsubscribeTrackedCount int64 `mailjet:"read_only"`
}
// Campaignaggregate: User defined campaign aggregates
type Campaignaggregate struct {
CampaignIDS string `json:",omitempty"`
ContactFilterID int64 `json:",omitempty"`
ContactFilterALT string `json:",omitempty"`
ContactsListID int64 `json:",omitempty"`
ContactsListALT string `json:",omitempty"`
Final bool `mailjet:"read_only"`
FromDate *RFC3339DateTime `json:",omitempty"`
ID int64 `mailjet:"read_only"`
Keyword string `json:",omitempty"`
Name string `json:",omitempty"`
SenderID int64 `json:",omitempty"`
SenderALT string `json:",omitempty"`
ToDate *RFC3339DateTime `json:",omitempty"`
}
// Campaigndraft: Newsletter and CampaignDraft objects are differentiated by the EditMode values.
type Campaigndraft struct {
AXFractionName string `json:",omitempty"`
AXTesting *Axtesting `json:",omitempty"`
CampaignID int64 `json:",omitempty"`
CampaignALT string `json:",omitempty"`
ContactsListID int64 `json:",omitempty"`
ContactsListALT string `json:",omitempty"`
CreatedAt *RFC3339DateTime `json:",omitempty"`
Current int64 `json:",omitempty"`
DeliveredAt *RFC3339DateTime `json:",omitempty"`
EditMode string `json:",omitempty"`
ID int64 `mailjet:"read_only"`
IsStarred bool `json:",omitempty"`
IsTextPartIncluded bool `json:",omitempty"`
Locale string
ModifiedAt *RFC3339DateTime `json:",omitempty"`
Preset string `json:",omitempty"`
ReplyEmail string `json:",omitempty"`
SegmentationID int64 `json:",omitempty"`
SegmentationALT string `json:",omitempty"`
Sender string
SenderEmail string
SenderName string `json:",omitempty"`
Status int64 `mailjet:"read_only"`
Subject string
TemplateID int64 `json:",omitempty"`
TemplateALT string `json:",omitempty"`
Title string `json:",omitempty"`
URL string `json:"Url,omitempty"`
Used bool `json:",omitempty"`
}
// CampaigndraftSchedule:
type CampaigndraftSchedule struct {
Date *RFC3339DateTime
}
// CampaigndraftTest:
type CampaigndraftTest struct {
Recipients []Recipient
}
// CampaigndraftDetailcontent:
type CampaigndraftDetailcontent struct {
TextPart string `json:"Text-part,omitempty"`
HtmlPart string `json:"Html-part,omitempty"`
MJMLContent string `json:",omitempty"`
Headers interface{} `json:",omitempty"`
}
// Campaigngraphstatistics: API Campaign statistics grouped over intervals
type Campaigngraphstatistics struct {
Clickcount int64 `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
Opencount int64 `mailjet:"read_only"`
Spamcount int64 `mailjet:"read_only"`
Tick int64 `mailjet:"read_only"`
Unsubcount int64 `mailjet:"read_only"`
}
// Campaignoverview: Returns a list of campaigns, including the AX campaigns
type Campaignoverview struct {
ClickedCount int64 `mailjet:"read_only"`
DeliveredCount int64 `mailjet:"read_only"`
EditMode string `mailjet:"read_only"`
EditType string `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
IDType string `mailjet:"read_only"`
OpenedCount int64 `mailjet:"read_only"`
ProcessedCount int64 `mailjet:"read_only"`
SendTimeStart int64 `mailjet:"read_only"`
Starred bool `mailjet:"read_only"`
Status int `mailjet:"read_only"`
Subject string `mailjet:"read_only"`
Title string `mailjet:"read_only"`
}
// Campaignstatistics: Statistics related to emails processed by Mailjet, grouped in a Campaign.
type Campaignstatistics struct {
AXTesting *Axtesting `mailjet:"read_only"`
BlockedCount int64 `mailjet:"read_only"`
BouncedCount int64 `mailjet:"read_only"`
CampaignID int64 `mailjet:"read_only"`
CampaignALT string `mailjet:"read_only"`
CampaignIsStarred bool `mailjet:"read_only"`
CampaignSendStartAt *RFC3339DateTime `mailjet:"read_only"`
CampaignSubject string `mailjet:"read_only"`
ClickedCount int64 `mailjet:"read_only"`
ContactListName string `mailjet:"read_only"`
DeliveredCount int64 `mailjet:"read_only"`
LastActivityAt *RFC3339DateTime `mailjet:"read_only"`
NewsLetterID int64 `mailjet:"read_only"`
OpenedCount int64 `mailjet:"read_only"`
ProcessedCount int64 `mailjet:"read_only"`
QueuedCount int64 `mailjet:"read_only"`
SegmentName string `mailjet:"read_only"`
SpamComplaintCount int64 `mailjet:"read_only"`
UnsubscribedCount int64 `mailjet:"read_only"`
}
// Clickstatistics: Click statistics for messages.
type Clickstatistics struct {
ClickedAt string `mailjet:"read_only"`
ClickedDelay int64 `mailjet:"read_only"`
ContactID int64 `mailjet:"read_only"`
ContactALT string `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
MessageID int64 `mailjet:"read_only"`
URL string `json:"Url" mailjet:"read_only"`
UserAgent string `mailjet:"read_only"`
}
// Contact: Manage the details of a Contact.
type Contact struct {
CreatedAt *RFC3339DateTime `mailjet:"read_only"`
DeliveredCount int64 `mailjet:"read_only"`
Email string
ID int64 `mailjet:"read_only"`
IsOptInPending bool `mailjet:"read_only"`
IsSpamComplaining bool `mailjet:"read_only"`
IsExcludedFromCampaigns bool
LastActivityAt *RFC3339DateTime `mailjet:"read_only"`
LastUpdateAt *RFC3339DateTime `mailjet:"read_only"`
Name string `json:",omitempty"`
UnsubscribedAt *RFC3339DateTime `mailjet:"read_only"`
UnsubscribedBy string `mailjet:"read_only"`
}
// ContactManagecontactslists: Managing the lists for a single contact. POST is supported.
type ContactManagecontactslists struct {
ContactsLists []ContactsListAction
}
// ContactManagemanycontacts: Uploading many contacts and returns a job_id.
// To monitor the upload issue a GET request to: APIBASEURL/contact/managemanycontacts/:job_id
type ContactManagemanycontacts struct {
ContactsLists []ContactsListAction
Contacts []AddContactAction
}
// Contactdata: This resource can be used to examine and manipulate the associated extra static data of a contact.
type Contactdata struct {
ContactID int64 `json:",omitempty"`
Data KeyValueList `json:",omitempty"`
ID int64 `mailjet:"read_only"`
}
// Contactfilter: A list of filter expressions for use in newsletters.
type Contactfilter struct {
Description string `json:",omitempty"`
Expression string `json:",omitempty"`
ID int64 `mailjet:"read_only"`
Name string `json:",omitempty"`
Status string `json:",omitempty"`
}
// Contacthistorydata: This resource can be used to examine the associated extra historical data of a contact.
type Contacthistorydata struct {
ContactID int64 `json:",omitempty"`
ContactALT string `json:",omitempty"`
CreatedAt *RFC3339DateTime `json:",omitempty"`
Data string `json:",omitempty"`
ID int64 `mailjet:"read_only"`
Name string `json:",omitempty"`
}
// Contactmetadata: Definition of available extra data items for contacts.
type Contactmetadata struct {
Datatype string
ID int64 `mailjet:"read_only"`
Name string
NameSpace string `mailjet:"read_only"`
}
// Contactslist: Manage your contact lists. One Contact might be associated to one or more ContactsList.
type Contactslist struct {
Address string `mailjet:"read_only"`
CreatedAt *RFC3339DateTime `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
IsDeleted bool `json:",omitempty"`
Name string `json:",omitempty"`
SubscriberCount int `mailjet:"read_only"`
}
// ContactslistManageContact: An action for adding a contact to a contact list.
// The API will internally create the new contact if it does not exist, add or update the name and properties.
// The properties have to be defined before they can be used.
// The API then adds the contact to the contact list with active=true and unsub=specified value
// if it is not already in the list, or updates the entry with these values.
// On success, the API returns a packet with the same format but with all properties available for that contact.
// Only POST is supported.
type ContactslistManageContact struct {
Email string
Name string
Action string
Properties JSONObject
}
// ContactslistManageManyContacts: Multiple contacts can be uploaded asynchronously using that action.
// Only POST is supported.
type ContactslistManageManyContacts struct {
Action string
Contacts []AddContactAction
}
type Job struct {
JobID int64
}
// ContactslistImportList: Import the contacts of another contact list into the current list and apply the specified action on imported contacts.
// In case of conflict, the contact original subscription state is overridden. Returns the ID of the job to monitor.
type ContactslistImportList struct {
Action string
ListID int64
}
// Contactslistsignup: Contacts list signup request.
type Contactslistsignup struct {
ConfirmAt int64 `json:",omitempty"`
ConfirmIP string `json:"ConfirmIp"`
ContactID int64 `json:",omitempty"`
ContactALT string `json:",omitempty"`
Email string
ID int64 `mailjet:"read_only"`
ListID int64 `json:",omitempty"`
ListALT string `json:",omitempty"`
SignupAt int64 `json:",omitempty"`
SignupIP string `json:"SignupIp,omitempty"`
SignupKey string `json:",omitempty"`
Source string
SourceId int64 `json:",omitempty"`
}
// Contactstatistics: View message statistics for a given contact.
type Contactstatistics struct {
BlockedCount int64 `mailjet:"read_only"`
BouncedCount int64 `mailjet:"read_only"`
ClickedCount int64 `mailjet:"read_only"`
ContactID int64 `mailjet:"read_only"`
ContactALT string `mailjet:"read_only"`
DeliveredCount int64 `mailjet:"read_only"`
LastActivityAt *RFC3339DateTime `mailjet:"read_only"`
MarketingContacts int64 `mailjet:"read_only"`
OpenedCount int64 `mailjet:"read_only"`
ProcessedCount int64 `mailjet:"read_only"`
QueuedCount int64 `mailjet:"read_only"`
SpamComplaintCount int64 `mailjet:"read_only"`
UnsubscribedCount int64 `mailjet:"read_only"`
UserMarketingContacts int64 `mailjet:"read_only"`
}
// ContactGetcontactslists: retrieve all contact lists for a specific contact
type ContactGetcontactslists struct {
ListID int64 `mailjet:"read_only"`
IsUnsub bool `mailjet:"read_only"`
IsActive bool `mailjet:"read_only"`
SubscribedAt *RFC3339DateTime `mailjet:"read_only"`
}
// Csvimport: A wrapper for the CSV importer
type Csvimport struct {
AliveAt *RFC3339DateTime `mailjet:"read_only"`
ContactsListID int64 `json:",omitempty"`
ContactsListALT string `json:",omitempty"`
Count int `mailjet:"read_only"`
Current int `mailjet:"read_only"`
DataID int64
Errcount int `mailjet:"read_only"`
ErrTreshold int `json:",omitempty"`
ID int64 `mailjet:"read_only"`
ImportOptions string `json:",omitempty"`
JobEnd *RFC3339DateTime `mailjet:"read_only"`
JobStart *RFC3339DateTime `mailjet:"read_only"`
Method string `json:",omitempty"`
RequestAt *RFC3339DateTime `mailjet:"read_only"`
Status string `json:",omitempty"`
}
// Dns: Sender Domain properties.
type Dns struct {
DKIMRecordName string `mailjet:"read_only"`
DKIMRecordValue string `mailjet:"read_only"`
DKIMStatus string `mailjet:"read_only"`
Domain string `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
IsCheckInProgress bool `mailjet:"read_only"`
LastCheckAt *RFC3339DateTime `mailjet:"read_only"`
OwnerShipToken string `mailjet:"read_only"`
OwnerShipTokenRecordName string `mailjet:"read_only"`
SPFRecordValue string `mailjet:"read_only"`
SPFStatus string `mailjet:"read_only"`
}
type DnsCheck struct {
DKIMErrors []string `mailjet:"read_only"`
DKIMStatus string `mailjet:"read_only"`
DKIMRecordCurrentValue string `mailjet:"read_only"`
SPFRecordCurrentValue string `mailjet:"read_only"`
SPFErrors []string `mailjet:"read_only"`
SPFStatus string `mailjet:"read_only"`
}
// Domainstatistics: View Campaign/Message/Click statistics grouped per domain.
type Domainstatistics struct {
BlockedCount int64 `mailjet:"read_only"`
BouncedCount int64 `mailjet:"read_only"`
ClickedCount int64 `mailjet:"read_only"`
DeliveredCount int64 `mailjet:"read_only"`
Domain string `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
OpenedCount int64 `mailjet:"read_only"`
ProcessedCount int64 `mailjet:"read_only"`
QueuedCount int64 `mailjet:"read_only"`
SpamComplaintCount int64 `mailjet:"read_only"`
UnsubscribedCount int64 `mailjet:"read_only"`
}
// Eventcallbackurl: Manage event-driven callback URLs, also called webhooks,
// used by the Mailjet platform when a specific action is triggered
type Eventcallbackurl struct {
APIKeyID int64 `json:",omitempty"`
APIKeyALT string `json:",omitempty"`
EventType string `json:",omitempty"`
ID int64 `mailjet:"read_only"`
IsBackup bool `json:",omitempty"`
Status string `json:",omitempty"`
URL string `json:"Url"`
Version int `json:",omitempty"`
}
// Geostatistics: Message click/open statistics grouped per country
type Geostatistics struct {
ClickedCount int64 `mailjet:"read_only"`
Country string `mailjet:"read_only"`
OpenedCount int64 `mailjet:"read_only"`
}
// Graphstatistics: API Campaign/message/click statistics grouped over intervals.
type Graphstatistics struct {
BlockedCount int64 `mailjet:"read_only"`
BouncedCount int64 `mailjet:"read_only"`
ClickedCount int64 `mailjet:"read_only"`
DeliveredCount int64 `mailjet:"read_only"`
OpenedCount int64 `mailjet:"read_only"`
ProcessedCount int64 `mailjet:"read_only"`
QueuedCount int64 `mailjet:"read_only"`
RefTimestamp string `mailjet:"read_only"`
SendtimeStart int64 `mailjet:"read_only"`
SpamcomplaintCount int64 `mailjet:"read_only"`
UnsubscribedCount int64 `mailjet:"read_only"`
}
// Listrecipient: Manage the relationship between a contact and a contactslists.
type Listrecipient struct {
ContactID int64 `json:",omitempty"`
ContactALT string `json:",omitempty"`
ID int64 `mailjet:"read_only"`
IsActive bool `json:",omitempty"`
IsUnsubscribed bool `json:",omitempty"`
ListID int64 `json:",omitempty"`
ListALT string `json:",omitempty"`
UnsubscribedAt *RFC3339DateTime `json:",omitempty"`
}
// Listrecipientstatistics: View statistics on Messages sent to the recipients of a given list.
type Listrecipientstatistics struct {
BlockedCount int64 `mailjet:"read_only"`
BouncedCount int64 `mailjet:"read_only"`
ClickedCount int64 `mailjet:"read_only"`
Data KeyValueList `mailjet:"read_only"`
DeliveredCount int64 `mailjet:"read_only"`
LastActivityAt *RFC3339DateTime `mailjet:"read_only"`
ListRecipientID int64 `mailjet:"read_only"`
OpenedCount int64 `mailjet:"read_only"`
ProcessedCount int64 `mailjet:"read_only"`
QueuedCount int64 `mailjet:"read_only"`
SpamComplaintCount int64 `mailjet:"read_only"`
UnsubscribedCount int64 `mailjet:"read_only"`
}
// Liststatistics: View Campaign/message/click statistics grouped by ContactsList.
type Liststatistics struct {
ActiveCount int64 `mailjet:"read_only"`
ActiveUnsubscribedCount int64 `mailjet:"read_only"`
Address string `mailjet:"read_only"`
BlockedCount int64 `mailjet:"read_only"`
BouncedCount int64 `mailjet:"read_only"`
ClickedCount int64 `mailjet:"read_only"`
CreatedAt *RFC3339DateTime `mailjet:"read_only"`
DeliveredCount int64 `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
IsDeleted bool `mailjet:"read_only"`
LastActivityAt *RFC3339DateTime `mailjet:"read_only"`
Name string `mailjet:"read_only"`
OpenedCount int64 `mailjet:"read_only"`
SpamComplaintCount int64 `mailjet:"read_only"`
SubscriberCount int `mailjet:"read_only"`
UnsubscribedCount int64 `mailjet:"read_only"`
}
// Message: Allows you to list and view the details of a Message (an e-mail) processed by Mailjet
type Message struct {
ArrivedAt *RFC3339DateTime `json:",omitempty"`
AttachmentCount int `json:",omitempty"`
AttemptCount int `json:",omitempty"`
CampaignALT string `json:",omitempty"`
CampaignID int64 `json:",omitempty"`
ContactALT string `json:",omitempty"`
ContactID int64 `json:",omitempty"`
CustomID string `json:",omitempty"`
Delay float64 `json:",omitempty"`
DestinationID int64 `json:",omitempty"`
FilterTime int `json:",omitempty"`
ID int64 `mailjet:"read_only"`
IsClickTracked bool `json:",omitempty"`
IsHTMLPartIncluded bool `json:",omitempty"`
IsOpenTracked bool `json:",omitempty"`
IsTextPartIncluded bool `json:",omitempty"`
IsUnsubTracked bool `json:",omitempty"`
MessageSize int64 `json:",omitempty"`
SenderID int64 `json:",omitempty"`
SpamassassinScore float64 `json:",omitempty"`
SpamassRules string `json:",omitempty"`
StateID int `json:",omitempty"`
StatePermanent bool `json:",omitempty"`
Status string `json:",omitempty"`
Subject string `json:",omitempty"`
UUID string `json:",omitempty"`
}
// Messagehistory: Event history of a message.
type Messagehistory struct {
Comment string `mailjet:"read_only"`
EventAt int64 `mailjet:"read_only"`
EventType string `mailjet:"read_only"`
State string `mailjet:"read_only"`
UserAgent string `json:"Useragent" mailjet:"read_only"`
}
// Messageinformation: API Key campaign/message information.
type Messageinformation struct {
CampaignID int64 `mailjet:"read_only"`
CampaignALT string `mailjet:"read_only"`
ClickTrackedCount int64 `mailjet:"read_only"`
ContactID int64 `mailjet:"read_only"`
ContactALT string `mailjet:"read_only"`
CreatedAt *RFC3339DateTime `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
MessageSize int64 `mailjet:"read_only"`
OpenTrackedCount int64 `mailjet:"read_only"`
QueuedCount int64 `mailjet:"read_only"`
SendEndAt *RFC3339DateTime `mailjet:"read_only"`
SentCount int64 `mailjet:"read_only"`
SpamAssassinRules struct {
Items []SpamAssassinRule
} `mailjet:"read_only"`
SpamAssassinScore float64 `mailjet:"read_only"`
}
// Messagesentstatistics: API Key Statistical campaign/message data.
type Messagesentstatistics struct {
ArrivalTs *RFC3339DateTime `mailjet:"read_only"`
Blocked bool `mailjet:"read_only"`
Bounce bool `mailjet:"read_only"`
BounceDate *RFC3339DateTime `mailjet:"read_only"`
BounceReason string `mailjet:"read_only"`
CampaignID int64 `mailjet:"read_only"`
CampaignALT string `mailjet:"read_only"`
Click bool `mailjet:"read_only"`
CntRecipients int64 `mailjet:"read_only"`
ComplaintDate *RFC3339DateTime `mailjet:"read_only"`
ContactID int64 `mailjet:"read_only"`
ContactALT string `mailjet:"read_only"`
Details string `mailjet:"read_only"`
FBLSource string `mailjet:"read_only"`
MessageID int64 `mailjet:"read_only"`
Open bool `mailjet:"read_only"`
Queued bool `mailjet:"read_only"`
Sent bool `mailjet:"read_only"`
Spam bool `mailjet:"read_only"`
StateID int64 `mailjet:"read_only"`
StatePermanent bool `mailjet:"read_only"`
Status string `mailjet:"read_only"`
ToEmail string `mailjet:"read_only"`
Unsub bool `mailjet:"read_only"`
}
// Messagestate: Message state reference.
type Messagestate struct {
ID int64 `mailjet:"read_only"`
RelatedTo string `json:",omitempty"`
State string
}
// MessageStatistics: API key Campaign/Message statistics.
type MessageStatistics struct {
AverageClickDelay float64 `mailjet:"read_only"`
AverageClickedCount float64 `mailjet:"read_only"`
AverageOpenDelay float64 `mailjet:"read_only"`
AverageOpenedCount float64 `mailjet:"read_only"`
BlockedCount int64 `mailjet:"read_only"`
BouncedCount int64 `mailjet:"read_only"`
CampaignCount int64 `mailjet:"read_only"`
ClickedCount int64 `mailjet:"read_only"`
DeliveredCount int64 `mailjet:"read_only"`
OpenedCount int64 `mailjet:"read_only"`
ProcessedCount int64 `mailjet:"read_only"`
QueuedCount int64 `mailjet:"read_only"`
SpamComplaintCount int64 `mailjet:"read_only"`
TransactionalCount int64 `mailjet:"read_only"`
UnsubscribedCount int64 `mailjet:"read_only"`
}
// Metadata: Mailjet API meta data.
type Metadata struct {
APIVersion string `mailjet:"read_only"`
Actions []ResourceAction `mailjet:"read_only"`
Description string `mailjet:"read_only"`
Filters []ResourceFilter `mailjet:"read_only"`
IsReadOnly bool `mailjet:"read_only"`
Name string `mailjet:"read_only"`
Properties []ResourceProperty `mailjet:"read_only"`
PublicOperations string `mailjet:"read_only"`
SortInfo []struct {
AllowDescending bool `mailjet:"read_only"`
PropertyName string `mailjet:"read_only"`
} `mailjet:"read_only"`
UniqueKey string `mailjet:"read_only"`
}
type ResourceAction struct {
Description string `mailjet:"read_only"`
IsGlobalAction bool `mailjet:"read_only"`
Name string `mailjet:"read_only"`
Parameters []ResourceFilter `mailjet:"read_only"`
Properties []ResourceProperty `mailjet:"read_only"`
PublicOperations string `mailjet:"read_only"`
}
type ResourceFilter struct {
DataType string `mailjet:"read_only"`
DefaultValue string `mailjet:"read_only"`
Description string `mailjet:"read_only"`
IsRequired bool `mailjet:"read_only"`
Name string `mailjet:"read_only"`
ReadOnly bool `mailjet:"read_only"`
}
type ResourceProperty struct {
DataType string `mailjet:"read_only"`
DefaultValue string `mailjet:"read_only"`
Description string `mailjet:"read_only"`
IsRequired bool `mailjet:"read_only"`
Name string `mailjet:"read_only"`
ReadOnly bool `mailjet:"read_only"`
}
// Metasender: Management of domains used for sending messages.
// A domain or address must be registered and validated before being used.
// See the related Sender object if you wish to register a given e-mail address.
type Metasender struct {
CreatedAt *RFC3339DateTime `json:",omitempty"`
Description string `json:",omitempty"`
Email string
Filename string `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
IsEnabled bool `json:",omitempty"`
}
// Myprofile: Manage user profile data such as address, payment information etc.
type Myprofile struct {
AddressCity string `json:",omitempty"`
AddressCountry string `json:",omitempty"`
AddressPostalCode string `json:",omitempty"`
AddressState string `json:",omitempty"`
AddressStreet string `json:",omitempty"`
BillingEmail string `json:",omitempty"`
BirthdayAt *RFC3339DateTime `json:",omitempty"`
CompanyName string `json:",omitempty"`
CompanyNumOfEmployees string `json:",omitempty"`
ContactPhone string `json:",omitempty"`
EstimatedVolume int `json:",omitempty"`
Features string `json:",omitempty"`
Firstname string `json:",omitempty"`
ID int64 `mailjet:"read_only"`
Industry string `json:",omitempty"`
JobTitle string `json:",omitempty"`
Lastname string `json:",omitempty"`
UserID int64 `json:",omitempty"`
UserALT string `json:",omitempty"`
VAT float64 `mailjet:"read_only"`
VATNumber string `json:",omitempty"`
Website string `json:",omitempty"`
}
// Newsletter: Newsletter data.
type Newsletter struct {
AXFraction float64 `json:",omitempty"`
AXFractionName string `json:",omitempty"`
AXTesting *Axtesting `json:",omitempty"`
Callback string `json:",omitempty"`
CampaignID int64 `mailjet:"read_only"`
CampaignALT string `mailjet:"read_only"`
ContactsListID int64 `json:",omitempty"`
ContactsListALT string `json:",omitempty"`
CreatedAt *RFC3339DateTime `json:",omitempty"`
DeliveredAt *RFC3339DateTime `json:",omitempty"`
EditMode string `json:",omitempty"`
EditType string `json:",omitempty"`
Footer string `json:",omitempty"`
FooterAddress string `json:",omitempty"`
FooterWYSIWYGType int `json:",omitempty"`
HeaderFilename string `json:",omitempty"`
HeaderLink string `json:",omitempty"`
HeaderText string `json:",omitempty"`
HeaderURL string `json:"HeaderUrl,omitempty"`
ID int64 `mailjet:"read_only"`
IP string `json:"Ip,omitempty"`
IsHandled bool `json:",omitempty"`
IsStarred bool `json:",omitempty"`
IsTextPartIncluded bool `json:",omitempty"`
Locale string
ModifiedAt *RFC3339DateTime `json:",omitempty"`
Permalink string `json:",omitempty"`
PermalinkHost string `json:",omitempty"`
PermalinkWYSIWYGType int `json:",omitempty"`
PolitenessMode int `json:",omitempty"`
ReplyEmail string `json:",omitempty"`
SegmentationID int64 `json:",omitempty"`
SegmentationALT string `json:",omitempty"`
Sender string
SenderEmail string
SenderName string `json:",omitempty"`
Status string `json:",omitempty"`
Subject string
TemplateID int64 `json:",omitempty"`
TestAddress string `json:",omitempty"`
Title string `json:",omitempty"`
URL string `json:"Url,omitempty"`
}
// NewsletterDetailcontent: An action to upload the content of the newsletter
type NewsletterDetailcontent struct {
TextPart string `json:"Text-part,omitempty"`
HtmlPart string `json:"Html-part,omitempty"`
}
// NewsletterSchedule: An action to schedule a newsletters.
type NewsLetterSchedule struct {
Date *RFC3339DateTime
}
// NewsletterTest: An action to test a newsletter.
type NewsletterTest struct {
Recipients []Recipient
}
// Newslettertemplate: Manages a Newsletter Template Properties.
type Newslettertemplate struct {
CategoryID int64 `json:",omitempty"`
CreatedAt *RFC3339DateTime `json:",omitempty"`
Footer string `json:",omitempty"`
FooterAddress string `json:",omitempty"`
FooterWYSIWYGType int `json:",omitempty"`
HeaderFilename string `json:",omitempty"`
HeaderLink string `json:",omitempty"`
HeaderText string `json:",omitempty"`
HeaderURL string `json:"HeaderUrl,omitempty"`
ID int64 `mailjet:"read_only"`
Locale string
Name string `json:",omitempty"`
Permalink string `json:",omitempty"`
PermalinkWYSIWYGType int `json:",omitempty"`
SourceNewsLetterID int64 `json:",omitempty"`
Status string `json:",omitempty"`
}
// Newslettertemplatecategory: Manage categories for your newsletters.
// Allows you to group newsletters by category.
type Newslettertemplatecategory struct {
Description string
ID int64 `mailjet:"read_only"`
Locale string
ParentCategoryID int64
Value string
}
// Openinformation: Retrieve informations about messages opened at least once by their recipients.
type Openinformation struct {
ArrivedAt *RFC3339DateTime `mailjet:"read_only"`
CampaignID int64 `mailjet:"read_only"`
CampaignALT string `mailjet:"read_only"`
ContactID int64 `mailjet:"read_only"`
ContactALT string `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
MessageID int64 `mailjet:"read_only"`
OpenedAt *RFC3339DateTime `mailjet:"read_only"`
UserAgent string `mailjet:"read_only"`
UserAgentFull string `mailjet:"read_only"`
}
// Openstatistics: Retrieve statistics on e-mails opened at least once by their recipients.
type Openstatistics struct {
OpenedCount int64 `mailjet:"read_only"`
OpenedDelay float64 `mailjet:"read_only"`
ProcessedCount int64 `mailjet:"read_only"`
}
// Parseroute: ParseRoute description
type Parseroute struct {
APIKeyID int64 `json:",omitempty"`
APIKeyALT string `json:",omitempty"`
Email string `json:",omitempty"`
ID int64 `mailjet:"read_only"`
URL string `json:"Url"`
}
// Preferences: User preferences in key=value format.
type Preferences struct {
ID int64 `mailjet:"read_only"`
Key string
UserID int64 `json:",omitempty"`
UserALT string `json:",omitempty"`
Value string `json:",omitempty"`
}
// Preset: The preset object contains global and user defined presets (styles) independent from templates or newsletters.
// Access is similar to template and depends on OwnerType, Owner. No versioning is done. Presets are never referenced by their ID.
// The preset value is copied into the template or newsletter.
type Preset struct {
Author string `json:",omitempty"`
Copyright string `json:",omitempty"`
Description string `json:",omitempty"`
ID int64 `mailjet:"read_only"`
Name string `json:",omitempty"`
OwnerID int64 `json:",omitempty"`
OwnerType string `json:",omitempty"`
Preset string `json:",omitempty"`
}
// Sender: Manage an email sender for a single API key.
// An e-mail address or a complete domain (*) has to be registered and validated before being used to send e-mails.
// In order to manage a sender available across multiple API keys, see the related MetaSender resource.
type Sender struct {
CreatedAt *RFC3339DateTime `mailjet:"read_only"`
DNS string `mailjet:"read_only"` // deprecated
DNSID int64 `mailjet:"read_only"`
Email string
EmailType string `json:",omitempty"`
Filename string `mailjet:"read_only"`
ID int64 `mailjet:"read_only"`
IsDefaultSender bool `json:",omitempty"`
Name string `json:",omitempty"`
Status string `mailjet:"read_only"`
}
// Senderstatistics: API Key sender email address message/open/click statistical information.
type Senderstatistics struct {
BlockedCount int64 `mailjet:"read_only"`
BouncedCount int64 `mailjet:"read_only"`
ClickedCount int64 `mailjet:"read_only"`
DeliveredCount int64 `mailjet:"read_only"`
LastActivityAt *RFC3339DateTime `mailjet:"read_only"`
OpenedCount int64 `mailjet:"read_only"`
ProcessedCount int64 `mailjet:"read_only"`
QueuedCount int64 `mailjet:"read_only"`
SenderID int64 `mailjet:"read_only"`
SenderALT string `mailjet:"read_only"`
SpamComplaintCount int64 `mailjet:"read_only"`
UnsubscribedCount int64 `mailjet:"read_only"`
}
// SenderValidate: validation result for a sender or domain
type SenderValidate struct {
Errors map[string]string `mailjet:"read_only"`
ValidationMethod string `mailjet:"read_only"`
GlobalError string `mailjet:"read_only"`
}