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
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
#![allow(dead_code, missing_docs)]
#![allow(clippy::enum_variant_names, clippy::large_enum_variant)]

//! This module contains the transcript of types from Definitions section of
//! the Letterboxd API:
//!
//! http://letterboxd-api.dev.cactuslab.com/#definitions.
//!
//! Note that, in the API it is not always specified if a field is optional.
//! Therefore, most of the types below have to be adjusted with optional
//! values. Further, only the types that are in the API implementation are
//! public.

use serde::{Deserialize, Serialize};

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
#[serde(tag = "type")]
enum AbstractActivity {
    /// Common fields:
    /// member The member associated with the activity.
    /// when_created The timestamp of the activity, in ISO 8601 format with UTC
    /// timezone, i.e. YYYY-MM-DDThh:mm:ssZ "1997-08-29T07:14:00Z"
    DiaryEntryActivity {
        member: MemberSummary,
        when_created: String,
        /// The log entry associated with this activity.
        diary_entry: LogEntry,
    },
    FilmLikeActivity {
        member: MemberSummary,
        when_created: String,
        /// The film associated with the activity. Includes a
        /// MemberFilmRelationship for the member who added the activity.
        film: FilmSummary,
    },
    FilmRatingActivity {
        member: MemberSummary,
        when_created: String,
        /// The film associated with the activity. Includes a
        /// MemberFilmRelationship for the member who added the activity.
        film: FilmSummary,
        /// The member’s rating for the film. Allowable values are between 0.5
        /// and 5.0, with increments of 0.5.
        rating: f32,
    },
    FilmWatchActivity {
        member: MemberSummary,
        when_created: String,
        /// The film associated with the activity. Includes a
        /// MemberFilmRelationship for the member who added the activity.
        film: FilmSummary,
    },
    FollowActivity {
        member: MemberSummary,
        when_created: String,
        /// A summary of the member that was followed.
        followed: MemberSummary,
    },
    InvitationAcceptedActivity {
        member: MemberSummary,
        when_created: String,
        invitor: MemberSummary,
    },
    ListActivity {
        member: MemberSummary,
        when_created: String,
        /// The list associated with the activity.
        list: ListSummary,
        /// The list that was cloned, if applicable.
        cloned_from: Option<ListSummary>,
    },
    ListCommentActivity {
        member: MemberSummary,
        when_created: String,
        /// The list associated with the activity.
        list: ListSummary,
        /// The comment associated with the activity.
        comment: ListComment,
    },
    ListLikeActivity {
        member: MemberSummary,
        when_created: String,
        /// The list associated with the activity.
        list: ListSummary,
    },
    RegistrationActivity {
        member: MemberSummary,
        when_created: String,
    },
    ReviewActivity {
        member: MemberSummary,
        when_created: String,
        /// The log entry associated with this activity.
        review: LogEntry,
    },
    ReviewCommentActivity {
        member: MemberSummary,
        when_created: String,
        /// The review associated with the activity.
        review: LogEntry,
        /// The comment associated with the activity.
        comment: ReviewComment,
    },
    ReviewLikeActivity {
        member: MemberSummary,
        when_created: String,
        /// The review associated with the activity.
        review: LogEntry,
    },
    WatchlistActivity {
        member: MemberSummary,
        when_created: String,
        /// The film associated with the activity. Includes a
        /// MemberFilmRelationship for the member who added the activity.
        film: FilmSummary,
    },
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
#[serde(tag = "type")]
enum AbstractComment {
    ListComment {
        /// The LID of the comment.
        id: String,
        /// The member who posted the comment.
        member: MemberSummary,
        /// ISO 8601 format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ:
        /// "1997-08-29T07:14:00Z"
        when_created: String,
        /// ISO 8601 format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ:
        /// "1997-08-29T07:14:00Z"
        when_updated: String,
        /// The message portion of the comment in LBML. May contain the
        /// following HTML tags: `<br>` `<strong>` `<em>` `<b>` `<i>` `<a
        /// href="">` `<blockquote>`.
        comment_lbml: String,
        /// If Letterboxd moderators have removed the comment from the site,
        /// removedByAdmin will be true and comment will not be included.
        removed_by_admin: bool,
        /// If the comment owner has removed the comment from the site, deleted
        /// will be true and comment will not be included.
        deleted: bool,
        /// If the authenticated member has blocked the commenter, blocked will
        /// be true and comment will not be included.
        blocked: bool,
        /// If the content owner has blocked the commenter, blockedByOwner will
        /// be true and comment will not be included.
        blocked_by_owner: bool,
        /// If the authenticated member posted this comment, and the comment is
        /// still editable, this value shows the number of seconds remaining
        /// until the editing window closes.
        editable_window_expires_in: Option<usize>,
        /// The list on which the comment was posted.
        list: ListIdentifier,
        /// The message portion of the comment formatted as HTML.
        comment: String,
    },
    ReviewComment {
        /// The LID of the comment.
        id: String,
        /// The member who posted the comment.
        member: MemberSummary,
        /// ISO 8601 format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ:
        /// "1997-08-29T07:14:00Z"
        when_created: String,
        /// ISO 8601 format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ:
        /// "1997-08-29T07:14:00Z"
        when_updated: String,
        /// The message portion of the comment in LBML. May contain the
        /// following HTML tags: `<br>` `<strong>` `<em>` `<b>` `<i>` `<a
        /// href="">` `<blockquote>`.
        comment_lbml: String,
        /// If Letterboxd moderators have removed the comment from the site,
        /// removedByAdmin will be true and comment will not be included.
        removed_by_admin: bool,
        /// If the comment owner has removed the comment from the site, deleted
        /// will be true and comment will not be included.
        deleted: bool,
        /// If the authenticated member has blocked the commenter, blocked will
        /// be true and comment will not be included.
        blocked: bool,
        /// If the content owner has blocked the commenter, blockedByOwner will
        /// be true and comment will not be included.
        blocked_by_owner: bool,
        /// If the authenticated member posted this comment, and the comment is
        /// still editable, this value shows the number of seconds remaining
        /// until the editing window closes.
        editable_window_expires_in: Option<usize>,
        /// The review on which the comment was posted.
        review: ReviewIdentifier,
        /// The message portion of the comment formatted as HTML.
        comment: String,
    },
}

#[derive(Clone, Debug, Deserialize)]
#[serde(tag = "type")]
pub enum AbstractSearchItem {
    /// Common fields:
    /// score A relevancy value that can be used to order results.
    ContributorSearchItem {
        /// A relevancy value that can be used to order results.
        score: f32,
        /// Contributor Details of the contributor.
        contributor: Contributor,
    },
    FilmSearchItem {
        score: f32,
        film: FilmSummary,
    },
    ListSearchItem {
        score: f32,
        list: ListSummary,
    },
    MemberSearchItem {
        score: f32,
        member: MemberSummary,
    },
    ReviewSearchItem {
        score: f32,
        /// Details of the review.
        review: LogEntry,
    },
    TagSearchItem {
        score: f32,
        tag: String,
    },
}

#[derive(Deserialize, Debug, Default, Clone)]
pub struct AccessToken {
    /// The access token that grants the member access. Combine this with the
    /// token_type to form the Authorization header.
    pub access_token: String,
    /// The type of the access token. Use value: bearer
    pub token_type: String,
    /// The refresh token is used to obtain a new access token, after the
    /// access token expires, without needing to prompt the member for their
    /// credentials again. The refresh token only expires if it is explicitly
    /// invalidated by Letterboxd, in which case the member should be prompted
    /// for their credentials (or stored credentials used).
    pub refresh_token: String,
    /// The number of seconds before the access token expires.
    pub expires_in: usize,
}

#[derive(Deserialize, Debug, Clone)]
enum ActivityClass {
    OwnActivity,
    NotOwnActivity,
    IncomingActivity,
    NotIncomingActivity,
    NetworkActivity,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct ActivityRequest {
    /// The pagination cursor.
    cursor: Option<Cursor>,
    /// The number of items to include per page (default is 20, maximum is 100).
    per_page: Option<usize>,
    /// Only supported for paying members.
    /// Use include to specify the subset of activity to be returned. If
    /// neither include nor exclude is set, the activity types included depend
    /// on the where parameter:
    /// If where=OwnActivity is specified, all activity except
    /// FilmLikeActivity, FilmWatchActivity and InvitationAcceptedActivity is
    /// included.
    /// Otherwise all activity except FilmLikeActivity, FilmWatchActivity,
    /// FilmRatingActivity, FollowActivity, RegistrationActivity and
    /// InvitationAcceptedActivity is included.
    /// These defaults mimic those shown on the website.
    include: Option<Vec<ActivityType>>,
    /// Use where to reduce the subset of activity to be returned. If where is
    /// not set, all default activity types relating to the member are
    /// returned. If multiple values are supplied, only activity matching all
    /// terms will be returned, e.g.
    /// where=OwnActivity&where=NotIncomingActivity will return all activity by
    /// the member except their comments on their own lists and reviews.
    /// NetworkActivity is activity performed either by the member or their
    /// followers. Use where=NetworkActivity&where=NotOwnActivity to only see
    /// activity from followers. If you don’t specify any of NetworkActivity,
    /// OwnActivity or NotIncomingActivity, you will receive activity related
    /// to the member’s content from members outside their network (e.g.
    /// comments and likes on the member’s lists and reviews).
    #[serde(rename = "where")]
    where_activity: Option<Vec<ActivityClass>>,
}

#[derive(Deserialize, Debug, Clone)]
enum ActivityType {
    ReviewActivity,
    ReviewCommentActivity,
    ReviewLikeActivity,
    ListActivity,
    ListCommentActivity,
    ListLikeActivity,
    DiaryEntryActivity,
    FilmRatingActivity,
    FilmWatchActivity,
    FilmLikeActivity,
    WatchlistActivity,
    FollowActivity,
    RegistrationActivity,
    InvitationAcceptedActivity,
}

#[derive(Deserialize, Debug, Clone)]
struct ActivityResponse {
    /// The cursor to the next page of results.
    next: Option<Cursor>,
    /// The list of activity items.
    items: Vec<AbstractActivity>,
}

#[derive(Serialize, Debug, Clone)]
pub struct CommentCreationRequest {
    /// The message portion of the comment in LBML. May contain the following
    /// HTML tags: `<br>` `<strong>` `<em>` `<b>` `<i>` `<a href="">`
    /// `<blockquote>`. This field has a maximum size of 100,000 characters.
    comment: String,
}

#[derive(Deserialize, Debug, Clone)]
enum CommentUpdateMessageCode {
    MissingComment,
    CommentOnContentYouBlocked,
    CommentOnBlockedContent,
    CommentBan,
    CommentEditWindowExpired,
    CommentTooLong,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(tag = "type")]
enum CommentUpdateMessage {
    Error {
        /// The error message code.
        code: CommentUpdateMessageCode,
        /// The error message text in human-readable form.
        title: String,
    },
    Success,
}

#[derive(Deserialize, Debug, Clone)]
struct CommentUpdateRequest {
    /// The message portion of the comment in LBML. May contain the following
    /// HTML tags: `<br>` `<strong>` `<em>` `<b>` `<i>` `<a href="">`
    /// `<blockquote>`. This field has a maximum size of 100,000 characters.
    comment: String,
}

#[derive(Deserialize, Debug, Clone)]
struct CommentUpdateResponse {
    /// The response object.
    data: AbstractComment,
    /// A list of messages the API client should show to the user.
    messages: Vec<CommentUpdateMessage>,
}

// TODO: Ordering
#[derive(Deserialize, Debug, Clone)]
enum CommentsRequestSort {
    Date,
    Updates,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct CommentsRequest {
    /// The pagination cursor.
    cursor: Option<Cursor>,
    /// The number of items to include per page (default is 20, maximum is 100).
    per_page: Option<usize>,
    /// Defaults to Date. The Updates sort order returns newest content first.
    /// Use this to get the most recently posted or edited comments, and pass
    /// include_deletions=true to remain consistent in the case where a comment
    /// has been deleted.
    sort: CommentsRequestSort,
    /// Use this to discover any comments that were deleted.
    include_deletions: bool,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct ContributionStatistics {
    /// The type of contribution.
    #[serde(rename = "type")]
    contribution_type: ContributionType,
    /// The number of films for this contribution type.
    film_count: usize,
}

#[derive(Deserialize, Serialize, Debug, Clone)]
pub enum ContributionType {
    Director,
    Actor,
    Producer,
    Writer,
    Editor,
    Cinematography,
    ArtDirection,
    VisualEffects,
    Composer,
    Sound,
    Costumes,
    MakeUp,
    Studio,
}

#[derive(Deserialize, Debug, Clone)]
pub struct Contributor {
    /// The LID of the contributor.
    pub id: String,
    /// The name of the contributor.
    pub name: String,
    /// An array of the types of contributions made, with a count of films for
    /// each contribution type.
    // TODO
    // statistics: ContributorStatistics,
    // A list of relevant URLs to this entity, on Letterboxd and external sites.
    pub links: Vec<Link>,
}

#[derive(Deserialize, Debug, Clone)]
struct ContributorStatistics {
    // The statistics for each contribution type.
    contributions: Vec<ContributionStatistics>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ContributorSummary {
    /// The LID of the contributor.
    pub id: String,
    /// The name of the contributor.
    pub name: String,
    /// The character name if available (only if the contribution is as an
    /// Actor; see the type field in FilmContributions).
    pub character_name: Option<String>,
}

/// A cursor is a String value provided by the API. It should be treated as an
/// opaque value — don’t change it.
pub type Cursor = String;

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct DiaryDetails {
    /// The date the film was watched, if specified, in ISO 8601 format, i.e.
    /// YYYY-MM-DD
    pub diary_date: String,
    /// Will be true if the member has indicated (or it can be otherwise
    /// determined) that the member has seen the film prior to this date.
    pub rewatch: bool,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Film {
    /// The LID of the film.
    pub id: String,
    /// The title of the film.
    pub name: String,
    /// The original title of the film, if it was first released with a
    /// non-English title.
    pub original_name: Option<String>,
    /// The other names by which the film is known (including alternative
    /// titles and/or foreign translations).
    pub alternative_names: Vec<String>,
    /// The year in which the film was first released.
    pub release_year: u16,
    /// The tagline for the film.
    pub tagline: String,
    /// A synopsis of the film.
    pub description: String,
    /// The film’s duration (in minutes).
    pub run_time: u16,
    /// The film’s poster image (2:3 ratio in multiple sizes).
    pub poster: Image,
    /// The film’s backdrop image (16:9 ratio in multiple sizes).
    pub backdrop: Image,
    /// The backdrop’s vertical focal point, expressed as a proportion of the
    /// image’s height, using values between 0.0 and 1.0. Use when cropping the
    /// image into a shorter space, such as in the page for a film on the
    /// Letterboxd site.
    pub backdrop_focal_point: f32,
    /// The film’s trailer.
    pub trailer: FilmTrailer,
    /// The film’s genres.
    pub genres: Vec<Genre>,
    /// The film’s contributors (director, cast and crew) grouped by discipline.
    pub contributions: Vec<FilmContributions>,
    /// A list of relevant URLs to this entity, on Letterboxd and external
    /// sites.
    pub links: Vec<Link>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct FilmAutocompleteRequest {
    /// The number of items to include per page (default is 20, maximum is 100).
    per_page: Option<usize>,
    /// The word, partial word or phrase to match against.
    input: String,
}

#[derive(Deserialize, Debug, Clone)]
pub enum FilmAvailabilityService {
    Amazon,
    AmazonVideo,
    AmazonPrime,
    #[allow(non_camel_case_types)]
    iTunes,
    Netflix,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct FilmAvailability {
    /// The service.
    pub service: FilmAvailabilityService,
    /// The service’s name.
    pub display_name: String,
    /// The regional store for the service. Not all countries are supported on
    /// all services.
    pub country: Country,
    /// The unique ID (if any) for the film on the store.
    pub id: String,
    /// The fully qualified URL for the film on this store.
    pub url: String,
}

// TODO: order
#[derive(Deserialize, Debug, Clone)]
pub enum Country {
    AIA,
    ARE,
    ARG,
    ARM,
    ATG,
    AUS,
    AUT,
    AZE,
    BEL,
    BFA,
    BGR,
    BHR,
    BHS,
    BLR,
    BLZ,
    BMU,
    BOL,
    BRA,
    BRB,
    BRN,
    BWA,
    CAN,
    CHE,
    CHL,
    CHN,
    COL,
    CPV,
    CRI,
    CYM,
    CYP,
    CZE,
    DEU,
    DMA,
    DNK,
    DOM,
    ECU,
    EGY,
    ESP,
    EST,
    FIN,
    FJI,
    FRA,
    FSM,
    GBR,
    GHA,
    GMB,
    GNB,
    GRC,
    GRD,
    GTM,
    HKG,
    HND,
    HUN,
    IDN,
    IND,
    IRL,
    ISR,
    ITA,
    JOR,
    JPN,
    KAZ,
    KEN,
    KGZ,
    KHM,
    KNA,
    LAO,
    LBN,
    LKA,
    LTU,
    LUX,
    LVA,
    MAC,
    MDA,
    MEX,
    MLT,
    MNG,
    MOZ,
    MUS,
    MYS,
    NAM,
    NER,
    NGA,
    NIC,
    NLD,
    NOR,
    NPL,
    NZL,
    OMN,
    PAN,
    PER,
    PHL,
    PNG,
    POL,
    PRT,
    PRY,
    QAT,
    ROU,
    RUS,
    SAU,
    SGP,
    SLV,
    SVK,
    SVN,
    SWE,
    SWZ,
    THA,
    TJK,
    TKM,
    TTO,
    TUR,
    TWN,
    UGA,
    UKR,
    USA,
    UZB,
    VEN,
    VGB,
    VNM,
    ZAF,
    ZWE,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct FilmAvailabilityResponse {
    /// The list of stores where the film is available for streaming or
    /// purchasing, in order of preference. If the member has not specified
    /// their preferred stores for a service, the USA store will be assumed.
    pub items: Option<Vec<FilmAvailability>>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct FilmContribution {
    /// The type of contribution.
    #[serde(rename = "type")]
    contribution_type: ContributionType,
    /// The film.
    film: FilmSummary,
    /// The name of the character (only when type is Actor).
    character_name: String,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct FilmContributions {
    /// The type of contribution.
    pub contribution_type: Option<ContributionType>,
    /// The list of contributors of the specified type for the film.
    pub contributors: Vec<ContributorSummary>,
}

// TODO: Ordering, Dedup
#[derive(Serialize, Debug, Clone)]
pub enum FilmStatus {
    Released,
    NotReleased,
    InWatchlist,
    NotInWatchlist,
    Watched,
    NotWatched,
    FeatureLength,
    NotFeatureLength,
}

// TODO: Ordering
#[derive(Serialize, Debug, Clone)]
pub enum FilmRelationshipType {
    Watched,
    NotWatched,
    Liked,
    NotLiked,
    InWatchlist,
    NotInWatchlist,
    Favorited,
}

#[derive(Serialize, Debug, Clone)]
enum FilmContributionsSort {
    FilmName,
    ReleaseDateLatestFirst,
    ReleaseDateEarliestFirst,
    RatingHighToLow,
    RatingLowToHigh,
    FilmDurationShortestFirst,
    FilmDurationLongestFirst,
    FilmPopularity,
    FilmPopularityThisWeek,
    FilmPopularityThisMonth,
    FilmPopularityThisYear,
}

#[derive(Serialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct FilmContributionsRequest {
    /// The pagination cursor.
    cursor: Option<Cursor>,
    /// The number of items to include per page (default is 20, maximum is 100).
    per_page: Option<usize>,
    /// The order in which the films should be returned. Defaults to
    /// FilmPopularity, which is an all-time measurement of the amount of
    /// activity the film has received. The FilmPopularityWithFriends values
    /// are only available to signed-in members and consider popularity amongst
    /// the signed-in member’s friends.
    sort: FilmContributionsSort,
    /// The type of contribution.
    #[serde(rename = "type")]
    contribution_type: ContributionType,
    /// Specify the LID of a genre to limit films to those within the specified
    /// genre.
    genre: String,
    /// Specify the starting year of a decade (must end in 0) to limit films to
    /// those released during the decade. 1990
    decade: u16,
    /// Specify a year to limit films to those released during that year. 1994
    year: u16,
    /// Specify the ID of a supported service to limit films to those available
    /// from that service. The list of available services can be found by using
    /// the /films/film-services endpoint.
    service: String,
    /// Specify one or more values to limit the list of films accordingly.
    /// where=Watched&where=Released
    #[serde(rename = "where")]
    where_film_status: Vec<FilmStatus>,
    /// Specify the LID of a member to limit the returned films according to
    /// the value set in memberRelationship.
    member: String,
    /// Must be used in conjunction with member. Defaults to Watched. Specify
    /// the type of relationship to limit the returned films accordingly.
    member_relationship: FilmRelationshipType,
    /// Must be used in conjunction with member. Defaults to None, which only
    /// returns films from the member’s account. Use Only to return films from
    /// the member’s friends, and All to return films from both the member and
    /// their friends.
    include_friends: IncludeFriends,
    /// Specify a tag code to limit the returned films to those tagged
    /// accordingly.
    tag_code: String,
    /// Must be used with tag. Specify the LID of a member to focus the tag
    /// filter on the member.
    tagger: String,
    /// Must be used in conjunction with tagger. Defaults to None, which
    /// filters tags set by the member. Use Only to filter tags set by the
    /// member’s friends, and All to filter tags set by both the member and
    /// their friends.
    include_tagger_friends: IncludeFriends,
}

#[derive(Deserialize, Debug, Clone)]
struct FilmContributionsResponse {
    /// The cursor to the next page of results.
    next: Option<Cursor>,
    /// The list of contributions.
    items: Vec<FilmContribution>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct FilmIdentifier {
    /// The LID of the film.
    pub id: String,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct FilmRelationship {
    /// Will be true if the member has indicated they’ve seen the film (via the
    /// ‘eye’ icon) or has a log entry for the film.
    pub watched: bool,
    /// Will be true if the member likes the film (via the ‘heart’ icon).
    pub liked: bool,
    /// Will be true if the member listed the film as one of their four
    /// favorites.
    pub favorited: bool,
    /// Will be true if the film is in the member’s watchlist.
    pub in_watchlist: bool,
    /// The member’s rating for the film.
    pub rating: Option<f32>,
    /// A list of LIDs for reviews the member has written for the film in the
    /// order they were added, with most recent reviews first.
    pub reviews: Vec<String>,
    /// A list of LIDs for log entries the member has added for the film in
    /// diary order, with most recent entries first.
    pub diary_entries: Vec<String>,
}

#[derive(Deserialize, Debug, Clone)]
pub enum FilmRelationshipUpdateMessageCode {
    InvalidRatingValue,
    UnableToRemoveWatch,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(tag = "type")]
pub enum FilmRelationshipUpdateMessage {
    Error {
        /// The error message code.
        code: FilmRelationshipUpdateMessageCode,
        /// The error message text in human-readable form.
        title: String,
    },
}

/// When PATCHing a film relationship, you may send all of the current property
/// struct values, or just those you wish to change. Properties that violate
/// business rules (see watched below) or contain invalid values will be
/// ignored.
#[derive(Serialize, Debug, Clone, Default)]
#[serde(rename_all = "camelCase")]
pub struct FilmRelationshipUpdateRequest {
    /// Set to true to change the film’s status for the authenticated member to
    /// ‘watched’ or false for ‘not watched’. If the status is changed to
    /// ‘watched’ and the film is in the member’s watchlist, it will be removed
    /// as part of this action. You may not change the status of a film to ‘not
    /// watched’ if there is existing activity (a review or diary entry) for
    /// the authenticated member—check the messages returned from this endpoint
    /// to ensure no such business rules have been violated.
    pub watched: Option<bool>,
    /// Set to true to change the film’s status for the authenticated member to
    /// ‘liked’ or false for ‘not liked’.
    pub liked: Option<bool>,
    /// Set to true to add the film to the authenticated member’s watchlist, or
    /// false to remove it.
    pub in_watchlist: Option<bool>,
    /// Accepts values between 0.5 and 5.0, with increments of 0.5, or null (to
    /// remove the rating).
    pub rating: Option<f32>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct FilmRelationshipUpdateResponse {
    /// The response object.
    pub data: FilmRelationship,
    /// A list of messages the API client should show to the user.
    pub messages: Vec<FilmRelationshipUpdateMessage>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct FilmServicesResponse {
    // The list of film services.
    pub items: Vec<Service>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct FilmStatistics {
    /// The film for which statistics were requested.
    pub film: FilmIdentifier,
    /// The number of watches, ratings, likes, etc. for the film.
    pub counts: FilmStatisticsCounts,
    /// The weighted average rating of the film between 0.5 and 5.0. Will not
    /// be present if the film has not received sufficient ratings.
    pub rating: Option<f32>,
    /// A summary of the number of ratings at each increment between 0.5 and
    /// 5.0.
    pub ratings_histogram: Vec<RatingsHistogramBar>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct FilmStatisticsCounts {
    /// The number of members who have watched the film.
    pub watches: usize,
    /// The number of members who have liked the film.
    pub likes: usize,
    /// The number of members who have rated the film.
    pub ratings: usize,
    /// The number of members who have the film as one of their four favorites.
    pub fans: usize,
    /// The number of lists in which the film appears.
    pub lists: usize,
    /// The number of reviews for the film.
    pub reviews: usize,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct FilmSummary {
    /// The LID of the film.
    pub id: String,
    /// The title of the film.
    pub name: String,
    /// The original title of the film, if it was first released with a
    /// non-English title.
    pub original_name: Option<String>,
    /// The other names by which the film is known (including alternative
    /// titles and/or foreign translations).
    pub alternative_names: Option<Vec<String>>,
    /// The year in which the film was first released.
    pub release_year: Option<u16>,
    /// The list of directors for the film.
    pub directors: Vec<ContributorSummary>,
    /// The film’s poster image (2:3 ratio in multiple sizes).
    pub poster: Option<Image>,
    /// Relationships to the film for the authenticated member (if any) and
    /// other members where relevant.
    pub relationships: Vec<MemberFilmRelationship>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct FilmTrailer {
    /// The YouTube ID of the trailer. "ICp4g9p_rgo".
    pub id: String,
    /// The YouTube URL for the trailer.
    /// "https://www.youtube.com/watch?v=ICp4g9p_rgo"
    pub url: String,
}

#[derive(Deserialize, Debug, Clone)]
struct FilmsAutocompleteResponse {
    // The list of films.
    items: Vec<FilmSummary>,
}

#[derive(Serialize, Debug, Clone)]
pub enum FilmRequestSort {
    FilmName,
    ReleaseDateLatestFirst,
    ReleaseDateEarliestFirst,
    RatingHighToLow,
    RatingLowToHigh,
    FilmDurationShortestFirst,
    FilmDurationLongestFirst,
    FilmPopularity,
    FilmPopularityThisWeek,
    FilmPopularityThisMonth,
    FilmPopularityThisYear,
    FilmPopularityWithFriends,
    FilmPopularityWithFriendsThisWeek,
    FilmPopularityWithFriendsThisMonth,
    FilmPopularityWithFriendsThisYear,
}

#[derive(Serialize, Debug, Clone, Default)]
#[serde(rename_all = "camelCase")]
pub struct FilmsRequest {
    /// The pagination cursor.
    pub cursor: Option<Cursor>,
    /// The number of items to include per page (default is 20, maximum is 100).
    pub per_page: Option<usize>,
    /// The order in which the films should be returned. Defaults to
    /// FilmPopularity, which is an all-time measurement of the amount of
    /// activity the film has received. The FilmPopularityWithFriends values
    /// are only available to signed-in members and consider popularity amongst
    /// the signed-in member’s friends.
    pub sort: Option<FilmRequestSort>,
    /// Specify the LID of a genre to limit films to those within the specified
    /// genre.
    pub genre: Option<String>,
    /// Specify the LID of up to 100 genres to limit films to those within none
    /// of the specified genres.
    pub include_genre: Option<Vec<String>>,
    /// Specify the LID of up to 100 genres to limit films to those within none
    /// of the specified genres.
    pub exclude_genre: Option<Vec<String>>,
    /// Specify the ISO 3166-1 defined code of the country to limit films to those
    /// produced in the specified country.
    pub country: Option<String>,
    /// Specify the ISO 639-1 defined code of the language to limit films to those
    /// using the specified spoken language.
    pub language: Option<String>,
    /// Specify the starting year of a decade (must end in 0) to limit films to
    /// those released during the decade. 1990
    pub decade: Option<u16>,
    /// Specify a year to limit films to those released during that year. 1994
    pub year: Option<u16>,
    /// Specify the ID of a supported service to limit films to those available
    /// from that service. The list of available services can be found by using
    /// the /films/film-services endpoint.
    pub service: Option<String>,
    /// Specify one or more values to limit the list of films accordingly.
    /// where=Watched&where=Released
    #[serde(rename = "where")]
    pub where_film_status: Vec<FilmStatus>,
    /// Specify the LID of a member to limit the returned films according to
    /// the value set in memberRelationship.
    pub member: Option<String>,
    /// Must be used in conjunction with member. Defaults to Watched. Specify
    /// the type of relationship to limit the returned films accordingly.
    pub member_relationship: Option<FilmRelationshipType>,
    /// Must be used in conjunction with member. Defaults to None, which only
    /// returns films from the member’s account. Use Only to return films from
    /// the member’s friends, and All to return films from both the member and
    /// their friends.
    pub include_friends: Option<IncludeFriends>,
    /// Specify a tag code to limit the returned films to those tagged
    /// accordingly.
    pub tag_code: Option<String>,
    /// Must be used with tag. Specify the LID of a member to focus the tag
    /// filter on the member.
    pub tagger: Option<String>,
    /// Must be used in conjunction with tagger. Defaults to None, which
    /// filters tags set by the member. Use Only to filter tags set by the
    /// member’s friends, and All to filter tags set by both the member and
    /// their friends.
    pub include_tagger_friends: Option<IncludeFriends>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct FilmsResponse {
    /// The cursor to the next page of results.
    pub next: Option<Cursor>,
    /// The list of films.
    pub items: Vec<FilmSummary>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct ForgottenPasswordRequest {
    email_address: String,
}

#[derive(Deserialize, Debug, Clone)]
pub struct Genre {
    /// The LID of the genre.
    pub id: String,
    /// The name of the genre.
    pub name: String,
}

#[derive(Deserialize, Debug, Clone)]
pub struct GenresResponse {
    /// The list of genres.
    pub items: Vec<Genre>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct Language {
    /// The ISO 639-1 defined code of the language.
    pub code: String,
    /// The name of the language.
    pub name: String,
}

#[derive(Deserialize, Debug, Clone)]
pub struct LanguagesResponse {
    /// The list of languages.
    pub items: Vec<Language>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct Image {
    /// The available sizes for the image.
    pub sizes: Vec<ImageSize>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct ImageSize {
    /// The image width in pixels.
    pub width: usize,
    /// The image height in pixels.
    pub height: usize,
    /// The URL to the image file.
    pub url: String,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(tag = "type", rename_all = "lowercase")]
pub enum Link {
    Letterboxd {
        ///   The object ID for the linked entity on the destination site.
        id: String,
        ///   The fully qualified URL on the destination site.
        url: String,
    },
    Tmdb {
        ///   The object ID for the linked entity on the destination site.
        id: String,
        ///   The fully qualified URL on the destination site.
        url: String,
    },
    Imdb {
        ///   The object ID for the linked entity on the destination site.
        id: String,
        ///   The fully qualified URL on the destination site.
        url: String,
    },
    Gwi {
        ///   The object ID for the linked entity on the destination site.
        id: String,
        ///   The fully qualified URL on the destination site.
        url: String,
    },
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct List {
    /// The LID of the list.
    pub id: String,
    /// The name of the list.
    pub name: String,
    /// The number of films in the list.
    pub film_count: usize,
    /// Will be true if the owner has elected to publish the list for other
    /// members to see.
    pub published: bool,
    /// Will be true if the owner has elected to make this a ranked list.
    pub ranked: bool,
    /// Will be true if the owner has added notes to any entries.
    pub has_entries_with_notes: bool,
    /// The list description in LBML. May contain the following HTML tags:
    /// `<br>` `<strong>` `<em>` `<b>` `<i>` `<a href="">` `<blockquote>`.
    pub description_lbml: Option<String>,
    /// The tags for the list.
    pub tags2: Vec<Tag>,
    /// The third-party service or services to which this list can be shared.
    /// Only included if the authenticated member is the list’s owner.
    pub can_share_on: Option<Vec<ThirdPartyService>>,
    /// The third-party service or services to which this list has been shared.
    /// Only included if the authenticated member is the list’s owner.
    pub shared_on: Option<Vec<ThirdPartyService>>,
    /// ISO 8601 format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ
    /// "1997-08-29T07:14:00Z"
    pub when_created: String,
    /// ISO 8601 format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ
    /// "1997-08-29T07:14:00Z"
    pub when_published: Option<String>,
    /// The member who owns the list.
    pub owner: MemberSummary,
    /// The list this was cloned from, if applicable.
    pub cloned_from: Option<ListIdentifier>,
    /// The first 12 entries in the list. To fetch more than 12 entries, and to
    /// fetch the entry notes, use the /list/{id}/entries endpoint.
    pub preview_entries: Vec<ListEntrySummary>,
    /// A list of relevant URLs to this entity, on Letterboxd and external
    /// sites.
    pub links: Vec<Link>,
    /// The list description formatted as HTML.
    pub description: Option<String>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct ListComment {
    /// The LID of the comment.
    id: String,
    /// The member who posted the comment.
    member: MemberSummary,
    /// ISO 8601 format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ
    /// "1997-08-29T07:14:00Z"
    when_created: String,
    /// ISO 8601 format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ
    /// "1997-08-29T07:14:00Z"
    when_updated: String,
    /// The message portion of the comment in LBML. May contain the following
    /// HTML tags: `<br>` `<strong>` `<em>` `<b>` `<i>` `<a href="">`
    /// `<blockquote>`.
    comment_lbml: String,
    /// If Letterboxd moderators have removed the comment from the site,
    /// removedByAdmin will be true and comment will not be included.
    removed_by_admin: bool,
    /// If the comment owner has removed the comment from the site, deleted
    /// will be true and comment will not be included.
    deleted: bool,
    /// If the authenticated member has blocked the commenter, blocked will be
    /// true and comment will not be included.
    blocked: bool,
    /// If the list owner has blocked the commenter, blockedByOwner will be
    /// true and comment will not be included.
    blocked_by_owner: bool,
    /// If the authenticated member posted this comment, and the comment is
    /// still editable, this value shows the number of seconds remaining until
    /// the editing window closes.
    editable_window_expires_in: Option<usize>,
    /// The list on which the comment was posted.
    list: ListIdentifier,
    /// The message portion of the comment formatted as HTML.
    comment: String,
}

#[derive(Deserialize, Debug, Clone)]
struct ListCommentsResponse {
    /// The cursor to the next page of results.
    next: Option<Cursor>,
    /// The list of comments.
    items: Vec<ListComment>,
}

#[derive(Serialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ListCreateEntry {
    /// The LID of the film.
    film: String,
    /// The entry’s rank in the list, numbered from 1. If not set, the entry
    /// will be appended to the end of the list. Sending two or more
    /// ListCreateEntrys with the same rank will return an error.
    rank: usize,
    /// The notes for the list entry in LBML. May contain the following HTML tags: `<br>` `<strong>` `<em>` `<b>` `<i>` `<a href="">` `<blockquote>`.
    notes: String,
    /// Set to true if the member has indicated that the notes field contains
    /// plot spoilers for the film.
    contains_spoilers: bool,
}

#[derive(Deserialize, Debug, Clone)]
pub enum ListCreateMessageCode {
    ListNameIsBlank,
    UnknownFilmCode,
    InvalidRatingValue,
    DuplicateRank,
    EmptyPublicList,
    CloneSourceNotFound,
    SharingServiceNotAuthorized,
    CannotSharePrivateList,
    ListDescriptionIsTooLong,
    ListEntryNotesTooLong,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(tag = "type")]
pub enum ListCreateMessage {
    Error {
        /// The error message code.
        code: ListCreateMessageCode,
        /// The error message text in human-readable form.
        title: String,
    },
    Success,
}

#[derive(Deserialize, Debug, Clone)]
pub struct ListCreateResponse {
    /// The response object.
    pub data: List,
    // A list of messages the API client should show to the user.
    pub messages: Vec<ListCreateMessage>,
}

#[derive(Serialize, Debug, Clone)]
pub struct ListCreationRequest {
    /// The name of the list.
    name: String,
    /// Set to true if the owner has elected to publish the list for other
    /// members to see.
    published: bool,
    /// Set to true if the owner has elected to make this a ranked list.
    ranked: bool,
    /// The list description in LBML. May contain the following HTML tags:
    /// `<br>` `<strong>` `<em>` `<b>` `<i>` `<a href="">` `<blockquote>`. This
    /// field has a maximum size of 100,000 characters.
    #[serde(skip_serializing_if = "Option::is_none")]
    description: Option<String>,
    /// The LID of a list to clone from. Only supported for paying members.
    #[serde(skip_serializing_if = "Option::is_none")]
    cloned_from: Option<String>,
    // The tags for the list.
    #[serde(skip_serializing_if = "Vec::is_empty")]
    tags: Vec<String>,
    /// The films that comprise the list. Required unless source is set.
    #[serde(skip_serializing_if = "Vec::is_empty")]
    entries: Vec<ListCreateEntry>,
    /// The third-party service or services to which this list should be shared. Valid options are found in the MemberAccount.authorizedSharingServicesForLists (see the /me endpoint).
    #[serde(skip_serializing_if = "Vec::is_empty")]
    share: Vec<ThirdPartyService>,
}

impl ListCreationRequest {
    pub fn new(name: String) -> Self {
        Self {
            name,
            published: false,
            ranked: false,
            description: None,
            cloned_from: None,
            tags: Vec::new(),
            entries: Vec::new(),
            share: Vec::new(),
        }
    }
}

#[derive(Serialize, Debug, Clone)]
pub enum ListEntriesRequestSort {
    ListRanking,
    WhenAddedToList,
    RatingHighToLow,
    RatingLowToHigh,
    FilmName,
    ReleaseDateLatestFirst,
    ReleaseDateEarliestFirst,
    FilmDurationShortestFirst,
    FilmDurationLongestFirst,
    FilmPopularity,
    FilmPopularityThisWeek,
    FilmPopularityThisMonth,
    FilmPopularityThisYear,
}

#[derive(Serialize, Debug, Clone, Default)]
#[serde(rename_all = "camelCase")]
pub struct ListEntriesRequest {
    /// The pagination cursor.
    pub cursor: Option<Cursor>,
    /// The number of items to include per page (default is 20, maximum is 100).
    pub per_page: Option<usize>,
    /// The order in which the entries should be returned. Defaults to
    /// ListRanking, which is the order specified by the list owner.
    pub sort: Option<ListEntriesRequestSort>,
    /// Specify the LID of a genre to limit films to those within the specified
    /// genre.
    pub genre: Option<String>,
    /// Specify the starting year of a decade (must end in 0) to limit films to
    /// those released during the decade. 1990
    pub decade: Option<u16>,
    /// Specify a year to limit films to those released during that year. 1994
    pub year: Option<u16>,
    /// Specify the ID of a supported service to limit films to those available
    /// from that service. The list of available services can be found by using
    /// the /films/film-services endpoint.
    pub service: Option<String>,
    /// Specify one or more values to limit the list of films accordingly.
    /// where=Watched&where=Released
    #[serde(rename = "where")]
    pub where_film_status: Vec<FilmStatus>,
    /// Specify the LID of a member to limit the returned films according to
    /// the value set in memberRelationship.
    pub member: Option<String>,
    /// Must be used in conjunction with member. Defaults to Watched. Specify
    /// the type of relationship to limit the returned films accordingly.
    pub member_relationship: Option<FilmRelationshipType>,
    /// Must be used in conjunction with member. Defaults to None, which only
    /// returns films from the member’s account. Use Only to return films from
    /// the member’s friends, and All to return films from both the member and
    /// their friends.
    pub include_friends: Option<IncludeFriends>,
    /// Specify a tag code to limit the returned films to those tagged
    /// accordingly.
    pub tag_code: Option<String>,
    /// Must be used with tag. Specify the LID of a member to focus the tag
    /// filter on the member.
    pub tagger: Option<String>,
    /// Must be used in conjunction with tagger. Defaults to None, which
    /// filters tags set by the member. Use Only to filter tags set by the
    /// member’s friends, and All to filter tags set by both the member and
    /// their friends.
    pub include_tagger_friends: Option<IncludeFriends>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct ListEntriesResponse {
    ///     The cursor to the next page of results.
    pub next: Option<Cursor>,
    // The list of entries.
    pub items: Vec<ListEntry>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ListEntry {
    /// The entry’s rank in the list, numbered from 1.
    pub rank: Option<usize>,
    /// The notes for the list entry in LBML. May contain the following HTML tags: `<br>` `<strong>` `<em>` `<b>` `<i>` `<a href="">` `<blockquote>`.
    pub notes_lbml: Option<String>,
    /// Will be true if the member has indicated that the notes field contains
    /// plot spoilers for the film.
    pub contains_spoilers: Option<bool>,
    /// The film for this entry. Includes a MemberFilmRelationship for the
    /// member who created the list.
    pub film: FilmSummary,
    /// The notes for the list entry formatted as HTML.
    pub notes: Option<String>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct ListEntrySummary {
    /// The entry’s rank in the list, numbered from 1.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub rank: Option<usize>,
    /// The film for this entry.
    pub film: FilmSummary,
}

#[derive(Deserialize, Debug, Clone)]
pub struct ListIdentifier {
    /// The LID of the list.
    pub id: String,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct ListRelationship {
    /// Will be true if the member likes the list (via the ‘heart’ icon). A
    /// member may not like their own list.
    liked: bool,
    /// Will be true if the member is subscribed to comment notifications for
    /// the list
    subscribed: bool,
    /// Defaults to Subscribed for the list’s owner, and NotSubscribed for
    /// other members. The subscription value may change when a member (other
    /// than the owner) posts a comment, as follows: the member will become
    /// automatically Subscribed unless they have previously Unsubscribed from
    /// the comment thread via the web interface or API, or unless they have
    /// disabled comment notifications in their profile settings.
    subscription_state: SubscriptionState,
    /// The authenticated member’s state with respect to adding comments for
    /// this list.
    comment_thread_state: CommentThreadState,
}

#[derive(Deserialize, Debug, Clone)]
enum ListRelationshipUpdateMessageCode {
    LikeBlockedContent,
    LikeOwnList,
    SubscribeWhenOptedOut,
    SubscribeToContentYouBlocked,
    SubscribeToBlockedContent,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(tag = "type")]
enum ListRelationshipUpdateMessage {
    Error {
        /// The error message code.
        code: ListRelationshipUpdateMessageCode,
        /// The error message text in human-readable form.
        title: String,
    },
    Success,
}

#[derive(Deserialize, Debug, Clone)]
struct ListRelationshipUpdateRequest {
    /// Set to true if the member likes the list (via the ‘heart’ icon). A
    /// member may not like their own list.
    liked: bool,
    /// Set to true to subscribe the member to comment notifications for the list, or false to unsubscribe them. A value of true will be ignored if the member has disabled comment notifications in their profile settings.
    subscribed: bool,
}

#[derive(Deserialize, Debug, Clone)]
struct ListRelationshipUpdateResponse {
    /// The response object.
    data: ListRelationship,
    /// A list of messages the API client should show to the user.
    messages: Vec<ListRelationshipUpdateMessage>,
}

#[derive(Deserialize, Debug, Clone)]
struct ListStatistics {
    /// The list for which statistics were requested.
    list: ListIdentifier,
    /// The number of comments and likes for the list.
    counts: ListStatisticsCounts,
}

#[derive(Deserialize, Debug, Clone)]
struct ListStatisticsCounts {
    /// The number of comments for the list.
    comments: usize,
    /// The number of members who like the list.
    likes: usize,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ListSummary {
    /// The LID of the list.
    pub id: String,
    /// The name of the list.
    pub name: String,
    /// The number of films in the list.
    pub film_count: usize,
    /// Will be true if the owner has elected to publish the list for other
    /// members to see.
    pub published: bool,
    /// Will be true if the owner has elected to make this a ranked list.
    pub ranked: bool,
    /// The list description in LBML. May contain the following HTML tags:
    /// `<br>` `<strong>` `<em>` `<b>` `<i>` `<a href="">` `<blockquote>`. The
    /// text is a preview extract, and may be truncated if it’s too long.
    pub description_lbml: Option<String>,
    /// Will be true if the list description was truncated because it’s very
    /// long.
    pub description_truncated: Option<bool>,
    /// The member who owns the list.
    pub owner: MemberSummary,
    /// The list this was cloned from, if applicable.
    pub cloned_from: Option<ListIdentifier>,
    /// The first 12 entries in the list. To fetch more than 12 entries, and to
    /// fetch the entry notes, use the /list/{id}/entries endpoint.
    pub preview_entries: Vec<ListEntrySummary>,
    /// The list description formatted as HTML. The text is a preview extract,
    /// and may be truncated if it’s too long.
    pub description: Option<String>,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ListUpdateEntry {
    /// The LID of the film.
    pub film: String,
    /// The entry’s rank in the list, numbered from 1. If not set, the entry
    /// will stay in the same place (if already in the list) or be appended to
    /// the end of the list (if not in the list). If set, any entries at or
    /// after this position will be incremented by one. Sending two or more
    /// ListUpdateEntrys with the same rank will return an error.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub rank: Option<usize>,
    /// The notes for the list entry in LBML. May contain the following HTML
    /// tags: `<br>` `<strong>` `<em>` `<b>` `<i>` `<a href="">`
    /// `<blockquote>`. This field has a maximum size of 100,000 characters.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub notes: Option<String>,
    /// Set to true if the member has indicated that the notes field contains
    /// plot spoilers for the film.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub contains_spoilers: Option<bool>,
}

impl ListUpdateEntry {
    pub fn new(film: String) -> ListUpdateEntry {
        ListUpdateEntry {
            film,
            rank: None,
            notes: None,
            contains_spoilers: None,
        }
    }
}

#[derive(Deserialize, Debug, Clone)]
pub enum ListUpdateMessageCode {
    ListNameIsBlank,
    UnknownFilmCode,
    InvalidRatingValue,
    DuplicateRank,
    EmptyPublicList,
    SharingServiceNotAuthorized,
    CannotSharePrivateList,
    ListDescriptionIsTooLong,
    ListEntryNotesTooLong,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(tag = "type")]
pub enum ListUpdateMessage {
    Error {
        /// The error message code.
        code: ListUpdateMessageCode,
        /// The error message text in human-readable form.
        title: String,
    },
    Success,
}

#[derive(Serialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ListUpdateRequest {
    /// Set to true if the owner has elected to publish the list for other
    /// members to see.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub published: Option<bool>,
    /// The name of the list.
    pub name: String,
    /// Set to true if the owner has elected to make this a ranked list.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ranked: Option<bool>,
    /// The list description in LBML. May contain the following HTML tags:
    /// `<br>` `<strong>` `<em>` `<b>` `<i>` `<a href="">` `<blockquote>`. This
    /// field has a maximum size of 100,000 characters.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The tags for the list.
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<String>,
    /// Specify the LIDs of films to be removed from the list.
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub films_to_remove: Vec<String>,
    /// The specified entries will be inserted/appended to the list if they are
    /// not already present, or updated if they are present.
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<ListUpdateEntry>,
    /// The third-party service or services to which this list should be
    /// shared. Valid options are found in the ListRelationship (see the
    /// /list/{id}/me endpoint).
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub share: Vec<ThirdPartyService>,
}

impl ListUpdateRequest {
    pub fn new(name: String) -> ListUpdateRequest {
        ListUpdateRequest {
            published: None,
            name,
            ranked: None,
            description: None,
            tags: Vec::new(),
            films_to_remove: Vec::new(),
            entries: Vec::new(),
            share: Vec::new(),
        }
    }
}

#[derive(Deserialize, Debug, Clone)]
pub struct ListUpdateResponse {
    /// The response object.
    pub data: List,
    // A list of messages the API client should show to the user.
    pub messages: Vec<ListUpdateMessage>,
}

#[derive(Serialize, Debug, Clone)]
pub enum ListRequestSort {
    Date,
    WhenCreatedLatestFirst,
    WhenCreatedEarliestFirst,
    ListName,
    ListPopularity,
    ListPopularityThisWeek,
    ListPopularityThisMonth,
    ListPopularityThisYear,
    ListPopularityWithFriends,
    ListPopularityWithFriendsThisWeek,
    ListPopularityWithFriendsThisMonth,
    ListPopularityWithFriendsThisYear,
}

#[derive(Serialize, Debug, Clone)]
pub enum ListMemberRelationship {
    Owner,
    Liked,
}

#[derive(Serialize, Debug, Clone)]
pub enum ListStatus {
    Clean,
    Published,
    Unpublished,
}

#[derive(Serialize, Debug, Clone)]
pub enum ListRequestFilter {
    NoDuplicateMembers,
}

#[derive(Serialize, Debug, Default, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ListsRequest {
    /// The pagination cursor.
    pub cursor: Option<Cursor>,
    /// The number of items to include per page (default is 20, maximum is 100).
    pub per_page: Option<usize>,
    /// Defaults to Date, which returns lists that were most recently
    /// created/updated first. The ListPopularityWithFriends values are only
    /// available to signed-in members and consider popularity amongst the
    /// signed-in member’s friends.
    pub sort: Option<ListRequestSort>,
    /// Specify the LID of a film to return lists that include that film.
    pub film: Option<String>,
    /// Specify the LID of a list to return lists that were cloned from that
    /// list.
    pub cloned_from: Option<String>,
    /// Specify a tag code to limit the returned lists to those tagged
    /// accordingly. Must be used with member and memberRelationship=Owner.
    pub tag_code: Option<String>,
    /// Specify the LID of a member to return lists that are owned or liked by
    /// the member (or their friends, when used with includeFriends).
    pub member: Option<String>,
    /// Must be used in conjunction with member. Defaults to Owner, which
    /// returns lists owned by the specified member. Use Liked to return lists
    /// liked by the member.
    pub member_relationship: Option<ListMemberRelationship>,
    /// Must be used in conjunction with member. Defaults to None, which only
    /// returns lists from the member’s account. Use Only to return lists from
    /// the member’s friends, and All to return lists from both the member and
    /// their friends.
    pub include_friends: Option<IncludeFriends>,
    /// Specify Clean to return lists that do not contain profane language.
    /// Specify Published to return the member’s lists that have been made
    /// public. Note that unpublished lists for members other than the
    /// authenticated member are never returned. Specify NotPublished to return
    /// the authenticated member’s lists that have not been made public.
    #[serde(rename = "where")]
    pub where_list_status: Vec<ListStatus>,
    /// Specify NoDuplicateMembers to limit the list to only the first list for
    /// each member. filter=NoDuplicateMembers
    pub filter: Vec<ListRequestFilter>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct ListsResponse {
    /// The cursor to the next page of results.
    next: Option<Cursor>,
    /// The list of lists.
    items: Vec<ListSummary>,
}

#[derive(Serialize, Debug, Clone)]
enum LogEntriesRequestSort {
    WhenAdded,
    Date,
    RatingHighToLow,
    RatingLowToHigh,
    ReleaseDateLatestFirst,
    ReleaseDateEarliestFirst,
    FilmName,
    FilmDurationShortestFirst,
    FilmDurationLongestFirst,
    ReviewPopularity,
    ReviewPopularityThisWeek,
    ReviewPopularityThisMonth,
    ReviewPopularityThisYear,
    ReviewPopularityWithFriends,
    ReviewPopularityWithFriendsThisWeek,
    ReviewPopularityWithFriendsThisMonth,
    ReviewPopularityWithFriendsThisYear,
    FilmPopularity,
    FilmPopularityThisWeek,
    FilmPopularityThisMonth,
    FilmPopularityThisYear,
    FilmPopularityWithFriends,
    FilmPopularityWithFriendsThisWeek,
    FilmPopularityWithFriendsThisMonth,
    FilmPopularityWithFriendsThisYear,
}

#[derive(Serialize, Debug, Clone)]
enum LogEntryRelationshipType {
    Owner,
    Liked,
}

#[derive(Serialize, Debug, Clone)]
enum LogEntryStatus {
    HasDiaryDate,
    HasReview,
    Clean,
    NoSpoilers,
    Released,
    NotReleased,
    FeatureLength,
    NotFeatureLength,
    InWatchlist,
    NotInWatchlist,
    Watched,
    NotWatched,
    Rated,
    NotRated,
}

#[derive(Serialize, Debug, Clone)]
enum LogEntryFilter {
    NoDuplicateMembers,
}

#[derive(Serialize, Debug, Clone)]
struct LogEntriesRequest {
    /// The pagination cursor.
    cursor: Option<Cursor>,
    /// The number of items to include per page (default is 20, maximum is 100).
    per_page: Option<usize>,
    /// The order in which the log entries should be returned. Defaults to
    /// WhenAdded, which orders by creation date, unless you specify
    /// where=HasDiaryDate in which case the default is Date.
    /// The ReviewPopularity values return reviews with more activity
    /// (likes/comments) first, and imply where=HasReview.
    /// The FilmPopularity values return reviews for more popular films first.
    /// The ReviewPopularityWithFriends and FilmPopularityWithFriends values
    /// are only available to signed-in members and consider popularity amongst
    /// the signed-in member’s friends.
    /// The Date value sorts by the diary date, and implies where=HasDiaryDate
    /// You may not specify a film when using ReleaseDateLatestFirst,
    /// ReleaseDateEarliestFirst, FilmName, FilmDurationShortestFirst,
    /// FilmDurationLongestFirst, or any of the FilmPopularity options.
    sort: LogEntriesRequestSort,
    /// Specify the LID of a film to return log entries for that film. Must not
    /// be included if the sort value is ReleaseDateLatestFirst,
    /// ReleaseDateEarliestFirst, FilmName, FilmDurationShortestFirst,
    /// FilmDurationLongestFirst, or any of the FilmPopularity options.
    film: String,
    /// Specify the LID of a member to limit the returned log entries according
    /// to the value set in memberRelationship.
    member: String,
    /// Must be used in conjunction with member. Use Owner to limit the
    /// returned log entries to those created by the specified member. Use
    /// Liked to limit the returned reviews to those liked by the specified
    /// member (implies where=HasReview).
    member_relationship: LogEntryRelationshipType,
    /// Must be used in conjunction with member. Specify the type of
    /// relationship to limit the returned films accordingly. e.g. Use Liked to
    /// limit the returned reviews to those for films liked by the member.
    film_member_relationship: FilmRelationshipType,
    /// Must be used in conjunction with member. Defaults to None, which only
    /// returns log entries created or liked by the member. Use Only to return
    /// log entries created or liked by the member’s friends, and All to return
    /// log entries created or liked by both the member and their friends.
    include_friends: IncludeFriends,
    /// If set, limits the returned log entries to those with date that falls
    /// during the specified year.
    year: u16,
    /// Accepts values of 1 through 12. Must be used with year. If set, limits
    /// the returned log entries to those with a date that falls during the
    /// specified month and year.
    month: u16,
    /// Accepts values of 1 through 52. Must be used with year. If set, limits
    /// the returned log entries to those with a date that falls during the
    /// specified week and year.
    week: u16,
    /// Accepts values of 1 through 31. Must be used with month and year. If
    /// set, limits the returned log entries to those with a date that falls on
    /// the specified day, month and year.
    day: u16,
    /// Allowable values are between 0.5 and 5.0, with increments of 0.5. If
    /// set, limits the returned log entries to those with a rating equal to or
    /// higher than the specified rating.
    min_rating: f32,
    /// Allowable values are between 0.5 and 5.0, with increments of 0.5. If
    /// set, limits the returned log entries to those with a rating equal to or
    /// lower than the specified rating.
    max_rating: f32,
    /// Specify the starting year of a decade (must end in 0) to limit films to
    /// those released during the decade. 1990
    film_decade: u16,
    /// Specify a year to limit films to those released during that year. 1994
    film_year: u16,
    /// The LID of the genre. If set, limits the returned log entries to those
    /// for films that match the specified genre.
    genre: String,
    /// Specify a tag code to limit the returned log entries to those tagged
    /// accordingly.
    tag_code: String,
    /// Must be used with tag. Specify the LID of a member to focus the tag
    /// filter on the member.
    tagger: String,
    /// Must be used in conjunction with tagger. Defaults to None, which
    /// filters tags set by the member. Use Only to filter tags set by the
    /// member’s friends, and All to filter tags set by both the member and
    /// their friends.
    include_tagger_friends: IncludeFriends,
    /// Specify the ID of a supported service to limit films to those available
    /// from that service. The list of available services can be found by using
    /// the /films/film-services endpoint.
    service: String,
    /// Specify one or more values to limit the returned log entries
    /// accordingly. All values except HasDiaryDate, HasReview, Clean and
    /// NoSpoilers refer to properties of the associated film rather than to
    /// the relevant log entry. Use HasDiaryDate to limit the returned log
    /// entries to those that appear in a member’s diary. Use HasReview to
    /// limit the returned log entries to those containing a review. Use Clean
    /// to exclude reviews that contain profane language. Use NoSpoilers to
    /// exclude reviews where the owner has indicated that the review text
    /// contains plot spoilers for the film. where=Clean&where=NoSpoilers
    #[serde(rename = "where")]
    where_logentry_status: Vec<LogEntryStatus>,
    /// Specify NoDuplicateMembers to return only the first log entry for each
    /// member. filter=NoDuplicateMembers
    filter: Vec<LogEntryFilter>,
}

#[derive(Deserialize, Debug, Clone)]
struct LogEntriesResponse {
    /// The cursor to the next page of results.
    next: Option<Cursor>,
    // The list of log entries.
    items: Vec<LogEntry>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct LogEntry {
    /// The LID of the log entry.
    pub id: String,
    /// A descriptive title for the log entry.
    pub name: String,
    /// The member who created the log entry.
    pub owner: MemberSummary,
    /// The film being logged. Includes a MemberFilmRelationship for the member
    /// who created the log entry.
    pub film: FilmSummary,
    /// Details about the log entry, if present.
    pub diary_details: Option<DiaryDetails>,
    /// Review details for the log entry, if present.
    pub review: Option<Review>,
    /// The tags for the log entry.
    pub tags2: Vec<Tag>,
    /// The timestamp of when the log entry was created, in ISO 8601 format
    /// with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ "1997-08-29T07:14:00Z"
    pub when_created: String,
    /// The timestamp of when the log entry was last updated, in ISO 8601
    /// format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ
    /// "1997-08-29T07:14:00Z"
    pub when_updated: String,
    /// The member’s rating for the film. Allowable values are between 0.5 and
    /// 5.0, with increments of 0.5.
    pub rating: f32,
    /// Will be true if the member likes the film (via the ‘heart’ icon).
    pub like: bool,
    /// Will be true if the log entry can have comments.
    pub commentable: bool,
    /// A list of relevant URLs to this entity, on Letterboxd and external
    /// sites.
    pub links: Vec<Link>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct LogEntryCreationRequest {
    /// The film being logged.
    film_id: String,
    /// Information about this log entry if adding to the member’s diary.
    diary_details: LogEntryCreationRequestDiaryDetails,
    /// Information about the review if adding a review.
    review: LogEntryCreationRequestReview,
    ///  The tags for the log entry.
    tags: Vec<String>,
    /// Allowable values are between 0.5 and 5.0, with increments of 0.5.
    rating: f32,
    /// Set to true if the member likes the film (via the ‘heart’ icon).
    like: bool,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct LogEntryCreationRequestDiaryDetails {
    /// The date the film was watched, if specified, in ISO 8601 format, i.e.
    /// YYYY-MM-DD
    diary_date: String,
    /// Set to true if the member has indicated (or it can be otherwise
    /// determined) that the member has seen the film prior to this date.
    rewatch: bool,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct LogEntryCreationRequestReview {
    /// The review text in LBML. May contain the following HTML tags: `<br>`
    /// `<strong>` `<em>` `<b>` `<i>` `<a href="">` `<blockquote>`. This field
    /// has a maximum size of 100,000 characters.
    text: String,
    /// Set to true if the member has indicated that the review field contains
    /// plot spoilers for the film.
    contains_spoilers: bool,
    /// The third-party service or services to which this review should be
    /// shared. Valid options are found in the
    /// MemberAccount.authorizedSharingServicesForReviews (see the /me
    /// endpoint).
    share: Vec<ThirdPartyService>,
}

#[derive(Deserialize, Debug, Clone)]
enum LogEntryUpdateMessageCode {
    InvalidRatingValue,
    InvalidDiaryDate,
    ReviewWithNoText,
    ReviewIsTooLong,
    LogEntryWithNoReviewOrDiaryDetails,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(tag = "type")]
enum LogEntryUpdateMessage {
    Error {
        /// The error message code
        code: LogEntryUpdateMessageCode,
        /// The error message text in human-readable form.
        title: String,
    },
    Success,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct LogEntryUpdateRequest {
    /// Information about this log entry if adding to the member’s diary. Set
    /// to null to remove this log entry from the diary.
    diary_details: LogEntryUpdateRequestDiaryDetails,
    /// Information about the review. Set to null to remove the review from
    /// this log entry.
    review: LogEntryUpdateRequestReview,
    // The tags for the log entry.
    tags: Vec<String>,
    /// Accepts values between 0.5 and 5.0, with increments of 0.5, or null (to
    /// remove the rating).
    rating: f32,
    /// Set to true if the member likes the film (via the ‘heart’ icon).
    like: bool,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct LogEntryUpdateRequestDiaryDetails {
    /// The date the film was watched, if specified, in ISO 8601 format, i.e.
    /// YYYY-MM-DD
    diary_date: String,
    /// Set to true if the member has indicated (or it can be otherwise
    /// determined) that the member has seen the film prior to this date.
    rewatch: bool,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct LogEntryUpdateRequestReview {
    /// The review text in LBML. May contain the following HTML tags: `<br>`
    /// `<strong>` `<em>` `<b>` `<i>` `<a href="">` `<blockquote>`.
    text: String,
    /// Set to true if the member has indicated that the review field contains
    /// plot spoilers for the film.
    contains_spoilers: bool,
    // The third-party service or services to which this review should be shared. Valid options are found in the ReviewRelationship.canShareOn (see the /log-entry/{id}/me endpoint).
    share: Vec<ThirdPartyService>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct Member {
    /// The LID of the member.
    id: String,
    /// The member’s Letterboxd username. Usernames must be between 2 and 15
    /// characters long and may only contain upper or lowercase letters,
    /// numbers or the underscore (_) character.
    username: String,
    /// The given name of the member.
    given_name: String,
    /// The family name of the member.
    family_name: String,
    /// A convenience method that returns the member’s given name and family
    /// name concatenated with a space, if both are set, or just their given
    /// name or family name, if one is set, or their username, if neither is
    /// set. Will never be empty.
    display_name: String,
    /// A convenience method that returns the member’s given name, if set, or
    /// their username. Will never be empty.
    short_name: String,
    /// The member’s preferred pronoun set. Use the /members/pronouns endpoint
    /// to request all available pronoun sets.
    pronoun: Pronoun,
    /// The member’s Twitter username, if they have authenticated their account.
    twitter_username: String,
    /// The member’s bio in LBML. May contain the following HTML tags: `<br>`
    /// `<strong>` `<em>` `<b>` `<i>` `<a href="">` `<blockquote>`.
    bio_lbml: String,
    /// The member’s location.
    location: String,
    /// The member’s website URL. URLs are not validated, so sanitizing may be
    /// required.
    website: String,
    /// The member’s avatar image at multiple sizes.
    avatar: Image,
    /// The member’s backdrop image at multiple sizes, sourced from the first
    /// film in the member’s list of favorite films, if available. Only
    /// returned for Patron members.
    backdrop: Image,
    /// The vertical focal point of the member’s backdrop image, if available.
    /// Expressed as a proportion of the image’s height, using values between
    /// 0.0 and 1.0. Use when cropping the image into a shorter space, such as
    /// in the page for a film on the Letterboxd site.
    backdrop_focal_point: f32,
    /// The member’s account type.
    member_status: MemberStatus,
    /// A summary of the member’s favorite films, up to a maximum of four.
    favorite_films: Vec<FilmSummary>,
    /// A link to the member’s profile page on the Letterboxd website.
    links: Vec<Link>,
    /// The member’s bio formatted as HTML.
    bio: String,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct MemberAccount {
    /// The member’s email address.
    email_address: String,
    /// Will be true if the member has validated their emailAddress via an
    /// emailed link.
    email_address_validated: bool,
    /// Defaults to false for new accounts. Indicates whether the member has
    /// elected for their content to appear in the API (other than in the /me
    /// endpoint).
    private_account: bool,
    /// Defaults to true for new accounts. Indicates whether the member has
    /// elected to appear in the People section of the Letterboxd website.
    include_in_people_section: bool,
    /// Defaults to false for new accounts. Indicates whether the member has
    /// elected to hide their Watchlist from other members.
    private_watchlist: bool,
    /// Defaults to true for new accounts. Indicates whether the member has elected to receive email notifications when they receive a new follower.
    email_when_followed: bool,
    /// Defaults to true for new accounts. Indicates whether the member has
    /// elected to receive email notifications when new comments are posted in
    /// threads they are subscribed to.
    email_comments: bool,
    /// Defaults to true for new accounts. Indicates whether the member has
    /// elected to receive regular email news (including ‘Call Sheet’) from
    /// Letterboxd.
    email_news: bool,
    /// Defaults to true for new accounts. Indicates whether the member has
    /// elected to receive a weekly email digest of new and popular content
    /// (called ‘Rushes’).
    email_rushes: bool,
    /// Defaults to false for new accounts. Indicates whether the member has
    /// commenting privileges. Commenting is disabled on new accounts until the
    /// member’s emailAddress is validated. At present canComment is synonymous
    /// with emailAddressValidated (unless the member is suspended) but this
    /// may change in future.
    can_comment: bool,
    /// Indicates whether the member is suspended from commenting due to a
    /// breach of the Community Policy.
    suspended: bool,
    /// Indicates whether the member is able to clone other members’ lists.
    /// Determined by Letterboxd based upon memberStatus.
    can_clone_lists: bool,
    /// Indicates whether the member is able to filter activity by type.
    /// Determined by Letterboxd based upon memberStatus.
    can_filter_activity: bool,
    /// The services the member has authorized Letterboxd to share lists to.
    /// More services may be added in the future.
    authorized_sharing_services_for_lists: Vec<ThirdPartyService>,
    /// The services the member has authorized Letterboxd to share reviews to.
    /// More services may be added in the future.
    authorized_sharing_services_for_reviews: Vec<ThirdPartyService>,
    /// The number of days the member has left in their subscription. Only
    /// returned for paying members.
    membership_days_remaining: usize,
    /// Standard member details.
    member: Member,
}

#[derive(Deserialize, Debug, Clone)]
pub struct MemberFilmRelationship {
    /// The member.
    pub member: MemberSummary,
    /// The relationship details.
    pub relationship: FilmRelationship,
}

// TODO: dedup and order
#[derive(Deserialize, Debug, Clone)]
enum MemberRelationshipType {
    IsFollowing,
    IsFollowedBy,
}

#[derive(Serialize, Debug, Clone)]
pub enum MemberFilmRelationshipsRequestSort {
    Date,
    Name,
    MemberPopularity,
    MemberPopularityThisWeek,
    MemberPopularityThisMonth,
    MemberPopularityThisYear,
    MemberPopularityWithFriends,
    MemberPopularityWithFriendsThisWeek,
    MemberPopularityWithFriendsThisMonth,
    MemberPopularityWithFriendsThisYear,
}

#[derive(Serialize, Debug, Clone, Default)]
pub struct MemberFilmRelationshipsRequest {
    /// The pagination cursor.
    pub cursor: Option<Cursor>,
    /// The number of items to include per page (default is 20, maximum is 100).
    pub per_page: Option<usize>,
    /// Defaults to Date, which has different semantics based on the request:
    /// When review is specified, members who most recently liked the review
    /// appear first.
    /// When list is specified, members who most recently liked the list appear
    /// first.
    /// When film is specified and filmRelationship=Watched, members who most
    /// recently watched the film appear first.
    /// When film is specified and filmRelationship=Liked, members who most
    /// recently liked the film appear first.
    /// When member is specified and memberRelationship=IsFollowing, most
    /// recently followed members appear first.
    /// When member is specified and memberRelationship=IsFollowedBy, most
    /// recent followers appear first.
    /// Otherwise, members who most recently joined the site appear first.
    /// The PopularWithFriends values are only available to authenticated
    /// members and consider popularity amongst the member’s friends.
    pub sort: Option<MemberFilmRelationshipsRequestSort>,
    /// Specify the LID of a member to return members who follow or are
    /// followed by that member.
    pub member: Option<String>,
    /// Must be used in conjunction with member. Defaults to IsFollowing, which
    /// returns the list of members followed by the member. Use IsFollowedBy to
    /// return the list of members that follow the member.
    pub member_relationship: Option<FilmRelationshipType>,
    /// Must be used in conjunction with film. Defaults to Watched, which
    /// returns the list of members who have seen the film. Specify the type of
    /// relationship to limit the returned members accordingly.
    pub film_relationship: Option<FilmRelationshipType>,
}

#[derive(Deserialize, Debug, Clone)]
pub struct MemberFilmRelationshipsResponse {
    /// The cursor to the next page of results.
    pub next: Cursor,
    /// The list of film relationships for members.
    pub items: Vec<MemberFilmRelationship>,
}

#[derive(Deserialize, Debug, Clone)]
struct MemberIdentifier {
    /// The LID of the member.
    id: String,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct MemberRelationship {
    /// Will be true if the authenticated member follows the member identified
    /// by ID.
    following: bool,
    /// Will be true if the member identified by ID follows the authenticated
    /// member.
    followed_by: bool,
    /// Will be true if the authenticated member has blocked the member
    /// identified by ID.
    blocking: bool,
    /// Will be true if the member identified by ID has blocked the
    /// authenticated member.
    blocked_by: bool,
}

#[derive(Deserialize, Debug, Clone)]
enum MemberRelationshipUpdateMessageCode {
    BlockYourself,
    FollowYourself,
    FollowBlockedMember,
    FollowMemberYouBlocked,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(tag = "type")]
enum MemberRelationshipUpdateMessage {
    Error {
        /// The error message code.
        code: MemberRelationshipUpdateMessageCode,
        /// The error message text in human-readable form.
        title: String,
    },
    Success,
}

#[derive(Deserialize, Debug, Clone)]
struct MemberRelationshipUpdateRequest {
    /// Set to true if the authenticated member wishes to follow the member
    /// identified by ID, or false if they wish to unfollow. A member may not
    /// follow their own account, or the account of a member they have blocked
    /// or that has blocked them.
    following: bool,
    /// Set to true if the authenticated member wishes to block the member
    /// identified by ID, or false if they wish to unblock. A member may not
    /// block their own account.
    blocking: bool,
}

#[derive(Deserialize, Debug, Clone)]
struct MemberRelationshipUpdateResponse {
    /// The response object.
    data: MemberRelationship,
    /// A list of messages the API client should show to the user.
    messages: Vec<MemberRelationshipUpdateMessage>,
}

#[derive(Deserialize, Debug, Clone)]
enum MemberSettingsUpdateMessageCode {
    IncorrectCurrentPassword,
    BlankPassword,
    InvalidEmailAddress,
    InvalidFavoriteFilm,
    BioTooLong,
    InvalidPronounOption,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(tag = "type")]
enum MemberSettingsUpdateMessage {
    Error {
        /// The error message code.
        code: MemberSettingsUpdateMessageCode,
        /// The error message text in human-readable form.
        title: String,
    },
    Success,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct MemberSettingsUpdateRequest {
    /// The member’s email address.
    email_address: String,
    /// The member’s current password. Required when updating the password.
    current_password: String,
    /// The member’s new password.
    password: String,
    /// The given name of the member.
    given_name: String,
    /// The family name of the member.
    family_name: String,
    /// The LID of the member’s preferred pronoun set. Use the
    /// /members/pronouns endpoint to request all available pronoun sets.
    pronoun: String,
    /// The member’s location.
    location: String,
    /// The member’s website URL. URLs are not validated, so sanitizing may be
    /// required.
    website: String,
    /// The member’s bio in LBML. May contain the following HTML tags: `<br>`
    /// `<strong>` `<em>` `<b>` `<i>` `<a href="">` `<blockquote>`. This field
    /// has a maximum size of 100,000 characters.
    bio: String,
    /// The LIDs of the member’s favorite films, in order, up to a maximum of
    /// four.
    favorite_films: Vec<String>,
    /// Set to true to prevent the member’s content from appearing in API
    /// requests other than the /me endpoint.
    private_account: bool,
    /// Set to false to remove the account from the People section of the
    /// Letterboxd website.
    include_in_people_section: bool,
    /// Set to true if the member wishes to receive email notifications when
    /// they receive a new follower.
    email_when_followed: bool,
    /// Set to true if the member wishes to receive email notifications when
    /// new comments are posted in threads they are subscribed to.
    email_comments: bool,
    /// Set to true if the member wishes to receive regular email news
    /// (including ‘Call Sheet’) from Letterboxd.
    email_news: bool,
    /// Set to true if the member wishes to receive a weekly email digest of
    /// new and popular content (called ‘Rushes’).
    email_rushes: bool,
}

#[derive(Deserialize, Debug, Clone)]
struct MemberSettingsUpdateResponse {
    /// The response object.
    data: MemberAccount,
    /// A list of messages the API client should show to the user.
    messages: Vec<MemberSettingsUpdateMessage>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct MemberStatistics {
    /// The member for which statistics were requested.
    member: MemberIdentifier,
    /// The number of watches, ratings, likes, etc. for the member.
    counts: MemberStatisticsCounts,
    /// A summary of the number of ratings the member has made for each
    /// increment between 0.5 and 5.0. Returns only the integer increments
    /// between 1.0 and 5.0 if the member never (or rarely) awards half-star
    /// ratings.
    ratings_histogram: Vec<RatingsHistogramBar>,
    /// A list of years the member has year-in-review pages for. Only supported
    /// for paying members.
    years_in_review: Vec<u16>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct MemberStatisticsCounts {
    /// The number of films the member has liked.
    film_likes: usize,
    /// The number of lists the member has liked.
    list_likes: usize,
    /// The number of reviews the member has liked.
    review_likes: usize,
    /// The number of films the member has watched. This is a distinct total —
    /// films with multiple log entries are only counted once.
    watches: usize,
    /// The number of films the member has rated.
    ratings: usize,
    /// The number of films the member has reviewed.
    reviews: usize,
    /// The number of entries the member has in their diary.
    diary_entries: usize,
    /// The number of entries the member has in their diary for the current
    /// year. The current year rolls over at midnight on 31 December in New
    /// Zealand Daylight Time (GMT + 13).
    diary_entries_this_year: usize,
    /// The number of unique films the member has in their diary for the
    /// current year. The current year rolls over at midnight on 31 December in
    /// New Zealand Daylight Time (GMT + 13).
    films_in_diary_this_year: usize,
    /// The number of films the member has in their watchlist.
    watchlist: usize,
    /// The number of lists for the member. Includes unpublished lists if the
    /// request is made for the authenticated member.
    lists: usize,
    /// The number of unpublished lists for the member. Only included if the
    /// request is made for the authenticated member.
    unpublished_lists: usize,
    /// The number of members who follow the member.
    followers: usize,
    /// The number of members the member is following.
    following: usize,
    /// The number of tags the member has used for lists.
    list_tags: usize,
    /// The number of tags the member has used for diary entries and reviews.
    film_tags: usize,
}

#[derive(Clone, Debug, Deserialize)]
pub enum MemberStatus {
    Crew,
    Patron,
    Pro,
    Member,
}

#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MemberSummary {
    /// The LID of the member.
    pub id: String,
    /// The member’s Letterboxd username. Usernames must be between 2 and 15
    /// characters long and
    /// may only contain upper or lowercase letters, numbers or the underscore
    /// (_) character.
    pub username: String,
    /// The given name of the member.
    pub given_name: Option<String>,
    /// The family name of the member.
    pub family_name: Option<String>,
    /// A convenience method that returns the member’s given name and family
    /// name concatenated with
    /// a space, if both are set, or just their given name or family name, if
    /// one is set, or their
    /// username, if neither is set. Will never be empty.
    pub display_name: String,
    /// A convenience method that returns the member’s given name, if set, or
    /// their username. Will never be empty.
    pub short_name: String,
    /// The member’s preferred pronoun set. Use the /members/pronouns endpoint
    /// to request all available pronoun sets.
    pub pronoun: Pronoun,
    /// The member’s avatar image at multiple sizes.
    pub avatar: Image,
    /// The member’s account type.
    pub member_status: MemberStatus,
}

#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct MemberTag {
    /// The tag code.
    code: String,
    /// The tag text as entered by the tagger.
    display_tag: String,
    /// Counts of the member’s uses of this tag.
    counts: MemberTagCounts,
}

#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct MemberTagCounts {
    /// The number of films the member has used this tag on.
    films: usize,
    /// The number of log entries the member has used this tag on.
    log_entries: usize,
    /// The number of diary entries the member has used this tag on.
    diary_entries: usize,
    /// The number of reviews the member has used this tag on.
    reviews: usize,
    /// The number of lists the member has used this tag on.
    lists: usize,
}

#[derive(Clone, Debug, Serialize)]
struct MemberTagsRequest {
    /// A case-insensitive prefix match. E.g. “pro” will match “pro”, “project”
    /// and “Professional”. An empty input will match all tags.
    input: String,
}

#[derive(Clone, Debug, Deserialize)]
struct MemberTagsResponse {
    /// The list of tag items, ordered by frequency of use.
    items: Vec<MemberTag>,
}

#[derive(Clone, Debug, Serialize)]
enum MembersRequestSort {
    Date,
    Name,
    MemberPopularity,
    MemberPopularityThisWeek,
    MemberPopularityThisMonth,
    MemberPopularityThisYear,
    MemberPopularityWithFriends,
    MemberPopularityWithFriendsThisWeek,
    MemberPopularityWithFriendsThisMonth,
    MemberPopularityWithFriendsThisYear,
}

// TODO: name
#[derive(Clone, Debug, Serialize)]
enum MembersRequestRelationship {
    IsFollowing,
    IsFollowedBy,
}

#[derive(Clone, Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct MembersRequest {
    /// The pagination cursor.
    cursor: Option<Cursor>,
    /// The number of items to include per page (default is 20, maximum is 100).
    per_page: Option<usize>,
    /// Defaults to Date, which has different semantics based on the request:
    /// When review is specified, members who most recently liked the review
    /// appear first.
    /// When list is specified, members who most recently liked the list appear
    /// first.
    /// When film is specified and filmRelationship=Watched, members who most
    /// recently watched the film appear first.
    /// When film is specified and filmRelationship=Liked, members who most
    /// recently liked the film appear first.
    /// When member is specified and memberRelationship=IsFollowing, most
    /// recently followed members appear first.
    /// When member is specified and memberRelationship=IsFollowedBy, most
    /// recent followers appear first.
    /// Otherwise, members who most recently joined the site appear first.
    /// The PopularWithFriends values are only available to authenticated
    /// members and consider popularity amongst the member’s friends.
    sort: MembersRequestSort,
    /// Specify the LID of a member to return members who follow or are
    /// followed by that member.
    member: String,
    /// Must be used in conjunction with member. Defaults to IsFollowing, which
    /// returns the list of members followed by the member. Use IsFollowedBy to
    /// return the list of members that follow the member.
    member_relationship: MembersRequestRelationship,
    /// Specify the LID of a film to return members who have interacted with
    /// that film.
    film: String,
    /// Must be used in conjunction with film. Defaults to Watched, which
    /// returns the list of members who have seen the film. Specify the type of
    /// relationship to limit the returned members accordingly. You must
    /// specify a member in order to use the InWatchlist relationship.
    film_relationship: FilmRelationship,
    /// Specify the LID of a list to return members who like that list.
    list: String,
    /// Specify the LID of a review to return members who like that review.
    review: String,
}

#[derive(Clone, Debug, Deserialize)]
struct MembersResponse {
    /// The cursor to the next page of results.
    next: Option<Cursor>,
    /// The list of members.
    items: Vec<MemberSummary>,
}

#[derive(Clone, Debug, Deserialize)]
struct OAuthError {
    /// The error code, usually invalid_grant.
    error: String,
}

#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Pronoun {
    /// The LID for this pronoun set.
    pub id: String,
    /// A label to describe this pronoun set.
    pub label: String,
    /// The pronoun to use when the member is the subject. "She went to the
    /// movies."
    pub subject_pronoun: String,
    /// The pronoun to use when the member is the object. "I went with her to
    /// the cinema."
    pub object_pronoun: String,
    /// The adjective to use when describing a specified thing or things
    /// belonging to or associated with a member previously mentioned. "He
    /// bought his tickets."
    pub possessive_adjective: String,
    /// The pronoun to use when referring to a specified thing or things
    /// belonging to or associated with a member previously mentioned. "That
    /// popcorn was hers."
    pub possessive_pronoun: String,
    /// The pronoun to use to refer back to the member. "He saw himself as a
    /// great director."
    pub reflexive: String,
}

#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct PronounsResponse {
    /// The list of pronouns.
    items: Vec<Pronoun>,
}

#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RatingsHistogramBar {
    /// The rating increment between 0.5 and 5.0.
    pub rating: f32,
    /// The height of this rating increment’s entry in a unit-height histogram,
    /// normalized between 0.0 and 1.0. The increment(s) with the highest
    /// number of ratings will always return 1.0 (unless there are no ratings
    /// for the film).
    pub normalized_weight: f32,
    /// The number of ratings made at this increment.
    pub count: usize,
}

#[derive(Serialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
struct RegisterRequest {
    /// The username for the new account. Use the /auth/username-check endpoint
    /// to check availability.
    username: String,
    /// The password for the new account.
    password: String,
    /// The email address for the new account.
    email_address: String,
    /// Set to true if the person creating the account has agreed to being at
    /// least 13 years of age, and to accepting Letterboxd’s Terms of Use.
    accept_terms_of_use: bool,
}

#[derive(Serialize, Debug, Clone)]
enum ReportCommentReason {
    Spoilers,
    Spam,
    Plagiarism,
    Other,
}

#[derive(Serialize, Debug, Clone)]
struct ReportCommentRequest {
    ///  The reason why the comment was reported.
    reason: ReportCommentReason,
    /// An optional, explanatory message to accompany the report. Required if
    /// the reason is Plagiarism or Other.
    message: Option<String>,
}

#[derive(Serialize, Debug, Clone)]
enum ReportFilmReason {
    Duplicate,
    NotAFilm,
    Other,
}

#[derive(Serialize, Debug, Clone)]
struct ReportFilmRequest {
    /// The reason why the film was reported.
    reason: ReportFilmReason,
    /// An optional, explanatory message to accompany the report. Required if
    /// the reason is Duplicate or Other.
    message: Option<String>,
}

#[derive(Serialize, Debug, Clone)]
enum ReportListReason {
    Spoilers,
    Spam,
    Plagiarism,
    Other,
}

#[derive(Serialize, Debug, Clone)]
struct ReportListRequest {
    /// The reason why the list was reported.
    reason: ReportListReason,
    /// An optional, explanatory message to accompany the report. Required if
    /// the reason is Plagiarism or Other.
    message: Option<String>,
}

#[derive(Serialize, Debug, Clone)]
enum ReportMemberReason {
    SpamAccount,
    Other,
}

#[derive(Serialize, Debug, Clone)]
struct ReportMemberRequest {
    /// The reason why the member was reported.
    reason: ReportMemberReason,
    /// An optional, explanatory message to accompany the report. Required if
    /// the reason is Other.
    message: Option<String>,
}

#[derive(Serialize, Debug, Clone)]
enum ReportReviewReason {
    Spoilers,
    Spam,
    Plagiarism,
    Other,
}

#[derive(Serialize, Debug, Clone)]
struct ReportReviewRequest {
    /// The reason why the review was reported.
    reason: ReportReviewReason,
    /// An optional, explanatory message to accompany the report. Required if
    /// the reason is Plagiarism or Other.
    message: Option<String>,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub enum ThirdPartyService {
    Facebook,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Review {
    /// The review text in LBML. May contain the following HTML tags: `<br>`
    /// `<strong>` `<em>` `<b>` `<i>` `<a href="">` `<blockquote>`.
    pub lbml: String,
    /// Will be true if the member has indicated that the review field contains
    /// plot spoilers for the film.
    pub contains_spoilers: bool,
    /// The third-party service or services to which this review can be shared.
    /// Only included if the authenticated member is the review’s owner.
    pub can_share_on: Option<ThirdPartyService>,
    /// The third-party service or services to which this review has been shared. Only included if the authenticated member is the review’s owner.
    pub shared_on: Option<ThirdPartyService>,
    /// The timestamp when this log entry’s review was first published, in ISO
    /// 8601 format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ
    /// "1997-08-29T07:14:00Z"
    pub when_reviewed: String,
    /// The review text formatted as HTML.
    pub text: String,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct ReviewComment {
    /// The LID of the comment.
    id: String,
    /// The member who posted the comment.
    member: MemberSummary,
    /// ISO 8601 format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ
    /// "1997-08-29T07:14:00Z"
    when_created: String,
    /// ISO 8601 format with UTC timezone, i.e. YYYY-MM-DDThh:mm:ssZ
    /// "1997-08-29T07:14:00Z"
    when_updated: String,
    /// The message portion of the comment in LBML. May contain the following
    /// HTML tags: `<br>` `<strong>` `<em>` `<b>` `<i>` `<a href="">`
    /// `<blockquote>`.
    comment_lbml: String,
    /// If Letterboxd moderators have removed the comment from the site,
    /// removedByAdmin will be true and comment will not be included.
    removed_by_admin: bool,
    /// If the comment owner has removed the comment from the site, deleted
    /// will be true and comment will not be included.
    deleted: bool,
    /// If the authenticated member has blocked the commenter, blocked will be
    /// true and comment will not be included.
    blocked: bool,
    /// If the review owner has blocked the commenter, blockedByOwner will be
    /// true and comment will not be included.
    blocked_by_owner: bool,
    /// If the authenticated member posted this comment, and the comment is
    /// still editable, this value shows the number of seconds remaining until
    /// the editing window closes.
    editable_window_expires_in: Option<usize>,
    /// The review on which the comment was posted.
    review: ReviewIdentifier,
    /// The message portion of the comment formatted as HTML.
    comment: String,
}

#[derive(Deserialize, Debug, Clone)]
struct ReviewCommentsResponse {
    /// The cursor to the next page of results.
    next: Option<Cursor>,
    // The list of comments.
    items: Vec<ReviewComment>,
}

#[derive(Deserialize, Debug, Clone)]
struct ReviewIdentifier {
    /// The LID of the log entry.
    id: String,
}

// TODO: order
#[derive(Deserialize, Debug, Clone)]
enum CommentThreadState {
    /// `CanComment` means the authenticated member is authorized to add a
    /// comment. All other
    /// values mean the authenticated member is not authorized to add a comment.
    CanComment,
    /// `Banned` means the Letterboxd community managers have restricted the
    /// member’s ability to
    /// comment on the site.
    Banned,
    /// `Blocked` means the owner has blocked the member from adding comments.
    Blocked,
    /// `NotCommentable` means that it is invalid to try to add comments to
    /// this content.
    NotCommentable,
}

// TODO: order
/// `NotSubscribed` and `Unsubscribed` are maintained as separate states so the
/// UI can, if needed,
/// indicate to the member how their subscription state will be affected
/// if/when they post a
/// comment.
#[derive(Deserialize, Debug, Clone)]
enum SubscriptionState {
    Subscribed,
    NotSubscribed,
    Unsubscribed,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct ReviewRelationship {
    /// Will be true if the member likes the review (via the ‘heart’ icon). A
    /// member may not like their own review.
    liked: bool,
    /// Will be true if the member is subscribed to comment notifications for
    /// the review
    subscribed: bool,
    /// Defaults to Subscribed for the review’s author, and NotSubscribed for
    /// other members. The subscription value may change when a member (other
    /// than the owner) posts a comment, as follows: the member will become
    /// automatically Subscribed unless they have previously Unsubscribed from
    /// the comment thread via the web interface or API, or unless they have
    /// disabled comment notifications in their profile settings.
    subscription_state: SubscriptionState,
    /// The authenticated member’s state with respect to adding comments for
    /// this review.
    comment_thread_state: CommentThreadState,
}

#[derive(Deserialize, Debug, Clone)]
enum ReviewRelationshipUpdateMessageCode {
    LikeBlockedContent,
    LikeOwnReview,
    LikeLogEntryWithoutReview,
    SubscribeWhenOptedOut,
    SubscribeToContentYouBlocked,
    SubscribeToBlockedContent,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(tag = "type")]
enum ReviewRelationshipUpdateMessage {
    Error {
        /// The error message code.
        code: ReviewRelationshipUpdateMessageCode,
        /// The error message text in human-readable form.
        title: String,
    },
    Success,
}

#[derive(Serialize, Debug, Clone)]
struct ReviewRelationshipUpdateRequest {
    /// Set to true if the member likes the review (via the ‘heart’ icon). A
    /// member may not like their own review.
    liked: bool,
    /// Set to true to subscribe the member to comment notifications for the
    /// review, or false to unsubscribe them. A value of true will be ignored
    /// if the member has disabled comment notifications in their profile
    /// settings.
    subscribed: bool,
}

#[derive(Deserialize, Debug, Clone)]
struct ReviewRelationshipUpdateResponse {
    /// The response object.
    data: ReviewRelationship,
    /// A list of messages the API client should show to the user.
    messages: Vec<ReviewRelationshipUpdateMessage>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct ReviewStatistics {
    /// The log entry for which statistics were requested.
    log_entry: ReviewIdentifier,
    /// The number of comments and likes for the review.
    counts: ReviewStatisticsCounts,
}

#[derive(Deserialize, Debug, Clone)]
struct ReviewStatisticsCounts {
    /// The number of comments for the review.
    comments: usize,
    /// The number of members who like the review.
    likes: usize,
}

#[derive(Deserialize, Debug, Clone)]
struct ReviewUpdateResponse {
    /// The response object.
    data: LogEntry,
    /// A list of messages the API client should show to the user.
    messages: Vec<LogEntryUpdateMessage>,
}

#[derive(Serialize, Debug, Clone)]
pub enum SearchMethod {
    FullText,
    Autocomplete,
}

#[derive(Serialize, Debug, Clone, Default)]
#[serde(rename_all = "camelCase")]
pub struct SearchRequest {
    /// The pagination cursor.
    pub cursor: Option<Cursor>,
    /// The number of items to include per page (default is 20, maximum is 100).
    pub per_page: Option<usize>,
    /// The word, partial word or phrase to search for.
    pub input: String,
    /// The type of search to perform. Defaults to FullText, which performs a
    /// standard search considering text in all fields. Autocomplete only
    /// searches primary fields.
    pub search_method: Option<SearchMethod>,
    // The types of results to search for. Default to all SearchResultTypes.
    pub include: Option<Vec<SearchResultType>>,
    /// The type of contributor to search for. Implies
    /// include=ContributorSearchItem.
    pub contribution_type: Option<ContributionType>,
}

impl SearchRequest {
    pub fn new(input: String) -> SearchRequest {
        SearchRequest {
            cursor: None,
            per_page: None,
            input,
            search_method: None,
            include: None,
            contribution_type: None,
        }
    }
}

#[derive(Deserialize, Debug, Clone)]
pub struct SearchResponse {
    /// The cursor to the next page of results.
    pub next: Option<Cursor>,
    /// The list of search results.
    pub items: Vec<AbstractSearchItem>,
}

#[derive(Serialize, Debug, Clone)]
pub enum SearchResultType {
    ContributorSearchItem,
    FilmSearchItem,
    ListSearchItem,
    MemberSearchItem,
    /// Details of the review.
    ReviewSearchItem,
    TagSearchItem,
}

#[derive(Deserialize, Debug, Clone)]
pub struct Service {
    /// The LID of the service.
    pub id: String,
    /// The name of the service.
    pub name: String,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Tag {
    /// The tag code.
    pub code: String,
    /// The tag text as entered by the tagger.
    pub display_tag: String,
}

#[derive(Deserialize, Debug, Clone)]
struct TagsResponse {
    /// The list of tags, ordered by frequency of use.
    items: Vec<String>,
}

#[derive(Deserialize, Debug, Clone)]
enum UsernameCheckResult {
    Available,
    NotAvailable,
    TooShort,
    TooLong,
    Invalid,
}

#[derive(Deserialize, Debug, Clone)]
struct UsernameCheckResponse {
    /// Will be Available if the username is available to register, or
    /// NotAvailable if used by another member (or attached to a deactivated
    /// account, or otherwise reserved). May return an appropriate error value
    /// if the username doesn’t meet Letterboxd’s requirements: Usernames must
    /// be between 2 and 15 characters long and may only contain upper or
    /// lowercase letters, numbers or the underscore (_) character.
    result: UsernameCheckResult,
}

#[derive(Serialize, Debug, Clone)]
pub enum WatchlistSort {
    Added,
    FilmName,
    ReleaseDateLatestFirst,
    ReleaseDateEarliestFirst,
    RatingHighToLow,
    RatingLowToHigh,
    FilmDurationShortestFirst,
    FilmDurationLongestFirst,
    FilmPopularity,
    FilmPopularityThisWeek,
    FilmPopularityThisMonth,
    FilmPopularityThisYear,
}

// TODO: order
#[derive(Serialize, Debug, Clone)]
pub enum IncludeFriends {
    None,
    All,
    Only,
}

#[derive(Serialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
struct WatchlistRequest {
    /// The pagination cursor.
    cursor: Option<Cursor>,
    /// The number of items to include per page (default is 20, maximum is 100).
    per_page: Option<usize>,
    /// The order in which the entries should be returned. Defaults to Added,
    /// which is the order that the films were added to the watchlist, most
    /// recent first.
    sort: WatchlistSort,
    /// Specify the LID of a genre to limit films to those within the specified
    /// genre.
    genre: String,
    /// Specify the starting year of a decade (must end in 0) to limit films to
    /// those released during the decade. 1990
    decade: u16,
    /// Specify a year to limit films to those released during that year. 1994
    year: u16,
    /// Specify the ID of a supported service to limit films to those available
    /// from that service. The list of available services can be found by using
    /// the /films/film-services endpoint.
    service: String,
    /// Specify one or more values to limit the list of films accordingly.
    /// where=Watched&where=Released
    #[serde(rename = "where")]
    where_film_status: Vec<FilmStatus>,
    /// Specify the LID of a member to limit the returned films according to
    /// the value set in memberRelationship. The member and memberRelationship
    /// parameters can be used to compute comparisons between the watchlist
    /// owner and another member.
    member: String,
    /// Must be used in conjunction with member. Defaults to Watched. Specify
    /// the type of relationship to limit the returned films accordingly.
    member_relationship: FilmRelationshipType,
    /// Must be used in conjunction with member. Defaults to None, which only
    /// returns films from the member’s account. Use Only to return films from
    /// the member’s friends, and All to return films from both the member and
    /// their friends.
    include_friends: IncludeFriends,
    /// Specify a tag code to limit the returned films to those tagged
    /// accordingly.
    tag_code: String,
    /// Must be used with tag. Specify the LID of a member to focus the tag
    /// filter on the member.
    tagger: String,
    /// Must be used in conjunction with tagger. Defaults to None, which
    /// filters tags set by the member. Use Only to filter tags set by the
    /// member’s friends, and All to filter tags set by both the member and
    /// their friends.
    include_tagger_friends: IncludeFriends,
}