harvest-api 5.0.0

Harvest client, generated from the OpenAPI spec.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
//! [`HarvestClient`](struct.HarvestClient.html) is the main entry point for this library.
//!
//! Library created with [`libninja`](https://www.libninja.com).
#![allow(non_camel_case_types)]
#![allow(unused)]
pub mod model;
pub mod request;
use crate::model::*;

pub struct HarvestClient {
    pub(crate) client: httpclient::Client,
    authentication: HarvestAuthentication,
}
impl HarvestClient {
    pub fn from_env() -> Self {
        let url = "https://api.harvestapp.com/v2".to_string();
        Self {
            client: httpclient::Client::new(Some(url)),
            authentication: HarvestAuthentication::from_env(),
        }
    }
}
impl HarvestClient {
    pub fn new(url: &str, authentication: HarvestAuthentication) -> Self {
        let client = httpclient::Client::new(Some(url.to_string()));
        Self { client, authentication }
    }
    pub fn with_authentication(mut self, authentication: HarvestAuthentication) -> Self {
        self.authentication = authentication;
        self
    }
    pub fn authenticate<'a>(
        &self,
        mut r: httpclient::RequestBuilder<'a>,
    ) -> httpclient::RequestBuilder<'a> {
        match &self.authentication {
            HarvestAuthentication::BearerAuth { bearer_auth, account_auth } => {
                r = r.header("Authorization", bearer_auth);
                r = r.header("Harvest-Account-Id", account_auth);
            }
        }
        r
    }
    pub fn with_middleware<M: httpclient::Middleware + 'static>(
        mut self,
        middleware: M,
    ) -> Self {
        self.client = self.client.with_middleware(middleware);
        self
    }
    /**List all clients

Returns a list of your clients. The clients are returned sorted by creation date, with the most recently created clients appearing first.

The response contains an object with a clients property that contains an array of up to per_page clients. Each entry in the array is a separate client object. If no more clients are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your clients.

See endpoint docs at <https://help.getharvest.com/api-v2/clients-api/clients/clients/#list-all-clients>.*/
    pub fn list_clients(&self) -> request::ListClientsRequest {
        request::ListClientsRequest {
            client: &self,
            is_active: None,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create a client

Creates a new client object. Returns a client object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/clients-api/clients/clients/#create-a-client>.*/
    pub fn create_client(&self) -> request::CreateClientRequest {
        request::CreateClientRequest {
            client: &self,
            name: None,
            is_active: None,
            address: None,
            currency: None,
        }
    }
    /**Retrieve a client

Retrieves the client with the given ID. Returns a client object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/clients-api/clients/clients/#retrieve-a-client>.*/
    pub fn retrieve_client(&self, client_id: &str) -> request::RetrieveClientRequest {
        request::RetrieveClientRequest {
            client: &self,
            client_id: client_id.to_owned(),
        }
    }
    /**Delete a client

Delete a client. Deleting a client is only possible if it has no projects, invoices, or estimates associated with it. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/clients-api/clients/clients/#delete-a-client>.*/
    pub fn delete_client(&self, client_id: &str) -> request::DeleteClientRequest {
        request::DeleteClientRequest {
            client: &self,
            client_id: client_id.to_owned(),
        }
    }
    /**Update a client

Updates the specific client by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a client object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/clients-api/clients/clients/#update-a-client>.*/
    pub fn update_client(&self, client_id: &str) -> request::UpdateClientRequest {
        request::UpdateClientRequest {
            client: &self,
            client_id: client_id.to_owned(),
            name: None,
            is_active: None,
            address: None,
            currency: None,
        }
    }
    /**Retrieve a company

Retrieves the company for the currently authenticated user. Returns a
company object and a 200 OK response code.

See endpoint docs at <https://help.getharvest.com/api-v2/company-api/company/company/#retrieve-a-company>.*/
    pub fn retrieve_company(&self) -> request::RetrieveCompanyRequest {
        request::RetrieveCompanyRequest {
            client: &self,
        }
    }
    /**Update a company

Updates the company setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a company object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/company-api/company/company/#update-a-company>.*/
    pub fn update_company(&self) -> request::UpdateCompanyRequest {
        request::UpdateCompanyRequest {
            client: &self,
            wants_timestamp_timers: None,
            weekly_capacity: None,
        }
    }
    /**List all contacts

Returns a list of your contacts. The contacts are returned sorted by creation date, with the most recently created contacts appearing first.

The response contains an object with a contacts property that contains an array of up to per_page contacts. Each entry in the array is a separate contact object. If no more contacts are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your contacts.

See endpoint docs at <https://help.getharvest.com/api-v2/clients-api/clients/contacts/#list-all-contacts>.*/
    pub fn list_contacts(&self) -> request::ListContactsRequest {
        request::ListContactsRequest {
            client: &self,
            client_id: None,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create a contact

Creates a new contact object. Returns a contact object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/clients-api/clients/contacts/#create-a-contact>.*/
    pub fn create_contact(&self) -> request::CreateContactRequest {
        request::CreateContactRequest {
            client: &self,
            client_id: None,
            title: None,
            first_name: None,
            last_name: None,
            email: None,
            phone_office: None,
            phone_mobile: None,
            fax: None,
        }
    }
    /**Retrieve a contact

Retrieves the contact with the given ID. Returns a contact object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/clients-api/clients/contacts/#retrieve-a-contact>.*/
    pub fn retrieve_contact(&self, contact_id: &str) -> request::RetrieveContactRequest {
        request::RetrieveContactRequest {
            client: &self,
            contact_id: contact_id.to_owned(),
        }
    }
    /**Delete a contact

Delete a contact. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/clients-api/clients/contacts/#delete-a-contact>.*/
    pub fn delete_contact(&self, contact_id: &str) -> request::DeleteContactRequest {
        request::DeleteContactRequest {
            client: &self,
            contact_id: contact_id.to_owned(),
        }
    }
    /**Update a contact

Updates the specific contact by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a contact object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/clients-api/clients/contacts/#update-a-contact>.*/
    pub fn update_contact(&self, contact_id: &str) -> request::UpdateContactRequest {
        request::UpdateContactRequest {
            client: &self,
            contact_id: contact_id.to_owned(),
            client_id: None,
            title: None,
            first_name: None,
            last_name: None,
            email: None,
            phone_office: None,
            phone_mobile: None,
            fax: None,
        }
    }
    /**List all estimate item categories

Returns a list of your estimate item categories. The estimate item categories are returned sorted by creation date, with the most recently created estimate item categories appearing first.

The response contains an object with a estimate_item_categories property that contains an array of up to per_page estimate item categories. Each entry in the array is a separate estimate item category object. If no more estimate item categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your estimate item categories.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-item-categories/#list-all-estimate-item-categories>.*/
    pub fn list_estimate_item_categories(
        &self,
    ) -> request::ListEstimateItemCategoriesRequest {
        request::ListEstimateItemCategoriesRequest {
            client: &self,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create an estimate item category

Creates a new estimate item category object. Returns an estimate item category object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-item-categories/#create-an-estimate-item-category>.*/
    pub fn create_estimate_item_category(
        &self,
    ) -> request::CreateEstimateItemCategoryRequest {
        request::CreateEstimateItemCategoryRequest {
            client: &self,
            name: None,
        }
    }
    /**Retrieve an estimate item category

Retrieves the estimate item category with the given ID. Returns an estimate item category object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-item-categories/#retrieve-an-estimate-item-category>.*/
    pub fn retrieve_estimate_item_category(
        &self,
        estimate_item_category_id: &str,
    ) -> request::RetrieveEstimateItemCategoryRequest {
        request::RetrieveEstimateItemCategoryRequest {
            client: &self,
            estimate_item_category_id: estimate_item_category_id.to_owned(),
        }
    }
    /**Delete an estimate item category

Delete an estimate item category. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-item-categories/#delete-an-estimate-item-category>.*/
    pub fn delete_estimate_item_category(
        &self,
        estimate_item_category_id: &str,
    ) -> request::DeleteEstimateItemCategoryRequest {
        request::DeleteEstimateItemCategoryRequest {
            client: &self,
            estimate_item_category_id: estimate_item_category_id.to_owned(),
        }
    }
    /**Update an estimate item category

Updates the specific estimate item category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an estimate item category object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-item-categories/#update-an-estimate-item-category>.*/
    pub fn update_estimate_item_category(
        &self,
        estimate_item_category_id: &str,
    ) -> request::UpdateEstimateItemCategoryRequest {
        request::UpdateEstimateItemCategoryRequest {
            client: &self,
            estimate_item_category_id: estimate_item_category_id.to_owned(),
            name: None,
        }
    }
    /**List all estimates

Returns a list of your estimates. The estimates are returned sorted by issue date, with the most recently issued estimates appearing first.

The response contains an object with a estimates property that contains an array of up to per_page estimates. Each entry in the array is a separate estimate object. If no more estimates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your estimates.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimates/#list-all-estimates>.*/
    pub fn list_estimates(&self) -> request::ListEstimatesRequest {
        request::ListEstimatesRequest {
            client: &self,
            client_id: None,
            updated_since: None,
            from: None,
            to: None,
            state: None,
            page: None,
            per_page: None,
        }
    }
    /**Create an estimate

Creates a new estimate object. Returns an estimate object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimates/#create-an-estimate>.*/
    pub fn create_estimate(&self) -> request::CreateEstimateRequest {
        request::CreateEstimateRequest {
            client: &self,
            client_id: None,
            number: None,
            purchase_order: None,
            tax: None,
            tax2: None,
            discount: None,
            subject: None,
            notes: None,
            currency: None,
            issue_date: None,
            line_items: None,
        }
    }
    /**Retrieve an estimate

Retrieves the estimate with the given ID. Returns an estimate object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimates/#retrieve-an-estimate>.*/
    pub fn retrieve_estimate(
        &self,
        estimate_id: &str,
    ) -> request::RetrieveEstimateRequest {
        request::RetrieveEstimateRequest {
            client: &self,
            estimate_id: estimate_id.to_owned(),
        }
    }
    /**Delete an estimate

Delete an estimate. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimates/#delete-an-estimate>.*/
    pub fn delete_estimate(&self, estimate_id: &str) -> request::DeleteEstimateRequest {
        request::DeleteEstimateRequest {
            client: &self,
            estimate_id: estimate_id.to_owned(),
        }
    }
    /**Update an estimate

Updates the specific estimate by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an estimate object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimates/#update-an-estimate>.*/
    pub fn update_estimate(&self, estimate_id: &str) -> request::UpdateEstimateRequest {
        request::UpdateEstimateRequest {
            client: &self,
            estimate_id: estimate_id.to_owned(),
            client_id: None,
            number: None,
            purchase_order: None,
            tax: None,
            tax2: None,
            discount: None,
            subject: None,
            notes: None,
            currency: None,
            issue_date: None,
            line_items: None,
        }
    }
    /**List all messages for an estimate

Returns a list of messages associated with a given estimate. The estimate messages are returned sorted by creation date, with the most recently created messages appearing first.

The response contains an object with an estimate_messages property that contains an array of up to per_page messages. Each entry in the array is a separate message object. If no more messages are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your messages.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-messages/#list-all-messages-for-an-estimate>.*/
    pub fn list_messages_for_estimate(
        &self,
        estimate_id: &str,
    ) -> request::ListMessagesForEstimateRequest {
        request::ListMessagesForEstimateRequest {
            client: &self,
            estimate_id: estimate_id.to_owned(),
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create an estimate message or change estimate status

Creates a new estimate message object. Returns an estimate message object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-messages/#create-an-estimate-message>.*/
    pub fn create_estimate_message(
        &self,
        estimate_id: &str,
    ) -> request::CreateEstimateMessageRequest {
        request::CreateEstimateMessageRequest {
            client: &self,
            estimate_id: estimate_id.to_owned(),
            event_type: None,
            recipients: None,
            subject: None,
            body: None,
            send_me_a_copy: None,
        }
    }
    /**Delete an estimate message

Delete an estimate message. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-messages/#delete-an-estimate-message>.*/
    pub fn delete_estimate_message(
        &self,
        estimate_id: &str,
        message_id: &str,
    ) -> request::DeleteEstimateMessageRequest {
        request::DeleteEstimateMessageRequest {
            client: &self,
            estimate_id: estimate_id.to_owned(),
            message_id: message_id.to_owned(),
        }
    }
    /**List all expense categories

Returns a list of your expense categories. The expense categories are returned sorted by creation date, with the most recently created expense categories appearing first.

The response contains an object with a expense_categories property that contains an array of up to per_page expense categories. Each entry in the array is a separate expense category object. If no more expense categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your expense categories.

See endpoint docs at <https://help.getharvest.com/api-v2/expenses-api/expenses/expense-categories/#list-all-expense-categories>.*/
    pub fn list_expense_categories(&self) -> request::ListExpenseCategoriesRequest {
        request::ListExpenseCategoriesRequest {
            client: &self,
            is_active: None,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create an expense category

Creates a new expense category object. Returns an expense category object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/expenses-api/expenses/expense-categories/#create-an-expense-category>.*/
    pub fn create_expense_category(&self) -> request::CreateExpenseCategoryRequest {
        request::CreateExpenseCategoryRequest {
            client: &self,
            name: None,
            unit_name: None,
            unit_price: None,
            is_active: None,
        }
    }
    /**Retrieve an expense category

Retrieves the expense category with the given ID. Returns an expense category object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/expenses-api/expenses/expense-categories/#retrieve-an-expense-category>.*/
    pub fn retrieve_expense_category(
        &self,
        expense_category_id: &str,
    ) -> request::RetrieveExpenseCategoryRequest {
        request::RetrieveExpenseCategoryRequest {
            client: &self,
            expense_category_id: expense_category_id.to_owned(),
        }
    }
    /**Delete an expense category

Delete an expense category. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/expenses-api/expenses/expense-categories/#delete-an-expense-category>.*/
    pub fn delete_expense_category(
        &self,
        expense_category_id: &str,
    ) -> request::DeleteExpenseCategoryRequest {
        request::DeleteExpenseCategoryRequest {
            client: &self,
            expense_category_id: expense_category_id.to_owned(),
        }
    }
    /**Update an expense category

Updates the specific expense category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an expense category object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/expenses-api/expenses/expense-categories/#update-an-expense-category>.*/
    pub fn update_expense_category(
        &self,
        expense_category_id: &str,
    ) -> request::UpdateExpenseCategoryRequest {
        request::UpdateExpenseCategoryRequest {
            client: &self,
            expense_category_id: expense_category_id.to_owned(),
            name: None,
            unit_name: None,
            unit_price: None,
            is_active: None,
        }
    }
    /**List all expenses

Returns a list of your expenses. If accessing this endpoint as an Administrator, all expenses in the account will be returned. If accessing this endpoint as a Manager, all expenses for assigned teammates and managed projects will be returned. The expenses are returned sorted by the spent_at date, with the most recent expenses appearing first.

The response contains an object with a expenses property that contains an array of up to per_page expenses. Each entry in the array is a separate expense object. If no more expenses are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your expenses.

See endpoint docs at <https://help.getharvest.com/api-v2/expenses-api/expenses/expenses/#list-all-expenses>.*/
    pub fn list_expenses(&self) -> request::ListExpensesRequest {
        request::ListExpensesRequest {
            client: &self,
            user_id: None,
            client_id: None,
            project_id: None,
            is_billed: None,
            updated_since: None,
            from: None,
            to: None,
            page: None,
            per_page: None,
        }
    }
    /**Create an expense

Creates a new expense object. Returns an expense object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/expenses-api/expenses/expenses/#create-an-expense>.*/
    pub fn create_expense(&self) -> request::CreateExpenseRequest {
        request::CreateExpenseRequest {
            client: &self,
            user_id: None,
            project_id: None,
            expense_category_id: None,
            spent_date: None,
            units: None,
            total_cost: None,
            notes: None,
            billable: None,
            receipt: None,
        }
    }
    /**Retrieve an expense

Retrieves the expense with the given ID. Returns an expense object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/expenses-api/expenses/expenses/#retrieve-an-expense>.*/
    pub fn retrieve_expense(&self, expense_id: &str) -> request::RetrieveExpenseRequest {
        request::RetrieveExpenseRequest {
            client: &self,
            expense_id: expense_id.to_owned(),
        }
    }
    /**Delete an expense

Delete an expense. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/expenses-api/expenses/expenses/#delete-an-expense>.*/
    pub fn delete_expense(&self, expense_id: &str) -> request::DeleteExpenseRequest {
        request::DeleteExpenseRequest {
            client: &self,
            expense_id: expense_id.to_owned(),
        }
    }
    /**Update an expense

Updates the specific expense by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an expense object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/expenses-api/expenses/expenses/#update-an-expense>.*/
    pub fn update_expense(&self, expense_id: &str) -> request::UpdateExpenseRequest {
        request::UpdateExpenseRequest {
            client: &self,
            expense_id: expense_id.to_owned(),
            project_id: None,
            expense_category_id: None,
            spent_date: None,
            units: None,
            total_cost: None,
            notes: None,
            billable: None,
            receipt: None,
            delete_receipt: None,
        }
    }
    /**List all invoice item categories

Returns a list of your invoice item categories. The invoice item categories are returned sorted by creation date, with the most recently created invoice item categories appearing first.

The response contains an object with a invoice_item_categories property that contains an array of up to per_page invoice item categories. Each entry in the array is a separate invoice item category object. If no more invoice item categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your invoice item categories.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-item-categories/#list-all-invoice-item-categories>.*/
    pub fn list_invoice_item_categories(
        &self,
    ) -> request::ListInvoiceItemCategoriesRequest {
        request::ListInvoiceItemCategoriesRequest {
            client: &self,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create an invoice item category

Creates a new invoice item category object. Returns an invoice item category object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-item-categories/#create-an-invoice-item-category>.*/
    pub fn create_invoice_item_category(
        &self,
    ) -> request::CreateInvoiceItemCategoryRequest {
        request::CreateInvoiceItemCategoryRequest {
            client: &self,
            name: None,
        }
    }
    /**Retrieve an invoice item category

Retrieves the invoice item category with the given ID. Returns an invoice item category object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-item-categories/#retrieve-an-invoice-item-category>.*/
    pub fn retrieve_invoice_item_category(
        &self,
        invoice_item_category_id: &str,
    ) -> request::RetrieveInvoiceItemCategoryRequest {
        request::RetrieveInvoiceItemCategoryRequest {
            client: &self,
            invoice_item_category_id: invoice_item_category_id.to_owned(),
        }
    }
    /**Delete an invoice item category

Delete an invoice item category. Deleting an invoice item category is only possible if use_as_service and use_as_expense are both false. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-item-categories/#delete-an-invoice-item-category>.*/
    pub fn delete_invoice_item_category(
        &self,
        invoice_item_category_id: &str,
    ) -> request::DeleteInvoiceItemCategoryRequest {
        request::DeleteInvoiceItemCategoryRequest {
            client: &self,
            invoice_item_category_id: invoice_item_category_id.to_owned(),
        }
    }
    /**Update an invoice item category

Updates the specific invoice item category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an invoice item category object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-item-categories/#update-an-invoice-item-category>.*/
    pub fn update_invoice_item_category(
        &self,
        invoice_item_category_id: &str,
    ) -> request::UpdateInvoiceItemCategoryRequest {
        request::UpdateInvoiceItemCategoryRequest {
            client: &self,
            invoice_item_category_id: invoice_item_category_id.to_owned(),
            name: None,
        }
    }
    /**List all invoices

Returns a list of your invoices. The invoices are returned sorted by issue date, with the most recently issued invoices appearing first.

The response contains an object with a invoices property that contains an array of up to per_page invoices. Each entry in the array is a separate invoice object. If no more invoices are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your invoices.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoices/#list-all-invoices>.*/
    pub fn list_invoices(&self) -> request::ListInvoicesRequest {
        request::ListInvoicesRequest {
            client: &self,
            client_id: None,
            project_id: None,
            updated_since: None,
            from: None,
            to: None,
            state: None,
            page: None,
            per_page: None,
        }
    }
    /**Create an invoice

Creates a new invoice object. Returns an invoice object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoices/#create-a-free-form-invoice>.*/
    pub fn create_invoice(&self) -> request::CreateInvoiceRequest {
        request::CreateInvoiceRequest {
            client: &self,
            client_id: None,
            retainer_id: None,
            estimate_id: None,
            number: None,
            purchase_order: None,
            tax: None,
            tax2: None,
            discount: None,
            subject: None,
            notes: None,
            currency: None,
            issue_date: None,
            due_date: None,
            payment_term: None,
            line_items_import: None,
            line_items: None,
        }
    }
    /**Retrieve an invoice

Retrieves the invoice with the given ID. Returns an invoice object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoices/#retrieve-an-invoice>.*/
    pub fn retrieve_invoice(&self, invoice_id: &str) -> request::RetrieveInvoiceRequest {
        request::RetrieveInvoiceRequest {
            client: &self,
            invoice_id: invoice_id.to_owned(),
        }
    }
    /**Delete an invoice

Delete an invoice. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoices/#delete-an-invoice>.*/
    pub fn delete_invoice(&self, invoice_id: &str) -> request::DeleteInvoiceRequest {
        request::DeleteInvoiceRequest {
            client: &self,
            invoice_id: invoice_id.to_owned(),
        }
    }
    /**Update an invoice

Updates the specific invoice by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an invoice object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoices/#update-an-invoice>.*/
    pub fn update_invoice(&self, invoice_id: &str) -> request::UpdateInvoiceRequest {
        request::UpdateInvoiceRequest {
            client: &self,
            invoice_id: invoice_id.to_owned(),
            client_id: None,
            retainer_id: None,
            estimate_id: None,
            number: None,
            purchase_order: None,
            tax: None,
            tax2: None,
            discount: None,
            subject: None,
            notes: None,
            currency: None,
            issue_date: None,
            due_date: None,
            payment_term: None,
            line_items: None,
        }
    }
    /**List all messages for an invoice

Returns a list of messages associated with a given invoice. The invoice messages are returned sorted by creation date, with the most recently created messages appearing first.

The response contains an object with an invoice_messages property that contains an array of up to per_page messages. Each entry in the array is a separate message object. If no more messages are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your messages.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#list-all-messages-for-an-invoice>.*/
    pub fn list_messages_for_invoice(
        &self,
        invoice_id: &str,
    ) -> request::ListMessagesForInvoiceRequest {
        request::ListMessagesForInvoiceRequest {
            client: &self,
            invoice_id: invoice_id.to_owned(),
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create an invoice message or change invoice status

Creates a new invoice message object. Returns an invoice message object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#create-an-invoice-message>.*/
    pub fn create_invoice_message(
        &self,
        invoice_id: &str,
    ) -> request::CreateInvoiceMessageRequest {
        request::CreateInvoiceMessageRequest {
            client: &self,
            invoice_id: invoice_id.to_owned(),
            event_type: None,
            recipients: None,
            subject: None,
            body: None,
            include_link_to_client_invoice: None,
            attach_pdf: None,
            send_me_a_copy: None,
            thank_you: None,
        }
    }
    /**Retrieve invoice message subject and body for specific invoice

Returns the subject and body text as configured in Harvest of an invoice message for a specific invoice and a 200 OK response code if the call succeeded. Does not create the invoice message. If no parameters are passed, will return the subject and body of a general invoice message for the specific invoice.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#retrieve-invoice-message-subject-and-body-for-specific-invoice>.*/
    pub fn retrieve_invoice_message_subject_and_body_for_specific_invoice(
        &self,
        invoice_id: &str,
    ) -> request::RetrieveInvoiceMessageSubjectAndBodyForSpecificInvoiceRequest {
        request::RetrieveInvoiceMessageSubjectAndBodyForSpecificInvoiceRequest {
            client: &self,
            invoice_id: invoice_id.to_owned(),
            thank_you: None,
            reminder: None,
        }
    }
    /**Delete an invoice message

Delete an invoice message. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#delete-an-invoice-message>.*/
    pub fn delete_invoice_message(
        &self,
        invoice_id: &str,
        message_id: &str,
    ) -> request::DeleteInvoiceMessageRequest {
        request::DeleteInvoiceMessageRequest {
            client: &self,
            invoice_id: invoice_id.to_owned(),
            message_id: message_id.to_owned(),
        }
    }
    /**List all payments for an invoice

Returns a list of payments associate with a given invoice. The payments are returned sorted by creation date, with the most recently created payments appearing first.

The response contains an object with an invoice_payments property that contains an array of up to per_page payments. Each entry in the array is a separate payment object. If no more payments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your payments.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-payments/#list-all-payments-for-an-invoice>.*/
    pub fn list_payments_for_invoice(
        &self,
        invoice_id: &str,
    ) -> request::ListPaymentsForInvoiceRequest {
        request::ListPaymentsForInvoiceRequest {
            client: &self,
            invoice_id: invoice_id.to_owned(),
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create an invoice payment

Creates a new invoice payment object. Returns an invoice payment object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-payments/#create-an-invoice-payment>.*/
    pub fn create_invoice_payment(
        &self,
        invoice_id: &str,
    ) -> request::CreateInvoicePaymentRequest {
        request::CreateInvoicePaymentRequest {
            client: &self,
            invoice_id: invoice_id.to_owned(),
            amount: None,
            paid_at: None,
            paid_date: None,
            notes: None,
        }
    }
    /**Delete an invoice payment

Delete an invoice payment. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-payments/#delete-an-invoice-payment>.*/
    pub fn delete_invoice_payment(
        &self,
        invoice_id: &str,
        payment_id: &str,
    ) -> request::DeleteInvoicePaymentRequest {
        request::DeleteInvoicePaymentRequest {
            client: &self,
            invoice_id: invoice_id.to_owned(),
            payment_id: payment_id.to_owned(),
        }
    }
    /**List all projects

Returns a list of your projects. The projects are returned sorted by creation date, with the most recently created projects appearing first.

The response contains an object with a projects property that contains an array of up to per_page projects. Each entry in the array is a separate project object. If no more projects are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your projects.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/projects/#list-all-projects>.*/
    pub fn list_projects(&self) -> request::ListProjectsRequest {
        request::ListProjectsRequest {
            client: &self,
            is_active: None,
            client_id: None,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create a project

Creates a new project object. Returns a project object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/projects/#create-a-project>.*/
    pub fn create_project(&self) -> request::CreateProjectRequest {
        request::CreateProjectRequest {
            client: &self,
            client_id: None,
            name: None,
            code: None,
            is_active: None,
            is_billable: None,
            is_fixed_fee: None,
            bill_by: None,
            hourly_rate: None,
            budget: None,
            budget_by: None,
            budget_is_monthly: None,
            notify_when_over_budget: None,
            over_budget_notification_percentage: None,
            show_budget_to_all: None,
            cost_budget: None,
            cost_budget_include_expenses: None,
            fee: None,
            notes: None,
            starts_on: None,
            ends_on: None,
        }
    }
    /**Retrieve a project

Retrieves the project with the given ID. Returns a project object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/projects/#retrieve-a-project>.*/
    pub fn retrieve_project(&self, project_id: &str) -> request::RetrieveProjectRequest {
        request::RetrieveProjectRequest {
            client: &self,
            project_id: project_id.to_owned(),
        }
    }
    /**Delete a project

Deletes a project and any time entries or expenses tracked to it.
However, invoices associated with the project will not be deleted.
If you don’t want the project’s time entries and expenses to be deleted, you should archive the project instead.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/projects/#delete-a-project>.*/
    pub fn delete_project(&self, project_id: &str) -> request::DeleteProjectRequest {
        request::DeleteProjectRequest {
            client: &self,
            project_id: project_id.to_owned(),
        }
    }
    /**Update a project

Updates the specific project by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a project object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/projects/#update-a-project>.*/
    pub fn update_project(&self, project_id: &str) -> request::UpdateProjectRequest {
        request::UpdateProjectRequest {
            client: &self,
            project_id: project_id.to_owned(),
            client_id: None,
            name: None,
            code: None,
            is_active: None,
            is_billable: None,
            is_fixed_fee: None,
            bill_by: None,
            hourly_rate: None,
            budget: None,
            budget_by: None,
            budget_is_monthly: None,
            notify_when_over_budget: None,
            over_budget_notification_percentage: None,
            show_budget_to_all: None,
            cost_budget: None,
            cost_budget_include_expenses: None,
            fee: None,
            notes: None,
            starts_on: None,
            ends_on: None,
        }
    }
    /**List all task assignments for a specific project

Returns a list of your task assignments for the project identified by PROJECT_ID. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first.

The response contains an object with a task_assignments property that contains an array of up to per_page task assignments. Each entry in the array is a separate task assignment object. If no more task assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your task assignments.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#list-all-task-assignments-for-a-specific-project>.*/
    pub fn list_task_assignments_for_specific_project(
        &self,
        project_id: &str,
    ) -> request::ListTaskAssignmentsForSpecificProjectRequest {
        request::ListTaskAssignmentsForSpecificProjectRequest {
            client: &self,
            project_id: project_id.to_owned(),
            is_active: None,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create a task assignment

Creates a new task assignment object. Returns a task assignment object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#create-a-task-assignment>.*/
    pub fn create_task_assignment(
        &self,
        project_id: &str,
    ) -> request::CreateTaskAssignmentRequest {
        request::CreateTaskAssignmentRequest {
            client: &self,
            project_id: project_id.to_owned(),
            task_id: None,
            is_active: None,
            billable: None,
            hourly_rate: None,
            budget: None,
        }
    }
    /**Retrieve a task assignment

Retrieves the task assignment with the given ID. Returns a task assignment object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#retrieve-a-task-assignment>.*/
    pub fn retrieve_task_assignment(
        &self,
        project_id: &str,
        task_assignment_id: &str,
    ) -> request::RetrieveTaskAssignmentRequest {
        request::RetrieveTaskAssignmentRequest {
            client: &self,
            project_id: project_id.to_owned(),
            task_assignment_id: task_assignment_id.to_owned(),
        }
    }
    /**Delete a task assignment

Delete a task assignment. Deleting a task assignment is only possible if it has no time entries associated with it. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#delete-a-task-assignment>.*/
    pub fn delete_task_assignment(
        &self,
        project_id: &str,
        task_assignment_id: &str,
    ) -> request::DeleteTaskAssignmentRequest {
        request::DeleteTaskAssignmentRequest {
            client: &self,
            project_id: project_id.to_owned(),
            task_assignment_id: task_assignment_id.to_owned(),
        }
    }
    /**Update a task assignment

Updates the specific task assignment by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a task assignment object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#update-a-task-assignment>.*/
    pub fn update_task_assignment(
        &self,
        project_id: &str,
        task_assignment_id: &str,
    ) -> request::UpdateTaskAssignmentRequest {
        request::UpdateTaskAssignmentRequest {
            client: &self,
            project_id: project_id.to_owned(),
            task_assignment_id: task_assignment_id.to_owned(),
            is_active: None,
            billable: None,
            hourly_rate: None,
            budget: None,
        }
    }
    /**List all user assignments for a specific project

Returns a list of user assignments for the project identified by PROJECT_ID. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first.

The response contains an object with a user_assignments property that contains an array of up to per_page user assignments. Each entry in the array is a separate user assignment object. If no more user assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your user assignments.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#list-all-user-assignments-for-a-specific-project>.*/
    pub fn list_user_assignments_for_specific_project(
        &self,
        project_id: &str,
    ) -> request::ListUserAssignmentsForSpecificProjectRequest {
        request::ListUserAssignmentsForSpecificProjectRequest {
            client: &self,
            project_id: project_id.to_owned(),
            user_id: None,
            is_active: None,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create a user assignment

Creates a new user assignment object. Returns a user assignment object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#create-a-user-assignment>.*/
    pub fn create_user_assignment(
        &self,
        project_id: &str,
    ) -> request::CreateUserAssignmentRequest {
        request::CreateUserAssignmentRequest {
            client: &self,
            project_id: project_id.to_owned(),
            user_id: None,
            is_active: None,
            is_project_manager: None,
            use_default_rates: None,
            hourly_rate: None,
            budget: None,
        }
    }
    /**Retrieve a user assignment

Retrieves the user assignment with the given ID. Returns a user assignment object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#retrieve-a-user-assignment>.*/
    pub fn retrieve_user_assignment(
        &self,
        project_id: &str,
        user_assignment_id: &str,
    ) -> request::RetrieveUserAssignmentRequest {
        request::RetrieveUserAssignmentRequest {
            client: &self,
            project_id: project_id.to_owned(),
            user_assignment_id: user_assignment_id.to_owned(),
        }
    }
    /**Delete a user assignment

Delete a user assignment. Deleting a user assignment is only possible if it has no time entries or expenses associated with it. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#delete-a-user-assignment>.*/
    pub fn delete_user_assignment(
        &self,
        project_id: &str,
        user_assignment_id: &str,
    ) -> request::DeleteUserAssignmentRequest {
        request::DeleteUserAssignmentRequest {
            client: &self,
            project_id: project_id.to_owned(),
            user_assignment_id: user_assignment_id.to_owned(),
        }
    }
    /**Update a user assignment

Updates the specific user assignment by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a user assignment object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#update-a-user-assignment>.*/
    pub fn update_user_assignment(
        &self,
        project_id: &str,
        user_assignment_id: &str,
    ) -> request::UpdateUserAssignmentRequest {
        request::UpdateUserAssignmentRequest {
            client: &self,
            project_id: project_id.to_owned(),
            user_assignment_id: user_assignment_id.to_owned(),
            is_active: None,
            is_project_manager: None,
            use_default_rates: None,
            hourly_rate: None,
            budget: None,
        }
    }
    /**Expense Categories Report

See endpoint docs at <https://help.getharvest.com/api-v2/reports-api/reports/expense-reports/#expense-categories-report>.*/
    pub fn expense_categories_report(
        &self,
        from: &str,
        to: &str,
    ) -> request::ExpenseCategoriesReportRequest {
        request::ExpenseCategoriesReportRequest {
            client: &self,
            from: from.to_owned(),
            to: to.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**Clients Report

See endpoint docs at <https://help.getharvest.com/api-v2/reports-api/reports/expense-reports/#clients-report>.*/
    pub fn clients_expenses_report(
        &self,
        from: &str,
        to: &str,
    ) -> request::ClientsExpensesReportRequest {
        request::ClientsExpensesReportRequest {
            client: &self,
            from: from.to_owned(),
            to: to.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**Projects Report

See endpoint docs at <https://help.getharvest.com/api-v2/reports-api/reports/expense-reports/#projects-report>.*/
    pub fn projects_expenses_report(
        &self,
        from: &str,
        to: &str,
    ) -> request::ProjectsExpensesReportRequest {
        request::ProjectsExpensesReportRequest {
            client: &self,
            from: from.to_owned(),
            to: to.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**Team Report

See endpoint docs at <https://help.getharvest.com/api-v2/reports-api/reports/expense-reports/#team-report>.*/
    pub fn team_expenses_report(
        &self,
        from: &str,
        to: &str,
    ) -> request::TeamExpensesReportRequest {
        request::TeamExpensesReportRequest {
            client: &self,
            from: from.to_owned(),
            to: to.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**Project Budget Report

The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results.

See endpoint docs at <https://help.getharvest.com/api-v2/reports-api/reports/project-budget-report/#project-budget-report>.*/
    pub fn project_budget_report(&self) -> request::ProjectBudgetReportRequest {
        request::ProjectBudgetReportRequest {
            client: &self,
            page: None,
            per_page: None,
            is_active: None,
        }
    }
    /**Clients Report

See endpoint docs at <https://help.getharvest.com/api-v2/reports-api/reports/time-reports/#clients-report>.*/
    pub fn clients_time_report(
        &self,
        from: &str,
        to: &str,
    ) -> request::ClientsTimeReportRequest {
        request::ClientsTimeReportRequest {
            client: &self,
            from: from.to_owned(),
            to: to.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**Projects Report

See endpoint docs at <https://help.getharvest.com/api-v2/reports-api/reports/time-reports/#projects-report>.*/
    pub fn projects_time_report(
        &self,
        from: &str,
        to: &str,
    ) -> request::ProjectsTimeReportRequest {
        request::ProjectsTimeReportRequest {
            client: &self,
            from: from.to_owned(),
            to: to.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**Tasks Report

See endpoint docs at <https://help.getharvest.com/api-v2/reports-api/reports/time-reports/#tasks-report>.*/
    pub fn tasks_report(&self, from: &str, to: &str) -> request::TasksReportRequest {
        request::TasksReportRequest {
            client: &self,
            from: from.to_owned(),
            to: to.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**Team Report

See endpoint docs at <https://help.getharvest.com/api-v2/reports-api/reports/time-reports/#team-report>.*/
    pub fn team_time_report(
        &self,
        from: &str,
        to: &str,
    ) -> request::TeamTimeReportRequest {
        request::TeamTimeReportRequest {
            client: &self,
            from: from.to_owned(),
            to: to.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**Uninvoiced Report

The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results.

Note: Each request requires both the from and to parameters to be supplied in the URL’s query string. The timeframe supplied cannot exceed 1 year (365 days).

See endpoint docs at <https://help.getharvest.com/api-v2/reports-api/reports/uninvoiced-report/#uninvoiced-report>.*/
    pub fn uninvoiced_report(
        &self,
        from: &str,
        to: &str,
    ) -> request::UninvoicedReportRequest {
        request::UninvoicedReportRequest {
            client: &self,
            from: from.to_owned(),
            to: to.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**List all roles

Returns a list of roles in the account. The roles are returned sorted by creation date, with the most recently created roles appearing first.

The response contains an object with a roles property that contains an array of up to per_page roles. Each entry in the array is a separate role object. If no more roles are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your roles.

See endpoint docs at <https://help.getharvest.com/api-v2/roles-api/roles/roles/#list-all-roles>.*/
    pub fn list_roles(&self) -> request::ListRolesRequest {
        request::ListRolesRequest {
            client: &self,
            page: None,
            per_page: None,
        }
    }
    /**Create a role

Creates a new role object. Returns a role object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/roles-api/roles/roles/#create-a-role>.*/
    pub fn create_role(&self) -> request::CreateRoleRequest {
        request::CreateRoleRequest {
            client: &self,
            name: None,
            user_ids: None,
        }
    }
    /**Retrieve a role

Retrieves the role with the given ID. Returns a role object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/roles-api/roles/roles/#retrieve-a-role>.*/
    pub fn retrieve_role(&self, role_id: &str) -> request::RetrieveRoleRequest {
        request::RetrieveRoleRequest {
            client: &self,
            role_id: role_id.to_owned(),
        }
    }
    /**Delete a role

Delete a role. Deleting a role will unlink it from any users it was assigned to. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/roles-api/roles/roles/#delete-a-role>.*/
    pub fn delete_role(&self, role_id: &str) -> request::DeleteRoleRequest {
        request::DeleteRoleRequest {
            client: &self,
            role_id: role_id.to_owned(),
        }
    }
    /**Update a role

Updates the specific role by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a role object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/roles-api/roles/roles/#update-a-role>.*/
    pub fn update_role(&self, role_id: &str) -> request::UpdateRoleRequest {
        request::UpdateRoleRequest {
            client: &self,
            role_id: role_id.to_owned(),
            name: None,
            user_ids: None,
        }
    }
    /**List all task assignments

Returns a list of your task assignments. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first.

The response contains an object with a task_assignments property that contains an array of up to per_page task assignments. Each entry in the array is a separate task assignment object. If no more task assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your task assignments.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#list-all-task-assignments>.*/
    pub fn list_task_assignments(&self) -> request::ListTaskAssignmentsRequest {
        request::ListTaskAssignmentsRequest {
            client: &self,
            is_active: None,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**List all tasks

Returns a list of your tasks. The tasks are returned sorted by creation date, with the most recently created tasks appearing first.

The response contains an object with a tasks property that contains an array of up to per_page tasks. Each entry in the array is a separate task object. If no more tasks are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your tasks.

See endpoint docs at <https://help.getharvest.com/api-v2/tasks-api/tasks/tasks/#list-all-tasks>.*/
    pub fn list_tasks(&self) -> request::ListTasksRequest {
        request::ListTasksRequest {
            client: &self,
            is_active: None,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create a task

Creates a new task object. Returns a task object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/tasks-api/tasks/tasks/#create-a-task>.*/
    pub fn create_task(&self) -> request::CreateTaskRequest {
        request::CreateTaskRequest {
            client: &self,
            name: None,
            billable_by_default: None,
            default_hourly_rate: None,
            is_default: None,
            is_active: None,
        }
    }
    /**Retrieve a task

Retrieves the task with the given ID. Returns a task object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/tasks-api/tasks/tasks/#retrieve-a-task>.*/
    pub fn retrieve_task(&self, task_id: &str) -> request::RetrieveTaskRequest {
        request::RetrieveTaskRequest {
            client: &self,
            task_id: task_id.to_owned(),
        }
    }
    /**Delete a task

Delete a task. Deleting a task is only possible if it has no time entries associated with it. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/tasks-api/tasks/tasks/#delete-a-task>.*/
    pub fn delete_task(&self, task_id: &str) -> request::DeleteTaskRequest {
        request::DeleteTaskRequest {
            client: &self,
            task_id: task_id.to_owned(),
        }
    }
    /**Update a task

Updates the specific task by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a task object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/tasks-api/tasks/tasks/#update-a-task>.*/
    pub fn update_task(&self, task_id: &str) -> request::UpdateTaskRequest {
        request::UpdateTaskRequest {
            client: &self,
            task_id: task_id.to_owned(),
            name: None,
            billable_by_default: None,
            default_hourly_rate: None,
            is_default: None,
            is_active: None,
        }
    }
    /**List all time entries

Returns a list of time entries. The time entries are returned sorted by spent_date date. At this time, the sort option can’t be customized.

The response contains an object with a time_entries property that contains an array of up to per_page time entries. Each entry in the array is a separate time entry object. If no more time entries are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your time entries.

See endpoint docs at <https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#list-all-time-entries>.*/
    pub fn list_time_entries(&self) -> request::ListTimeEntriesRequest {
        request::ListTimeEntriesRequest {
            client: &self,
            user_id: None,
            client_id: None,
            project_id: None,
            task_id: None,
            external_reference_id: None,
            is_billed: None,
            is_running: None,
            updated_since: None,
            from: None,
            to: None,
            page: None,
            per_page: None,
        }
    }
    /**Create a time entry

Creates a new time entry object. Returns a time entry object and a 201 Created response code if the call succeeded.

You should only use this method to create time entries when your account is configured to track time via duration. You can verify this by visiting the Settings page in your Harvest account or by checking if wants_timestamp_timers is false in the Company API.

See endpoint docs at <https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#create-a-time-entry-via-duration>.*/
    pub fn create_time_entry(&self) -> request::CreateTimeEntryRequest {
        request::CreateTimeEntryRequest {
            client: &self,
            user_id: None,
            project_id: None,
            task_id: None,
            spent_date: None,
            started_time: None,
            ended_time: None,
            notes: None,
            external_reference: None,
            hours: None,
        }
    }
    /**Retrieve a time entry

Retrieves the time entry with the given ID. Returns a time entry object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#retrieve-a-time-entry>.*/
    pub fn retrieve_time_entry(
        &self,
        time_entry_id: &str,
    ) -> request::RetrieveTimeEntryRequest {
        request::RetrieveTimeEntryRequest {
            client: &self,
            time_entry_id: time_entry_id.to_owned(),
        }
    }
    /**Delete a time entry

Delete a time entry. Deleting a time entry is only possible if it’s not closed and the associated project and task haven’t been archived.  However, Admins can delete closed entries. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#delete-a-time-entry>.*/
    pub fn delete_time_entry(
        &self,
        time_entry_id: &str,
    ) -> request::DeleteTimeEntryRequest {
        request::DeleteTimeEntryRequest {
            client: &self,
            time_entry_id: time_entry_id.to_owned(),
        }
    }
    /**Update a time entry

Updates the specific time entry by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a time entry object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#update-a-time-entry>.*/
    pub fn update_time_entry(
        &self,
        time_entry_id: &str,
    ) -> request::UpdateTimeEntryRequest {
        request::UpdateTimeEntryRequest {
            client: &self,
            time_entry_id: time_entry_id.to_owned(),
            project_id: None,
            task_id: None,
            spent_date: None,
            started_time: None,
            ended_time: None,
            hours: None,
            notes: None,
            external_reference: None,
        }
    }
    /**Delete a time entry’s external reference

Delete a time entry’s external reference. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#delete-a-time-entrys-external-reference>.*/
    pub fn delete_time_entry_external_reference(
        &self,
        time_entry_id: &str,
    ) -> request::DeleteTimeEntryExternalReferenceRequest {
        request::DeleteTimeEntryExternalReferenceRequest {
            client: &self,
            time_entry_id: time_entry_id.to_owned(),
        }
    }
    /**Restart a stopped time entry

Restarting a time entry is only possible if it isn’t currently running. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#restart-a-stopped-time-entry>.*/
    pub fn restart_stopped_time_entry(
        &self,
        time_entry_id: &str,
    ) -> request::RestartStoppedTimeEntryRequest {
        request::RestartStoppedTimeEntryRequest {
            client: &self,
            time_entry_id: time_entry_id.to_owned(),
        }
    }
    /**Stop a running time entry

Stopping a time entry is only possible if it’s currently running. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#stop-a-running-time-entry>.*/
    pub fn stop_running_time_entry(
        &self,
        time_entry_id: &str,
    ) -> request::StopRunningTimeEntryRequest {
        request::StopRunningTimeEntryRequest {
            client: &self,
            time_entry_id: time_entry_id.to_owned(),
        }
    }
    /**List all user assignments

Returns a list of your projects user assignments, active and archived. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first.

The response contains an object with a user_assignments property that contains an array of up to per_page user assignments. Each entry in the array is a separate user assignment object. If no more user assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your user assignments.

See endpoint docs at <https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#list-all-user-assignments>.*/
    pub fn list_user_assignments(&self) -> request::ListUserAssignmentsRequest {
        request::ListUserAssignmentsRequest {
            client: &self,
            user_id: None,
            is_active: None,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**List all users

Returns a list of your users. The users are returned sorted by creation date, with the most recently created users appearing first.

The response contains an object with a users property that contains an array of up to per_page users. Each entry in the array is a separate user object. If no more users are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your users.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/users/#list-all-users>.*/
    pub fn list_users(&self) -> request::ListUsersRequest {
        request::ListUsersRequest {
            client: &self,
            is_active: None,
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**Create a user

Creates a new user object and sends an invitation email to the address specified in the email parameter. Returns a user object and a 201 Created response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/users/#create-a-user>.*/
    pub fn create_user(&self) -> request::CreateUserRequest {
        request::CreateUserRequest {
            client: &self,
            first_name: None,
            last_name: None,
            email: None,
            timezone: None,
            has_access_to_all_future_projects: None,
            is_contractor: None,
            is_active: None,
            weekly_capacity: None,
            default_hourly_rate: None,
            cost_rate: None,
            roles: None,
            access_roles: None,
        }
    }
    /**Retrieve the currently authenticated user

Retrieves the currently authenticated user. Returns a user object and a 200 OK response code.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/users/#retrieve-the-currently-authenticated-user>.*/
    pub fn retrieve_the_currently_authenticated_user(
        &self,
    ) -> request::RetrieveTheCurrentlyAuthenticatedUserRequest {
        request::RetrieveTheCurrentlyAuthenticatedUserRequest {
            client: &self,
        }
    }
    /**List active project assignments for the currently authenticated user

Returns a list of your active project assignments for the currently authenticated user. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first.

The response contains an object with a project_assignments property that contains an array of up to per_page project assignments. Each entry in the array is a separate project assignment object. If no more project assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your project assignments.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/project-assignments/#list-active-project-assignments-for-the-currently-authenticated-user>.*/
    pub fn list_active_project_assignments_for_the_currently_authenticated_user(
        &self,
    ) -> request::ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUserRequest {
        request::ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUserRequest {
            client: &self,
            page: None,
            per_page: None,
        }
    }
    /**Retrieve a user

Retrieves the user with the given ID. Returns a user object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/users/#retrieve-a-user>.*/
    pub fn retrieve_user(&self, user_id: &str) -> request::RetrieveUserRequest {
        request::RetrieveUserRequest {
            client: &self,
            user_id: user_id.to_owned(),
        }
    }
    /**Delete a user

Delete a user. Deleting a user is only possible if they have no time entries or expenses associated with them. Returns a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/users/#delete-a-user>.*/
    pub fn delete_user(&self, user_id: &str) -> request::DeleteUserRequest {
        request::DeleteUserRequest {
            client: &self,
            user_id: user_id.to_owned(),
        }
    }
    /**Update a user

Updates the specific user by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a user object and a 200 OK response code if the call succeeded.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/users/#update-a-user>.*/
    pub fn update_user(&self, user_id: &str) -> request::UpdateUserRequest {
        request::UpdateUserRequest {
            client: &self,
            user_id: user_id.to_owned(),
            first_name: None,
            last_name: None,
            email: None,
            timezone: None,
            has_access_to_all_future_projects: None,
            is_contractor: None,
            is_active: None,
            weekly_capacity: None,
            default_hourly_rate: None,
            cost_rate: None,
            roles: None,
            access_roles: None,
        }
    }
    /**List all billable rates for a specific user

Returns a list of billable rates for the user identified by USER_ID. The billable rates are returned sorted by start_date, with the oldest starting billable rates appearing first.

The response contains an object with a billable_rates property that contains an array of up to per_page billable rates. Each entry in the array is a separate billable rate object. If no more billable rates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your billable rates.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/billable-rates/#list-all-billable-rates-for-a-specific-user>.*/
    pub fn list_billable_rates_for_specific_user(
        &self,
        user_id: &str,
    ) -> request::ListBillableRatesForSpecificUserRequest {
        request::ListBillableRatesForSpecificUserRequest {
            client: &self,
            user_id: user_id.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**Create a billable rate

Creates a new billable rate object. Returns a billable rate object and a 201 Created response code if the call succeeded.


  Creating a billable rate with no start_date will replace a user’s existing rate(s).
  Creating a billable rate with a start_date that is before a user’s existing rate(s) will replace those billable rates with the new one.


See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/billable-rates/#create-a-billable-rate>.*/
    pub fn create_billable_rate(
        &self,
        user_id: &str,
    ) -> request::CreateBillableRateRequest {
        request::CreateBillableRateRequest {
            client: &self,
            user_id: user_id.to_owned(),
            amount: None,
            start_date: None,
        }
    }
    /**Retrieve a billable rate

Retrieves the billable rate with the given ID. Returns a billable rate object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/billable-rates/#retrieve-a-billable-rate>.*/
    pub fn retrieve_billable_rate(
        &self,
        user_id: &str,
        billable_rate_id: &str,
    ) -> request::RetrieveBillableRateRequest {
        request::RetrieveBillableRateRequest {
            client: &self,
            user_id: user_id.to_owned(),
            billable_rate_id: billable_rate_id.to_owned(),
        }
    }
    /**List all cost rates for a specific user

Returns a list of cost rates for the user identified by USER_ID. The cost rates are returned sorted by start_date, with the oldest starting cost rates appearing first.

The response contains an object with a cost_rates property that contains an array of up to per_page cost rates. Each entry in the array is a separate cost rate object. If no more cost rates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your cost rates.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/cost-rates/#list-all-cost-rates-for-a-specific-user>.*/
    pub fn list_cost_rates_for_specific_user(
        &self,
        user_id: &str,
    ) -> request::ListCostRatesForSpecificUserRequest {
        request::ListCostRatesForSpecificUserRequest {
            client: &self,
            user_id: user_id.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**Create a cost rate

Creates a new cost rate object. Returns a cost rate object and a 201 Created response code if the call succeeded.


  Creating a cost rate with no start_date will replace a user’s existing rate(s).
  Creating a cost rate with a start_date that is before a user’s existing rate(s) will replace those cost rates with the new one.


See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/cost-rates/#create-a-cost-rate>.*/
    pub fn create_cost_rate(&self, user_id: &str) -> request::CreateCostRateRequest {
        request::CreateCostRateRequest {
            client: &self,
            user_id: user_id.to_owned(),
            amount: None,
            start_date: None,
        }
    }
    /**Retrieve a cost rate

Retrieves the cost rate with the given ID. Returns a cost rate object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/cost-rates/#retrieve-a-cost-rate>.*/
    pub fn retrieve_cost_rate(
        &self,
        user_id: &str,
        cost_rate_id: &str,
    ) -> request::RetrieveCostRateRequest {
        request::RetrieveCostRateRequest {
            client: &self,
            user_id: user_id.to_owned(),
            cost_rate_id: cost_rate_id.to_owned(),
        }
    }
    /**List active project assignments

Returns a list of active project assignments for the user identified by USER_ID. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first.

The response contains an object with a project_assignments property that contains an array of up to per_page project assignments. Each entry in the array is a separate project assignment object. If no more project assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your project assignments.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/project-assignments/#list-active-project-assignments>.*/
    pub fn list_active_project_assignments(
        &self,
        user_id: &str,
    ) -> request::ListActiveProjectAssignmentsRequest {
        request::ListActiveProjectAssignmentsRequest {
            client: &self,
            user_id: user_id.to_owned(),
            updated_since: None,
            page: None,
            per_page: None,
        }
    }
    /**List all assigned teammates for a specific user

Returns a list of assigned teammates for the user identified by USER_ID. The USER_ID must belong to a user that is a Manager, if not, a 422 Unprocessable Entity status code will be returned.

The response contains an object with a teammates property that contains an array of up to per_page teammates. Each entry in the array is a separate teammate object. If no more teammates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your teammates.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/teammates/#list-all-assigned-teammates-for-a-specific-user>.*/
    pub fn list_assigned_teammates_for_specific_user(
        &self,
        user_id: &str,
    ) -> request::ListAssignedTeammatesForSpecificUserRequest {
        request::ListAssignedTeammatesForSpecificUserRequest {
            client: &self,
            user_id: user_id.to_owned(),
            page: None,
            per_page: None,
        }
    }
    /**Update a user’s assigned teammates

Updates the the assigned teammates for a specific user. Returns list of assigned teammates and a 200 OK response code if the call succeeded. The USER_ID must belong to a user that is a Manager, if not, a 422 Unprocessable Entity status code will be returned.

Adding teammates for the first time will add the people_manager access role to the Manager. Any IDs not included in the teammate_ids that are currently assigned will be unassigned from the Manager. Use an empty array to unassign all users. This will also remove the people_manager access role from the Manager.

See endpoint docs at <https://help.getharvest.com/api-v2/users-api/users/teammates/#update-a-users-assigned-teammates>.*/
    pub fn update_user_assigned_teammates(
        &self,
        user_id: &str,
    ) -> request::UpdateUserAssignedTeammatesRequest {
        request::UpdateUserAssignedTeammatesRequest {
            client: &self,
            user_id: user_id.to_owned(),
            teammate_ids: None,
        }
    }
}
pub enum HarvestAuthentication {
    BearerAuth { bearer_auth: String, account_auth: String },
}
impl HarvestAuthentication {
    pub fn from_env() -> Self {
        Self::BearerAuth {
            bearer_auth: std::env::var("HARVEST_BEARER_AUTH")
                .expect("Environment variable HARVEST_BEARER_AUTH is not set."),
            account_auth: std::env::var("HARVEST_ACCOUNT_AUTH")
                .expect("Environment variable HARVEST_ACCOUNT_AUTH is not set."),
        }
    }
}