forked from scaleway/scaleway-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtem_sdk.go
2615 lines (2054 loc) · 76.8 KB
/
tem_sdk.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
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.
// Package tem provides methods and message types of the tem v1alpha1 API.
package tem
import (
"bytes"
"encoding/json"
"fmt"
"net"
"net/http"
"net/url"
"strings"
"time"
"github.com/scaleway/scaleway-sdk-go/errors"
"github.com/scaleway/scaleway-sdk-go/marshaler"
"github.com/scaleway/scaleway-sdk-go/namegenerator"
"github.com/scaleway/scaleway-sdk-go/parameter"
"github.com/scaleway/scaleway-sdk-go/scw"
)
// always import dependencies
var (
_ fmt.Stringer
_ json.Unmarshaler
_ url.URL
_ net.IP
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join
_ scw.ScalewayRequest
_ marshaler.Duration
_ scw.File
_ = parameter.AddToQuery
_ = namegenerator.GetRandomName
)
type BlocklistType string
const (
// If unspecified, the type of blocklist is unknown by default.
BlocklistTypeUnknownType = BlocklistType("unknown_type")
// The recipient's mailbox is full and cannot receive any new email.
BlocklistTypeMailboxFull = BlocklistType("mailbox_full")
// The recipient's mailbox does not exist.
BlocklistTypeMailboxNotFound = BlocklistType("mailbox_not_found")
)
func (enum BlocklistType) String() string {
if enum == "" {
// return default value if empty
return "unknown_type"
}
return string(enum)
}
func (enum BlocklistType) Values() []BlocklistType {
return []BlocklistType{
"unknown_type",
"mailbox_full",
"mailbox_not_found",
}
}
func (enum BlocklistType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *BlocklistType) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = BlocklistType(BlocklistType(tmp).String())
return nil
}
type DomainLastStatusAutoconfigStateReason string
const (
// If not specified, the auto-configuration state is unknown by default.
DomainLastStatusAutoconfigStateReasonUnknownReason = DomainLastStatusAutoconfigStateReason("unknown_reason")
// The token doesn't have the necessary permissions to manage the domain's DNS records.
DomainLastStatusAutoconfigStateReasonPermissionDenied = DomainLastStatusAutoconfigStateReason("permission_denied")
// The domain does not exist or isn't manageable by the token.
DomainLastStatusAutoconfigStateReasonDomainNotFound = DomainLastStatusAutoconfigStateReason("domain_not_found")
)
func (enum DomainLastStatusAutoconfigStateReason) String() string {
if enum == "" {
// return default value if empty
return "unknown_reason"
}
return string(enum)
}
func (enum DomainLastStatusAutoconfigStateReason) Values() []DomainLastStatusAutoconfigStateReason {
return []DomainLastStatusAutoconfigStateReason{
"unknown_reason",
"permission_denied",
"domain_not_found",
}
}
func (enum DomainLastStatusAutoconfigStateReason) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *DomainLastStatusAutoconfigStateReason) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = DomainLastStatusAutoconfigStateReason(DomainLastStatusAutoconfigStateReason(tmp).String())
return nil
}
type DomainLastStatusRecordStatus string
const (
// If unspecified, the status of the domain's record is unknown by default.
DomainLastStatusRecordStatusUnknownRecordStatus = DomainLastStatusRecordStatus("unknown_record_status")
// The record is valid.
DomainLastStatusRecordStatusValid = DomainLastStatusRecordStatus("valid")
// The record is invalid.
DomainLastStatusRecordStatusInvalid = DomainLastStatusRecordStatus("invalid")
// The record was not found.
DomainLastStatusRecordStatusNotFound = DomainLastStatusRecordStatus("not_found")
)
func (enum DomainLastStatusRecordStatus) String() string {
if enum == "" {
// return default value if empty
return "unknown_record_status"
}
return string(enum)
}
func (enum DomainLastStatusRecordStatus) Values() []DomainLastStatusRecordStatus {
return []DomainLastStatusRecordStatus{
"unknown_record_status",
"valid",
"invalid",
"not_found",
}
}
func (enum DomainLastStatusRecordStatus) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *DomainLastStatusRecordStatus) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = DomainLastStatusRecordStatus(DomainLastStatusRecordStatus(tmp).String())
return nil
}
type DomainReputationStatus string
const (
// If unspecified, the status of the domain's reputation is unknown by default.
DomainReputationStatusUnknownStatus = DomainReputationStatus("unknown_status")
// The domain has an excellent reputation.
DomainReputationStatusExcellent = DomainReputationStatus("excellent")
// The domain has a good reputation.
DomainReputationStatusGood = DomainReputationStatus("good")
// The domain has an average reputation.
DomainReputationStatusAverage = DomainReputationStatus("average")
// The domain has a bad reputation.
DomainReputationStatusBad = DomainReputationStatus("bad")
)
func (enum DomainReputationStatus) String() string {
if enum == "" {
// return default value if empty
return "unknown_status"
}
return string(enum)
}
func (enum DomainReputationStatus) Values() []DomainReputationStatus {
return []DomainReputationStatus{
"unknown_status",
"excellent",
"good",
"average",
"bad",
}
}
func (enum DomainReputationStatus) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *DomainReputationStatus) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = DomainReputationStatus(DomainReputationStatus(tmp).String())
return nil
}
type DomainStatus string
const (
// If unspecified, the status of the domain is unknown by default.
DomainStatusUnknown = DomainStatus("unknown")
// The domain is checked.
DomainStatusChecked = DomainStatus("checked")
// The domain is unchecked.
DomainStatusUnchecked = DomainStatus("unchecked")
// The domain is invalid.
DomainStatusInvalid = DomainStatus("invalid")
// The domain is locked.
DomainStatusLocked = DomainStatus("locked")
// The domain is revoked.
DomainStatusRevoked = DomainStatus("revoked")
// The domain is pending, waiting to be checked.
DomainStatusPending = DomainStatus("pending")
// The domain is in process of auto-configuration of the domain's DNS zone.
DomainStatusAutoconfiguring = DomainStatus("autoconfiguring")
)
func (enum DomainStatus) String() string {
if enum == "" {
// return default value if empty
return "unknown"
}
return string(enum)
}
func (enum DomainStatus) Values() []DomainStatus {
return []DomainStatus{
"unknown",
"checked",
"unchecked",
"invalid",
"locked",
"revoked",
"pending",
"autoconfiguring",
}
}
func (enum DomainStatus) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *DomainStatus) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = DomainStatus(DomainStatus(tmp).String())
return nil
}
type EmailFlag string
const (
// If unspecified, the flag type is unknown by default.
EmailFlagUnknownFlag = EmailFlag("unknown_flag")
// Refers to a non critical error received while sending the email(s). Soft bounced emails are retried.
EmailFlagSoftBounce = EmailFlag("soft_bounce")
// Refers to a critical error that happened while sending the email(s).
EmailFlagHardBounce = EmailFlag("hard_bounce")
// Refers to an email considered as spam.
EmailFlagSpam = EmailFlag("spam")
// Refers to an undelivered email because the recipient mailbox is full.
EmailFlagMailboxFull = EmailFlag("mailbox_full")
// Refers to an undelivered email because the recipient mailbox does not exist.
EmailFlagMailboxNotFound = EmailFlag("mailbox_not_found")
// Refers to an email slightly delayed by the recipient to ensure that Scaleway is not sending spam.
EmailFlagGreylisted = EmailFlag("greylisted")
// Refers to an email with a `send-before` tag to indicate the maximum time limit for the email to be sent.
EmailFlagSendBeforeExpiration = EmailFlag("send_before_expiration")
// Refers to an email blocked by a blocklist.
EmailFlagBlocklisted = EmailFlag("blocklisted")
)
func (enum EmailFlag) String() string {
if enum == "" {
// return default value if empty
return "unknown_flag"
}
return string(enum)
}
func (enum EmailFlag) Values() []EmailFlag {
return []EmailFlag{
"unknown_flag",
"soft_bounce",
"hard_bounce",
"spam",
"mailbox_full",
"mailbox_not_found",
"greylisted",
"send_before_expiration",
"blocklisted",
}
}
func (enum EmailFlag) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *EmailFlag) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = EmailFlag(EmailFlag(tmp).String())
return nil
}
type EmailRcptType string
const (
// If unspecified, the recipient type is unknown by default.
EmailRcptTypeUnknownRcptType = EmailRcptType("unknown_rcpt_type")
// Primary recipient.
EmailRcptTypeTo = EmailRcptType("to")
// Carbon copy recipient.
EmailRcptTypeCc = EmailRcptType("cc")
// Blind carbon copy recipient.
EmailRcptTypeBcc = EmailRcptType("bcc")
)
func (enum EmailRcptType) String() string {
if enum == "" {
// return default value if empty
return "unknown_rcpt_type"
}
return string(enum)
}
func (enum EmailRcptType) Values() []EmailRcptType {
return []EmailRcptType{
"unknown_rcpt_type",
"to",
"cc",
"bcc",
}
}
func (enum EmailRcptType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *EmailRcptType) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = EmailRcptType(EmailRcptType(tmp).String())
return nil
}
type EmailStatus string
const (
// If unspecified, the status of the email is unknown by default.
EmailStatusUnknown = EmailStatus("unknown")
// The email is new.
EmailStatusNew = EmailStatus("new")
// The email is in the process of being sent.
EmailStatusSending = EmailStatus("sending")
// The email was sent.
EmailStatusSent = EmailStatus("sent")
// The sending of the email failed.
EmailStatusFailed = EmailStatus("failed")
// The sending of the email was canceled.
EmailStatusCanceled = EmailStatus("canceled")
)
func (enum EmailStatus) String() string {
if enum == "" {
// return default value if empty
return "unknown"
}
return string(enum)
}
func (enum EmailStatus) Values() []EmailStatus {
return []EmailStatus{
"unknown",
"new",
"sending",
"sent",
"failed",
"canceled",
}
}
func (enum EmailStatus) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *EmailStatus) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = EmailStatus(EmailStatus(tmp).String())
return nil
}
type ListBlocklistsRequestOrderBy string
const (
// Order by creation date (descending chronological order).
ListBlocklistsRequestOrderByCreatedAtDesc = ListBlocklistsRequestOrderBy("created_at_desc")
// Order by creation date (ascending chronological order).
ListBlocklistsRequestOrderByCreatedAtAsc = ListBlocklistsRequestOrderBy("created_at_asc")
// Order by blocklist ends date (descending chronological order).
ListBlocklistsRequestOrderByEndsAtDesc = ListBlocklistsRequestOrderBy("ends_at_desc")
// Order by blocklist ends date (ascending chronological order).
ListBlocklistsRequestOrderByEndsAtAsc = ListBlocklistsRequestOrderBy("ends_at_asc")
)
func (enum ListBlocklistsRequestOrderBy) String() string {
if enum == "" {
// return default value if empty
return "created_at_desc"
}
return string(enum)
}
func (enum ListBlocklistsRequestOrderBy) Values() []ListBlocklistsRequestOrderBy {
return []ListBlocklistsRequestOrderBy{
"created_at_desc",
"created_at_asc",
"ends_at_desc",
"ends_at_asc",
}
}
func (enum ListBlocklistsRequestOrderBy) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *ListBlocklistsRequestOrderBy) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = ListBlocklistsRequestOrderBy(ListBlocklistsRequestOrderBy(tmp).String())
return nil
}
type ListEmailsRequestOrderBy string
const (
// Order by creation date (descending chronological order).
ListEmailsRequestOrderByCreatedAtDesc = ListEmailsRequestOrderBy("created_at_desc")
// Order by creation date (ascending chronological order).
ListEmailsRequestOrderByCreatedAtAsc = ListEmailsRequestOrderBy("created_at_asc")
// Order by last update date (descending chronological order).
ListEmailsRequestOrderByUpdatedAtDesc = ListEmailsRequestOrderBy("updated_at_desc")
// Order by last update date (ascending chronological order).
ListEmailsRequestOrderByUpdatedAtAsc = ListEmailsRequestOrderBy("updated_at_asc")
// Order by status (descending alphabetical order).
ListEmailsRequestOrderByStatusDesc = ListEmailsRequestOrderBy("status_desc")
// Order by status (ascending alphabetical order).
ListEmailsRequestOrderByStatusAsc = ListEmailsRequestOrderBy("status_asc")
// Order by mail_from (descending alphabetical order).
ListEmailsRequestOrderByMailFromDesc = ListEmailsRequestOrderBy("mail_from_desc")
// Order by mail_from (ascending alphabetical order).
ListEmailsRequestOrderByMailFromAsc = ListEmailsRequestOrderBy("mail_from_asc")
// Order by mail recipient (descending alphabetical order).
ListEmailsRequestOrderByMailRcptDesc = ListEmailsRequestOrderBy("mail_rcpt_desc")
// Order by mail recipient (ascending alphabetical order).
ListEmailsRequestOrderByMailRcptAsc = ListEmailsRequestOrderBy("mail_rcpt_asc")
// Order by subject (descending alphabetical order).
ListEmailsRequestOrderBySubjectDesc = ListEmailsRequestOrderBy("subject_desc")
// Order by subject (ascending alphabetical order).
ListEmailsRequestOrderBySubjectAsc = ListEmailsRequestOrderBy("subject_asc")
)
func (enum ListEmailsRequestOrderBy) String() string {
if enum == "" {
// return default value if empty
return "created_at_desc"
}
return string(enum)
}
func (enum ListEmailsRequestOrderBy) Values() []ListEmailsRequestOrderBy {
return []ListEmailsRequestOrderBy{
"created_at_desc",
"created_at_asc",
"updated_at_desc",
"updated_at_asc",
"status_desc",
"status_asc",
"mail_from_desc",
"mail_from_asc",
"mail_rcpt_desc",
"mail_rcpt_asc",
"subject_desc",
"subject_asc",
}
}
func (enum ListEmailsRequestOrderBy) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *ListEmailsRequestOrderBy) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = ListEmailsRequestOrderBy(ListEmailsRequestOrderBy(tmp).String())
return nil
}
type ListWebhookEventsRequestOrderBy string
const (
ListWebhookEventsRequestOrderByCreatedAtDesc = ListWebhookEventsRequestOrderBy("created_at_desc")
ListWebhookEventsRequestOrderByCreatedAtAsc = ListWebhookEventsRequestOrderBy("created_at_asc")
)
func (enum ListWebhookEventsRequestOrderBy) String() string {
if enum == "" {
// return default value if empty
return "created_at_desc"
}
return string(enum)
}
func (enum ListWebhookEventsRequestOrderBy) Values() []ListWebhookEventsRequestOrderBy {
return []ListWebhookEventsRequestOrderBy{
"created_at_desc",
"created_at_asc",
}
}
func (enum ListWebhookEventsRequestOrderBy) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *ListWebhookEventsRequestOrderBy) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = ListWebhookEventsRequestOrderBy(ListWebhookEventsRequestOrderBy(tmp).String())
return nil
}
type ListWebhooksRequestOrderBy string
const (
ListWebhooksRequestOrderByCreatedAtDesc = ListWebhooksRequestOrderBy("created_at_desc")
ListWebhooksRequestOrderByCreatedAtAsc = ListWebhooksRequestOrderBy("created_at_asc")
)
func (enum ListWebhooksRequestOrderBy) String() string {
if enum == "" {
// return default value if empty
return "created_at_desc"
}
return string(enum)
}
func (enum ListWebhooksRequestOrderBy) Values() []ListWebhooksRequestOrderBy {
return []ListWebhooksRequestOrderBy{
"created_at_desc",
"created_at_asc",
}
}
func (enum ListWebhooksRequestOrderBy) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *ListWebhooksRequestOrderBy) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = ListWebhooksRequestOrderBy(ListWebhooksRequestOrderBy(tmp).String())
return nil
}
type ProjectSettingsPeriodicReportFrequency string
const (
// If unspecified, the frequency is unknown by default.
ProjectSettingsPeriodicReportFrequencyUnknownFrequency = ProjectSettingsPeriodicReportFrequency("unknown_frequency")
// The periodic report is sent once a month.
ProjectSettingsPeriodicReportFrequencyMonthly = ProjectSettingsPeriodicReportFrequency("monthly")
// The periodic report is sent once a week.
ProjectSettingsPeriodicReportFrequencyWeekly = ProjectSettingsPeriodicReportFrequency("weekly")
// The periodic report is sent once a day.
ProjectSettingsPeriodicReportFrequencyDaily = ProjectSettingsPeriodicReportFrequency("daily")
)
func (enum ProjectSettingsPeriodicReportFrequency) String() string {
if enum == "" {
// return default value if empty
return "unknown_frequency"
}
return string(enum)
}
func (enum ProjectSettingsPeriodicReportFrequency) Values() []ProjectSettingsPeriodicReportFrequency {
return []ProjectSettingsPeriodicReportFrequency{
"unknown_frequency",
"monthly",
"weekly",
"daily",
}
}
func (enum ProjectSettingsPeriodicReportFrequency) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *ProjectSettingsPeriodicReportFrequency) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = ProjectSettingsPeriodicReportFrequency(ProjectSettingsPeriodicReportFrequency(tmp).String())
return nil
}
type WebhookEventStatus string
const (
// If unspecified, the status of the Webhook event is unknown by default.
WebhookEventStatusUnknownStatus = WebhookEventStatus("unknown_status")
// The Webhook event is being sent.
WebhookEventStatusSending = WebhookEventStatus("sending")
// The Webhook event was sent.
WebhookEventStatusSent = WebhookEventStatus("sent")
// The Webhook event cannot be sent after multiple retries.
WebhookEventStatusFailed = WebhookEventStatus("failed")
)
func (enum WebhookEventStatus) String() string {
if enum == "" {
// return default value if empty
return "unknown_status"
}
return string(enum)
}
func (enum WebhookEventStatus) Values() []WebhookEventStatus {
return []WebhookEventStatus{
"unknown_status",
"sending",
"sent",
"failed",
}
}
func (enum WebhookEventStatus) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *WebhookEventStatus) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = WebhookEventStatus(WebhookEventStatus(tmp).String())
return nil
}
type WebhookEventType string
const (
// If unspecified, the type of the Webhook Event is unknown by default.
WebhookEventTypeUnknownType = WebhookEventType("unknown_type")
// The email was received and is in preparation to be sent to the recipient servers.
WebhookEventTypeEmailQueued = WebhookEventType("email_queued")
// The email was sent but hard-bounced by the recipient server.
WebhookEventTypeEmailDropped = WebhookEventType("email_dropped")
// The email was sent but soft-bounced by the recipient server. In this case, the sending of the email will be automatically retried.
WebhookEventTypeEmailDeferred = WebhookEventType("email_deferred")
// The email was successfully sent.
WebhookEventTypeEmailDelivered = WebhookEventType("email_delivered")
// The email resource was identified as spam by Scaleway or by the recipient server.
WebhookEventTypeEmailSpam = WebhookEventType("email_spam")
// The email hard-bounced with a "mailbox not found" error.
WebhookEventTypeEmailMailboxNotFound = WebhookEventType("email_mailbox_not_found")
// The email was blocked before it was sent, as the recipient matches a blocklist.
WebhookEventTypeEmailBlocklisted = WebhookEventType("email_blocklisted")
// A new blocklist is created.
WebhookEventTypeBlocklistCreated = WebhookEventType("blocklist_created")
)
func (enum WebhookEventType) String() string {
if enum == "" {
// return default value if empty
return "unknown_type"
}
return string(enum)
}
func (enum WebhookEventType) Values() []WebhookEventType {
return []WebhookEventType{
"unknown_type",
"email_queued",
"email_dropped",
"email_deferred",
"email_delivered",
"email_spam",
"email_mailbox_not_found",
"email_blocklisted",
"blocklist_created",
}
}
func (enum WebhookEventType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *WebhookEventType) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = WebhookEventType(WebhookEventType(tmp).String())
return nil
}
// DomainRecordsDMARC: domain records dmarc.
type DomainRecordsDMARC struct {
// Name: name of the DMARC TXT record.
Name string `json:"name"`
// Value: value of the DMARC TXT record.
Value string `json:"value"`
}
// EmailTry: email try.
type EmailTry struct {
// Rank: rank number of this attempt to send the email.
Rank uint32 `json:"rank"`
// TriedAt: date of the attempt to send the email.
TriedAt *time.Time `json:"tried_at"`
// Code: the SMTP status code received after the attempt. 0 if the attempt did not reach an SMTP server.
Code int32 `json:"code"`
// Message: the SMTP message received. If the attempt did not reach an SMTP server, the message returned explains what happened.
Message string `json:"message"`
}
// DomainRecords: domain records.
type DomainRecords struct {
// Dmarc: dMARC TXT record specification.
Dmarc *DomainRecordsDMARC `json:"dmarc"`
}
// DomainReputation: domain reputation.
type DomainReputation struct {
// Status: status of your domain's reputation.
// Default value: unknown_status
Status DomainReputationStatus `json:"status"`
// Score: a range from 0 to 100 that determines your domain's reputation score. A score of `0` means a bad domain reputation and a score of `100` means an excellent domain reputation.
Score uint32 `json:"score"`
// ScoredAt: time and date the score was calculated.
ScoredAt *time.Time `json:"scored_at"`
// PreviousScore: the previously-calculated domain's reputation score.
PreviousScore *uint32 `json:"previous_score"`
// PreviousScoredAt: time and date the previous reputation score was calculated.
PreviousScoredAt *time.Time `json:"previous_scored_at"`
}
// DomainStatistics: domain statistics.
type DomainStatistics struct {
TotalCount uint32 `json:"total_count"`
SentCount uint32 `json:"sent_count"`
FailedCount uint32 `json:"failed_count"`
CanceledCount uint32 `json:"canceled_count"`
}
// Blocklist: blocklist.
type Blocklist struct {
// ID: ID of the blocklist.
ID string `json:"id"`
// DomainID: domain ID linked to the blocklist.
DomainID string `json:"domain_id"`
// CreatedAt: date and time of the blocklist creation.
CreatedAt *time.Time `json:"created_at"`
// UpdatedAt: date and time of the blocklist's last update.
UpdatedAt *time.Time `json:"updated_at"`
// EndsAt: date and time when the blocklist ends. Empty if the blocklist has no end.
EndsAt *time.Time `json:"ends_at"`
// Email: email blocked by the blocklist.
Email string `json:"email"`
// Type: type of block for this email.
// Default value: unknown_type
Type BlocklistType `json:"type"`
// Reason: reason to block this email.
Reason string `json:"reason"`
// Custom: true if this blocklist was created manually. False for an automatic Transactional Email blocklist.
Custom bool `json:"custom"`
}
// CreateEmailRequestAddress: create email request address.
type CreateEmailRequestAddress struct {
// Email: email address.
Email string `json:"email"`
// Name: (Optional) Name displayed.
Name *string `json:"name"`
}
// CreateEmailRequestAttachment: create email request attachment.
type CreateEmailRequestAttachment struct {
// Name: filename of the attachment.
Name string `json:"name"`
// Type: mIME type of the attachment.
Type string `json:"type"`
// Content: content of the attachment encoded in base64.
Content []byte `json:"content"`
}
// CreateEmailRequestHeader: create email request header.
type CreateEmailRequestHeader struct {
// Key: email header key.
Key string `json:"key"`
// Value: email header value.
Value string `json:"value"`
}
// Email: email.
type Email struct {
// ID: technical ID of the email.
ID string `json:"id"`
// MessageID: message ID of the email.
MessageID string `json:"message_id"`
// ProjectID: ID of the Project to which the email belongs.
ProjectID string `json:"project_id"`
// MailFrom: email address of the sender.
MailFrom string `json:"mail_from"`
// Deprecated: RcptTo: deprecated. Email address of the recipient.
RcptTo *string `json:"rcpt_to,omitempty"`
// MailRcpt: email address of the recipient.
MailRcpt string `json:"mail_rcpt"`
// RcptType: type of recipient.
// Default value: unknown_rcpt_type
RcptType EmailRcptType `json:"rcpt_type"`
// Subject: subject of the email.
Subject string `json:"subject"`
// CreatedAt: creation date of the email object.
CreatedAt *time.Time `json:"created_at"`
// UpdatedAt: last update of the email object.
UpdatedAt *time.Time `json:"updated_at"`
// Status: status of the email.
// Default value: unknown
Status EmailStatus `json:"status"`
// StatusDetails: additional status information.
StatusDetails *string `json:"status_details"`
// TryCount: number of attempts to send the email.
TryCount uint32 `json:"try_count"`
// LastTries: information about the last three attempts to send the email.
LastTries []*EmailTry `json:"last_tries"`
// Flags: flags categorize emails. They allow you to obtain more information about recurring errors, for example.
Flags []EmailFlag `json:"flags"`
}
// DomainLastStatusAutoconfigState: domain last status autoconfig state.
type DomainLastStatusAutoconfigState struct {
// Enabled: enable or disable the auto-configuration of domain DNS records.
Enabled bool `json:"enabled"`
// Autoconfigurable: whether the domain can be auto-configured or not.
Autoconfigurable bool `json:"autoconfigurable"`
// Reason: the reason that the domain cannot be auto-configurable.
// Default value: unknown_reason
Reason *DomainLastStatusAutoconfigStateReason `json:"reason"`
}
// DomainLastStatusDkimRecord: domain last status dkim record.
type DomainLastStatusDkimRecord struct {
// Status: status of the DKIM record's configuration.
// Default value: unknown_record_status
Status DomainLastStatusRecordStatus `json:"status"`
// LastValidAt: time and date the DKIM record was last valid.
LastValidAt *time.Time `json:"last_valid_at"`
// Error: an error text displays in case the record is not valid.
Error *string `json:"error"`
}
// DomainLastStatusDmarcRecord: domain last status dmarc record.
type DomainLastStatusDmarcRecord struct {
// Status: status of the DMARC record's configuration.
// Default value: unknown_record_status
Status DomainLastStatusRecordStatus `json:"status"`
// LastValidAt: time and date the DMARC record was last valid.
LastValidAt *time.Time `json:"last_valid_at"`
// Error: an error text displays in case the record is not valid.
Error *string `json:"error"`
}
// DomainLastStatusSpfRecord: domain last status spf record.
type DomainLastStatusSpfRecord struct {
// Status: status of the SPF record's configuration.
// Default value: unknown_record_status
Status DomainLastStatusRecordStatus `json:"status"`
// LastValidAt: time and date the SPF record was last valid.
LastValidAt *time.Time `json:"last_valid_at"`
// Error: an error text displays in case the record is not valid.
Error *string `json:"error"`
}
// Domain: domain.
type Domain struct {
// ID: ID of the domain.
ID string `json:"id"`
// OrganizationID: ID of the domain's Organization.
OrganizationID string `json:"organization_id"`