harvest_api/
model.rs

1use serde::{Serialize, Deserialize};
2#[derive(Debug, Serialize, Deserialize)]
3pub struct BillableRates {
4    pub previous_page: Option<i64>,
5    pub total_entries: i64,
6    pub billable_rates: Vec<BillableRate>,
7    pub per_page: i64,
8    pub page: i64,
9    pub total_pages: i64,
10    pub next_page: Option<i64>,
11    pub links: PaginationLinks,
12}
13impl std::fmt::Display for BillableRates {
14    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15        write!(f, "{}", serde_json::to_string(self).unwrap())
16    }
17}
18#[derive(Debug, Serialize, Deserialize, Default)]
19pub struct PaginationLinks {
20    ///Last page
21    pub last: String,
22    ///First page
23    pub first: String,
24    ///Previous page
25    pub previous: Option<String>,
26    ///Next page
27    pub next: Option<String>,
28}
29impl std::fmt::Display for PaginationLinks {
30    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
31        write!(f, "{}", serde_json::to_string(self).unwrap())
32    }
33}
34#[derive(Debug, Serialize, Deserialize, Default)]
35pub struct User {
36    ///The URL to the user’s avatar image.
37    pub avatar_url: Option<String>,
38    ///Access role(s) that determine the user’s permissions in Harvest. Possible values: administrator, manager or member. Users with the manager role can additionally be granted one or more of these roles: project_creator, billable_rates_manager, managed_projects_invoice_drafter, managed_projects_invoice_manager, client_and_task_manager, time_and_expenses_manager, estimates_manager.
39    pub access_roles: Option<Vec<String>>,
40    ///The last name of the user.
41    pub last_name: Option<String>,
42    ///The user’s timezone.
43    pub timezone: Option<String>,
44    ///The email address of the user.
45    pub email: Option<String>,
46    ///The cost rate to use for this user when calculating a project’s costs vs billable amount.
47    pub cost_rate: Option<f64>,
48    ///Unique ID for the user.
49    pub id: Option<i64>,
50    ///Date and time the user was created.
51    pub created_at: Option<String>,
52    ///The first name of the user.
53    pub first_name: Option<String>,
54    ///Date and time the user was last updated.
55    pub updated_at: Option<String>,
56    ///The number of hours per week this person is available to work in seconds, in half hour increments. For example, if a person’s capacity is 35 hours, the API will return 126000 seconds.
57    pub weekly_capacity: Option<i64>,
58    ///Descriptive names of the business roles assigned to this person. They can be used for filtering reports, and have no effect in their permissions in Harvest.
59    pub roles: Option<Vec<String>>,
60    ///Whether the user should be automatically added to future projects.
61    pub has_access_to_all_future_projects: Option<bool>,
62    ///The user’s telephone number.
63    pub telephone: Option<String>,
64    ///Whether the user is a contractor or an employee.
65    pub is_contractor: Option<bool>,
66    ///Whether the user is active or archived.
67    pub is_active: Option<bool>,
68    ///The billable rate to use for this user when they are added to a project.
69    pub default_hourly_rate: Option<f64>,
70}
71impl std::fmt::Display for User {
72    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
73        write!(f, "{}", serde_json::to_string(self).unwrap())
74    }
75}
76#[derive(Debug, Serialize, Deserialize)]
77pub struct TaskAssignments {
78    pub page: i64,
79    pub total_entries: i64,
80    pub links: PaginationLinks,
81    pub per_page: i64,
82    pub total_pages: i64,
83    pub task_assignments: Vec<TaskAssignment>,
84    pub next_page: Option<i64>,
85    pub previous_page: Option<i64>,
86}
87impl std::fmt::Display for TaskAssignments {
88    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
89        write!(f, "{}", serde_json::to_string(self).unwrap())
90    }
91}
92#[derive(Debug, Serialize, Deserialize)]
93pub struct UninvoicedReportResults {
94    pub results: Vec<UninvoicedReportResult>,
95    pub next_page: Option<i64>,
96    pub links: PaginationLinks,
97    pub total_pages: i64,
98    pub previous_page: Option<i64>,
99    pub per_page: i64,
100    pub total_entries: i64,
101    pub page: i64,
102}
103impl std::fmt::Display for UninvoicedReportResults {
104    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
105        write!(f, "{}", serde_json::to_string(self).unwrap())
106    }
107}
108#[derive(Debug, Serialize, Deserialize, Default)]
109pub struct EstimateMessage {
110    ///Email of the user that created the message.
111    pub sent_by_email: Option<String>,
112    ///Date and time the message was last updated.
113    pub updated_at: Option<String>,
114    ///Array of estimate message recipients.
115    pub recipients: Option<Vec<EstimateMessageRecipient>>,
116    ///The type of estimate event that occurred with the message: send, accept, decline, re-open, view, or invoice.
117    pub event_type: Option<String>,
118    ///Name of the user that the message was sent from.
119    pub sent_from: Option<String>,
120    ///Unique ID for the message.
121    pub id: Option<i64>,
122    ///The message subject.
123    pub subject: Option<String>,
124    ///Whether to email a copy of the message to the current user.
125    pub send_me_a_copy: Option<bool>,
126    ///Email of the user that message was sent from.
127    pub sent_from_email: Option<String>,
128    ///Name of the user that created the message.
129    pub sent_by: Option<String>,
130    ///The message body.
131    pub body: Option<String>,
132    ///Date and time the message was created.
133    pub created_at: Option<String>,
134}
135impl std::fmt::Display for EstimateMessage {
136    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
137        write!(f, "{}", serde_json::to_string(self).unwrap())
138    }
139}
140#[derive(Debug, Serialize, Deserialize)]
141pub struct InvoiceLineItem {
142    ///An object containing the associated project’s id, name, and code.
143    pub project: Option<serde_json::Value>,
144    ///Unique ID for the line item.
145    pub id: Option<i64>,
146    ///The individual price per unit.
147    pub unit_price: Option<f64>,
148    ///Whether the invoice’s tax2 percentage applies to this line item.
149    pub taxed2: Option<bool>,
150    ///The name of an invoice item category.
151    pub kind: Option<String>,
152    ///Text description of the line item.
153    pub description: Option<String>,
154    ///The line item subtotal (quantity * unit_price).
155    pub amount: Option<f64>,
156    ///The unit quantity of the item.
157    pub quantity: Option<f64>,
158    ///Whether the invoice’s tax percentage applies to this line item.
159    pub taxed: Option<bool>,
160}
161impl std::fmt::Display for InvoiceLineItem {
162    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
163        write!(f, "{}", serde_json::to_string(self).unwrap())
164    }
165}
166#[derive(Debug, Serialize, Deserialize, Default)]
167pub struct Client {
168    ///The physical address for the client.
169    pub address: Option<String>,
170    ///Date and time the client was created.
171    pub created_at: Option<String>,
172    ///A textual description of the client.
173    pub name: Option<String>,
174    ///Used to build a URL to your client’s invoice dashboard:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/statements/{STATEMENT_KEY}
175    pub statement_key: Option<String>,
176    ///Date and time the client was last updated.
177    pub updated_at: Option<String>,
178    ///Whether the client is active or archived.
179    pub is_active: Option<bool>,
180    ///The currency code associated with this client.
181    pub currency: Option<String>,
182    ///Unique ID for the client.
183    pub id: Option<i64>,
184}
185impl std::fmt::Display for Client {
186    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
187        write!(f, "{}", serde_json::to_string(self).unwrap())
188    }
189}
190#[derive(Debug, Serialize, Deserialize, Default)]
191pub struct InvoiceMessageSubjectAndBody {
192    pub subject: String,
193    pub invoice_id: i64,
194    pub body: String,
195    pub reminder: bool,
196    pub thank_you: bool,
197}
198impl std::fmt::Display for InvoiceMessageSubjectAndBody {
199    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
200        write!(f, "{}", serde_json::to_string(self).unwrap())
201    }
202}
203#[derive(Debug, Serialize, Deserialize)]
204pub struct TaskAssignment {
205    ///An object containing the id and name of the associated task.
206    pub task: Option<serde_json::Value>,
207    ///Whether the task assignment is active or archived.
208    pub is_active: Option<bool>,
209    ///Budget used when the project’s budget_by is task or task_fees.
210    pub budget: Option<f64>,
211    ///Whether the task assignment is billable or not. For example: if set to true, all time tracked on this project for the associated task will be marked as billable.
212    pub billable: Option<bool>,
213    ///Rate used when the project’s bill_by is Tasks.
214    pub hourly_rate: Option<f64>,
215    ///Date and time the task assignment was last updated.
216    pub updated_at: Option<String>,
217    ///Unique ID for the task assignment.
218    pub id: Option<i64>,
219    ///An object containing the id, name, and code of the associated project.
220    pub project: Option<serde_json::Value>,
221    ///Date and time the task assignment was created.
222    pub created_at: Option<String>,
223}
224impl std::fmt::Display for TaskAssignment {
225    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
226        write!(f, "{}", serde_json::to_string(self).unwrap())
227    }
228}
229#[derive(Debug, Serialize, Deserialize)]
230pub struct Tasks {
231    pub page: i64,
232    pub total_pages: i64,
233    pub previous_page: Option<i64>,
234    pub links: PaginationLinks,
235    pub next_page: Option<i64>,
236    pub per_page: i64,
237    pub total_entries: i64,
238    pub tasks: Vec<Task>,
239}
240impl std::fmt::Display for Tasks {
241    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
242        write!(f, "{}", serde_json::to_string(self).unwrap())
243    }
244}
245#[derive(Debug, Serialize, Deserialize)]
246pub struct Contacts {
247    pub page: i64,
248    pub next_page: Option<i64>,
249    pub links: PaginationLinks,
250    pub per_page: i64,
251    pub total_entries: i64,
252    pub previous_page: Option<i64>,
253    pub contacts: Vec<Contact>,
254    pub total_pages: i64,
255}
256impl std::fmt::Display for Contacts {
257    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
258        write!(f, "{}", serde_json::to_string(self).unwrap())
259    }
260}
261#[derive(Debug, Serialize, Deserialize, Default)]
262pub struct EstimateMessageRecipient {
263    ///Email of the message recipient.
264    pub email: Option<String>,
265    ///Name of the message recipient.
266    pub name: Option<String>,
267}
268impl std::fmt::Display for EstimateMessageRecipient {
269    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
270        write!(f, "{}", serde_json::to_string(self).unwrap())
271    }
272}
273#[derive(Debug, Serialize, Deserialize)]
274pub struct Clients {
275    pub previous_page: Option<i64>,
276    pub page: i64,
277    pub total_pages: i64,
278    pub links: PaginationLinks,
279    pub clients: Vec<Client>,
280    pub next_page: Option<i64>,
281    pub total_entries: i64,
282    pub per_page: i64,
283}
284impl std::fmt::Display for Clients {
285    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
286        write!(f, "{}", serde_json::to_string(self).unwrap())
287    }
288}
289#[derive(Debug, Serialize, Deserialize)]
290pub struct EstimateItemCategories {
291    pub previous_page: Option<i64>,
292    pub total_entries: i64,
293    pub total_pages: i64,
294    pub next_page: Option<i64>,
295    pub links: PaginationLinks,
296    pub per_page: i64,
297    pub estimate_item_categories: Vec<EstimateItemCategory>,
298    pub page: i64,
299}
300impl std::fmt::Display for EstimateItemCategories {
301    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
302        write!(f, "{}", serde_json::to_string(self).unwrap())
303    }
304}
305#[derive(Debug, Serialize, Deserialize)]
306pub struct InvoicePayments {
307    pub links: PaginationLinks,
308    pub total_entries: i64,
309    pub per_page: i64,
310    pub previous_page: Option<i64>,
311    pub page: i64,
312    pub total_pages: i64,
313    pub invoice_payments: Vec<InvoicePayment>,
314    pub next_page: Option<i64>,
315}
316impl std::fmt::Display for InvoicePayments {
317    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
318        write!(f, "{}", serde_json::to_string(self).unwrap())
319    }
320}
321#[derive(Debug, Serialize, Deserialize)]
322pub struct Estimates {
323    pub total_pages: i64,
324    pub next_page: Option<i64>,
325    pub links: PaginationLinks,
326    pub estimates: Vec<Estimate>,
327    pub per_page: i64,
328    pub total_entries: i64,
329    pub page: i64,
330    pub previous_page: Option<i64>,
331}
332impl std::fmt::Display for Estimates {
333    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
334        write!(f, "{}", serde_json::to_string(self).unwrap())
335    }
336}
337#[derive(Debug, Serialize, Deserialize)]
338pub struct Expenses {
339    pub per_page: i64,
340    pub total_entries: i64,
341    pub previous_page: Option<i64>,
342    pub page: i64,
343    pub next_page: Option<i64>,
344    pub links: PaginationLinks,
345    pub total_pages: i64,
346    pub expenses: Vec<Expense>,
347}
348impl std::fmt::Display for Expenses {
349    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
350        write!(f, "{}", serde_json::to_string(self).unwrap())
351    }
352}
353#[derive(Debug, Serialize, Deserialize)]
354pub struct TimeEntries {
355    pub total_pages: i64,
356    pub total_entries: i64,
357    pub per_page: i64,
358    pub previous_page: Option<i64>,
359    pub time_entries: Vec<TimeEntry>,
360    pub next_page: Option<i64>,
361    pub page: i64,
362    pub links: PaginationLinks,
363}
364impl std::fmt::Display for TimeEntries {
365    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
366        write!(f, "{}", serde_json::to_string(self).unwrap())
367    }
368}
369#[derive(Debug, Serialize, Deserialize)]
370pub struct ExpenseReportsResults {
371    pub page: i64,
372    pub total_pages: i64,
373    pub previous_page: Option<i64>,
374    pub results: Vec<ExpenseReportsResult>,
375    pub links: PaginationLinks,
376    pub next_page: Option<i64>,
377    pub total_entries: i64,
378    pub per_page: i64,
379}
380impl std::fmt::Display for ExpenseReportsResults {
381    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
382        write!(f, "{}", serde_json::to_string(self).unwrap())
383    }
384}
385#[derive(Debug, Serialize, Deserialize)]
386pub struct UserAssignment {
387    ///Date and time the user assignment was created.
388    pub created_at: Option<String>,
389    ///Determines which billable rate(s) will be used on the project for this user when bill_by is People. When true, the project will use the user’s default billable rates. When false, the project will use the custom rate defined on this user assignment.
390    pub use_default_rates: Option<bool>,
391    ///Date and time the user assignment was last updated.
392    pub updated_at: Option<String>,
393    ///Unique ID for the user assignment.
394    pub id: Option<i64>,
395    ///An object containing the id and name of the associated user.
396    pub user: Option<serde_json::Value>,
397    ///Whether the user assignment is active or archived.
398    pub is_active: Option<bool>,
399    ///Determines if the user has Project Manager permissions for the project.
400    pub is_project_manager: Option<bool>,
401    ///An object containing the id, name, and code of the associated project.
402    pub project: Option<serde_json::Value>,
403    ///Custom rate used when the project’s bill_by is People and use_default_rates is false.
404    pub hourly_rate: Option<f64>,
405    ///Budget used when the project’s budget_by is person.
406    pub budget: Option<f64>,
407}
408impl std::fmt::Display for UserAssignment {
409    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
410        write!(f, "{}", serde_json::to_string(self).unwrap())
411    }
412}
413#[derive(Debug, Serialize, Deserialize, Default)]
414pub struct BillableRate {
415    ///The date the billable rate is no longer effective. This date is calculated by Harvest.
416    pub end_date: Option<String>,
417    ///Date and time the billable rate was last updated.
418    pub updated_at: Option<String>,
419    ///Date and time the billable rate was created.
420    pub created_at: Option<String>,
421    ///Unique ID for the billable rate.
422    pub id: Option<i64>,
423    ///The date the billable rate is effective.
424    pub start_date: Option<String>,
425    ///The amount of the billable rate.
426    pub amount: Option<f64>,
427}
428impl std::fmt::Display for BillableRate {
429    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
430        write!(f, "{}", serde_json::to_string(self).unwrap())
431    }
432}
433#[derive(Debug, Serialize, Deserialize)]
434pub struct Projects {
435    pub page: i64,
436    pub total_pages: i64,
437    pub next_page: Option<i64>,
438    pub projects: Vec<Project>,
439    pub per_page: i64,
440    pub total_entries: i64,
441    pub previous_page: Option<i64>,
442    pub links: PaginationLinks,
443}
444impl std::fmt::Display for Projects {
445    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
446        write!(f, "{}", serde_json::to_string(self).unwrap())
447    }
448}
449#[derive(Debug, Serialize, Deserialize)]
450pub struct Teammates {
451    pub per_page: i64,
452    pub page: i64,
453    pub teammates: Vec<Teammate>,
454    pub total_pages: i64,
455    pub links: PaginationLinks,
456    pub next_page: Option<i64>,
457    pub previous_page: Option<i64>,
458    pub total_entries: i64,
459}
460impl std::fmt::Display for Teammates {
461    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
462        write!(f, "{}", serde_json::to_string(self).unwrap())
463    }
464}
465#[derive(Debug, Serialize, Deserialize)]
466pub struct Roles {
467    pub roles: Vec<Role>,
468    pub previous_page: Option<i64>,
469    pub page: i64,
470    pub total_pages: i64,
471    pub total_entries: i64,
472    pub next_page: Option<i64>,
473    pub per_page: i64,
474    pub links: PaginationLinks,
475}
476impl std::fmt::Display for Roles {
477    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
478        write!(f, "{}", serde_json::to_string(self).unwrap())
479    }
480}
481#[derive(Debug, Serialize, Deserialize)]
482pub struct Companies {
483    pub per_page: i64,
484    pub total_pages: i64,
485    pub links: PaginationLinks,
486    pub next_page: Option<i64>,
487    pub page: i64,
488    pub companies: Vec<Company>,
489    pub total_entries: i64,
490    pub previous_page: Option<i64>,
491}
492impl std::fmt::Display for Companies {
493    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
494        write!(f, "{}", serde_json::to_string(self).unwrap())
495    }
496}
497#[derive(Debug, Serialize, Deserialize, Default)]
498pub struct Role {
499    ///The name of the role.
500    pub name: Option<String>,
501    ///The IDs of the users assigned to this role.
502    pub user_ids: Option<Vec<i64>>,
503    ///Date and time the role was created.
504    pub created_at: Option<String>,
505    ///Date and time the role was last updated.
506    pub updated_at: Option<String>,
507    ///Unique ID for the role.
508    pub id: Option<i64>,
509}
510impl std::fmt::Display for Role {
511    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
512        write!(f, "{}", serde_json::to_string(self).unwrap())
513    }
514}
515#[derive(Debug, Serialize, Deserialize)]
516pub struct InvoiceMessageRecipients {
517    pub total_pages: i64,
518    pub next_page: Option<i64>,
519    pub previous_page: Option<i64>,
520    pub page: i64,
521    pub invoice_message_recipients: Vec<InvoiceMessageRecipient>,
522    pub total_entries: i64,
523    pub links: PaginationLinks,
524    pub per_page: i64,
525}
526impl std::fmt::Display for InvoiceMessageRecipients {
527    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
528        write!(f, "{}", serde_json::to_string(self).unwrap())
529    }
530}
531#[derive(Debug, Serialize, Deserialize)]
532pub struct Invoices {
533    pub invoices: Vec<Invoice>,
534    pub total_entries: i64,
535    pub page: i64,
536    pub per_page: i64,
537    pub links: PaginationLinks,
538    pub next_page: Option<i64>,
539    pub previous_page: Option<i64>,
540    pub total_pages: i64,
541}
542impl std::fmt::Display for Invoices {
543    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
544        write!(f, "{}", serde_json::to_string(self).unwrap())
545    }
546}
547#[derive(Debug, Serialize, Deserialize, Default)]
548pub struct ExpenseCategory {
549    ///Date and time the expense category was last updated.
550    pub updated_at: Option<String>,
551    ///The name of the expense category.
552    pub name: Option<String>,
553    ///The unit price of the expense category.
554    pub unit_price: Option<f64>,
555    ///Date and time the expense category was created.
556    pub created_at: Option<String>,
557    ///Unique ID for the expense category.
558    pub id: Option<i64>,
559    ///The unit name of the expense category.
560    pub unit_name: Option<String>,
561    ///Whether the expense category is active or archived.
562    pub is_active: Option<bool>,
563}
564impl std::fmt::Display for ExpenseCategory {
565    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
566        write!(f, "{}", serde_json::to_string(self).unwrap())
567    }
568}
569#[derive(Debug, Serialize, Deserialize, Default)]
570pub struct InvoiceMessageRecipient {
571    ///Name of the message recipient.
572    pub name: Option<String>,
573    ///Email of the message recipient.
574    pub email: Option<String>,
575}
576impl std::fmt::Display for InvoiceMessageRecipient {
577    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
578        write!(f, "{}", serde_json::to_string(self).unwrap())
579    }
580}
581#[derive(Debug, Serialize, Deserialize)]
582pub struct TimeReportsResults {
583    pub total_entries: i64,
584    pub page: i64,
585    pub next_page: Option<i64>,
586    pub per_page: i64,
587    pub links: PaginationLinks,
588    pub previous_page: Option<i64>,
589    pub results: Vec<TimeReportsResult>,
590    pub total_pages: i64,
591}
592impl std::fmt::Display for TimeReportsResults {
593    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
594        write!(f, "{}", serde_json::to_string(self).unwrap())
595    }
596}
597#[derive(Debug, Serialize, Deserialize, Default)]
598pub struct Company {
599    ///Symbol used when formatting decimals.
600    pub decimal_symbol: Option<String>,
601    ///The Harvest URL for the company.
602    pub base_uri: Option<String>,
603    ///The type of plan the company is on. Examples: trial, free, or simple-v4
604    pub plan_type: Option<String>,
605    ///Whether the expense module is enabled.
606    pub expense_feature: Option<bool>,
607    ///Whether the company is active or archived.
608    pub is_active: Option<bool>,
609    ///The format used to display time in Harvest. Returns either decimal or hours_minutes.
610    pub time_format: Option<String>,
611    ///The color scheme being used in the Harvest web client.
612    pub color_scheme: Option<String>,
613    ///The weekly capacity in seconds.
614    pub weekly_capacity: Option<i64>,
615    ///The name of the company.
616    pub name: Option<String>,
617    ///The weekday used as the start of the week. Returns one of: Saturday, Sunday, or Monday.
618    pub week_start_day: Option<String>,
619    ///Separator used when formatting numbers.
620    pub thousands_separator: Option<String>,
621    ///Whether the invoice module is enabled.
622    pub invoice_feature: Option<bool>,
623    ///Whether the estimate module is enabled.
624    pub estimate_feature: Option<bool>,
625    ///Used to represent whether the company is using a 12-hour or 24-hour clock. Returns either 12h or 24h.
626    pub clock: Option<String>,
627    ///Whether time is tracked via duration or start and end times.
628    pub wants_timestamp_timers: Option<bool>,
629    ///The Harvest domain for the company.
630    pub full_domain: Option<String>,
631    ///How to display the currency code when formatting currency. Returns one of: iso_code_none, iso_code_before, or iso_code_after.
632    pub currency_code_display: Option<String>,
633    ///How to display the currency symbol when formatting currency. Returns one of: symbol_none, symbol_before, or symbol_after.
634    pub currency_symbol_display: Option<String>,
635    ///Whether the approval module is enabled.
636    pub approval_feature: Option<bool>,
637    ///The format used to display date in Harvest. Returns one of: %m/%d/%Y, %d/%m/%Y, %Y-%m-%d, %d.%m.%Y,.%Y.%m.%d or %Y/%m/%d.
638    pub date_format: Option<String>,
639}
640impl std::fmt::Display for Company {
641    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
642        write!(f, "{}", serde_json::to_string(self).unwrap())
643    }
644}
645#[derive(Debug, Serialize, Deserialize)]
646pub struct Contact {
647    ///The last name of the contact.
648    pub last_name: Option<String>,
649    ///The title of the contact.
650    pub title: Option<String>,
651    ///The contact’s office phone number.
652    pub phone_office: Option<String>,
653    ///The contact’s mobile phone number.
654    pub phone_mobile: Option<String>,
655    ///An object containing the contact’s client id and name.
656    pub client: Option<serde_json::Value>,
657    ///Date and time the contact was last updated.
658    pub updated_at: Option<String>,
659    ///The first name of the contact.
660    pub first_name: Option<String>,
661    ///The contact’s fax number.
662    pub fax: Option<String>,
663    ///Date and time the contact was created.
664    pub created_at: Option<String>,
665    ///The contact’s email address.
666    pub email: Option<String>,
667    ///Unique ID for the contact.
668    pub id: Option<i64>,
669}
670impl std::fmt::Display for Contact {
671    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
672        write!(f, "{}", serde_json::to_string(self).unwrap())
673    }
674}
675#[derive(Debug, Serialize, Deserialize, Default)]
676pub struct ProjectBudgetReportResult {
677    ///The total hours or money spent against the project’s budget. If Time Rounding is turned on, the hours will be rounded according to your settings. If the project is budgeted by money, this value will only be visible to Administrators and Project Managers with the View billable rates and amounts permission.
678    pub budget_spent: Option<f64>,
679    ///The ID of the client associated with this project.
680    pub client_id: Option<i64>,
681    ///The method by which the project is budgeted. Options: project (Hours Per Project), project_cost (Total Project Fees), task (Hours Per Task), task_fees (Fees Per Task), person (Hours Per Person), none (No Budget).
682    pub budget_by: Option<String>,
683    ///The budget in hours or money for the project when budgeting by time. If the project is budgeted by money, this value will only be visible to Administrators and Project Managers with the View billable rates and amounts permission.
684    pub budget: Option<f64>,
685    ///The name of the project.
686    pub project_name: Option<String>,
687    ///Whether the budget is reset every month.
688    pub budget_is_monthly: Option<bool>,
689    ///The total hours or money remaining in the project’s budget. If Time Rounding is turned on, the hours will be rounded according to your settings. If the project is budgeted by money, this value will only be visible to Administrators and Project Managers with the View billable rates and amounts permission.
690    pub budget_remaining: Option<f64>,
691    ///Whether the project is active or archived.
692    pub is_active: Option<bool>,
693    ///The name of the client associated with this project.
694    pub client_name: Option<String>,
695    ///The ID of the project.
696    pub project_id: Option<i64>,
697}
698impl std::fmt::Display for ProjectBudgetReportResult {
699    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
700        write!(f, "{}", serde_json::to_string(self).unwrap())
701    }
702}
703#[derive(Debug, Serialize, Deserialize)]
704pub struct EstimateMessages {
705    pub next_page: Option<i64>,
706    pub previous_page: Option<i64>,
707    pub page: i64,
708    pub per_page: i64,
709    pub links: PaginationLinks,
710    pub estimate_messages: Vec<EstimateMessage>,
711    pub total_entries: i64,
712    pub total_pages: i64,
713}
714impl std::fmt::Display for EstimateMessages {
715    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
716        write!(f, "{}", serde_json::to_string(self).unwrap())
717    }
718}
719#[derive(Debug, Serialize, Deserialize, Default)]
720pub struct Error {
721    pub message: Option<String>,
722    pub code: Option<i64>,
723}
724impl std::fmt::Display for Error {
725    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
726        write!(f, "{}", serde_json::to_string(self).unwrap())
727    }
728}
729#[derive(Debug, Serialize, Deserialize)]
730pub struct InvoiceMessages {
731    pub total_pages: i64,
732    pub per_page: i64,
733    pub page: i64,
734    pub links: PaginationLinks,
735    pub next_page: Option<i64>,
736    pub previous_page: Option<i64>,
737    pub invoice_messages: Vec<InvoiceMessage>,
738    pub total_entries: i64,
739}
740impl std::fmt::Display for InvoiceMessages {
741    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
742        write!(f, "{}", serde_json::to_string(self).unwrap())
743    }
744}
745#[derive(Debug, Serialize, Deserialize)]
746pub struct UserAssignments {
747    pub page: i64,
748    pub links: PaginationLinks,
749    pub per_page: i64,
750    pub total_entries: i64,
751    pub previous_page: Option<i64>,
752    pub next_page: Option<i64>,
753    pub user_assignments: Vec<UserAssignment>,
754    pub total_pages: i64,
755}
756impl std::fmt::Display for UserAssignments {
757    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
758        write!(f, "{}", serde_json::to_string(self).unwrap())
759    }
760}
761#[derive(Debug, Serialize, Deserialize, Default)]
762pub struct EstimateLineItem {
763    ///The unit quantity of the item.
764    pub quantity: Option<f64>,
765    ///Whether the estimate’s tax2 percentage applies to this line item.
766    pub taxed2: Option<bool>,
767    ///Unique ID for the line item.
768    pub id: Option<i64>,
769    ///The individual price per unit.
770    pub unit_price: Option<f64>,
771    ///The name of an estimate item category.
772    pub kind: Option<String>,
773    ///Text description of the line item.
774    pub description: Option<String>,
775    ///The line item subtotal (quantity * unit_price).
776    pub amount: Option<f64>,
777    ///Whether the estimate’s tax percentage applies to this line item.
778    pub taxed: Option<bool>,
779}
780impl std::fmt::Display for EstimateLineItem {
781    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
782        write!(f, "{}", serde_json::to_string(self).unwrap())
783    }
784}
785#[derive(Debug, Serialize, Deserialize)]
786pub struct Teammate {
787    ///The first name of the teammate
788    pub first_name: Option<String>,
789    ///Unique ID for the teammate
790    pub id: Option<serde_json::Value>,
791    ///The last name of the teammate
792    pub last_name: Option<String>,
793    ///The email of the teammate
794    pub email: Option<String>,
795}
796impl std::fmt::Display for Teammate {
797    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
798        write!(f, "{}", serde_json::to_string(self).unwrap())
799    }
800}
801#[derive(Debug, Serialize, Deserialize)]
802pub struct ProjectAssignment {
803    ///Date and time the project assignment was last updated.
804    pub updated_at: Option<String>,
805    ///Determines if the user has Project Manager permissions for the project.
806    pub is_project_manager: Option<bool>,
807    ///Determines which billable rate(s) will be used on the project for this user when bill_by is People. When true, the project will use the user’s default billable rates. When false, the project will use the custom rate defined on this user assignment.
808    pub use_default_rates: Option<bool>,
809    ///Budget used when the project’s budget_by is person.
810    pub budget: Option<f64>,
811    ///Date and time the project assignment was created.
812    pub created_at: Option<String>,
813    ///An object containing the assigned project id, name, and code.
814    pub project: Option<serde_json::Value>,
815    ///An object containing the project’s client id and name.
816    pub client: Option<serde_json::Value>,
817    ///Array of task assignment objects associated with the project.
818    pub task_assignments: Option<Vec<TaskAssignment>>,
819    ///Custom rate used when the project’s bill_by is People and use_default_rates is false.
820    pub hourly_rate: Option<f64>,
821    ///Unique ID for the project assignment.
822    pub id: Option<i64>,
823    ///Whether the project assignment is active or archived.
824    pub is_active: Option<bool>,
825}
826impl std::fmt::Display for ProjectAssignment {
827    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
828        write!(f, "{}", serde_json::to_string(self).unwrap())
829    }
830}
831#[derive(Debug, Serialize, Deserialize, Default)]
832pub struct TeammatesPatchResponse {
833    pub teammates: Vec<Teammate>,
834}
835impl std::fmt::Display for TeammatesPatchResponse {
836    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
837        write!(f, "{}", serde_json::to_string(self).unwrap())
838    }
839}
840#[derive(Debug, Serialize, Deserialize, Default)]
841pub struct InvoiceItemCategory {
842    ///Unique ID for the invoice item category.
843    pub id: Option<i64>,
844    ///Whether this invoice item category is used for billable hours when generating an invoice.
845    pub use_as_service: Option<bool>,
846    ///Date and time the invoice item category was created.
847    pub created_at: Option<String>,
848    ///The name of the invoice item category.
849    pub name: Option<String>,
850    ///Whether this invoice item category is used for expenses when generating an invoice.
851    pub use_as_expense: Option<bool>,
852    ///Date and time the invoice item category was last updated.
853    pub updated_at: Option<String>,
854}
855impl std::fmt::Display for InvoiceItemCategory {
856    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
857        write!(f, "{}", serde_json::to_string(self).unwrap())
858    }
859}
860#[derive(Debug, Serialize, Deserialize)]
861pub struct Project {
862    ///The method by which the project is budgeted.
863    pub budget_by: Option<String>,
864    ///Whether the project is billable or not.
865    pub is_billable: Option<bool>,
866    ///Option to have the budget reset every month.
867    pub budget_is_monthly: Option<bool>,
868    ///Date the project was started.
869    pub starts_on: Option<String>,
870    ///Date and time the project was created.
871    pub created_at: Option<String>,
872    ///Whether the project is a fixed-fee project or not.
873    pub is_fixed_fee: Option<bool>,
874    ///Whether Project Managers should be notified when the project goes over budget.
875    pub notify_when_over_budget: Option<bool>,
876    ///The method by which the project is invoiced.
877    pub bill_by: Option<String>,
878    ///Percentage value used to trigger over budget email alerts.
879    pub over_budget_notification_percentage: Option<f64>,
880    ///The amount you plan to invoice for the project. Only used by fixed-fee projects.
881    pub fee: Option<f64>,
882    ///Option for budget of Total Project Fees projects to include tracked expenses.
883    pub cost_budget_include_expenses: Option<bool>,
884    ///The monetary budget for the project when budgeting by money.
885    pub cost_budget: Option<f64>,
886    ///Option to show project budget to all employees. Does not apply to Total Project Fee projects.
887    pub show_budget_to_all: Option<bool>,
888    ///Project notes.
889    pub notes: Option<String>,
890    ///Whether the project is active or archived.
891    pub is_active: Option<bool>,
892    ///An object containing the project’s client id, name, and currency.
893    pub client: Option<serde_json::Value>,
894    ///Rate for projects billed by Project Hourly Rate.
895    pub hourly_rate: Option<f64>,
896    ///The budget in hours for the project when budgeting by time.
897    pub budget: Option<f64>,
898    ///Date the project will end.
899    pub ends_on: Option<String>,
900    ///Date and time the project was last updated.
901    pub updated_at: Option<String>,
902    ///Unique ID for the project.
903    pub id: Option<i64>,
904    ///Date of last over budget notification. If none have been sent, this will be null.
905    pub over_budget_notification_date: Option<String>,
906    ///Unique name for the project.
907    pub name: Option<String>,
908    ///The code associated with the project.
909    pub code: Option<String>,
910}
911impl std::fmt::Display for Project {
912    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
913        write!(f, "{}", serde_json::to_string(self).unwrap())
914    }
915}
916#[derive(Debug, Serialize, Deserialize)]
917pub struct EstimateMessageRecipients {
918    pub page: i64,
919    pub links: PaginationLinks,
920    pub estimate_message_recipients: Vec<EstimateMessageRecipient>,
921    pub total_pages: i64,
922    pub per_page: i64,
923    pub total_entries: i64,
924    pub previous_page: Option<i64>,
925    pub next_page: Option<i64>,
926}
927impl std::fmt::Display for EstimateMessageRecipients {
928    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
929        write!(f, "{}", serde_json::to_string(self).unwrap())
930    }
931}
932#[derive(Debug, Serialize, Deserialize)]
933pub struct InvoicePayment {
934    ///The email of the person who recorded the payment.
935    pub recorded_by_email: Option<String>,
936    ///The payment gateway id and name used to process the payment.
937    pub payment_gateway: Option<serde_json::Value>,
938    ///Date and time the payment was made.
939    pub paid_at: Option<String>,
940    ///Date and time the payment was recorded.
941    pub created_at: Option<String>,
942    ///Date the payment was made.
943    pub paid_date: Option<String>,
944    ///The name of the person who recorded the payment.
945    pub recorded_by: Option<String>,
946    ///Date and time the payment was last updated.
947    pub updated_at: Option<String>,
948    ///Unique ID for the payment.
949    pub id: Option<i64>,
950    ///Any notes associated with the payment.
951    pub notes: Option<String>,
952    ///The amount of the payment.
953    pub amount: Option<f64>,
954    ///Either the card authorization or PayPal transaction ID.
955    pub transaction_id: Option<String>,
956}
957impl std::fmt::Display for InvoicePayment {
958    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
959        write!(f, "{}", serde_json::to_string(self).unwrap())
960    }
961}
962#[derive(Debug, Serialize, Deserialize, Default)]
963pub struct InvoiceMessage {
964    ///Whether this is a thank you message.
965    pub thank_you: Option<bool>,
966    ///Date and time the message was created.
967    pub created_at: Option<String>,
968    ///Email of the user that message was sent from.
969    pub sent_from_email: Option<String>,
970    ///Unique ID for the message.
971    pub id: Option<i64>,
972    ///Whether to email a copy of the message to the current user.
973    pub send_me_a_copy: Option<bool>,
974    ///The type of invoice event that occurred with the message: send, close, draft, re-open, or view.
975    pub event_type: Option<String>,
976    ///Whether to include a link to the client invoice in the message body. Not used when thank_you is true.
977    pub include_link_to_client_invoice: Option<bool>,
978    ///Email of the user that created the message.
979    pub sent_by_email: Option<String>,
980    ///Name of the user that the message was sent from.
981    pub sent_from: Option<String>,
982    ///Array of invoice message recipients.
983    pub recipients: Option<Vec<InvoiceMessageRecipient>>,
984    ///The message subject.
985    pub subject: Option<String>,
986    ///Whether this is a reminder message.
987    pub reminder: Option<bool>,
988    ///The message body.
989    pub body: Option<String>,
990    ///Whether to attach the invoice PDF to the message email.
991    pub attach_pdf: Option<bool>,
992    ///The date the reminder email will be sent.
993    pub send_reminder_on: Option<String>,
994    ///Name of the user that created the message.
995    pub sent_by: Option<String>,
996    ///Date and time the message was last updated.
997    pub updated_at: Option<String>,
998}
999impl std::fmt::Display for InvoiceMessage {
1000    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1001        write!(f, "{}", serde_json::to_string(self).unwrap())
1002    }
1003}
1004#[derive(Debug, Serialize, Deserialize)]
1005pub struct TimeEntry {
1006    ///An object containing the id and name of the associated task.
1007    pub task: Option<serde_json::Value>,
1008    pub task_assignment: Option<TaskAssignment>,
1009    pub user_assignment: Option<UserAssignment>,
1010    ///Notes attached to the time entry.
1011    pub notes: Option<String>,
1012    ///An object containing the id and name of the associated user.
1013    pub user: Option<serde_json::Value>,
1014    ///An object containing the id, group_id, account_id, permalink, service, and service_icon_url of the associated external reference.
1015    pub external_reference: Option<serde_json::Value>,
1016    ///Number of (decimal time) hours tracked in this time entry.
1017    pub hours: Option<f64>,
1018    ///An object containing the id and name of the associated client.
1019    pub client: Option<serde_json::Value>,
1020    ///The billable rate for the time entry.
1021    pub billable_rate: Option<f64>,
1022    ///Date and time the time entry was last updated. Use the ISO 8601 Format.
1023    pub updated_at: Option<String>,
1024    ///Whether or not the time entry counts towards the project budget.
1025    pub budgeted: Option<bool>,
1026    ///Why the time entry has been locked.
1027    pub locked_reason: Option<String>,
1028    ///Date and time the time entry was created. Use the ISO 8601 Format.
1029    pub created_at: Option<String>,
1030    ///Unique ID for the time entry.
1031    pub id: Option<i64>,
1032    ///Whether or not the time entry has been marked as invoiced.
1033    pub is_billed: Option<bool>,
1034    ///Time the time entry was started (if tracking by start/end times).
1035    pub started_time: Option<String>,
1036    ///Time the time entry was ended (if tracking by start/end times).
1037    pub ended_time: Option<String>,
1038    ///Whether or not the time entry is billable.
1039    pub billable: Option<bool>,
1040    ///Number of (decimal time) hours already tracked in this time entry, before the timer was last started.
1041    pub hours_without_timer: Option<f64>,
1042    ///Whether or not the time entry has been approved via Timesheet Approval.
1043    pub is_closed: Option<bool>,
1044    ///Date and time the timer was started (if tracking by duration). Use the ISO 8601 Format.
1045    pub timer_started_at: Option<String>,
1046    ///Whether or not the time entry is currently running.
1047    pub is_running: Option<bool>,
1048    ///Number of (decimal time) hours tracked in this time entry used in summary reports and invoices. This value is rounded according to the Time Rounding setting in your Preferences.
1049    pub rounded_hours: Option<f64>,
1050    ///Whether or not the time entry has been locked.
1051    pub is_locked: Option<bool>,
1052    ///Date of the time entry.
1053    pub spent_date: Option<String>,
1054    ///Once the time entry has been invoiced, this field will include the associated invoice’s id and number.
1055    pub invoice: Option<serde_json::Value>,
1056    ///The cost rate for the time entry.
1057    pub cost_rate: Option<f64>,
1058    ///An object containing the id and name of the associated project.
1059    pub project: Option<serde_json::Value>,
1060}
1061impl std::fmt::Display for TimeEntry {
1062    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1063        write!(f, "{}", serde_json::to_string(self).unwrap())
1064    }
1065}
1066#[derive(Debug, Serialize, Deserialize, Default)]
1067pub struct CostRate {
1068    ///Date and time the cost rate was created.
1069    pub created_at: Option<String>,
1070    ///Date and time the cost rate was last updated.
1071    pub updated_at: Option<String>,
1072    ///The date the cost rate is effective.
1073    pub start_date: Option<String>,
1074    ///Unique ID for the cost rate.
1075    pub id: Option<i64>,
1076    ///The date the cost rate is no longer effective. This date is calculated by Harvest.
1077    pub end_date: Option<String>,
1078    ///The amount of the cost rate.
1079    pub amount: Option<f64>,
1080}
1081impl std::fmt::Display for CostRate {
1082    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1083        write!(f, "{}", serde_json::to_string(self).unwrap())
1084    }
1085}
1086#[derive(Debug, Serialize, Deserialize)]
1087pub struct ExpenseCategories {
1088    pub page: i64,
1089    pub next_page: Option<i64>,
1090    pub total_entries: i64,
1091    pub total_pages: i64,
1092    pub per_page: i64,
1093    pub previous_page: Option<i64>,
1094    pub links: PaginationLinks,
1095    pub expense_categories: Vec<ExpenseCategory>,
1096}
1097impl std::fmt::Display for ExpenseCategories {
1098    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1099        write!(f, "{}", serde_json::to_string(self).unwrap())
1100    }
1101}
1102#[derive(Debug, Serialize, Deserialize)]
1103pub struct CostRates {
1104    pub per_page: i64,
1105    pub total_pages: i64,
1106    pub previous_page: Option<i64>,
1107    pub total_entries: i64,
1108    pub links: PaginationLinks,
1109    pub page: i64,
1110    pub next_page: Option<i64>,
1111    pub cost_rates: Vec<CostRate>,
1112}
1113impl std::fmt::Display for CostRates {
1114    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1115        write!(f, "{}", serde_json::to_string(self).unwrap())
1116    }
1117}
1118#[derive(Debug, Serialize, Deserialize)]
1119pub struct InvoiceItemCategories {
1120    pub total_entries: i64,
1121    pub previous_page: Option<i64>,
1122    pub per_page: i64,
1123    pub page: i64,
1124    pub invoice_item_categories: Vec<InvoiceItemCategory>,
1125    pub next_page: Option<i64>,
1126    pub links: PaginationLinks,
1127    pub total_pages: i64,
1128}
1129impl std::fmt::Display for InvoiceItemCategories {
1130    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1131        write!(f, "{}", serde_json::to_string(self).unwrap())
1132    }
1133}
1134#[derive(Debug, Serialize, Deserialize)]
1135pub struct Estimate {
1136    ///Any additional notes included on the estimate.
1137    pub notes: Option<String>,
1138    ///If no value is set, the number will be automatically generated.
1139    pub number: Option<String>,
1140    ///An object containing estimate’s client id and name.
1141    pub client: Option<serde_json::Value>,
1142    ///The currency code associated with this estimate.
1143    pub currency: Option<String>,
1144    ///The purchase order number.
1145    pub purchase_order: Option<String>,
1146    ///The estimate subject.
1147    pub subject: Option<String>,
1148    ///The current state of the estimate: draft, sent, accepted, or declined.
1149    pub state: Option<String>,
1150    ///Date and time the estimate was sent.
1151    pub sent_at: Option<String>,
1152    ///Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/estimates/abc123456
1153    pub client_key: Option<String>,
1154    ///An object containing the id and name of the person that created the estimate.
1155    pub creator: Option<serde_json::Value>,
1156    ///This percentage is applied to the subtotal, including line items and discounts.
1157    pub tax2: Option<f64>,
1158    ///The amount calculated from tax2.
1159    pub tax2_amount: Option<f64>,
1160    ///This percentage is subtracted from the subtotal.
1161    pub discount: Option<f64>,
1162    ///The amount calcuated from discount.
1163    pub discount_amount: Option<f64>,
1164    ///Date and time the estimate was accepted.
1165    pub accepted_at: Option<String>,
1166    ///Date and time the estimate was last updated.
1167    pub updated_at: Option<String>,
1168    ///Date and time the estimate was created.
1169    pub created_at: Option<String>,
1170    ///Unique ID for the estimate.
1171    pub id: Option<i64>,
1172    ///The first amount of tax included, calculated from tax. If no tax is defined, this value will be null.
1173    pub tax_amount: Option<f64>,
1174    ///Date the estimate was issued.
1175    pub issue_date: Option<String>,
1176    ///Date and time the estimate was declined.
1177    pub declined_at: Option<String>,
1178    ///The total amount for the estimate, including any discounts and taxes.
1179    pub amount: Option<f64>,
1180    ///Array of estimate line items.
1181    pub line_items: Option<Vec<EstimateLineItem>>,
1182    ///This percentage is applied to the subtotal, including line items and discounts.
1183    pub tax: Option<f64>,
1184}
1185impl std::fmt::Display for Estimate {
1186    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1187        write!(f, "{}", serde_json::to_string(self).unwrap())
1188    }
1189}
1190#[derive(Debug, Serialize, Deserialize)]
1191pub struct InvoiceLineItems {
1192    pub per_page: i64,
1193    pub total_entries: i64,
1194    pub links: PaginationLinks,
1195    pub invoice_line_items: Vec<InvoiceLineItem>,
1196    pub page: i64,
1197    pub total_pages: i64,
1198    pub next_page: Option<i64>,
1199    pub previous_page: Option<i64>,
1200}
1201impl std::fmt::Display for InvoiceLineItems {
1202    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1203        write!(f, "{}", serde_json::to_string(self).unwrap())
1204    }
1205}
1206#[derive(Debug, Serialize, Deserialize)]
1207pub struct EstimateLineItems {
1208    pub estimate_line_items: Vec<EstimateLineItem>,
1209    pub per_page: i64,
1210    pub next_page: Option<i64>,
1211    pub total_pages: i64,
1212    pub previous_page: Option<i64>,
1213    pub page: i64,
1214    pub total_entries: i64,
1215    pub links: PaginationLinks,
1216}
1217impl std::fmt::Display for EstimateLineItems {
1218    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1219        write!(f, "{}", serde_json::to_string(self).unwrap())
1220    }
1221}
1222#[derive(Debug, Serialize, Deserialize)]
1223pub struct ProjectBudgetReportResults {
1224    pub total_pages: i64,
1225    pub results: Vec<ProjectBudgetReportResult>,
1226    pub next_page: Option<i64>,
1227    pub per_page: i64,
1228    pub total_entries: i64,
1229    pub previous_page: Option<i64>,
1230    pub page: i64,
1231    pub links: PaginationLinks,
1232}
1233impl std::fmt::Display for ProjectBudgetReportResults {
1234    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1235        write!(f, "{}", serde_json::to_string(self).unwrap())
1236    }
1237}
1238#[derive(Debug, Serialize, Deserialize, Default)]
1239pub struct EstimateItemCategory {
1240    ///Unique ID for the estimate item category.
1241    pub id: Option<i64>,
1242    ///Date and time the estimate item category was created.
1243    pub created_at: Option<String>,
1244    ///Date and time the estimate item category was last updated.
1245    pub updated_at: Option<String>,
1246    ///The name of the estimate item category.
1247    pub name: Option<String>,
1248}
1249impl std::fmt::Display for EstimateItemCategory {
1250    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1251        write!(f, "{}", serde_json::to_string(self).unwrap())
1252    }
1253}
1254#[derive(Debug, Serialize, Deserialize, Default)]
1255pub struct Task {
1256    ///Whether this task should be automatically added to future projects.
1257    pub is_default: Option<bool>,
1258    ///Used in determining whether default tasks should be marked billable when creating a new project.
1259    pub billable_by_default: Option<bool>,
1260    ///The hourly rate to use for this task when it is added to a project.
1261    pub default_hourly_rate: Option<f64>,
1262    ///Whether this task is active or archived.
1263    pub is_active: Option<bool>,
1264    ///Date and time the task was created.
1265    pub created_at: Option<String>,
1266    ///Date and time the task was last updated.
1267    pub updated_at: Option<String>,
1268    ///The name of the task.
1269    pub name: Option<String>,
1270    ///Unique ID for the task.
1271    pub id: Option<i64>,
1272}
1273impl std::fmt::Display for Task {
1274    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1275        write!(f, "{}", serde_json::to_string(self).unwrap())
1276    }
1277}
1278#[derive(Debug, Serialize, Deserialize, Default)]
1279pub struct ExpenseReportsResult {
1280    ///The name of the client associated with the reported expenses. Only returned in the Client and Project reports.
1281    pub client_name: Option<String>,
1282    ///The name of the user associated with the reported expenses. Only returned in the Team report.
1283    pub user_name: Option<String>,
1284    ///The currency code associated with the expenses for this result.
1285    pub currency: Option<String>,
1286    ///The totaled cost for billable expenses for the given timeframe, subject (client, project, expense category, or user), and currency.
1287    pub billable_amount: Option<f64>,
1288    ///The ID of the expense category associated with the reported expenses. Only returned in the Expense Category report.
1289    pub expense_category_id: Option<i64>,
1290    ///The ID of the project associated with the reported expenses. Only returned in the Client and Project reports.
1291    pub project_id: Option<i64>,
1292    ///The contractor status of the user associated with the reported expenses. Only returned in the Team report.
1293    pub is_contractor: Option<bool>,
1294    ///The name of the project associated with the reported expenses. Only returned in the Client and Project reports.
1295    pub project_name: Option<String>,
1296    ///The name of the expense category associated with the reported expenses. Only returned in the Expense Category report.
1297    pub expense_category_name: Option<String>,
1298    ///The ID of the user associated with the reported expenses. Only returned in the Team report.
1299    pub user_id: Option<i64>,
1300    ///The ID of the client associated with the reported expenses. Only returned in the Client and Project reports.
1301    pub client_id: Option<i64>,
1302    ///The totaled cost for all expenses for the given timeframe, subject (client, project, expense category, or user), and currency.
1303    pub total_amount: Option<f64>,
1304}
1305impl std::fmt::Display for ExpenseReportsResult {
1306    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1307        write!(f, "{}", serde_json::to_string(self).unwrap())
1308    }
1309}
1310#[derive(Debug, Serialize, Deserialize, Default)]
1311pub struct TimeReportsResult {
1312    ///The ID of the client associated with the reported hours. Only returned in the Client and Project reports.
1313    pub client_id: Option<i64>,
1314    ///The ID of the task associated with the reported hours. Only returned in the Task report.
1315    pub task_id: Option<i64>,
1316    ///The ID of the user associated with the reported hours. Only returned in the Team report.
1317    pub user_id: Option<i64>,
1318    ///The name of the task associated with the reported hours. Only returned in the Task report.
1319    pub task_name: Option<String>,
1320    ///The name of the user associated with the reported hours. Only returned in the Team report.
1321    pub user_name: Option<String>,
1322    ///The totaled billable hours for the given timeframe, subject (client, project, task, or user), and currency. If Time Rounding is turned on, the hours will be rounded according to your settings.
1323    pub billable_hours: Option<f64>,
1324    ///The totaled billable amount for the billable hours above. Only visible to Administrators and Project Managers with the View billable rates and amounts permission.
1325    pub billable_amount: Option<f64>,
1326    ///The name of the project associated with the reported hours. Only returned in the Client and Project reports.
1327    pub project_name: Option<String>,
1328    ///The ID of the project associated with the reported hours. Only returned in the Client and Project reports.
1329    pub project_id: Option<i64>,
1330    ///The name of the client associated with the reported hours. Only returned in the Client and Project reports.
1331    pub client_name: Option<String>,
1332    ///The contractor status of the user associated with the reported hours. Only returned in the Team report.
1333    pub is_contractor: Option<bool>,
1334    ///The currency code associated with the tracked hours for this result. Only visible to Administrators and Project Managers with the View billable rates and amounts permission.
1335    pub currency: Option<String>,
1336    ///The totaled hours for the given timeframe, subject (client, project, task, or user), and currency. If Time Rounding is turned on, the hours will be rounded according to your settings.
1337    pub total_hours: Option<f64>,
1338}
1339impl std::fmt::Display for TimeReportsResult {
1340    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1341        write!(f, "{}", serde_json::to_string(self).unwrap())
1342    }
1343}
1344#[derive(Debug, Serialize, Deserialize)]
1345pub struct ProjectAssignments {
1346    pub project_assignments: Vec<ProjectAssignment>,
1347    pub total_pages: i64,
1348    pub per_page: i64,
1349    pub page: i64,
1350    pub total_entries: i64,
1351    pub next_page: Option<i64>,
1352    pub links: PaginationLinks,
1353    pub previous_page: Option<i64>,
1354}
1355impl std::fmt::Display for ProjectAssignments {
1356    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1357        write!(f, "{}", serde_json::to_string(self).unwrap())
1358    }
1359}
1360#[derive(Debug, Serialize, Deserialize)]
1361pub struct Users {
1362    pub total_entries: i64,
1363    pub next_page: Option<i64>,
1364    pub links: PaginationLinks,
1365    pub per_page: i64,
1366    pub previous_page: Option<i64>,
1367    pub page: i64,
1368    pub total_pages: i64,
1369    pub users: Vec<User>,
1370}
1371impl std::fmt::Display for Users {
1372    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1373        write!(f, "{}", serde_json::to_string(self).unwrap())
1374    }
1375}
1376#[derive(Debug, Serialize, Deserialize)]
1377pub struct Invoice {
1378    ///If no value is set, the number will be automatically generated.
1379    pub number: Option<String>,
1380    ///Date the invoice was issued.
1381    pub issue_date: Option<String>,
1382    ///Date the invoice is due.
1383    pub due_date: Option<String>,
1384    ///The invoice subject.
1385    pub subject: Option<String>,
1386    ///Date and time the invoice was closed.
1387    pub closed_at: Option<String>,
1388    ///Start of the period during which time entries were added to this invoice.
1389    pub period_start: Option<String>,
1390    ///The timeframe in which the invoice should be paid. Options: upon receipt, net 15, net 30, net 45, net 60, or custom.
1391    pub payment_term: Option<String>,
1392    ///Date and time the invoice was paid.
1393    pub paid_at: Option<String>,
1394    ///The total amount for the invoice, including any discounts and taxes.
1395    pub amount: Option<f64>,
1396    ///Any additional notes included on the invoice.
1397    pub notes: Option<String>,
1398    ///This percentage is applied to the subtotal, including line items and discounts.
1399    pub tax2: Option<f64>,
1400    ///The total amount due at this time for this invoice.
1401    pub due_amount: Option<f64>,
1402    ///The amount calcuated from discount.
1403    pub discount_amount: Option<f64>,
1404    ///The currency code associated with this invoice.
1405    pub currency: Option<String>,
1406    ///Date the invoice was paid.
1407    pub paid_date: Option<String>,
1408    ///Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/invoices/{CLIENT_KEY}
1409    pub client_key: Option<String>,
1410    ///Unique ID of the associated recurring invoice.
1411    pub recurring_invoice_id: Option<i64>,
1412    ///An object containing the associated estimate’s id.
1413    pub estimate: Option<serde_json::Value>,
1414    ///Date and time the invoice was sent.
1415    pub sent_at: Option<String>,
1416    ///This percentage is subtracted from the subtotal.
1417    pub discount: Option<f64>,
1418    ///End of the period during which time entries were added to this invoice.
1419    pub period_end: Option<String>,
1420    ///This percentage is applied to the subtotal, including line items and discounts.
1421    pub tax: Option<f64>,
1422    ///An object containing invoice’s client id and name.
1423    pub client: Option<serde_json::Value>,
1424    ///The purchase order number.
1425    pub purchase_order: Option<String>,
1426    ///Array of invoice line items.
1427    pub line_items: Option<Vec<InvoiceLineItem>>,
1428    ///Unique ID for the invoice.
1429    pub id: Option<i64>,
1430    ///The current state of the invoice: draft, open, paid, or closed.
1431    pub state: Option<String>,
1432    ///An object containing the id and name of the person that created the invoice.
1433    pub creator: Option<serde_json::Value>,
1434    ///The amount calculated from tax2.
1435    pub tax2_amount: Option<f64>,
1436    ///An object containing the associated retainer’s id.
1437    pub retainer: Option<serde_json::Value>,
1438    ///Date and time the invoice was created.
1439    pub created_at: Option<String>,
1440    ///The first amount of tax included, calculated from tax. If no tax is defined, this value will be null.
1441    pub tax_amount: Option<f64>,
1442    ///Date and time the invoice was last updated.
1443    pub updated_at: Option<String>,
1444}
1445impl std::fmt::Display for Invoice {
1446    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1447        write!(f, "{}", serde_json::to_string(self).unwrap())
1448    }
1449}
1450#[derive(Debug, Serialize, Deserialize)]
1451pub struct Expense {
1452    pub user_assignment: Option<UserAssignment>,
1453    ///The quantity of units used to calculate the total_cost of the expense.
1454    pub units: Option<i64>,
1455    ///An explanation of why the expense has been locked.
1456    pub locked_reason: Option<String>,
1457    ///Unique ID for the expense.
1458    pub id: Option<i64>,
1459    ///An object containing the expense’s receipt URL and file name.
1460    pub receipt: Option<serde_json::Value>,
1461    ///Date and time the expense was created.
1462    pub created_at: Option<String>,
1463    ///Whether the expense is billable or not.
1464    pub billable: Option<bool>,
1465    ///Whether the expense has been approved or closed for some other reason.
1466    pub is_closed: Option<bool>,
1467    ///An object containing the expense’s expense category id, name, unit_price, and unit_name.
1468    pub expense_category: Option<serde_json::Value>,
1469    ///Once the expense has been invoiced, this field will include the associated invoice’s id and number.
1470    pub invoice: Option<serde_json::Value>,
1471    ///The total amount of the expense.
1472    pub total_cost: Option<f64>,
1473    ///Date and time the expense was last updated.
1474    pub updated_at: Option<String>,
1475    ///An object containing the id and name of the user that recorded the expense.
1476    pub user: Option<serde_json::Value>,
1477    ///Date the expense occurred.
1478    pub spent_date: Option<String>,
1479    ///Textual notes used to describe the expense.
1480    pub notes: Option<String>,
1481    ///An object containing the expense’s project id, name, and code.
1482    pub project: Option<serde_json::Value>,
1483    ///Whether the expense has been been invoiced, approved, or the project or person related to the expense is archived.
1484    pub is_locked: Option<bool>,
1485    ///An object containing the expense’s client id, name, and currency.
1486    pub client: Option<serde_json::Value>,
1487    ///Whether or not the expense has been marked as invoiced.
1488    pub is_billed: Option<bool>,
1489}
1490impl std::fmt::Display for Expense {
1491    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1492        write!(f, "{}", serde_json::to_string(self).unwrap())
1493    }
1494}
1495#[derive(Debug, Serialize, Deserialize, Default)]
1496pub struct UninvoicedReportResult {
1497    ///The total amount for billable expenses for the timeframe and project that have not been invoiced.
1498    pub uninvoiced_expenses: Option<f64>,
1499    ///The ID of the client associated with the reported hours and expenses.
1500    pub client_id: Option<i64>,
1501    ///The name of the client associated with the reported hours and expenses.
1502    pub client_name: Option<String>,
1503    ///The name of the project associated with the reported hours and expenses.
1504    pub project_name: Option<String>,
1505    ///The total hours for the given timeframe and project. If Time Rounding is turned on, the hours will be rounded according to your settings.
1506    pub total_hours: Option<f64>,
1507    ///The currency code associated with the tracked hours for this result.
1508    pub currency: Option<String>,
1509    ///The ID of the project associated with the reported hours and expenses.
1510    pub project_id: Option<i64>,
1511    ///The total amount (time and expenses) for the timeframe and project that have not been invoiced.
1512    pub uninvoiced_amount: Option<f64>,
1513    ///The total hours for the given timeframe and project that have not been invoiced. If Time Rounding is turned on, the hours will be rounded according to your settings.
1514    pub uninvoiced_hours: Option<f64>,
1515}
1516impl std::fmt::Display for UninvoicedReportResult {
1517    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1518        write!(f, "{}", serde_json::to_string(self).unwrap())
1519    }
1520}