aweber 0.1.1

A CLI and library for the AWeber API
Documentation
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
#[doc = r" Error types."]
use std::collections::HashMap;

pub mod error {
    #[doc = r" Error from a `TryFrom` or `FromStr` implementation."]
    pub struct ConversionError(std::borrow::Cow<'static, str>);
    impl std::error::Error for ConversionError {}
    impl std::fmt::Display for ConversionError {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
            std::fmt::Display::fmt(&self.0, f)
        }
    }
    impl std::fmt::Debug for ConversionError {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
            std::fmt::Debug::fmt(&self.0, f)
        }
    }
    impl From<&'static str> for ConversionError {
        fn from(value: &'static str) -> Self {
            Self(value.into())
        }
    }
    impl From<String> for ConversionError {
        fn from(value: String) -> Self {
            Self(value.into())
        }
    }
}

macro_rules! validated_string {
    // min + max length validation
    ($name:ident, min=$min:expr, max=$max:expr) => {
        #[derive(serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
        #[serde(transparent)]
        pub struct $name(String);
        impl std::ops::Deref for $name {
            type Target = String;
            fn deref(&self) -> &String { &self.0 }
        }
        impl From<$name> for String {
            fn from(value: $name) -> Self { value.0 }
        }
        impl std::str::FromStr for $name {
            type Err = self::error::ConversionError;
            fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
                if value.chars().count() > $max {
                    return Err(concat!("longer than ", stringify!($max), " characters").into());
                }
                if value.chars().count() < $min {
                    return Err(concat!("shorter than ", stringify!($min), " characters").into());
                }
                Ok(Self(value.to_string()))
            }
        }
        validated_string!(@try_from $name);
        validated_string!(@deserialize $name);
    };
    // min-only validation
    ($name:ident, min=$min:expr) => {
        #[derive(serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
        #[serde(transparent)]
        pub struct $name(String);
        impl std::ops::Deref for $name {
            type Target = String;
            fn deref(&self) -> &String { &self.0 }
        }
        impl From<$name> for String {
            fn from(value: $name) -> Self { value.0 }
        }
        impl std::str::FromStr for $name {
            type Err = self::error::ConversionError;
            fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
                if value.chars().count() < $min {
                    return Err(concat!("shorter than ", stringify!($min), " characters").into());
                }
                Ok(Self(value.to_string()))
            }
        }
        validated_string!(@try_from $name);
        validated_string!(@deserialize $name);
    };
    // max-only validation
    ($name:ident, max=$max:expr) => {
        #[derive(serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
        #[serde(transparent)]
        pub struct $name(String);
        impl std::ops::Deref for $name {
            type Target = String;
            fn deref(&self) -> &String { &self.0 }
        }
        impl From<$name> for String {
            fn from(value: $name) -> Self { value.0 }
        }
        impl std::str::FromStr for $name {
            type Err = self::error::ConversionError;
            fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
                if value.chars().count() > $max {
                    return Err(concat!("longer than ", stringify!($max), " characters").into());
                }
                Ok(Self(value.to_string()))
            }
        }
        validated_string!(@try_from $name);
        validated_string!(@deserialize $name);
    };
    // UUID validation
    ($name:ident, uuid) => {
        #[derive(serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
        #[serde(transparent)]
        pub struct $name(String);
        impl std::ops::Deref for $name {
            type Target = String;
            fn deref(&self) -> &String { &self.0 }
        }
        impl From<$name> for String {
            fn from(value: $name) -> Self { value.0 }
        }
        impl std::str::FromStr for $name {
            type Err = self::error::ConversionError;
            fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
                uuid::Uuid::parse_str(value)
                    .map_err(|_| self::error::ConversionError::from("invalid UUID format"))?;
                Ok(Self(value.to_string()))
            }
        }
        validated_string!(@try_from $name);
        validated_string!(@deserialize $name);
    };
    // no validation (pub field, From<String>, Display, Infallible)
    ($name:ident) => {
        #[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
        #[serde(transparent)]
        pub struct $name(pub String);
        impl std::ops::Deref for $name {
            type Target = String;
            fn deref(&self) -> &String { &self.0 }
        }
        impl From<$name> for String {
            fn from(value: $name) -> Self { value.0 }
        }
        impl From<String> for $name {
            fn from(value: String) -> Self { Self(value) }
        }
        impl std::str::FromStr for $name {
            type Err = ::std::convert::Infallible;
            fn from_str(value: &str) -> Result<Self, Self::Err> {
                Ok(Self(value.to_string()))
            }
        }
        impl std::fmt::Display for $name {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                self.0.fmt(f)
            }
        }
    };
    // shared TryFrom impls
    (@try_from $name:ident) => {
        impl TryFrom<&str> for $name {
            type Error = self::error::ConversionError;
            fn try_from(value: &str) -> Result<Self, self::error::ConversionError> { value.parse() }
        }
        impl TryFrom<&String> for $name {
            type Error = self::error::ConversionError;
            fn try_from(value: &String) -> Result<Self, self::error::ConversionError> { value.parse() }
        }
        impl TryFrom<String> for $name {
            type Error = self::error::ConversionError;
            fn try_from(value: String) -> Result<Self, self::error::ConversionError> { value.parse() }
        }
    };
    // shared Deserialize impl
    (@deserialize $name:ident) => {
        impl<'de> ::serde::Deserialize<'de> for $name {
            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
            where
                D: ::serde::Deserializer<'de>,
            {
                String::deserialize(deserializer)?
                    .parse()
                    .map_err(|e: self::error::ConversionError| {
                        <D::Error as ::serde::de::Error>::custom(e.to_string())
                    })
            }
        }
    };
}

macro_rules! string_enum {
    (pub enum $name:ident { $($variant:ident => $str:expr),+ $(,)? }) => {
        #[derive(serde::Deserialize, serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
        pub enum $name {
            $(#[serde(rename = $str)] $variant,)+
        }
        impl std::fmt::Display for $name {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                match *self {
                    $(Self::$variant => f.write_str($str),)+
                }
            }
        }
        impl std::str::FromStr for $name {
            type Err = self::error::ConversionError;
            fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
                match value {
                    $($str => Ok(Self::$variant),)+
                    _ => Err("invalid value".into()),
                }
            }
        }
        impl TryFrom<&str> for $name {
            type Error = self::error::ConversionError;
            fn try_from(value: &str) -> Result<Self, self::error::ConversionError> { value.parse() }
        }
        impl TryFrom<&String> for $name {
            type Error = self::error::ConversionError;
            fn try_from(value: &String) -> Result<Self, self::error::ConversionError> { value.parse() }
        }
        impl TryFrom<String> for $name {
            type Error = self::error::ConversionError;
            fn try_from(value: String) -> Result<Self, self::error::ConversionError> { value.parse() }
        }
    };
}

#[doc = "`Account`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Account {
    #[doc = "Analytics source for event tracking Javascript."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub analytics_src: Option<String>,
    #[doc = "Company Name associated with the account"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub company: Option<String>,
    #[doc = "The ETag HTTP header"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub http_etag: Option<String>,
    #[doc = "The unique ID for the account"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    #[doc = "The link to the [3rd party service Integrations](#tag/Integrations/paths/~1accounts~1{accountId}~1integrations/get)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub integrations_collection_link: Option<String>,
    #[doc = "The link to the [Lists for the account](#tag/Lists/paths/~1accounts~1{accountId}~1lists/get)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lists_collection_link: Option<String>,
    #[doc = "The link to the account type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to the account resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The UUID (universally unique identifier) for the account"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uuid: Option<::uuid::Uuid>,
}
#[doc = "`Accounts`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Accounts {
    #[doc = "A list of account entries"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<Account>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
#[doc = "`Activity`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Activity {
    #[doc = "The timestamp of when the event occurred"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub event_time: Option<String>,
    #[doc = "Identifier for this subscriber activity.  This is set to the type if no reasonable identifier exists."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    #[doc = "The link to the event type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to the event resource (may be null)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The link to the [Subscriber](#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers~1{subscriberId}/get) resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subscriber_link: Option<String>,
    #[doc = "The type of activity"]
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub type_: Option<ActivityType>,
}
string_enum! { pub enum ActivityType { Click => "click", Link => "link", Open => "open", SentMessage => "sent_message", Subscribed => "subscribed", TrackedEvent => "tracked_event", Verified => "verified" } }
#[doc = "`AddSubscriberRequestBody`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct AddSubscriberRequestBody {
    #[doc = "The customer ad tracking field"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ad_tracking: Option<AddSubscriberRequestBodyAdTracking>,
    #[doc = "The custom fields specified on the subscriber.  Note that the custom fields are required to already exist for the list. See [Custom Fields](#tag/Custom-Fields) for details."]
    #[serde(
        default,
        skip_serializing_if = "HashMap::is_empty"
    )]
    pub custom_fields: HashMap<
        String,
        AddSubscriberRequestBodyCustomFieldsValue,
    >,
    #[doc = "The subscriber's email address"]
    pub email: AddSubscriberRequestBodyEmail,
    #[doc = "The subscriber's IP address. This field is used to determine the following Geo Location fields: area_code, city, country, dma_code, latitude, longitude, postal_code, and region. IP address can only be specified when Subscribers are initially created. Internal, private, or reserved IP addresses are not acceptable."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ip_address: Option<AddSubscriberRequestBodyIpAddress>,
    #[doc = "The sequence number of the last followup message sent to the subscriber.  This field determines the next followup message to be sent to the Subscriber.  When set to 0 (default), the Subscriber should receive the 1st (autoresponse) Followup message.  Set the value of this field to 1001 if you do not want any Followups to be sent to this Subscriber."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub last_followup_message_number_sent: Option<i64>,
    #[doc = "Miscellaneous notes"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub misc_notes: Option<AddSubscriberRequestBodyMiscNotes>,
    #[doc = "The subscriber's name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<AddSubscriberRequestBodyName>,
    #[doc = "If this parameter is present and set to `true`, then custom field names are matched case sensitively.  Enabling this option also causes the operation to fail if a custom field is included that is not defined for the list."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub strict_custom_fields: Option<AddSubscriberRequestBodyStrictCustomFields>,
    #[doc = "A list of tags added to the subscriber.  This field is used to apply a list of tags to a Subscriber. With Campaigns, you can trigger a series of messages based on what Tags have been applied to your subscribers."]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<String>,
    #[doc = "If this parameter is present and set to `true`, then if a subscriber is already present on the list, the subscriber will be updated. <br><br> **Note:** <br>\n- Only the fields defined in the <a href='#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers~1{subscriberId}/patch'>patch</a> endpoint will be updated.\n- Any tags in the request will be **appended** to the existing Subscriber."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub update_existing: Option<AddSubscriberRequestBodyUpdateExisting>,
}
validated_string!(AddSubscriberRequestBodyAdTracking, min=1, max=20);
validated_string!(AddSubscriberRequestBodyCustomFieldsValue, min=1);
validated_string!(AddSubscriberRequestBodyEmail, min=1, max=50);
validated_string!(AddSubscriberRequestBodyIpAddress, min=1, max=60);
validated_string!(AddSubscriberRequestBodyMiscNotes, min=1, max=60);
validated_string!(AddSubscriberRequestBodyName, min=1, max=60);
string_enum! { pub enum AddSubscriberRequestBodyStrictCustomFields { True => "true", False => "false" } }
string_enum! { pub enum AddSubscriberRequestBodyUpdateExisting { True => "true", False => "false" } }
#[doc = "This will create an access token using an `authorization_code`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct AuthCode {
    #[doc = "The client ID of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_id: String,
    #[doc = "The client secret of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_secret: String,
    #[doc = "The authorization code received from the authorization call."]
    pub code: String,
    #[doc = "The grant type of the token."]
    pub grant_type: AuthCodeGrantType,
}
string_enum! { pub enum AuthCodeGrantType { AuthorizationCode => "authorization_code" } }
#[doc = "`AuthError`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct AuthError {
    #[doc = "The type of authentication error returned.\nThe following error may be received:\n\n| Error Type       | Explanation                              |\n|------------------|------------------------------------------|\n| invalid_token    | The access token is invalid or has expired |\n"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    #[doc = "A human friendly description of the error\n"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub error_description: Option<String>,
}
#[doc = "`Broadcast`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Broadcast {
    #[doc = "The link to the broadcast archive page, only set if the broadcast was sent."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub archive_url: Option<String>,
    #[doc = "<b>[Please read <a href=\"https://help.aweber.com/hc/en-us/articles/360025741194\" target=\"_blank\">our KB article</a> before using this field.]</b><br>The content of the message in AMP format."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub body_amp: Option<String>,
    #[doc = "The content of the message in html format."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub body_html: Option<String>,
    #[doc = "The content of the message in plain text, displayed when HTML is not supported."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub body_text: Option<String>,
    #[doc = "The broadcast ID."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub broadcast_id: Option<i64>,
    #[doc = "Enables links in the email message to be tracked."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub click_tracking_enabled: Option<bool>,
    #[doc = "The link to this broadcasts clicks collection."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub clicks_collection_link: Option<String>,
    #[doc = "When the message was created."]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub created_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "List of [Lists](#tag/Lists) URLs that are excluded in the delivery of this broadcast.<br> This is the `self_link` of the list here - e.g. `https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>`"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub exclude_lists: Vec<String>,
    #[doc = "URL to the [Facebook broadcast integration](#tag/Integrations) to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be posted to this Facebook integration  - e.g., `https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>`"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub facebook_integration: Option<String>,
    #[doc = "If true, the plain text field will be shown when HTML is not supported. If false, it will auto-generate plain text based on the HTML given."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub has_customized_body_text: Option<bool>,
    #[doc = "List of [Lists](#tag/Lists) URLs that are included in the delivery of this broadcast.<br> This is the `self_link` of the list here - e.g. `https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>`"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub include_lists: Vec<String>,
    #[doc = "Whether the broadcast enabled sharing via an archive url."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_archived: Option<bool>,
    #[doc = "A list of links relevant to the broadcast such as RSS feeds and broadcast archives."]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub links: Vec<BroadcastLinksItem>,
    #[doc = "If true, notify when stats are available on a sent broadcast message, defaults to true."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub notify_on_send: Option<bool>,
    #[doc = "The link to this broadcasts opens collection."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub opens_collection_link: Option<String>,
    #[doc = "When broadcast is scheduled to send."]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub scheduled_for: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "URL to the [Segment](#tag/Segments) to send this broadcast to."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub segment_link: Option<::serde_json::Value>,
    #[doc = "The name of the segment the broadcast will be sent to, or Unknown if the segment no longer exists."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub segment_name: Option<String>,
    #[doc = "The link to this resource."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "Date/Time broadcast was sent."]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub sent_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "A list of statistics for a broadcast, only set for sent broadcasts."]
    #[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
    pub stats: ::serde_json::Map<String, ::serde_json::Value>,
    #[doc = "The status of the broadcast."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<BroadcastStatus>,
    #[doc = "The broadcast subject line."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subject: Option<String>,
    #[doc = "URL to the [Twitter broadcast integration](#tag/Integrations) to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be tweeted - e.g., `https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>`"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub twitter_integration: Option<String>,
    #[doc = "The broadcast UUID."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uuid: Option<String>,
}
#[doc = "`BroadcastClicks`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct BroadcastClicks {
    #[doc = "A list of aggregated click entries, showing unique clicks per subscriber with click statistics"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<BroadcastClicksEntriesItem>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The total number of unique subscribers who clicked the broadcast"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
#[doc = "`BroadcastClicksDetailed`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct BroadcastClicksDetailed {
    #[doc = "A list of individual click event entries, showing each click occurrence with the specific URL"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<BroadcastClicksDetailedEntriesItem>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The total number of individual click events (can be higher than unique subscribers if some clicked multiple times)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
#[doc = "`BroadcastClicksDetailedEntriesItem`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct BroadcastClicksDetailedEntriesItem {
    #[doc = "Timestamp of when this specific click occurred"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub clicked_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "Email address of the subscriber who clicked the broadcast. *Note:* This is the current email address of the subscriber, not necessarily the email address the broadcast was sent to."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    #[doc = "Time when this individual click event occurred (same value as clicked_at)"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub event_time: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "A link to the click type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to the subscriber entry"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subscriber_link: Option<String>,
    #[doc = "Type of subscriber activity"]
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub type_: Option<BroadcastClicksDetailedEntriesItemType>,
    #[doc = "The URL that was clicked"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
}
string_enum! { pub enum BroadcastClicksDetailedEntriesItemType { Click => "click" } }
#[doc = "`BroadcastClicksEntriesItem`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct BroadcastClicksEntriesItem {
    #[doc = "Email address of the subscriber who clicked the broadcast. *Note:* This is the current email address of the subscriber, not necessarily the email address the broadcast was sent to."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    #[doc = "Time when the first click occurred for this subscriber"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub event_time: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "Time of the first click by this subscriber"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub first_click_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "Time of the last click by this subscriber"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub last_click_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "A link to the click type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to the subscriber entry"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subscriber_link: Option<String>,
    #[doc = "Total number of clicks by this subscriber"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_clicks: Option<::std::num::NonZeroU64>,
    #[doc = "Type of subscriber activity"]
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub type_: Option<BroadcastClicksEntriesItemType>,
}
string_enum! { pub enum BroadcastClicksEntriesItemType { Click => "click" } }
#[doc = "`BroadcastLinksItem`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct BroadcastLinksItem {
    #[doc = "Link target"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub href: Option<String>,
    #[doc = "Link relation (`\"list_archive_rss_url\"`, `\"list_archive_url\"`, etc.)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub rel: Option<String>,
}
#[doc = "`BroadcastOpens`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct BroadcastOpens {
    #[doc = "A list of entries"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<BroadcastOpensEntriesItem>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
#[doc = "`BroadcastOpensEntriesItem`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct BroadcastOpensEntriesItem {
    #[doc = "Email address of the subscriber who opened the broadcast. *Note:* This is the current email address of the subscriber, not necessarily the email address the broadcast was sent to."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    #[doc = "Time that the open occurred"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub event_time: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "A link to the open type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to the subscriber entry"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subscriber_link: Option<String>,
    #[doc = "Type of subscriber activity"]
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub type_: Option<BroadcastOpensEntriesItemType>,
}
string_enum! { pub enum BroadcastOpensEntriesItemType { Open => "open" } }
string_enum! { pub enum BroadcastStatus { AdminHold => "admin_hold", Draft => "draft", Scheduled => "scheduled", Sending => "sending", Sent => "sent", Unknown => "unknown" } }
#[doc = "`Broadcasts`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Broadcasts {
    #[doc = "The list of broadcast entries."]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<BroadcastsEntriesItem>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if previous entries exist. This attribute is omitted if this is the first page."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "A link to the current page of entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "A link to a resource that provides the total number of broadcasts in the collection."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size_link: Option<String>,
}
#[doc = "`BroadcastsEntriesItem`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct BroadcastsEntriesItem {
    #[doc = "The legacy broadcast ID."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub broadcast_id: Option<i64>,
    #[doc = "When broadcast is scheduled to send."]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub scheduled_for: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The link to this resource."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "Date/Time broadcast was sent."]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub sent_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The status of the broadcast."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<BroadcastsEntriesItemStatus>,
    #[doc = "The broadcast subject line."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subject: Option<String>,
    #[doc = "The broadcast UUID."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uuid: Option<String>,
}
string_enum! { pub enum BroadcastsEntriesItemStatus { Draft => "draft", Scheduled => "scheduled", Sent => "sent" } }
#[doc = "`Campaign`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Campaign {
    #[doc = "Type of campaign. (f: followup, b: broadcast)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub campaign_type: Option<CampaignCampaignType>,
    #[doc = "Whether click tracking is enabled"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub click_tracking_enabled: Option<bool>,
    #[doc = "Type of message"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub content_type: Option<CampaignContentType>,
    #[doc = "Unique campaign ID for followup or broadcast"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    #[doc = "Is the campaign in the campaign archive (broadcast only)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_archived: Option<bool>,
    #[doc = "A URL to retrieve the [Links](#tag/Campaigns/paths/~1accounts~1{accountId}~1lists~1{listId}~1campaigns~1{campaignType}{campaignId}~1links/get) for this campaign"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub links_collection_link: Option<String>,
    #[doc = "Message interval (followup only)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message_interval: Option<::std::num::NonZeroU64>,
    #[doc = "Followup sequence number (followup only)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message_number: Option<::std::num::NonZeroU64>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "When broadcast is scheduled to send (broadcast only)"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub scheduled_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "Date/Time campaign was sent (broadcast only)"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub sent_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub spam_assassin_score: Option<f32>,
    #[doc = "A link to the [statistics collection](#tag/Campaigns/paths/~1accounts~1{accountId}~1lists~1{listId}~1campaigns~1b{campaignId}~1stats/get) for this campaign"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub stats_collection_link: Option<String>,
    #[doc = "Subject of message"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subject: Option<String>,
    #[doc = "Total clicks of this message"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_clicks: Option<i64>,
    #[doc = "Total number of messages opened"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_opens: Option<i64>,
    #[doc = "Total number of messages sent"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_sent: Option<i64>,
    #[doc = "Total number of spam complaints received"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_spam_complaints: Option<i64>,
    #[doc = "Total number of undeliverable messages"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_undelivered: Option<i64>,
    #[doc = "Total number of unsubscribes from this campaign"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_unsubscribes: Option<i64>,
    #[doc = "Twitter account where broadcast was tweeted (broadcasts only). Links to [Integration](#tag/Integrations/paths/~1accounts~1{accountId}~1integrations~1{integrationId}/get)."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub twitter_account_link: Option<String>,
}
string_enum! { pub enum CampaignCampaignType { B => "b", F => "f" } }
string_enum! { pub enum CampaignContentType { Text => "Text", Html => "HTML", TextHtml => "Text/HTML" } }
#[doc = "`Confidential`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct Confidential {
    #[doc = "The client ID of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_id: String,
    #[doc = "The client secret of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_secret: String,
    #[doc = "The access token or refresh token to revoke"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub token: Option<String>,
    #[doc = "Type of token given in the token parameter. Valid values are <ul><li>access_token<li>refresh_token</ul><br>If not specified, search for both kinds of tokens."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub token_type_hint: Option<ConfidentialTokenTypeHint>,
}
string_enum! { pub enum ConfidentialTokenTypeHint { AccessToken => "access_token", RefreshToken => "refresh_token" } }
#[doc = "`CreateBroadcast`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct CreateBroadcast {
    #[doc = "<b>[Please read <a href=\"https://help.aweber.com/hc/en-us/articles/360025741194\" target=\"_blank\">our KB article</a> before using this field.]</b><br>The content of the message in AMP format."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub body_amp: Option<String>,
    #[doc = "The content of the message in html format. If body_text is not provided, it will be auto-generated. If body_text is not provided, body_html must be provided."]
    pub body_html: String,
    #[doc = "The content of the message in plain text, used when HTML is not supported. If body_html is not provided, the broadcast will be sent using only the body_text. If body_text is not provided, body_html must be provided."]
    pub body_text: String,
    #[doc = "Enables links in the email message to be tracked"]
    #[serde(default = "defaults::default_bool::<true>")]
    pub click_tracking_enabled: bool,
    #[doc = "JSON encoded list of [Lists](#tag/Lists) URLs to exclude in the delivery of this broadcast.<br> Use the `self_link` of the list here - e.g. `https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>`. If updated, this value will replace the existing excluded_lists."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub exclude_lists: Option<String>,
    #[doc = "URL to the [Facebook broadcast integration](#tag/Integrations) to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be posted to this Facebook integration  - e.g., `https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>`"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub facebook_integration: Option<String>,
    #[doc = "JSON encoded list of [Lists](#tag/Lists) URLs to include in the delivery of this broadcast.<br> Use the `self_link` of the list here - e.g. `https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>`. If updated, this value will replace the existing included_lists."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub include_lists: Option<String>,
    #[doc = "Whether the broadcast enabled sharing via an archive url"]
    #[serde(default = "defaults::default_bool::<true>")]
    pub is_archived: bool,
    #[doc = "If true, notify when stats are available on a sent broadcast message"]
    #[serde(default = "defaults::default_bool::<true>")]
    pub notify_on_send: bool,
    #[doc = "URL to the [Segment](#tag/Segments) to send this broadcast to.  Use the `self_link` of the\nsegment here - e.g.\n`https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>/segments/<segment_id>`.\nIf not specified, the broadcast will be sent to the “Active Subscribers” segment.\n"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub segment_link: Option<::serde_json::Value>,
    #[doc = "The broadcast subject line. Subject must not be empty nor contain only whitespace."]
    pub subject: String,
    #[doc = "URL to the [Twitter broadcast integration](#tag/Integrations) to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be tweeted - e.g., `https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>`"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub twitter_integration: Option<String>,
}
#[doc = "`CustomField`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct CustomField {
    #[doc = "The ETag HTTP header"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub http_etag: Option<String>,
    #[doc = "The unique ID for the custom field"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    #[doc = "Whether the subscriber is allowed to update the custom field"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_subscriber_updateable: Option<bool>,
    #[doc = "The name of the custom field"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "The link to the custom field type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to the event resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
}
#[doc = "`CustomFields`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct CustomFields {
    #[doc = "A list of custom field entries"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<CustomField>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
validated_string!(DeleteAccountsListsSubscribersSubscriberEmail, min=1, max=50);
#[doc = "`EndpointError`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct EndpointError {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub error: Option<EndpointErrorError>,
}
#[doc = "An error object.\nThe following error may be received:\n\n| Error Type           | Explanation                              |\n|----------------------|------------------------------------------|\n| UnauthorizedError    | There is a problem with your authorization credentials |\n\nPlease see the message body for more details.\n"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct EndpointErrorError {
    #[doc = "A link to the documentation that describes the error"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub documentation_url: Option<String>,
    #[doc = "A human friendly description of the error"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    #[doc = "The HTTP status code"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<EndpointErrorErrorStatus>,
    #[doc = "The API error type"]
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub type_: Option<EndpointErrorErrorType>,
}
#[doc = "The HTTP status code"]
#[derive(serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct EndpointErrorErrorStatus(i64);
impl std::ops::Deref for EndpointErrorErrorStatus {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl From<EndpointErrorErrorStatus> for i64 {
    fn from(value: EndpointErrorErrorStatus) -> Self {
        value.0
    }
}
impl TryFrom<i64> for EndpointErrorErrorStatus {
    type Error = self::error::ConversionError;
    fn try_from(value: i64) -> Result<Self, self::error::ConversionError> {
        if ![401_i64].contains(&value) {
            Err("invalid value".into())
        } else {
            Ok(Self(value))
        }
    }
}
impl<'de> ::serde::Deserialize<'de> for EndpointErrorErrorStatus {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        Self::try_from(<i64>::deserialize(deserializer)?)
            .map_err(|e| <D::Error as ::serde::de::Error>::custom(e.to_string()))
    }
}
string_enum! { pub enum EndpointErrorErrorType { UnauthorizedError => "UnauthorizedError" } }
#[doc = "`FindCampaigns`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct FindCampaigns {
    #[doc = "A list of campaign entries"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<Campaign>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "Link to the total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size_link: Option<String>,
}
#[doc = "`FindLists`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct FindLists {
    #[doc = "The list of list entries"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<List>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "A link to check the total number of entries found for this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size_link: Option<String>,
}
#[doc = "`FindSubscribers`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct FindSubscribers {
    #[doc = "The list of subscriber entries plus list information"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<SubscriberFind>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if previous entries exist. This attribute is omitted if this is the first page."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "Link to the total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size_link: Option<String>,
}
#[doc = "`FindSubscribersAccount`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct FindSubscribersAccount {
    #[doc = "The list of subscriber entries plus list information"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<SubscriberFind>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if previous entries exist. This attribute is omitted if this is the first page."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "A link to the current page of entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "Link to the total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size_link: Option<String>,
}
#[doc = "`Form`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct Form {
    #[doc = "The client ID of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_id: String,
    #[doc = "The client secret of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_secret: String,
    #[doc = "The access token or refresh token to revoke"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub token: Option<String>,
    #[doc = "Type of token given in the token parameter. Valid values are <ul><li>access_token<li>refresh_token</ul><br>If not specified, search for both kinds of tokens."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub token_type_hint: Option<FormTokenTypeHint>,
}
#[doc = "`FormPkce`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct FormPkce {
    #[doc = "The client ID of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_id: String,
    #[doc = "The access token or refresh token to revoke"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub token: Option<String>,
    #[doc = "Type of token given in the token parameter. Valid values are <ul><li>access_token<li>refresh_token</ul><br>If not specified, search for both kinds of tokens."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub token_type_hint: Option<FormPkceTokenTypeHint>,
}
string_enum! { pub enum FormPkceTokenTypeHint { AccessToken => "access_token", RefreshToken => "refresh_token" } }
string_enum! { pub enum FormTokenTypeHint { AccessToken => "access_token", RefreshToken => "refresh_token" } }
validated_string!(GetAccountsFindsubscribersAdTracking, min=1, max=20);
validated_string!(GetAccountsFindsubscribersCity, min=1, max=100);
validated_string!(GetAccountsFindsubscribersCountry, min=1, max=100);
validated_string!(GetAccountsFindsubscribersEmail, min=1, max=50);
validated_string!(GetAccountsFindsubscribersMiscNotes, max=60);
validated_string!(GetAccountsFindsubscribersName, min=1, max=60);
validated_string!(GetAccountsFindsubscribersPostalCode, min=1, max=100);
validated_string!(GetAccountsFindsubscribersRegion, min=1, max=100);
string_enum! { pub enum GetAccountsFindsubscribersStatus { Subscribed => "subscribed", Unsubscribed => "unsubscribed", Unconfirmed => "unconfirmed" } }
string_enum! { pub enum GetAccountsFindsubscribersSubscriptionMethod { Api => "api", Email => "email", Import => "import", Webform => "webform" } }
string_enum! { pub enum GetAccountsFindsubscribersUnsubscribeMethod { UnsubscribeLink => "unsubscribe link", CustomerCp => "customer cp", Undeliverable => "undeliverable", ApiUnsubscribe => "api: unsubscribe", ApiMove => "api: move" } }
string_enum! { pub enum GetAccountsFindsubscribersWsOp { FindSubscribers => "findSubscribers" } }
string_enum! { pub enum GetAccountsFindsubscribersWsShow { TotalSize => "total_size" } }
string_enum! { pub enum GetAccountsGetwebformsWsOp { GetWebForms => "getWebForms" } }
string_enum! { pub enum GetAccountsGetwebformsplittestsWsOp { GetWebFormSplitTests => "getWebFormSplitTests" } }
string_enum! { pub enum GetAccountsListsBroadcastsStatus { Draft => "draft", Scheduled => "scheduled", Sent => "sent" } }
#[doc = "`GetAccountsListsBroadcastsTotalResponse`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct GetAccountsListsBroadcastsTotalResponse {
    #[doc = "The total broadcasts with the status."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<i64>,
}
string_enum! { pub enum GetAccountsListsBroadcastsTotalStatus { Draft => "draft", Scheduled => "scheduled", Sent => "sent" } }
string_enum! { pub enum GetAccountsListsCampaignsBcampaignidStats2StatsId { TotalClicks => "total_clicks", UniqueClicks => "unique_clicks", TotalOpens => "total_opens", UniqueOpens => "unique_opens", TotalSales => "total_sales", TotalSalesDollars => "total_sales_dollars", TotalUnsubscribed => "total_unsubscribed", HourlyOpens => "hourly_opens", HourlyClicks => "hourly_clicks", HourlyWebhits => "hourly_webhits", HourlySales => "hourly_sales", HourlyUnsubscribed => "hourly_unsubscribed", DailyOpens => "daily_opens", DailyClicks => "daily_clicks", DailyWebhits => "daily_webhits", DailySales => "daily_sales", DailyUnsubscribed => "daily_unsubscribed", ClicksByLink => "clicks_by_link", WebhitsByLink => "webhits_by_link", OpensBySubscriber => "opens_by_subscriber", SalesBySubscriber => "sales_by_subscriber" } }
string_enum! { pub enum GetAccountsListsCampaignsCampaigntypecampaignidCampaignType { B => "b", F => "f" } }
string_enum! { pub enum GetAccountsListsCampaignsFindCampaignType { B => "b", F => "f" } }
string_enum! { pub enum GetAccountsListsCampaignsFindWsOp { Find => "find" } }
string_enum! { pub enum GetAccountsListsCampaignsFindWsShow { TotalSize => "total_size" } }
validated_string!(GetAccountsListsFindName, min=1, max=100);
string_enum! { pub enum GetAccountsListsFindWsOp { Find => "find" } }
string_enum! { pub enum GetAccountsListsFindWsShow { TotalSize => "total_size" } }
#[doc = "`GetAccountsListsSubscribers2Response`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct GetAccountsListsSubscribers2Response {
    #[doc = "The customer ad tracking field"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ad_tracking: Option<String>,
    #[doc = "The subscriber's area code"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub area_code: Option<i64>,
    #[doc = "The subscriber's address city"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub city: Option<String>,
    #[doc = "The subscriber's address country"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
    #[doc = "The custom fields specified on the subscriber"]
    #[serde(
        default,
        skip_serializing_if = "HashMap::is_empty"
    )]
    pub custom_fields:
        HashMap<String, String>,
    #[doc = "The subscriber's designated market area code (USA and canada only)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub dma_code: Option<i64>,
    #[doc = "The subscriber's email address."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    #[doc = "The lead ID"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<u64>,
    #[doc = "The subscriber's IP address."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ip_address: Option<String>,
    #[doc = "A value indication if the subscriber's email address confirmed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_verified: Option<bool>,
    #[doc = "The sequence number of the last followup message sent to the subscriber.  If this value is set to 1001, then the subscriber will not receive followup messages."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub last_followup_message_number_sent: Option<i64>,
    #[doc = "The last followup message sent to the subscriber"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub last_followup_sent_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "A link to the [Last Follow Up Message](#tag/Campaigns/paths/~1accounts~1{accountId}~1lists~1{listId}~1campaigns~1{campaignType}{campaignId}/get) the subscriber was sent"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub last_followup_sent_link: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub latitude: Option<f64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub longitude: Option<f64>,
    #[doc = "Miscellaneous notes."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub misc_notes: Option<String>,
    #[doc = "The subscriber's name."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "The subscriber's address postal code"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub postal_code: Option<String>,
    #[doc = "The subscriber's address stage or region abbreviation"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub region: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link:
        Option<GetAccountsListsSubscribers2ResponseResourceTypeLink>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The subscriber's status"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<GetAccountsListsSubscribers2ResponseStatus>,
    #[doc = "The timestamp for when the subscriber subscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub subscribed_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The method by which the subscriber was subscribed.\n\n| Method    | Description                              |\n| ------    | -----------                              |\n| api       | subscribed via an API integration        |\n| email     | subscriber emailed to list to opt-in     |\n| import    | subscriber was imported by the customer  |\n| webform   | subscriber subscribed via a web form     |\n"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subscription_method:
        Option<GetAccountsListsSubscribers2ResponseSubscriptionMethod>,
    #[doc = "The webform url from which the subscriber subscribed from"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subscription_url: Option<String>,
    #[doc = "A list of tags added to the subscriber"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<String>,
    #[doc = "The method that describes how the subscriber unsubscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub unsubscribe_method:
        Option<GetAccountsListsSubscribers2ResponseUnsubscribeMethod>,
    #[doc = "The timestamp for when the subscriber unsubscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub unsubscribed_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The UUID (universally unique identifier) for the subscriber"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uuid: Option<String>,
    #[doc = "The timestamp for when the subscriber confirmed their email address"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub verified_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
string_enum! { pub enum GetAccountsListsSubscribers2ResponseResourceTypeLink { HttpsApiAweberCom10Subscriber => "https://api.aweber.com/1.0/#subscriber" } }
string_enum! { pub enum GetAccountsListsSubscribers2ResponseStatus { Subscribed => "subscribed", Unsubscribed => "unsubscribed", Unconfirmed => "unconfirmed" } }
string_enum! { pub enum GetAccountsListsSubscribers2ResponseSubscriptionMethod { Api => "api", Email => "email", Import => "import", Webform => "webform" } }
string_enum! { pub enum GetAccountsListsSubscribers2ResponseUnsubscribeMethod { UnsubscribeLink => "unsubscribe link", CustomerCp => "customer cp", Undeliverable => "undeliverable", ApiUnsubscribe => "api: unsubscribe", ApiMove => "api: move" } }
validated_string!(GetAccountsListsSubscribersFindAdTracking, min=1, max=20);
validated_string!(GetAccountsListsSubscribersFindCity, min=1, max=100);
validated_string!(GetAccountsListsSubscribersFindCountry, min=1, max=100);
validated_string!(GetAccountsListsSubscribersFindEmail, min=1, max=50);
validated_string!(GetAccountsListsSubscribersFindMiscNotes, max=60);
validated_string!(GetAccountsListsSubscribersFindName, min=1, max=60);
validated_string!(GetAccountsListsSubscribersFindPostalCode, min=1, max=100);
validated_string!(GetAccountsListsSubscribersFindRegion, min=1, max=100);
string_enum! { pub enum GetAccountsListsSubscribersFindSortKey { SubscribedAt => "subscribed_at", UnsubscribedAt => "unsubscribed_at" } }
string_enum! { pub enum GetAccountsListsSubscribersFindSortOrder { Asc => "asc", Desc => "desc" } }
string_enum! { pub enum GetAccountsListsSubscribersFindStatus { Subscribed => "subscribed", Unsubscribed => "unsubscribed", Unconfirmed => "unconfirmed" } }
string_enum! { pub enum GetAccountsListsSubscribersFindSubscriptionMethod { Api => "api", Email => "email", Import => "import", Webform => "webform" } }
string_enum! { pub enum GetAccountsListsSubscribersFindUnsubscribeMethod { UnsubscribeLink => "unsubscribe link", CustomerCp => "customer cp", Undeliverable => "undeliverable", ApiUnsubscribe => "api: unsubscribe", ApiMove => "api: move" } }
string_enum! { pub enum GetAccountsListsSubscribersFindWsOp { Find => "find" } }
string_enum! { pub enum GetAccountsListsSubscribersFindWsShow { TotalSize => "total_size" } }
string_enum! { pub enum GetAccountsListsSubscribersGetactivityWsOp { GetActivity => "getActivity" } }
string_enum! { pub enum GetAccountsListsSubscribersSortOrder { Asc => "asc", Desc => "desc" } }
validated_string!(GetBroadcastLinksAnalyticsAccountId, uuid);
validated_string!(GetBroadcastLinksAnalyticsBroadcastId, uuid);
string_enum! { pub enum GetBroadcastLinksAnalyticsFilter { Clicks => "clicks", Pageviews => "pageviews" } }
#[doc = "`GetBroadcastLinksAnalyticsResponseItem`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct GetBroadcastLinksAnalyticsResponseItem {
    #[doc = "Total number of interactions with the link"]
    pub total: i64,
    #[doc = "Type of interaction (click or pageview)"]
    #[serde(rename = "type")]
    pub type_: GetBroadcastLinksAnalyticsResponseItemType,
    #[doc = "Number of unique interactions with the link"]
    pub unique: i64,
    #[doc = "The URL of the link"]
    pub url: String,
}
string_enum! { pub enum GetBroadcastLinksAnalyticsResponseItemType { Click => "click", Pageview => "pageview" } }
string_enum! { pub enum GetBroadcastLinksAnalyticsSortBy { Unique => "unique", Total => "total" } }
#[doc = "`Integration`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Integration {
    #[doc = "The ETag HTTP header"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub http_etag: Option<String>,
    #[doc = "The unique ID for the integration"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    #[doc = "The integration user name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub login: Option<String>,
    #[doc = "The link to the integration type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The integration name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub service_name: Option<String>,
}
#[doc = "`Integrations`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Integrations {
    #[doc = "A list of integration entries"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<Integration>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
#[doc = "`LandingPage`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct LandingPage {
    #[doc = "The draft HTML of the landing page"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub content_html: Option<String>,
    #[doc = "When the landing page was created"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub created_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The unique ID for the landing page"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<::uuid::Uuid>,
    #[doc = "When the landing page was last modified"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub modified_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The landing page name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "When the landing page was published"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub published_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The published HTML of the landing page"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub published_html: Option<String>,
    #[doc = "The URL for the landing page"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub published_url: Option<String>,
    #[doc = "The link to the landing page type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The status of the landing page"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<LandingPageStatus>,
}
#[doc = "`LandingPageNoContent`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct LandingPageNoContent {
    #[doc = "When the landing page was created"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub created_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The unique ID for the landing page"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<::uuid::Uuid>,
    #[doc = "When the landing page was last modified"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub modified_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The landing page name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "When the landing page was published"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub published_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The URL for the landing page"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub published_url: Option<String>,
    #[doc = "The link to the landing page type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The status of the landing page"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<LandingPageNoContentStatus>,
}
string_enum! { pub enum LandingPageNoContentStatus { Published => "published", Unpublished => "unpublished" } }
string_enum! { pub enum LandingPageStatus { Published => "published", Unpublished => "unpublished" } }
#[doc = "`LandingPages`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct LandingPages {
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<LandingPageNoContent>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "The link to the landing page page type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
#[doc = "`List`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct List {
    #[doc = "[E-Mail Campaigns](#tag/Campaigns/paths/~1accounts~1{accountId}~1lists~1{listId}~1campaigns/get) used by this list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub campaigns_collection_link: Option<String>,
    #[doc = "Subscriber [Custom Fields](#tag/Custom-Fields/paths/~1accounts~1{accountId}~1lists~1{listId}~1custom_fields/get) defined for this list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub custom_fields_collection_link: Option<String>,
    #[doc = "Draft [Broadcasts](#tag/Broadcasts/paths/~1accounts~1{accountId}~1lists~1{listId}~1broadcasts/get) belonging to this list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub draft_broadcasts_link: Option<String>,
    #[doc = "The ETag HTTP header"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub http_etag: Option<String>,
    #[doc = "The unique ID for the list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    #[doc = "Link to the [Landing Pages](#tag/Landing-Pages/paths/~1accounts~1{accountId}~1lists~1{listId}~1landing_pages/get) used by this list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub landing_pages_collection_link: Option<String>,
    #[doc = "The name of the list.  This name may be changed by the customer at any time."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<ListName>,
    #[doc = "The link to the list type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "Scheduled [Broadcasts](#tag/Broadcasts/paths/~1accounts~1{accountId}~1lists~1{listId}~1broadcasts/get) belonging to this list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub scheduled_broadcasts_link: Option<String>,
    #[doc = "Link to the Subscriber [Segments](#tag/Segments/paths/~1accounts~1{accountId}~1lists~1{listId}~1segments/get) used by this list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub segments_collection_link: Option<String>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "Sent [Broadcasts](#tag/Broadcasts/paths/~1accounts~1{accountId}~1lists~1{listId}~1broadcasts/get) belonging to this list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sent_broadcasts_link: Option<String>,
    #[doc = "Link to the [Subscribers](#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers/get) belonging to this list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subscribers_collection_link: Option<String>,
    #[doc = "Number of subscribers where status = subscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_subscribed_subscribers: Option<u64>,
    #[doc = "Number of subscribers"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_subscribers: Option<u64>,
    #[doc = "Number of subscribers that were subscribed today"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_subscribers_subscribed_today: Option<u64>,
    #[doc = "Number of subscribers that were subscribed yesterday"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_subscribers_subscribed_yesterday: Option<u64>,
    #[doc = "Number of subscribers where status = unconfirmed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_unconfirmed_subscribers: Option<u64>,
    #[doc = "Number of subscribers where status = unsubscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_unsubscribed_subscribers: Option<u64>,
    #[doc = "Unique list ID of list.\n\nThe unique list ID is the automatically generated name for your list.\n\nIf you create a custom sign up form, you'll need to specify the unique list ID in the form's HTML code, ensuring that subscribers will be added to the list.\n\nThe unique list ID is also the first part of your autoresponder's e-mail address used by subscribers to sign up to your list.\n\nA subscriber can sign up to your list by sending an email to this address. (Though this method is rarely used anymore.)\n"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub unique_list_id: Option<ListUniqueListId>,
    #[doc = "The UUID (universally unique identifier) for the list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uuid: Option<String>,
    #[doc = "Public key that is used to validate web push notifications"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub vapid_public_key: Option<String>,
    #[doc = "[Webform Split Tests](#tag/Webforms/paths/~1accounts~1{accountId}~1lists~1{listId}~1web_form_split_tests/get) defined for this list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub web_form_split_tests_collection_link: Option<String>,
    #[doc = "[Webforms](#tag/Webforms/paths/~1accounts~1{accountId}~1lists~1{listId}~1web_forms/get) defined for this list."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub web_forms_collection_link: Option<String>,
}
#[doc = "`ListCampaigns`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct ListCampaigns {
    #[doc = "A list of campaign entries"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<Campaign>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<i64>,
}
validated_string!(ListName, min=1, max=32);
validated_string!(ListUniqueListId, min=1, max=30);
#[doc = "`Lists`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Lists {
    #[doc = "A list of list entries"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<List>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
#[doc = "`MoveSubscriberRequestBody`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct MoveSubscriberRequestBody {
    #[doc = "If set to true, this will cause the move of a subscriber to fail if the custom fields from the origin list do not match (case insensitively) to the target list"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enforce_custom_field_mapping: Option<bool>,
    #[doc = "The sequence number of the last followup message sent to the subscriber.  This field determines the next followup message to be sent to the Subscriber.  When set to 0, the Subscriber will receive the 1st (autoresponse) Followup message.  Set the value of this field to 1001 if you do not want any Followups to be sent to this Subscriber."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub last_followup_message_number_sent: Option<i64>,
    #[doc = "The link to the destination [List](#tag/Lists/paths/~1accounts~1{accountId}~1lists~1{listId}/get)"]
    pub list_link: String,
    #[doc = "The method name - expecting \"move\""]
    #[serde(rename = "ws.op")]
    pub ws_op: MoveSubscriberRequestBodyWsOp,
}
string_enum! { pub enum MoveSubscriberRequestBodyWsOp { Move => "move" } }
validated_string!(OauthCallback);
validated_string!(OauthConsumerKey);
validated_string!(OauthNonce);
validated_string!(OauthSignature);
validated_string!(OauthSignatureMethod);
validated_string!(OauthTimestamp);
validated_string!(OauthToken);
validated_string!(OauthVersion);
#[doc = "`PatchAccountsListsCustomFieldsBody`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct PatchAccountsListsCustomFieldsBody {
    #[doc = "Whether the subscriber is allowed to update the custom field"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_subscriber_updateable: Option<bool>,
    #[doc = "The name of the custom field"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}
validated_string!(PatchAccountsListsSubscribersSubscriberEmail, min=1, max=50);
#[doc = "`Pkce`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct Pkce {
    #[doc = "The client ID of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_id: String,
    #[doc = "The authorization code received from the authorization call."]
    pub code: String,
    #[doc = "As described in the <a href=\"https://tools.ietf.org/html/rfc7636#section-4.1\" target=\"_blank\">PKCE RFC</a>, this is a high-entropy cryptographic random string with a minimum length of 43 characters and a maximum length of 128 characters."]
    pub code_verifier: String,
    #[doc = "The grant type of the token."]
    pub grant_type: PkceGrantType,
}
string_enum! { pub enum PkceGrantType { AuthorizationCode => "authorization_code" } }
#[doc = "`PostAccountsListsBroadcastsCancelResponse`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct PostAccountsListsBroadcastsCancelResponse {
    #[doc = "The link to this resource."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
}
#[doc = "`PostAccountsListsBroadcastsScheduleResponse`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct PostAccountsListsBroadcastsScheduleResponse {
    #[doc = "The link to the broadcast resource."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
}
#[doc = "`PostAccountsListsCustomFieldsBody`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct PostAccountsListsCustomFieldsBody {
    #[doc = "The name of the custom field"]
    pub name: String,
    #[doc = "The method name - expecting \"create\""]
    #[serde(rename = "ws.op")]
    pub ws_op: PostAccountsListsCustomFieldsBodyWsOp,
}
string_enum! { pub enum PostAccountsListsCustomFieldsBodyWsOp { Create => "create" } }
#[doc = "`PostOauth2RevokeBody`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum PostOauth2RevokeBody {
    Confidential(Confidential),
    RevokePkce(RevokePkce),
}
impl From<Confidential> for PostOauth2RevokeBody {
    fn from(value: Confidential) -> Self {
        Self::Confidential(value)
    }
}
impl From<RevokePkce> for PostOauth2RevokeBody {
    fn from(value: RevokePkce) -> Self {
        Self::RevokePkce(value)
    }
}
#[doc = "`PostOauth2TokenBody`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum PostOauth2TokenBody {
    AuthCode(AuthCode),
    RefreshTokenConfidential(RefreshTokenConfidential),
    RefreshTokenPublic(RefreshTokenPublic),
    Pkce(Pkce),
}
impl From<AuthCode> for PostOauth2TokenBody {
    fn from(value: AuthCode) -> Self {
        Self::AuthCode(value)
    }
}
impl From<RefreshTokenConfidential> for PostOauth2TokenBody {
    fn from(value: RefreshTokenConfidential) -> Self {
        Self::RefreshTokenConfidential(value)
    }
}
impl From<RefreshTokenPublic> for PostOauth2TokenBody {
    fn from(value: RefreshTokenPublic) -> Self {
        Self::RefreshTokenPublic(value)
    }
}
impl From<Pkce> for PostOauth2TokenBody {
    fn from(value: Pkce) -> Self {
        Self::Pkce(value)
    }
}
#[doc = "`PostOauth2TokenResponse`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct PostOauth2TokenResponse {
    #[doc = "The access token, which will be used to represent this specific AWeber user's account and can be used to gain access to their data. It should be stored for later use, consider doing so in a database or some other local storage in your application."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub access_token: Option<String>,
    #[doc = "The time in seconds in which the access token will expire."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub expires_in: Option<i64>,
    #[doc = "The refresh token, which will be used to refresh a user's access token. It should be stored for later use, consider doing so in a database or some other local storage in your application."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub refresh_token: Option<String>,
    #[doc = "The type of token the access token will be used as."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub token_type: Option<String>,
}
#[doc = "`PostOauthAccessTokenBody`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct PostOauthAccessTokenBody {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_callback: Option<OauthCallback>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_consumer_key: Option<OauthConsumerKey>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_nonce: Option<OauthNonce>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_signature: Option<OauthSignature>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_signature_method: Option<OauthSignatureMethod>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_timestamp: Option<OauthTimestamp>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_token: Option<OauthToken>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_version: Option<OauthVersion>,
}
#[doc = "`PostOauthAccessTokenResponse`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct PostOauthAccessTokenResponse {
    #[doc = "The access token, which will be used to represent this specific AWeber user's account and can be used to gain access to their data. It should be stored for later use, consider doing so in a database or some other local storage in your application."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_token: Option<String>,
    #[doc = "This is a newly generated secret which will be used in the creation of the request's oauth_signature. This token secret is paired exclusively with the access token and does not expire. It should be stored for later use. Consider savng it in a database or some other local storage in your application. At this point, the oauth_token and oauth_token_secret that were generated in Step 1 as the request token have expired, and can not be used again."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_token_secret: Option<bool>,
}
#[doc = "`PostOauthRequestTokenBody`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct PostOauthRequestTokenBody {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_callback: Option<OauthCallback>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_consumer_key: Option<OauthConsumerKey>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_nonce: Option<OauthNonce>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_signature: Option<OauthSignature>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_signature_method: Option<OauthSignatureMethod>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_timestamp: Option<OauthTimestamp>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_token: Option<OauthToken>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_version: Option<OauthVersion>,
}
#[doc = "`PostOauthRequestTokenResponse`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct PostOauthRequestTokenResponse {
    #[doc = "Whether the callback was accepted. If true, the result of the authorization step will be sent to this url."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_callback_confirmed: Option<bool>,
    #[doc = "This is a newly generated request token that temporarily represents the user of the application. This will expire when an access token is created for this user."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oauth_token: Option<String>,
}
#[doc = "`Purchase`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct Purchase {
    #[doc = "The customer ad tracking field"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ad_tracking: Option<PurchaseAdTracking>,
    #[doc = "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html)."]
    pub currency: String,
    #[doc = "The custom fields specified on the subscriber"]
    #[serde(
        default,
        skip_serializing_if = "HashMap::is_empty"
    )]
    pub custom_fields:
        HashMap<String, String>,
    #[doc = "The subscriber's email address"]
    pub email: PurchaseEmail,
    #[doc = "A custom note associated with this specific tracked event"]
    pub event_note: String,
    #[doc = "The timestamp of when the event occurred"]
    pub event_time: String,
    #[doc = "The subscriber's IP address. This must be a public IP address."]
    pub ip_address: PurchaseIpAddress,
    #[doc = "Miscellaneous notes"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub misc_notes: Option<PurchaseMiscNotes>,
    #[doc = "The subscriber's name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<PurchaseName>,
    #[doc = "A custom description for the page or event"]
    pub product_name: String,
    #[doc = "A list of tags added to the subscriber"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<PurchaseTagsItem>,
    #[doc = "The URL for the tracked event"]
    pub url: String,
    pub value: f64,
    #[doc = "The sales tracking url profile for the web page"]
    pub vendor: String,
}
validated_string!(PurchaseAdTracking, min=1, max=20);
validated_string!(PurchaseEmail, min=1, max=50);
validated_string!(PurchaseIpAddress, min=1, max=60);
validated_string!(PurchaseMiscNotes, max=60);
validated_string!(PurchaseName, min=1, max=60);
validated_string!(PurchaseTagsItem, min=1);
#[doc = "This will create an access token using a `refresh_token`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct RefreshTokenConfidential {
    #[doc = "The client ID of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_id: String,
    #[doc = "The client secret of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_secret: String,
    #[doc = "The grant type of the token."]
    pub grant_type: RefreshTokenConfidentialGrantType,
    #[doc = "The refresh token associated with the expired access token."]
    pub refresh_token: String,
}
string_enum! { pub enum RefreshTokenConfidentialGrantType { RefreshToken => "refresh_token" } }
#[doc = "`RefreshTokenPublic`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct RefreshTokenPublic {
    #[doc = "The client ID of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_id: String,
    #[doc = "The grant type of the token."]
    pub grant_type: RefreshTokenPublicGrantType,
    #[doc = "The refresh token associated with the expired access token."]
    pub refresh_token: String,
}
string_enum! { pub enum RefreshTokenPublicGrantType { RefreshToken => "refresh_token" } }
#[doc = "`RevokePkce`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct RevokePkce {
    #[doc = "The client ID of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_id: String,
    #[doc = "The access token or refresh token to revoke"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub token: Option<String>,
    #[doc = "Type of token given in the token parameter. Valid values are <ul><li>access_token<li>refresh_token</ul><br>If not specified, search for both kinds of tokens."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub token_type_hint: Option<RevokePkceTokenTypeHint>,
}
string_enum! { pub enum RevokePkceTokenTypeHint { AccessToken => "access_token", RefreshToken => "refresh_token" } }
#[doc = "`ScheduleBroadcast`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct ScheduleBroadcast {
    #[doc = "Scheduled time for sending broadcast message, ISO-8601 formatted."]
    #[serde(with = "flexible_datetime")]
    pub scheduled_for: ::chrono::DateTime<::chrono::offset::Utc>,
}
#[doc = "`Segment`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Segment {
    #[doc = "The unique ID for the segment"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    #[doc = "Whether the segment is part of a split test.\n\nMust be false to use for scheduling a broadcast.\n\nSegments that were created automatically for a split test in the control panel are set to true.\n"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_split_test: Option<bool>,
    #[doc = "The segment name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "The link to the segment type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
}
#[doc = "`Segments`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Segments {
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<Segment>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "The link to the segment page type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
#[doc = "`Stat`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Stat {
    #[doc = "A description of the statistic"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[doc = "Statistic's ID"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "A link that identifies the type of resource that this represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<StatResourceTypeLink>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The statistic's value\n\nThe datatype of the value attribute may be different for each Stat.\nStats can be integer_stat, decimal_stat, or list_stat. Evaluate the\nresource_type_link attribute if you must programmatically handle\ndifferent datatypes in a special way.\n\nBelow is a list of the statistics ID and return type\n\n>\n> __Aggregate Statistics__\n>\n> * total_clicks - integer_stat\n> * unique_clicks - integer_stat\n> * total_opens - integer_stat\n> * unique_opens - integer_stat\n> * total_sales - integer_stat\n> * total_sales_dollars - decimal_stat\n> * total_unsubscribed - integer_stat\n\n> __Time Related Statistics__\n>\n> * hourly_opens - list_stat\n> * hourly_clicks - list_stat\n> * hourly_webhits - list_stat\n> * hourly_sales - list_stat\n> * hourly_unsubscribes - list_stat\n> * daily_opens - list_stat\n> * daily_clicks - list_stat\n> * daily_webhits - list_stat\n> * daily_sales - list_stat\n> * daily_unsubscribes - list_stat\n\n> __Top 10 URL Statistics__\n>\n> * clicks_by_link - list_stat\n> * webhits_by_link - list_stat\n\n>  __Top 10 Subscriber Statistics__ (Requires access to subscriber data)\n>\n> * opens_by_subscriber - list_stat\n> * sales_by_subscriber - list_stat\n"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<StatValue>,
}
string_enum! { pub enum StatResourceTypeLink { IntegerStat => "integer_stat", DecimalStat => "decimal_stat", ListStat => "list_stat" } }
#[doc = "The statistic's value\n\nThe datatype of the value attribute may be different for each Stat.\nStats can be integer_stat, decimal_stat, or list_stat. Evaluate the\nresource_type_link attribute if you must programmatically handle\ndifferent datatypes in a special way.\n\nBelow is a list of the statistics ID and return type\n\n>\n> __Aggregate Statistics__\n>\n> * total_clicks - integer_stat\n> * unique_clicks - integer_stat\n> * total_opens - integer_stat\n> * unique_opens - integer_stat\n> * total_sales - integer_stat\n> * total_sales_dollars - decimal_stat\n> * total_unsubscribed - integer_stat\n\n> __Time Related Statistics__\n>\n> * hourly_opens - list_stat\n> * hourly_clicks - list_stat\n> * hourly_webhits - list_stat\n> * hourly_sales - list_stat\n> * hourly_unsubscribes - list_stat\n> * daily_opens - list_stat\n> * daily_clicks - list_stat\n> * daily_webhits - list_stat\n> * daily_sales - list_stat\n> * daily_unsubscribes - list_stat\n\n> __Top 10 URL Statistics__\n>\n> * clicks_by_link - list_stat\n> * webhits_by_link - list_stat\n\n>  __Top 10 Subscriber Statistics__ (Requires access to subscriber data)\n>\n> * opens_by_subscriber - list_stat\n> * sales_by_subscriber - list_stat\n"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum StatValue {
    Integer(i64),
    Number(f64),
    String(String),
}
impl std::fmt::Display for StatValue {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match self {
            Self::Integer(x) => x.fmt(f),
            Self::Number(x) => x.fmt(f),
            Self::String(x) => x.fmt(f),
        }
    }
}
impl From<i64> for StatValue {
    fn from(value: i64) -> Self {
        Self::Integer(value)
    }
}
impl From<f64> for StatValue {
    fn from(value: f64) -> Self {
        Self::Number(value)
    }
}
#[doc = "`Stats`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Stats {
    #[doc = "A list of stats entries"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<Stat>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<i64>,
}
#[doc = "`Subscriber`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Subscriber {
    #[doc = "The customer ad tracking field"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ad_tracking: Option<String>,
    #[doc = "The subscriber's area code"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub area_code: Option<i64>,
    #[doc = "The subscriber's address city"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub city: Option<String>,
    #[doc = "The subscriber's address country"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
    #[doc = "The custom fields specified on the subscriber"]
    #[serde(
        default,
        skip_serializing_if = "HashMap::is_empty"
    )]
    pub custom_fields:
        HashMap<String, String>,
    #[doc = "The subscriber's designated market area code (USA and canada only)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub dma_code: Option<i64>,
    #[doc = "The subscriber's email address."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    #[doc = "The lead ID"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<u64>,
    #[doc = "The subscriber's IP address."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ip_address: Option<String>,
    #[doc = "A value indication if the subscriber's email address confirmed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_verified: Option<bool>,
    #[doc = "The sequence number of the last followup message sent to the subscriber.  If this value is set to 1001, then the subscriber will not receive followup messages."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub last_followup_message_number_sent: Option<i64>,
    #[doc = "The last followup message sent to the subscriber"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub last_followup_sent_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "A link to the [Last Follow Up Message](#tag/Campaigns/paths/~1accounts~1{accountId}~1lists~1{listId}~1campaigns~1{campaignType}{campaignId}/get) the subscriber was sent"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub last_followup_sent_link: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub latitude: Option<f64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub longitude: Option<f64>,
    #[doc = "Miscellaneous notes."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub misc_notes: Option<String>,
    #[doc = "The subscriber's name."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "The subscriber's address postal code"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub postal_code: Option<String>,
    #[doc = "The subscriber's address stage or region abbreviation"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub region: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<SubscriberResourceTypeLink>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The subscriber's status"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<SubscriberStatus>,
    #[doc = "The timestamp for when the subscriber subscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub subscribed_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The method by which the subscriber was subscribed.\n\n| Method    | Description                              |\n| ------    | -----------                              |\n| api       | subscribed via an API integration        |\n| email     | subscriber emailed to list to opt-in     |\n| import    | subscriber was imported by the customer  |\n| webform   | subscriber subscribed via a web form     |\n"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subscription_method: Option<SubscriberSubscriptionMethod>,
    #[doc = "The webform url from which the subscriber subscribed from"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subscription_url: Option<String>,
    #[doc = "A list of tags added to the subscriber"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<String>,
    #[doc = "The method that describes how the subscriber unsubscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub unsubscribe_method: Option<SubscriberUnsubscribeMethod>,
    #[doc = "The timestamp for when the subscriber unsubscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub unsubscribed_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The timestamp for when the subscriber confirmed their email address"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub verified_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
#[doc = "`SubscriberFind`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct SubscriberFind {
    #[doc = "The customer ad tracking field"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ad_tracking: Option<SubscriberFindAdTracking>,
    #[doc = "The subscriber's area code"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub area_code: Option<i64>,
    #[doc = "The subscriber's address city"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub city: Option<SubscriberFindCity>,
    #[doc = "The subscriber's address country"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub country: Option<SubscriberFindCountry>,
    #[doc = "The custom fields specified on the subscriber"]
    #[serde(
        default,
        skip_serializing_if = "HashMap::is_empty"
    )]
    pub custom_fields:
        HashMap<String, String>,
    #[doc = "The subscriber's designated market area code (usa and canada only)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub dma_code: Option<i64>,
    #[doc = "The subscriber's email address"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email: Option<SubscriberFindEmail>,
    #[doc = "The lead ID"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<u64>,
    #[doc = "The subscriber's IP address"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ip_address: Option<SubscriberFindIpAddress>,
    #[doc = "A value indication if the subscriber's email address confirmed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_verified: Option<bool>,
    #[doc = "The sequence number of the last followup message sent to the subscriber"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub last_followup_message_number_sent: Option<i64>,
    #[doc = "The last followup message sent to the subscriber"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub last_followup_sent_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "A link to the [Last Follow Up Message](#tag/Campaigns/paths/~1accounts~1{accountId}~1lists~1{listId}~1campaigns~1{campaignType}{campaignId}/get) the subscriber was sent"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub last_followup_sent_link: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub latitude: Option<f64>,
    #[doc = "A link to the [List](#tag/Lists/paths/~1accounts~1{accountId}~1lists~1{listId}/get) the subscriber is on"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub list_link: Option<String>,
    #[doc = "List name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub list_name: Option<SubscriberFindListName>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub longitude: Option<f64>,
    #[doc = "Miscellaneous notes"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub misc_notes: Option<SubscriberFindMiscNotes>,
    #[doc = "The subscriber's name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<SubscriberFindName>,
    #[doc = "The subscriber's address postal code"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub postal_code: Option<SubscriberFindPostalCode>,
    #[doc = "The subscriber's address stage or region abbreviation"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub region: Option<SubscriberFindRegion>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The subscriber's status"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<SubscriberFindStatus>,
    #[doc = "The timestamp for when the subscriber subscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub subscribed_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The method by which the subscriber was subscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subscription_method: Option<SubscriberFindSubscriptionMethod>,
    #[doc = "The webform url from which the subscriber subscribed from"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subscription_url: Option<String>,
    #[doc = "A list of tags added to the subscriber"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<SubscriberFindTagsItem>,
    #[doc = "The method that describes how the subscriber unsubscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub unsubscribe_method: Option<SubscriberFindUnsubscribeMethod>,
    #[doc = "The timestamp for when the subscriber unsubscribed"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub unsubscribed_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[doc = "The timestamp for when the subscriber confirmed their email address"]
    #[serde(default, skip_serializing_if = "Option::is_none", with = "flexible_datetime::option")]
    pub verified_at: Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
validated_string!(SubscriberFindAdTracking, min=1, max=20);
validated_string!(SubscriberFindCity, min=1, max=100);
validated_string!(SubscriberFindCountry, min=1, max=100);
validated_string!(SubscriberFindEmail, min=1, max=50);
validated_string!(SubscriberFindIpAddress, min=1, max=60);
validated_string!(SubscriberFindListName, min=1, max=32);
validated_string!(SubscriberFindMiscNotes, max=60);
validated_string!(SubscriberFindName, min=1, max=60);
validated_string!(SubscriberFindPostalCode, min=1, max=100);
validated_string!(SubscriberFindRegion, min=1, max=100);
string_enum! { pub enum SubscriberFindStatus { Subscribed => "subscribed", Unsubscribed => "unsubscribed", Unconfirmed => "unconfirmed" } }
string_enum! { pub enum SubscriberFindSubscriptionMethod { Api => "api", Email => "email", Import => "import", Webform => "webform" } }
validated_string!(SubscriberFindTagsItem, min=1);
string_enum! { pub enum SubscriberFindUnsubscribeMethod { UnsubscribeLink => "unsubscribe link", CustomerCp => "customer cp", Undeliverable => "undeliverable", ApiUnsubscribe => "api: unsubscribe", ApiMove => "api: move" } }
#[doc = "`SubscriberGetActivity`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct SubscriberGetActivity {
    #[doc = "The list of activity entries.  The contents of the entry varies, but will always have the following fields listed"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<Activity>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if previous entries exist. This attribute is omitted if this is the first page."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "A link to check the total number of entries found for this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size_link: Option<String>,
}
string_enum! { pub enum SubscriberResourceTypeLink { HttpsApiAweberCom10Subscriber => "https://api.aweber.com/1.0/#subscriber" } }
string_enum! { pub enum SubscriberStatus { Subscribed => "subscribed", Unsubscribed => "unsubscribed", Unconfirmed => "unconfirmed" } }
string_enum! { pub enum SubscriberSubscriptionMethod { Api => "api", Email => "email", Import => "import", Webform => "webform" } }
string_enum! { pub enum SubscriberUnsubscribeMethod { UnsubscribeLink => "unsubscribe link", CustomerCp => "customer cp", Undeliverable => "undeliverable", ApiUnsubscribe => "api: unsubscribe", ApiMove => "api: move" } }
#[doc = "`Subscribers`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Subscribers {
    #[doc = "The list of subscriber entries"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<Subscriber>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if previous entries exist. This attribute is omitted if this is the first page."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "A link to the current page of entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
#[doc = "`Token`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
pub struct Token {
    #[doc = "The client ID of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_id: String,
    #[doc = "The client secret of the application. Available on the <a href=\"https://labs.aweber.com/apps\" target=\"_blank\">My Apps Page</a>. <br>_Not required if `Authorization` header is set._"]
    pub client_secret: String,
}
#[doc = "`UpdateBroadcast`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct UpdateBroadcast {
    #[doc = "<b>[Please read <a href=\"https://help.aweber.com/hc/en-us/articles/360025741194\" target=\"_blank\">our KB article</a> before using this field.]</b><br>The content of the message in AMP format."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub body_amp: Option<String>,
    #[doc = "The content of the message in html format. If body_text is not provided, it will be auto-generated."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub body_html: Option<String>,
    #[doc = "The content of the message in plain text, used when HTML is not supported. If body_html is not provided, the broadcast will be sent using only the body_text."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub body_text: Option<String>,
    #[doc = "Enables links in the email message to be tracked."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub click_tracking_enabled: Option<bool>,
    #[doc = "JSON encoded list of [Lists](#tag/Lists) URLs to exclude in the delivery of this broadcast.<br> Use the `self_link` of the list here - e.g. `https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>`. If updated, this value will replace the existing excluded_lists."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub exclude_lists: Option<String>,
    #[doc = "URL to the [Facebook broadcast integration](#tag/Integrations) to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be posted to this Facebook integration  - e.g., `https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>`"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub facebook_integration: Option<String>,
    #[doc = "JSON encoded list of [Lists](#tag/Lists) URLs to include in the delivery of this broadcast.<br> Use the `self_link` of the list here - e.g. `https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>`. If updated, this value will replace the existing included_lists."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub include_lists: Option<String>,
    #[doc = "Whether the broadcast enabled sharing via an archive url."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_archived: Option<bool>,
    #[doc = "If true, notify when stats are available on a sent broadcast message, defaults to true."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub notify_on_send: Option<bool>,
    #[doc = "URL to the [Segment](#tag/Segments) to send this broadcast to.  Use the `self_link` of the segment here - e.g. `https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>/segments/<segment_id>`. If not specified, the broadcast will be sent to the “Active Subscribers” segment."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub segment_link: Option<String>,
    #[doc = "The broadcast subject line. Subject must not be empty nor contain only whitespace."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subject: Option<String>,
    #[doc = "URL to the [Twitter broadcast integration](#tag/Integrations) to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be tweeted - e.g., `https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>`"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub twitter_integration: Option<String>,
}
#[doc = "`UpdateSubscriberRequestBody`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct UpdateSubscriberRequestBody {
    #[doc = "The customer ad tracking field"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ad_tracking: Option<UpdateSubscriberRequestBodyAdTracking>,
    #[doc = "The custom fields specified on the subscriber.  Custom fields are represented as a sub-object where only the **values** can be modified. <br><br> **Note:** If updating custom field values, **all** fields must be included in the request. If all fields are not included, the omitted fields will be set to *null*. <br><br> In order to modify custom field values:\n- Retrieve the custom fields and values for the subscriber.\n- Add all fields and their values to the PATCH request.\n- Modify the value **only** for the fields you wish to update.\n- Submit the request containing all the custom fields and their respective values."]
    #[serde(
        default,
        skip_serializing_if = "HashMap::is_empty"
    )]
    pub custom_fields: HashMap<
        String,
        UpdateSubscriberRequestBodyCustomFieldsValue,
    >,
    #[doc = "The subscriber's email address"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    #[doc = "The sequence number of the last followup message sent to the subscriber.  This field determines the next followup message to be sent to the Subscriber.  When set to 0, the Subscriber will receive the 1st (autoresponse) Followup message.  Set the value of this field to 1001 if you do not want any Followups to be sent to this Subscriber."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub last_followup_message_number_sent: Option<i64>,
    #[doc = "Miscellaneous notes"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub misc_notes: Option<String>,
    #[doc = "The subscriber's name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<UpdateSubscriberRequestBodyName>,
    #[doc = "The subscriber's status.<br> **Note** you cannot set a subscriber's status to \"unconfirmed\"."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<UpdateSubscriberRequestBodyStatus>,
    #[doc = "If this parameter is present and set to `true`, then custom field names are matched case sensitively.  Enabling this option also causes the operation to fail if a custom field is included that is not defined for the list."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub strict_custom_fields:
        Option<UpdateSubscriberRequestBodyStrictCustomFields>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tags: Option<UpdateSubscriberRequestBodyTags>,
}
validated_string!(UpdateSubscriberRequestBodyAdTracking, min=1, max=20);
validated_string!(UpdateSubscriberRequestBodyCustomFieldsValue, min=1);
validated_string!(UpdateSubscriberRequestBodyName, min=1, max=60);
string_enum! { pub enum UpdateSubscriberRequestBodyStatus { Subscribed => "subscribed", Unsubscribed => "unsubscribed" } }
string_enum! { pub enum UpdateSubscriberRequestBodyStrictCustomFields { True => "true", False => "false" } }
#[doc = "An object with the keys \"add\" and/or \"remove\" and values of lists of tags"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct UpdateSubscriberRequestBodyTags {
    #[doc = "List of tags to add to the subscriber"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub add: Vec<String>,
    #[doc = "List of tags to remove from the subscriber"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub remove: Vec<String>,
}
#[doc = "`WebFormSplitTests`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct WebFormSplitTests {
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<WebformSplitTest>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "The link to the event type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
#[doc = "`Webform`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Webform {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub conversion_percentage: Option<f32>,
    #[doc = "The webform HTML source URL"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub html_source_link: Option<String>,
    #[doc = "The ETag HTTP header"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub http_etag: Option<String>,
    #[doc = "The unique ID for the webform activity"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    #[doc = "Whether the webform is active or not"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_active: Option<bool>,
    #[doc = "The webform javascript source URL"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub javascript_source_link: Option<String>,
    #[doc = "The webform name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "The link to the webform type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "A list of tags added to the webform"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<WebformTagsItem>,
    #[doc = "The total number of times the webform is displayed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_displays: Option<i64>,
    #[doc = "The total number of submissions received by the webform"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_submissions: Option<i64>,
    #[doc = "The total number of unique times the webform is displayed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_unique_displays: Option<i64>,
    #[doc = "The webform display type"]
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub type_: Option<WebformType>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub unique_conversion_percentage: Option<f32>,
}
#[doc = "`WebformSplitTest`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct WebformSplitTest {
    #[doc = "The webform [Split Test Components](#tag/Webforms/paths/~1accounts~1{accountId}~1lists~1{listId}~1web_form_split_tests~1{splitTestId}~1components/get) URL"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub components_collection_link: Option<String>,
    #[doc = "The ETag HTTP header"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub http_etag: Option<String>,
    #[doc = "The unique ID for the webform split test"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    #[doc = "Whether the split test is active or not"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_active: Option<bool>,
    #[doc = "The webform javascript source URL"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub javascript_source_link: Option<String>,
    #[doc = "The split test name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "The link to the split test type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
}
#[doc = "`WebformSplitTestComponent`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct WebformSplitTestComponent {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub conversion_percentage: Option<f32>,
    #[doc = "The webform HTML source URL"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub html_source_link: Option<String>,
    #[doc = "The ETag HTTP header"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub http_etag: Option<String>,
    #[doc = "The unique ID for the webform component"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "Whether the webform is active or not"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_active: Option<bool>,
    #[doc = "The webform javascript source URL"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub javascript_source_link: Option<String>,
    #[doc = "The webform name"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "The link to the webform type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The link to this resource"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[doc = "A list of tags added to the webform component"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<WebformSplitTestComponentTagsItem>,
    #[doc = "The total number of times the webform is displayed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_displays: Option<u64>,
    #[doc = "The total number of submissions received by the webform"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_submissions: Option<u64>,
    #[doc = "The total number of unique times the webform is displayed"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_unique_displays: Option<u64>,
    #[doc = "The webform display type"]
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub type_: Option<WebformSplitTestComponentType>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub unique_conversion_percentage: Option<f32>,
    #[doc = "The link to [Webform](#tag/Webforms/paths/~1accounts~1{accountId}~1lists~1{listId}~1web_forms~1{webformId}/get)"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub web_form_link: Option<String>,
    #[doc = "The relative display weight"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub weight: Option<u64>,
}
validated_string!(WebformSplitTestComponentTagsItem, min=1);
string_enum! { pub enum WebformSplitTestComponentType { Exitpopup => "exitpopup", Inline => "inline", Lightbox => "lightbox", Popover => "popover", Popunder => "popunder", Popup => "popup", Styled => "styled" } }
#[doc = "`WebformSplitTestComponents`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct WebformSplitTestComponents {
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<WebformSplitTestComponent>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "The link to the Component type"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
validated_string!(WebformTagsItem, min=1);
string_enum! { pub enum WebformType { Exitpopup => "exitpopup", Inline => "inline", Lightbox => "lightbox", Popover => "popover", Popunder => "popunder", Popup => "popup", Styled => "styled" } }
#[doc = "`Webforms`"]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct Webforms {
    #[doc = "A list of webform entries"]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<Webform>,
    #[doc = "A link to the next page of entries if more entries exist. This attribute is omitted from the collection if there are no more entries."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub next_collection_link: Option<String>,
    #[doc = "A link to the previous page of entries if any exist. This attribute is omitted from the collection if ws.start is 0."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prev_collection_link: Option<String>,
    #[doc = "A link that identifies the type of resource that this collection represents"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resource_type_link: Option<String>,
    #[doc = "The starting offset for the page of entries to retrieve"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    #[doc = "The total number of entries"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<u64>,
}
#[doc = r" Generation of default values for serde."]
pub mod defaults {
    pub(super) fn default_bool<const V: bool>() -> bool {
        V
    }
}

/// Flexible datetime deserialization that handles both timezone-aware
/// ("2025-11-21T10:31:53.202963-05:00") and naive ("2025-11-21T10:56:38") formats.
mod flexible_datetime {
    use chrono::{DateTime, NaiveDateTime, Utc};
    use serde::{self, Deserialize, Deserializer, Serializer};

    pub fn serialize<S>(dt: &DateTime<Utc>, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: Serializer,
    {
        serializer.serialize_str(&dt.to_rfc3339())
    }

    pub fn deserialize<'de, D>(deserializer: D) -> Result<DateTime<Utc>, D::Error>
    where
        D: Deserializer<'de>,
    {
        let s = String::deserialize(deserializer)?;
        // Try full RFC 3339 / ISO 8601 with timezone first
        if let Ok(dt) = DateTime::parse_from_rfc3339(&s) {
            return Ok(dt.with_timezone(&Utc));
        }
        // Try with timezone offset but without T separator or other formats
        if let Ok(dt) = s.parse::<DateTime<Utc>>() {
            return Ok(dt);
        }
        // Fall back to naive datetime (no timezone), assume UTC
        NaiveDateTime::parse_from_str(&s, "%Y-%m-%dT%H:%M:%S")
            .or_else(|_| NaiveDateTime::parse_from_str(&s, "%Y-%m-%dT%H:%M:%S%.f"))
            .map(|ndt| ndt.and_utc())
            .map_err(serde::de::Error::custom)
    }

    pub mod option {
        use chrono::{DateTime, NaiveDateTime, Utc};
        use serde::{self, Deserialize, Deserializer, Serializer};

        pub fn serialize<S>(opt: &Option<DateTime<Utc>>, serializer: S) -> Result<S::Ok, S::Error>
        where
            S: Serializer,
        {
            match opt {
                Some(dt) => super::serialize(dt, serializer),
                None => serializer.serialize_none(),
            }
        }

        pub fn deserialize<'de, D>(deserializer: D) -> Result<Option<DateTime<Utc>>, D::Error>
        where
            D: Deserializer<'de>,
        {
            let opt: Option<String> = Option::deserialize(deserializer)?;
            match opt {
                Some(ref s) if s.is_empty() => Ok(None),
                Some(s) => {
                    if let Ok(dt) = DateTime::parse_from_rfc3339(&s) {
                        return Ok(Some(dt.with_timezone(&Utc)));
                    }
                    if let Ok(dt) = s.parse::<DateTime<Utc>>() {
                        return Ok(Some(dt));
                    }
                    NaiveDateTime::parse_from_str(&s, "%Y-%m-%dT%H:%M:%S")
                        .or_else(|_| NaiveDateTime::parse_from_str(&s, "%Y-%m-%dT%H:%M:%S%.f"))
                        .map(|ndt| Some(ndt.and_utc()))
                        .map_err(serde::de::Error::custom)
                }
                None => Ok(None),
            }
        }
    }
}