Repository navigation
Expand file tree
/
Copy pathgenerated_types.go
More file actions
2589 lines (2288 loc) · 123 KB
/
Copy pathgenerated_types.go
File metadata and controls
2589 lines (2288 loc) · 123 KB
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
// Code generated by lettermint/sdk-generator. DO NOT EDIT.
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next
package lettermint
import (
"bytes"
"encoding/json"
"fmt"
"io"
)
// Nullable is an optional value that may also be null: absent (the zero
// value), null, or a value. Fields of this type are optional and nullable in
// the API. With the omitzero JSON tag an absent value is left out, so an
// update can tell "leave unchanged" (absent) from "clear" (null).
type Nullable[T any] struct {
value T
state nullableState
}
type nullableState uint8
const (
nullableAbsent nullableState = iota
nullableNull
nullableValue
)
// Value returns a Nullable that holds v.
func Value[T any](v T) Nullable[T] {
return Nullable[T]{value: v, state: nullableValue}
}
// Null returns a Nullable that is explicitly null.
func Null[T any]() Nullable[T] {
return Nullable[T]{state: nullableNull}
}
// Get returns the value and true when n holds a value, or the zero value and
// false when n is absent or null.
func (n Nullable[T]) Get() (T, bool) {
return n.value, n.state == nullableValue
}
// ValueOrZero returns the value, or the zero value when n is absent or null.
func (n Nullable[T]) ValueOrZero() T {
return n.value
}
// IsNull reports whether n is explicitly null.
func (n Nullable[T]) IsNull() bool {
return n.state == nullableNull
}
// IsSet reports whether n is present: null or a value.
func (n Nullable[T]) IsSet() bool {
return n.state != nullableAbsent
}
// IsZero reports whether n is absent. The omitzero JSON tag uses it.
func (n Nullable[T]) IsZero() bool {
return n.state == nullableAbsent
}
// Format prints the value, null or <absent>, so that printing a struct shows
// a Nullable like the value it holds and uses that value's own formatting.
func (n Nullable[T]) Format(f fmt.State, verb rune) {
switch n.state {
case nullableValue:
fmt.Fprintf(f, fmt.FormatString(f, verb), n.value)
case nullableNull:
_, _ = io.WriteString(f, "null")
default:
_, _ = io.WriteString(f, "<absent>")
}
}
// MarshalJSON encodes null or the value. An absent value also encodes as
// null; use the omitzero tag to leave it out. HTML characters are not
// escaped here, so the encoder of the enclosing value decides.
func (n Nullable[T]) MarshalJSON() ([]byte, error) {
if n.state != nullableValue {
return []byte("null"), nil
}
var buffer bytes.Buffer
encoder := json.NewEncoder(&buffer)
encoder.SetEscapeHTML(false)
if err := encoder.Encode(n.value); err != nil {
return nil, err
}
return bytes.TrimSuffix(buffer.Bytes(), []byte("\n")), nil
}
// UnmarshalJSON decodes null or a value. A property that is missing from the
// JSON leaves n absent.
func (n *Nullable[T]) UnmarshalJSON(data []byte) error {
if string(bytes.TrimSpace(data)) == "null" {
var zero T
n.value, n.state = zero, nullableNull
return nil
}
var value T
if err := json.Unmarshal(data, &value); err != nil {
return err
}
n.value, n.state = value, nullableValue
return nil
}
// AnalyticsBreakdownRow: Metric values for one group of dimension values.
type AnalyticsBreakdownRow struct {
Metrics AnalyticsMetricValues `json:"metrics"`
RateBases AnalyticsRateBases `json:"rate_bases"`
Previous *AnalyticsComparisonValues `json:"previous,omitzero"`
Change map[string]AnalyticsMetricChange `json:"change,omitzero"`
Dimensions map[string]*string `json:"dimensions"`
Trend []AnalyticsTimeSeriesPoint `json:"trend,omitzero"`
}
// AnalyticsCatalogueDimension is an open enum: values the API adds later decode unchanged.
type AnalyticsCatalogueDimension string
// Known values of AnalyticsCatalogueDimension.
const (
AnalyticsCatalogueDimensionProjectID AnalyticsCatalogueDimension = "project_id"
AnalyticsCatalogueDimensionRouteID AnalyticsCatalogueDimension = "route_id"
AnalyticsCatalogueDimensionMessageType AnalyticsCatalogueDimension = "message_type"
AnalyticsCatalogueDimensionSendingDomain AnalyticsCatalogueDimension = "sending_domain"
AnalyticsCatalogueDimensionRecipientDomain AnalyticsCatalogueDimension = "recipient_domain"
AnalyticsCatalogueDimensionProviderFamily AnalyticsCatalogueDimension = "provider_family"
AnalyticsCatalogueDimensionProviderSubtype AnalyticsCatalogueDimension = "provider_subtype"
AnalyticsCatalogueDimensionFromAddress AnalyticsCatalogueDimension = "from_address"
AnalyticsCatalogueDimensionSubject AnalyticsCatalogueDimension = "subject"
AnalyticsCatalogueDimensionDedicatedIP AnalyticsCatalogueDimension = "dedicated_ip"
AnalyticsCatalogueDimensionDedicatedPoolID AnalyticsCatalogueDimension = "dedicated_pool_id"
AnalyticsCatalogueDimensionInfrastructureState AnalyticsCatalogueDimension = "infrastructure_state"
AnalyticsCatalogueDimensionSMTPCode AnalyticsCatalogueDimension = "smtp_code"
AnalyticsCatalogueDimensionEnhancedStatusCode AnalyticsCatalogueDimension = "enhanced_status_code"
AnalyticsCatalogueDimensionEnhancedStatusCategory AnalyticsCatalogueDimension = "enhanced_status_category"
AnalyticsCatalogueDimensionBounceClassification AnalyticsCatalogueDimension = "bounce_classification"
AnalyticsCatalogueDimensionFailureReason AnalyticsCatalogueDimension = "failure_reason"
AnalyticsCatalogueDimensionEngagementState AnalyticsCatalogueDimension = "engagement_state"
AnalyticsCatalogueDimensionRequestActor AnalyticsCatalogueDimension = "request_actor"
AnalyticsCatalogueDimensionProxyType AnalyticsCatalogueDimension = "proxy_type"
AnalyticsCatalogueDimensionIsHuman AnalyticsCatalogueDimension = "is_human"
AnalyticsCatalogueDimensionIsPrivacy AnalyticsCatalogueDimension = "is_privacy"
AnalyticsCatalogueDimensionIsBot AnalyticsCatalogueDimension = "is_bot"
AnalyticsCatalogueDimensionIsScanner AnalyticsCatalogueDimension = "is_scanner"
)
// AnalyticsCatalogueGroupDimension is an open enum: values the API adds later decode unchanged.
type AnalyticsCatalogueGroupDimension string
// Known values of AnalyticsCatalogueGroupDimension.
const (
AnalyticsCatalogueGroupDimensionProjectID AnalyticsCatalogueGroupDimension = "project_id"
AnalyticsCatalogueGroupDimensionRouteID AnalyticsCatalogueGroupDimension = "route_id"
AnalyticsCatalogueGroupDimensionMessageType AnalyticsCatalogueGroupDimension = "message_type"
AnalyticsCatalogueGroupDimensionSendingDomain AnalyticsCatalogueGroupDimension = "sending_domain"
AnalyticsCatalogueGroupDimensionRecipientDomain AnalyticsCatalogueGroupDimension = "recipient_domain"
AnalyticsCatalogueGroupDimensionProviderFamily AnalyticsCatalogueGroupDimension = "provider_family"
AnalyticsCatalogueGroupDimensionProviderSubtype AnalyticsCatalogueGroupDimension = "provider_subtype"
AnalyticsCatalogueGroupDimensionFromAddress AnalyticsCatalogueGroupDimension = "from_address"
AnalyticsCatalogueGroupDimensionSubject AnalyticsCatalogueGroupDimension = "subject"
AnalyticsCatalogueGroupDimensionDedicatedIP AnalyticsCatalogueGroupDimension = "dedicated_ip"
AnalyticsCatalogueGroupDimensionDedicatedPoolID AnalyticsCatalogueGroupDimension = "dedicated_pool_id"
AnalyticsCatalogueGroupDimensionInfrastructureState AnalyticsCatalogueGroupDimension = "infrastructure_state"
AnalyticsCatalogueGroupDimensionSMTPCode AnalyticsCatalogueGroupDimension = "smtp_code"
AnalyticsCatalogueGroupDimensionEnhancedStatusCode AnalyticsCatalogueGroupDimension = "enhanced_status_code"
AnalyticsCatalogueGroupDimensionEnhancedStatusCategory AnalyticsCatalogueGroupDimension = "enhanced_status_category"
AnalyticsCatalogueGroupDimensionBounceClassification AnalyticsCatalogueGroupDimension = "bounce_classification"
AnalyticsCatalogueGroupDimensionFailureReason AnalyticsCatalogueGroupDimension = "failure_reason"
AnalyticsCatalogueGroupDimensionSMTPResponseGroup AnalyticsCatalogueGroupDimension = "smtp_response_group"
AnalyticsCatalogueGroupDimensionEngagementState AnalyticsCatalogueGroupDimension = "engagement_state"
AnalyticsCatalogueGroupDimensionRequestActor AnalyticsCatalogueGroupDimension = "request_actor"
AnalyticsCatalogueGroupDimensionProxyType AnalyticsCatalogueGroupDimension = "proxy_type"
)
// AnalyticsComparison: A comparison period.
//
// AnalyticsComparison is an open enum: values the API adds later decode unchanged.
type AnalyticsComparison string
// Known values of AnalyticsComparison.
const (
AnalyticsComparisonPreviousPeriod AnalyticsComparison = "previous_period"
)
// AnalyticsComparisonValues: Metric values for the comparison period.
type AnalyticsComparisonValues struct {
Metrics AnalyticsMetricValues `json:"metrics"`
RateBases AnalyticsRateBases `json:"rate_bases"`
}
// AnalyticsDimension: A catalogue dimension or tag:<case-sensitive name> to filter by. is_human, is_privacy, is_bot and is_scanner select an engagement class: filter them with the value 1 to restrict engagement metrics to that class.
type AnalyticsDimension = AnalyticsCatalogueDimension
// AnalyticsFilter: A dimension filter.
type AnalyticsFilter struct {
Dimension AnalyticsDimension `json:"dimension"`
// eq requires one value; in and not_in require one or more values; is_null and is_not_null require no values.
Operator AnalyticsFilterOperator `json:"operator"`
// String values to match. Supply one for eq, one or more for in/not_in, and none for null checks. project_id and route_id take UUIDs; smtp_code takes a three-digit reply code.
Values []string `json:"values,omitzero"`
}
// AnalyticsFilterOperator: A filter operator.
//
// AnalyticsFilterOperator is an open enum: values the API adds later decode unchanged.
type AnalyticsFilterOperator string
// Known values of AnalyticsFilterOperator.
const (
AnalyticsFilterOperatorEq AnalyticsFilterOperator = "eq"
AnalyticsFilterOperatorIn AnalyticsFilterOperator = "in"
AnalyticsFilterOperatorNotIn AnalyticsFilterOperator = "not_in"
AnalyticsFilterOperatorIsNull AnalyticsFilterOperator = "is_null"
AnalyticsFilterOperatorIsNotNull AnalyticsFilterOperator = "is_not_null"
)
// AnalyticsGroupDimension: A catalogue dimension or tag:<case-sensitive name> to group breakdown rows by. Engagement class dimensions (is_human, is_privacy, is_bot and is_scanner) can only filter. smtp_response_group can only group: each row reads the SMTP reply of the group as its reply code, enhanced status code and response text, with addresses and other identifiers replaced by placeholders.
type AnalyticsGroupDimension = AnalyticsCatalogueGroupDimension
// AnalyticsInterval: A time-series bucket size.
//
// AnalyticsInterval is an open enum: values the API adds later decode unchanged.
type AnalyticsInterval string
// Known values of AnalyticsInterval.
const (
AnalyticsIntervalHour AnalyticsInterval = "hour"
AnalyticsIntervalDay AnalyticsInterval = "day"
)
// AnalyticsMeta: The time window and data availability of the results.
type AnalyticsMeta struct {
TimeBasis AnalyticsMetaTimeBasis `json:"time_basis"`
Timezone string `json:"timezone"`
Interval AnalyticsInterval `json:"interval"`
// Start of the window read, aligned down to the alignment grain.
From string `json:"from"`
// Exclusive end of the window, aligned up to the alignment grain.
To string `json:"to"`
// Exclusive end of the counted data: to, or generated_at while the window is ongoing.
EffectiveTo string `json:"effective_to"`
// Grain the requested boundaries were widened to: whole UTC hours, or whole UTC days for personal-data dimensions. Counts cover exactly from to effective_to.
Alignment AnalyticsMetaAlignment `json:"alignment"`
GeneratedAt string `json:"generated_at"`
AvailableSince string `json:"available_since"`
Partial bool `json:"partial"`
Ongoing bool `json:"ongoing"`
CollectionCompleteness AnalyticsMetaCollectionCompleteness `json:"collection_completeness"`
// Latest ingestion among matching rollup rows. This is not a completeness watermark.
LastIngestedAt *string `json:"last_ingested_at"`
MetricDefinitionVersion string `json:"metric_definition_version"`
RankedGroupLimit int `json:"ranked_group_limit"`
Comparison *AnalyticsMetaComparison `json:"comparison,omitzero"`
}
// AnalyticsMetaAlignment: Grain the requested boundaries were widened to: whole UTC hours, or whole UTC days for personal-data dimensions. Counts cover exactly from to effective_to.
//
// AnalyticsMetaAlignment is an open enum: values the API adds later decode unchanged.
type AnalyticsMetaAlignment string
// Known values of AnalyticsMetaAlignment.
const (
AnalyticsMetaAlignmentHour AnalyticsMetaAlignment = "hour"
AnalyticsMetaAlignmentDay AnalyticsMetaAlignment = "day"
)
// AnalyticsMetaCollectionCompleteness is an open enum: values the API adds later decode unchanged.
type AnalyticsMetaCollectionCompleteness string
// Known values of AnalyticsMetaCollectionCompleteness.
const (
AnalyticsMetaCollectionCompletenessBestEffort AnalyticsMetaCollectionCompleteness = "best_effort"
)
type AnalyticsMetaComparison struct {
From string `json:"from"`
To string `json:"to"`
Partial bool `json:"partial"`
}
// AnalyticsMetaTimeBasis is an open enum: values the API adds later decode unchanged.
type AnalyticsMetaTimeBasis string
// Known values of AnalyticsMetaTimeBasis.
const (
AnalyticsMetaTimeBasisEvent AnalyticsMetaTimeBasis = "event"
)
// AnalyticsMetric: A metric from the analytics catalogue.
//
// AnalyticsMetric is an open enum: values the API adds later decode unchanged.
type AnalyticsMetric string
// Known values of AnalyticsMetric.
const (
AnalyticsMetricAccepted AnalyticsMetric = "accepted"
AnalyticsMetricProcessed AnalyticsMetric = "processed"
AnalyticsMetricSuppressed AnalyticsMetric = "suppressed"
AnalyticsMetricPolicyRejected AnalyticsMetric = "policy_rejected"
AnalyticsMetricApplicationFailed AnalyticsMetric = "application_failed"
AnalyticsMetricMtaAccepted AnalyticsMetric = "mta_accepted"
AnalyticsMetricCanceled AnalyticsMetric = "canceled"
AnalyticsMetricMessages AnalyticsMetric = "messages"
AnalyticsMetricDelivered AnalyticsMetric = "delivered"
AnalyticsMetricBounced AnalyticsMetric = "bounced"
AnalyticsMetricSoftBounced AnalyticsMetric = "soft_bounced"
AnalyticsMetricAdministrativelyBounced AnalyticsMetric = "administratively_bounced"
AnalyticsMetricDeferredRecipients AnalyticsMetric = "deferred_recipients"
AnalyticsMetricDeferredEvents AnalyticsMetric = "deferred_events"
AnalyticsMetricDeliveryAttempts AnalyticsMetric = "delivery_attempts"
AnalyticsMetricAttemptedRecipients AnalyticsMetric = "attempted_recipients"
AnalyticsMetricTransportOutcomeRecipients AnalyticsMetric = "transport_outcome_recipients"
AnalyticsMetricEffectiveDelivered AnalyticsMetric = "effective_delivered"
AnalyticsMetricOpenTrackedDelivered AnalyticsMetric = "open_tracked_delivered"
AnalyticsMetricClickTrackedDelivered AnalyticsMetric = "click_tracked_delivered"
AnalyticsMetricOutOfBandBouncedRecipients AnalyticsMetric = "out_of_band_bounced_recipients"
AnalyticsMetricOutOfBandBounceEvents AnalyticsMetric = "out_of_band_bounce_events"
AnalyticsMetricComplained AnalyticsMetric = "complained"
AnalyticsMetricUnsubscribed AnalyticsMetric = "unsubscribed"
AnalyticsMetricHumanOpens AnalyticsMetric = "human_opens"
AnalyticsMetricHumanOpensEvents AnalyticsMetric = "human_opens_events"
AnalyticsMetricHumanClicks AnalyticsMetric = "human_clicks"
AnalyticsMetricHumanClicksEvents AnalyticsMetric = "human_clicks_events"
AnalyticsMetricMachineOpens AnalyticsMetric = "machine_opens"
AnalyticsMetricMachineOpensEvents AnalyticsMetric = "machine_opens_events"
AnalyticsMetricMachineClicks AnalyticsMetric = "machine_clicks"
AnalyticsMetricMachineClicksEvents AnalyticsMetric = "machine_clicks_events"
AnalyticsMetricPrivacyOpens AnalyticsMetric = "privacy_opens"
AnalyticsMetricPrivacyOpensEvents AnalyticsMetric = "privacy_opens_events"
AnalyticsMetricPrivacyClicks AnalyticsMetric = "privacy_clicks"
AnalyticsMetricPrivacyClicksEvents AnalyticsMetric = "privacy_clicks_events"
AnalyticsMetricBotOpens AnalyticsMetric = "bot_opens"
AnalyticsMetricBotOpensEvents AnalyticsMetric = "bot_opens_events"
AnalyticsMetricBotClicks AnalyticsMetric = "bot_clicks"
AnalyticsMetricBotClicksEvents AnalyticsMetric = "bot_clicks_events"
AnalyticsMetricScannerOpens AnalyticsMetric = "scanner_opens"
AnalyticsMetricScannerOpensEvents AnalyticsMetric = "scanner_opens_events"
AnalyticsMetricScannerClicks AnalyticsMetric = "scanner_clicks"
AnalyticsMetricScannerClicksEvents AnalyticsMetric = "scanner_clicks_events"
AnalyticsMetricObservedOpens AnalyticsMetric = "observed_opens"
AnalyticsMetricObservedOpensEvents AnalyticsMetric = "observed_opens_events"
AnalyticsMetricObservedClicks AnalyticsMetric = "observed_clicks"
AnalyticsMetricObservedClicksEvents AnalyticsMetric = "observed_clicks_events"
AnalyticsMetricDeliveryRate AnalyticsMetric = "delivery_rate"
AnalyticsMetricEffectiveDeliveryRate AnalyticsMetric = "effective_delivery_rate"
AnalyticsMetricBounceRate AnalyticsMetric = "bounce_rate"
AnalyticsMetricDeferralRate AnalyticsMetric = "deferral_rate"
AnalyticsMetricComplaintRate AnalyticsMetric = "complaint_rate"
AnalyticsMetricHumanOpenRate AnalyticsMetric = "human_open_rate"
AnalyticsMetricHumanClickRate AnalyticsMetric = "human_click_rate"
AnalyticsMetricProcessingLatencyP50Ms AnalyticsMetric = "processing_latency_p50_ms"
AnalyticsMetricProcessingLatencyP95Ms AnalyticsMetric = "processing_latency_p95_ms"
AnalyticsMetricProcessingLatencyP99Ms AnalyticsMetric = "processing_latency_p99_ms"
AnalyticsMetricProcessingLatencySamples AnalyticsMetric = "processing_latency_samples"
AnalyticsMetricDeliveryLatencyP50Ms AnalyticsMetric = "delivery_latency_p50_ms"
AnalyticsMetricDeliveryLatencyP95Ms AnalyticsMetric = "delivery_latency_p95_ms"
AnalyticsMetricDeliveryLatencyP99Ms AnalyticsMetric = "delivery_latency_p99_ms"
AnalyticsMetricDeliveryLatencySamples AnalyticsMetric = "delivery_latency_samples"
AnalyticsMetricTotalLatencyP50Ms AnalyticsMetric = "total_latency_p50_ms"
AnalyticsMetricTotalLatencyP95Ms AnalyticsMetric = "total_latency_p95_ms"
AnalyticsMetricTotalLatencyP99Ms AnalyticsMetric = "total_latency_p99_ms"
AnalyticsMetricTotalLatencySamples AnalyticsMetric = "total_latency_samples"
)
// AnalyticsMetricChange: Change of a metric against the comparison period.
type AnalyticsMetricChange struct {
Absolute Nullable[float64] `json:"absolute,omitzero"`
Relative Nullable[float64] `json:"relative,omitzero"`
PercentagePoints Nullable[float64] `json:"percentage_points,omitzero"`
}
// AnalyticsMetricValues: Values of the selected metrics. Rates are fractions; null when not available.
type AnalyticsMetricValues struct {
Accepted Nullable[int] `json:"accepted,omitzero"`
Processed Nullable[int] `json:"processed,omitzero"`
Suppressed Nullable[int] `json:"suppressed,omitzero"`
PolicyRejected Nullable[int] `json:"policy_rejected,omitzero"`
ApplicationFailed Nullable[int] `json:"application_failed,omitzero"`
MtaAccepted Nullable[int] `json:"mta_accepted,omitzero"`
Canceled Nullable[int] `json:"canceled,omitzero"`
Messages Nullable[int] `json:"messages,omitzero"`
Delivered Nullable[int] `json:"delivered,omitzero"`
Bounced Nullable[int] `json:"bounced,omitzero"`
SoftBounced Nullable[int] `json:"soft_bounced,omitzero"`
AdministrativelyBounced Nullable[int] `json:"administratively_bounced,omitzero"`
DeferredRecipients Nullable[int] `json:"deferred_recipients,omitzero"`
DeferredEvents Nullable[int] `json:"deferred_events,omitzero"`
DeliveryAttempts Nullable[int] `json:"delivery_attempts,omitzero"`
AttemptedRecipients Nullable[int] `json:"attempted_recipients,omitzero"`
TransportOutcomeRecipients Nullable[int] `json:"transport_outcome_recipients,omitzero"`
EffectiveDelivered Nullable[int] `json:"effective_delivered,omitzero"`
OpenTrackedDelivered Nullable[int] `json:"open_tracked_delivered,omitzero"`
ClickTrackedDelivered Nullable[int] `json:"click_tracked_delivered,omitzero"`
OutOfBandBouncedRecipients Nullable[int] `json:"out_of_band_bounced_recipients,omitzero"`
OutOfBandBounceEvents Nullable[int] `json:"out_of_band_bounce_events,omitzero"`
Complained Nullable[int] `json:"complained,omitzero"`
Unsubscribed Nullable[int] `json:"unsubscribed,omitzero"`
HumanOpens Nullable[int] `json:"human_opens,omitzero"`
HumanOpensEvents Nullable[int] `json:"human_opens_events,omitzero"`
HumanClicks Nullable[int] `json:"human_clicks,omitzero"`
HumanClicksEvents Nullable[int] `json:"human_clicks_events,omitzero"`
MachineOpens Nullable[int] `json:"machine_opens,omitzero"`
MachineOpensEvents Nullable[int] `json:"machine_opens_events,omitzero"`
MachineClicks Nullable[int] `json:"machine_clicks,omitzero"`
MachineClicksEvents Nullable[int] `json:"machine_clicks_events,omitzero"`
PrivacyOpens Nullable[int] `json:"privacy_opens,omitzero"`
PrivacyOpensEvents Nullable[int] `json:"privacy_opens_events,omitzero"`
PrivacyClicks Nullable[int] `json:"privacy_clicks,omitzero"`
PrivacyClicksEvents Nullable[int] `json:"privacy_clicks_events,omitzero"`
BotOpens Nullable[int] `json:"bot_opens,omitzero"`
BotOpensEvents Nullable[int] `json:"bot_opens_events,omitzero"`
BotClicks Nullable[int] `json:"bot_clicks,omitzero"`
BotClicksEvents Nullable[int] `json:"bot_clicks_events,omitzero"`
ScannerOpens Nullable[int] `json:"scanner_opens,omitzero"`
ScannerOpensEvents Nullable[int] `json:"scanner_opens_events,omitzero"`
ScannerClicks Nullable[int] `json:"scanner_clicks,omitzero"`
ScannerClicksEvents Nullable[int] `json:"scanner_clicks_events,omitzero"`
ObservedOpens Nullable[int] `json:"observed_opens,omitzero"`
ObservedOpensEvents Nullable[int] `json:"observed_opens_events,omitzero"`
ObservedClicks Nullable[int] `json:"observed_clicks,omitzero"`
ObservedClicksEvents Nullable[int] `json:"observed_clicks_events,omitzero"`
DeliveryRate Nullable[float64] `json:"delivery_rate,omitzero"`
EffectiveDeliveryRate Nullable[float64] `json:"effective_delivery_rate,omitzero"`
BounceRate Nullable[float64] `json:"bounce_rate,omitzero"`
DeferralRate Nullable[float64] `json:"deferral_rate,omitzero"`
ComplaintRate Nullable[float64] `json:"complaint_rate,omitzero"`
HumanOpenRate Nullable[float64] `json:"human_open_rate,omitzero"`
HumanClickRate Nullable[float64] `json:"human_click_rate,omitzero"`
ProcessingLatencyP50Ms Nullable[float64] `json:"processing_latency_p50_ms,omitzero"`
ProcessingLatencyP95Ms Nullable[float64] `json:"processing_latency_p95_ms,omitzero"`
ProcessingLatencyP99Ms Nullable[float64] `json:"processing_latency_p99_ms,omitzero"`
ProcessingLatencySamples Nullable[int] `json:"processing_latency_samples,omitzero"`
DeliveryLatencyP50Ms Nullable[float64] `json:"delivery_latency_p50_ms,omitzero"`
DeliveryLatencyP95Ms Nullable[float64] `json:"delivery_latency_p95_ms,omitzero"`
DeliveryLatencyP99Ms Nullable[float64] `json:"delivery_latency_p99_ms,omitzero"`
DeliveryLatencySamples Nullable[int] `json:"delivery_latency_samples,omitzero"`
TotalLatencyP50Ms Nullable[float64] `json:"total_latency_p50_ms,omitzero"`
TotalLatencyP95Ms Nullable[float64] `json:"total_latency_p95_ms,omitzero"`
TotalLatencyP99Ms Nullable[float64] `json:"total_latency_p99_ms,omitzero"`
TotalLatencySamples Nullable[int] `json:"total_latency_samples,omitzero"`
}
// AnalyticsPagination: Breakdown pagination.
type AnalyticsPagination struct {
TotalGroups int `json:"total_groups"`
ReturnedGroups int `json:"returned_groups"`
NextCursor *string `json:"next_cursor"`
Truncated bool `json:"truncated"`
}
// AnalyticsQuery: An analytics query.
type AnalyticsQuery struct {
// Every count is attributed to the time its event occurred, so a message accepted in one bucket can be delivered in the next. Delivery outcomes happen once per recipient, so their event counts equal recipient counts. messages counts accepted messages; mta_accepted and attempted_recipients count recipients the MTA received. Under provider, infrastructure and diagnosis dimensions, sent/attempted count delivery attempts: mta_accepted and attempted_recipients equal delivery_attempts when a query groups or filters by provider_family, provider_subtype, dedicated_ip, dedicated_pool_id, infrastructure_state or an SMTP diagnosis dimension, because the MTA assigns those values at the delivery attempt; the other lifecycle metrics return null there, and a breakdown by those dimensions omits the unknown group. deferred_recipients counts recipients delayed on the first attempt; deferred_events counts every deferral. delivery_attempts counts delivered, deferred and in-band bounced attempts. transport_outcome_recipients = delivered + bounced + soft_bounced. effective_delivered = delivered minus out-of-band bounces in the same period and can be negative for a single bucket or group. Engagement counts per class are unique per recipient, counted when the first qualifying open or click occurred; _events variants count every observation. Rates are fractions; zero denominators return null, and event-time rates can exceed 1. Latency percentiles are milliseconds read from log-scale histograms (error below 15 percent); _samples returns the sample count. Personal message dimensions support daily buckets over the message retention period. delivery_rate = delivered / transport_outcome_recipients. effective_delivery_rate = effective_delivered / transport_outcome_recipients. bounce_rate = bounced / transport_outcome_recipients. deferral_rate = deferred_events / delivery_attempts. complaint_rate = complained / delivered. human_open_rate = human_opens / open_tracked_delivered. human_click_rate = human_clicks / click_tracked_delivered.
Metrics []AnalyticsMetric `json:"metrics"`
// Inclusive calendar date or RFC 3339 instant. Default: 30 calendar days including today. Instants are aligned outward to whole UTC hours, or whole UTC days when from_address or subject is grouped or filtered; meta.from, meta.to, meta.effective_to and meta.alignment report the exact window used.
From *string `json:"from,omitzero"`
// Inclusive calendar date or exclusive RFC 3339 instant. Maximum window: 90 days. Instants are aligned outward to whole UTC hours, or whole UTC days when from_address or subject is grouped or filtered; meta.from, meta.to, meta.effective_to and meta.alignment report the exact window used.
To *string `json:"to,omitzero"`
// IANA time zone. Default: UTC.
Timezone *string `json:"timezone,omitzero"`
// Result sections. Default: summary only. breakdown requires group_by, and group_by requires breakdown.
Include []AnalyticsSection `json:"include,omitzero"`
// Up to three grouping dimensions for breakdown rows. Requires breakdown in include. Default: no grouping.
GroupBy []AnalyticsGroupDimension `json:"group_by,omitzero"`
// Dimension filters combined with AND. Default: no filters. Each metric must support every filter dimension.
Filters []AnalyticsFilter `json:"filters,omitzero"`
// Time-series bucket size. Default: day.
Interval *AnalyticsInterval `json:"interval,omitzero"`
// Compares with the preceding period of the same duration. Omit for no comparison.
Compare *AnalyticsComparison `json:"compare,omitzero"`
// Includes trends for breakdown rows. Requires breakdown and group_by. Default: false.
IncludeTrend *bool `json:"include_trend,omitzero"`
// Optional breakdown sort. Omit to use the default row order.
Sort *AnalyticsSort `json:"sort,omitzero"`
// Maximum breakdown rows per page. Default: 50; maximum: 200.
Limit *int `json:"limit,omitzero"`
// Repeat the same query with this cursor. It expires within 60 seconds.
Cursor *string `json:"cursor,omitzero"`
}
// AnalyticsRateBase: Numerator and denominator of a rate metric.
type AnalyticsRateBase struct {
Numerator *int `json:"numerator"`
Denominator *int `json:"denominator"`
}
// AnalyticsRateBases: Numerators and denominators of the selected rate metrics.
type AnalyticsRateBases struct {
DeliveryRate *AnalyticsRateBase `json:"delivery_rate,omitzero"`
EffectiveDeliveryRate *AnalyticsRateBase `json:"effective_delivery_rate,omitzero"`
BounceRate *AnalyticsRateBase `json:"bounce_rate,omitzero"`
DeferralRate *AnalyticsRateBase `json:"deferral_rate,omitzero"`
ComplaintRate *AnalyticsRateBase `json:"complaint_rate,omitzero"`
HumanOpenRate *AnalyticsRateBase `json:"human_open_rate,omitzero"`
HumanClickRate *AnalyticsRateBase `json:"human_click_rate,omitzero"`
}
// AnalyticsResponse: Analytics results with their window metadata and pagination.
type AnalyticsResponse struct {
Data AnalyticsResults `json:"data"`
Meta AnalyticsMeta `json:"meta"`
Pagination AnalyticsPagination `json:"pagination"`
}
// AnalyticsResults: The selected result sections.
type AnalyticsResults struct {
Summary *AnalyticsSummary `json:"summary,omitzero"`
TimeSeries []AnalyticsTimeSeriesPoint `json:"time_series,omitzero"`
Breakdown []AnalyticsBreakdownRow `json:"breakdown,omitzero"`
}
// AnalyticsSection: A result section.
//
// AnalyticsSection is an open enum: values the API adds later decode unchanged.
type AnalyticsSection string
// Known values of AnalyticsSection.
const (
AnalyticsSectionSummary AnalyticsSection = "summary"
AnalyticsSectionTimeSeries AnalyticsSection = "time_series"
AnalyticsSectionBreakdown AnalyticsSection = "breakdown"
)
// AnalyticsSort: A breakdown sort order.
type AnalyticsSort struct {
// Metric used to sort breakdown rows. Must also be selected in metrics.
Metric AnalyticsMetric `json:"metric"`
// Ascending or descending order for the selected sort metric.
Direction AnalyticsSortDirection `json:"direction"`
}
// AnalyticsSortDirection: Ascending or descending order for the selected sort metric.
//
// AnalyticsSortDirection is an open enum: values the API adds later decode unchanged.
type AnalyticsSortDirection string
// Known values of AnalyticsSortDirection.
const (
AnalyticsSortDirectionAsc AnalyticsSortDirection = "asc"
AnalyticsSortDirectionDesc AnalyticsSortDirection = "desc"
)
// AnalyticsSummary: Metric values for the whole window.
type AnalyticsSummary struct {
Metrics AnalyticsMetricValues `json:"metrics"`
RateBases AnalyticsRateBases `json:"rate_bases"`
Previous *AnalyticsComparisonValues `json:"previous,omitzero"`
Change map[string]AnalyticsMetricChange `json:"change,omitzero"`
}
// AnalyticsTimeSeriesPoint: Metric values for one time-series bucket.
type AnalyticsTimeSeriesPoint struct {
Metrics AnalyticsMetricValues `json:"metrics"`
RateBases AnalyticsRateBases `json:"rate_bases"`
Previous *AnalyticsComparisonValues `json:"previous,omitzero"`
Change map[string]AnalyticsMetricChange `json:"change,omitzero"`
From string `json:"from"`
To string `json:"to"`
Available bool `json:"available"`
Partial bool `json:"partial"`
}
// ApiErrorBody: Structured API error.
type ApiErrorBody struct {
Error ApiErrorDetail `json:"error"`
}
type ApiErrorDetail struct {
// Machine-readable error code, for example `RESOURCE_NOT_FOUND`.
Code string `json:"code"`
// Human-readable error message.
Message string `json:"message"`
// Additional context. Its shape depends on the error code.
Details Nullable[any] `json:"details,omitzero"`
}
// AttachmentDelivery is an open enum: values the API adds later decode unchanged.
type AttachmentDelivery string
// Known values of AttachmentDelivery.
const (
AttachmentDeliveryInline AttachmentDelivery = "inline"
AttachmentDeliveryURL AttachmentDelivery = "url"
)
// BlockedFileTypes: File types that cannot be sent as email attachments.
type BlockedFileTypes struct {
// Blocked file extensions, without the leading dot
Extensions []string `json:"extensions"`
// Blocked MIME types
MimeTypes []string `json:"mime_types"`
}
// BuiltInTeamRole is an open enum: values the API adds later decode unchanged.
type BuiltInTeamRole string
// Known values of BuiltInTeamRole.
const (
BuiltInTeamRoleOwner BuiltInTeamRole = "owner"
BuiltInTeamRoleAdmin BuiltInTeamRole = "admin"
BuiltInTeamRoleMember BuiltInTeamRole = "member"
)
type CreateTeamInviteData struct {
Email string `json:"email"`
RoleID string `json:"role_id"`
ProjectAccess CreateTeamInviteDataProjectAccess `json:"project_access"`
}
type CreateTeamInviteDataProjectAccess struct {
Scope ProjectAccessScope `json:"scope"`
ProjectIDs []string `json:"project_ids,omitzero"`
}
type CreateTeamRoleData struct {
Name string `json:"name"`
Description Nullable[string] `json:"description,omitzero"`
Permissions []RbacPermission `json:"permissions"`
}
// CursorPage is a page of a cursor-paginated list. Pass NextCursor back as the
// cursor query parameter to read the next page; it is nil on the last page.
type CursorPage[T any] struct {
Data []T `json:"data"`
// Base path for paginator generated URLs.
Path *string `json:"path"`
// Number of items shown per page.
PerPage int `json:"per_page"`
// The "cursor" that points to the next set of items.
NextCursor *string `json:"next_cursor"`
NextPageURL *string `json:"next_page_url"`
// The "cursor" that points to the previous set of items.
PrevCursor *string `json:"prev_cursor"`
PrevPageURL *string `json:"prev_page_url"`
}
type DeleteSuppressionResponse struct {
Success bool `json:"success"`
Status DeleteSuppressionResponseStatus `json:"status"`
// Human-readable confirmation
Message string `json:"message"`
// Confidence of the automated removal assessment, when one ran
Confidence *float64 `json:"confidence,omitzero"`
// The identifier of the support ticket that reviews the removal
TicketIdentifier *string `json:"ticket_identifier,omitzero"`
}
// DeleteSuppressionResponseStatus is an open enum: values the API adds later decode unchanged.
type DeleteSuppressionResponseStatus string
// Known values of DeleteSuppressionResponseStatus.
const (
DeleteSuppressionResponseStatusRemoved DeleteSuppressionResponseStatus = "removed"
DeleteSuppressionResponseStatusReviewTicketCreated DeleteSuppressionResponseStatus = "review_ticket_created"
DeleteSuppressionResponseStatusReviewTicketExists DeleteSuppressionResponseStatus = "review_ticket_exists"
)
// DeleteTeamRoleQuery holds the query parameters of DELETE /team/roles/{roleId} (deleteTeamRole).
// A zero value is not sent; booleans are pointers so that false can be sent.
type DeleteTeamRoleQuery struct {
// Same-team non-Owner role that receives existing assignments. Required only while the deleted role is assigned.
ReplacementRoleID string `query:"replacement_role_id"`
}
// DeliveryMode is an open enum: values the API adds later decode unchanged.
type DeliveryMode string
// Known values of DeliveryMode.
const (
DeliveryModeLive DeliveryMode = "live"
DeliveryModeSandbox DeliveryMode = "sandbox"
)
// DkimMode is an open enum: values the API adds later decode unchanged.
type DkimMode string
// Known values of DkimMode.
const (
DkimModeLegacyTxt DkimMode = "legacy_txt"
DkimModeManagedCname DkimMode = "managed_cname"
)
// DmarcPolicy is an open enum: values the API adds later decode unchanged.
type DmarcPolicy string
// Known values of DmarcPolicy.
const (
DmarcPolicyNone DmarcPolicy = "none"
DmarcPolicyQuarantine DmarcPolicy = "quarantine"
DmarcPolicyReject DmarcPolicy = "reject"
)
// DnsRecordPurpose is an open enum: values the API adds later decode unchanged.
type DnsRecordPurpose string
// Known values of DnsRecordPurpose.
const (
DnsRecordPurposeReturnPath DnsRecordPurpose = "return_path"
DnsRecordPurposeDmarc DnsRecordPurpose = "dmarc"
DnsRecordPurposeDkimLegacy DnsRecordPurpose = "dkim_legacy"
DnsRecordPurposeDkimPrimary DnsRecordPurpose = "dkim_primary"
DnsRecordPurposeDkimSecondary DnsRecordPurpose = "dkim_secondary"
)
// DnsRecordStatus: | |
// |---|
// | `active` <br/> The record is active and verified. |
// | `failed` <br/> The record could not be verified. |
// | `pending` <br/> The record is pending verification. |
//
// DnsRecordStatus is an open enum: values the API adds later decode unchanged.
type DnsRecordStatus string
// Known values of DnsRecordStatus.
const (
DnsRecordStatusActive DnsRecordStatus = "active"
DnsRecordStatusFailed DnsRecordStatus = "failed"
DnsRecordStatusPending DnsRecordStatus = "pending"
)
// DnsRecordVerificationFailureResponse: A DNS record that did not pass verification, with the verification details.
type DnsRecordVerificationFailureResponse struct {
// Human-readable verification error
Message string `json:"message"`
Result DnsVerificationResultData `json:"result"`
}
// DnsVerificationError: Why a DNS record did not pass verification.
type DnsVerificationError struct {
// The DNS record ID
RecordID string `json:"record_id"`
Error string `json:"error"`
}
// DnsVerificationFailedRecord: A DNS record that did not pass verification.
type DnsVerificationFailedRecord struct {
// The DNS record ID
ID string `json:"id"`
Type RecordType `json:"type"`
// The record hostname
Name string `json:"name"`
}
// DnsVerificationFailureResponse: One or more required DNS records of the domain did not pass verification.
type DnsVerificationFailureResponse struct {
// Human-readable verification result
Message string `json:"message"`
// Required records that did not pass verification
FailedRecords []DnsVerificationFailedRecord `json:"failed_records"`
// Verification errors of every failed record, including recommended records
Errors []DnsVerificationError `json:"errors"`
// The number of required records that failed
FailedCount int `json:"failed_count"`
// The number of required records
TotalCount int `json:"total_count"`
}
type DnsVerificationResultData struct {
DmarcSpfAlignmentIssue *DnsVerificationResultDataDmarcSpfAlignmentIssue `json:"dmarc_spf_alignment_issue"`
Verified bool `json:"verified"`
Error *string `json:"error"`
ExpectedRecord *string `json:"expected_record"`
FoundRecord *string `json:"found_record"`
DmarcPolicyDomain *string `json:"dmarc_policy_domain"`
DmarcEffectivePolicy *DmarcPolicy `json:"dmarc_effective_policy"`
}
type DnsVerificationResultDataDmarcSpfAlignmentIssue struct {
Code string `json:"code"`
BlocksVerification bool `json:"blocks_verification"`
ReturnPathDomain string `json:"return_path_domain"`
}
// DnsVerificationScope is an open enum: values the API adds later decode unchanged.
type DnsVerificationScope string
// Known values of DnsVerificationScope.
const (
DnsVerificationScopeRequired DnsVerificationScope = "required"
DnsVerificationScopeRecommended DnsVerificationScope = "recommended"
DnsVerificationScopeMigration DnsVerificationScope = "migration"
DnsVerificationScopeDeprecated DnsVerificationScope = "deprecated"
)
// DnsVerificationSuccessResponse: All required DNS records of the domain passed verification.
type DnsVerificationSuccessResponse struct {
// Human-readable verification result
Message string `json:"message"`
// Recommended records that did not pass verification. They do not block verification
RecommendedFailedRecords []DnsVerificationFailedRecord `json:"recommended_failed_records"`
}
type DomainData struct {
ID string `json:"id"`
Domain string `json:"domain"`
DkimMode DkimMode `json:"dkim_mode"`
RotationReady bool `json:"rotation_ready"`
StatusChangedAt *string `json:"status_changed_at"`
DNSRecords []DomainDnsRecordData `json:"dns_records,omitzero"`
Projects []DomainDataProjectsItem `json:"projects,omitzero"`
CreatedAt string `json:"created_at"`
}
type DomainDataProjectsItem struct {
ID string `json:"id"`
Name string `json:"name"`
}
type DomainDnsRecordData struct {
ID string `json:"id"`
Type RecordType `json:"type"`
Hostname string `json:"hostname"`
Fqdn string `json:"fqdn"`
Content string `json:"content"`
Status DnsRecordStatus `json:"status"`
Purpose DnsRecordPurpose `json:"purpose"`
VerificationScope DnsVerificationScope `json:"verification_scope"`
RequiredForVerification bool `json:"required_for_verification"`
VerifiedAt *string `json:"verified_at"`
LastCheckedAt *string `json:"last_checked_at"`
}
type DomainListData struct {
ID string `json:"id"`
Domain string `json:"domain"`
Status DomainStatus `json:"status"`
DkimMode DkimMode `json:"dkim_mode"`
StatusChangedAt *string `json:"status_changed_at"`
CreatedAt string `json:"created_at"`
}
// DomainMutationResponse: The domain after a change, with a confirmation message.
type DomainMutationResponse struct {
Data DomainData `json:"data"`
// Human-readable confirmation
Message string `json:"message"`
}
// DomainStatus: | |
// |---|
// | `verified` <br/> The domain is active and verified. |
// | `partially_verified` <br/> Some DNS records of the domain could not be verified. |
// | `pending_verification` <br/> The domain is new and verification is pending. |
// | `failed_verification` <br/> The domain verification failed. |
//
// DomainStatus is an open enum: values the API adds later decode unchanged.
type DomainStatus string
// Known values of DomainStatus.
const (
DomainStatusVerified DomainStatus = "verified"
DomainStatusPartiallyVerified DomainStatus = "partially_verified"
DomainStatusPendingVerification DomainStatus = "pending_verification"
DomainStatusFailedVerification DomainStatus = "failed_verification"
)
type DuplicateTeamRoleData struct {
Name string `json:"name"`
Description Nullable[string] `json:"description,omitzero"`
}
// ErrorMessage: Error with only a message.
type ErrorMessage struct {
// Error overview.
Message string `json:"message"`
}
// GetDomainQuery holds the query parameters of GET /domains/{domainId} (getDomain).
// A zero value is not sent; booleans are pointers so that false can be sent.
type GetDomainQuery struct {
Include []GetDomainQueryIncludeItem `query:"include"`
}
// GetDomainQueryIncludeItem is an open enum: values the API adds later decode unchanged.
type GetDomainQueryIncludeItem string
// Known values of GetDomainQueryIncludeItem.
const (
GetDomainQueryIncludeItemDNSRecords GetDomainQueryIncludeItem = "dnsRecords"
GetDomainQueryIncludeItemProjects GetDomainQueryIncludeItem = "projects"
)
// GetProjectQuery holds the query parameters of GET /projects/{projectId} (getProject).
// A zero value is not sent; booleans are pointers so that false can be sent.
type GetProjectQuery struct {
Include []GetProjectQueryIncludeItem `query:"include"`
}
// GetProjectQueryIncludeItem is an open enum: values the API adds later decode unchanged.
type GetProjectQueryIncludeItem string
// Known values of GetProjectQueryIncludeItem.
const (
GetProjectQueryIncludeItemRoutes GetProjectQueryIncludeItem = "routes"
GetProjectQueryIncludeItemRoutesCount GetProjectQueryIncludeItem = "routesCount"
GetProjectQueryIncludeItemRoutesExists GetProjectQueryIncludeItem = "routesExists"
GetProjectQueryIncludeItemDomains GetProjectQueryIncludeItem = "domains"
GetProjectQueryIncludeItemDomainsCount GetProjectQueryIncludeItem = "domainsCount"
GetProjectQueryIncludeItemDomainsExists GetProjectQueryIncludeItem = "domainsExists"
GetProjectQueryIncludeItemMessageStats GetProjectQueryIncludeItem = "messageStats"
GetProjectQueryIncludeItemMessageStatsCount GetProjectQueryIncludeItem = "messageStatsCount"
GetProjectQueryIncludeItemMessageStatsExists GetProjectQueryIncludeItem = "messageStatsExists"
)
type GetReportForwardingResponse struct {
Data ReportForwardingResource `json:"data"`
}
// GetRouteQuery holds the query parameters of GET /routes/{routeId} (getRoute).
// A zero value is not sent; booleans are pointers so that false can be sent.
type GetRouteQuery struct {
// Include legacy machine observations in open and click totals. Privacy opens are reported in the observed and privacy fields without this option.
IncludeMachine *bool `query:"include_machine"`
Include []GetRouteQueryIncludeItem `query:"include"`
}
// GetRouteQueryIncludeItem is an open enum: values the API adds later decode unchanged.
type GetRouteQueryIncludeItem string
// Known values of GetRouteQueryIncludeItem.
const (
GetRouteQueryIncludeItemProject GetRouteQueryIncludeItem = "project"
GetRouteQueryIncludeItemProjectCount GetRouteQueryIncludeItem = "projectCount"
GetRouteQueryIncludeItemProjectExists GetRouteQueryIncludeItem = "projectExists"
GetRouteQueryIncludeItemStatistics GetRouteQueryIncludeItem = "statistics"
)
// GetStatsQuery holds the query parameters of GET /stats (getStats).
// A zero value is not sent; booleans are pointers so that false can be sent.
type GetStatsQuery struct {
From string `query:"from"`
To string `query:"to"`
ProjectID string `query:"project_id"`
IncludeMachine *bool `query:"include_machine"`
}
// GetTeamQuery holds the query parameters of GET /team (getTeam).
// A zero value is not sent; booleans are pointers so that false can be sent.
type GetTeamQuery struct {
Include []GetTeamQueryIncludeItem `query:"include"`
}
// GetTeamQueryIncludeItem is an open enum: values the API adds later decode unchanged.
type GetTeamQueryIncludeItem string
// Known values of GetTeamQueryIncludeItem.
const (
GetTeamQueryIncludeItemFeatures GetTeamQueryIncludeItem = "features"
GetTeamQueryIncludeItemAddons GetTeamQueryIncludeItem = "addons"
)
// InboundDomainVerification: Whether the inbound domain MX records point to Lettermint. The MX record lists are only returned when verification fails.
type InboundDomainVerification struct {
Verified bool `json:"verified"`
// Human-readable verification result
Message string `json:"message"`
// The MX records the inbound domain must publish
ExpectedMXRecords []string `json:"expected_mx_records,omitzero"`
// The MX records found for the inbound domain
FoundMXRecords []string `json:"found_mx_records,omitzero"`
}
// InboundDomainVerificationResponse: The result of an inbound domain MX verification.
type InboundDomainVerificationResponse struct {
Data InboundDomainVerification `json:"data"`
}
// InitialRoutes is an open enum: values the API adds later decode unchanged.
type InitialRoutes string
// Known values of InitialRoutes.
const (
InitialRoutesBoth InitialRoutes = "both"
InitialRoutesTransactional InitialRoutes = "transactional"
InitialRoutesBroadcast InitialRoutes = "broadcast"
)
// ListDomainsQuery holds the query parameters of GET /domains (listDomains).
// A zero value is not sent; booleans are pointers so that false can be sent.
type ListDomainsQuery struct {
// The number of results that will be returned per page.
PageSize int `query:"page[size]"`
// The cursor to start the pagination from.
PageCursor string `query:"page[cursor]"`
Sort []ListDomainsQuerySortItem `query:"sort"`
// Filter by project ID
FilterProject string `query:"filter[project]"`
FilterStatus DomainStatus `query:"filter[status]"`
// Search by domain name (partial match, case insensitive)
FilterDomain string `query:"filter[domain]"`
}