gusto_api/
custom_fields.rs1use crate::Client;
2use crate::ClientResult;
3
4pub struct CustomFields {
5 pub client: Client,
6}
7
8impl CustomFields {
9 #[doc(hidden)]
10 pub fn new(client: Client) -> Self {
11 CustomFields { client }
12 }
13
14 pub async fn get_employee(
22 &self,
23 employee_id: &str,
24 ) -> ClientResult<crate::Response<crate::types::GetEmployeeCustomFieldsResponse>> {
25 let url = self.client.url(
26 &format!(
27 "/v1/employees/{}/custom_fields",
28 crate::progenitor_support::encode_path(employee_id),
29 ),
30 None,
31 );
32 self.client
33 .get(
34 &url,
35 crate::Message {
36 body: None,
37 content_type: None,
38 },
39 )
40 .await
41 }
42 pub async fn get_company(
50 &self,
51 company_id: &str,
52 ) -> ClientResult<crate::Response<crate::types::GetCompanyCustomFieldsResponse>> {
53 let url = self.client.url(
54 &format!(
55 "/v1/companies/{}/custom_fields",
56 crate::progenitor_support::encode_path(company_id),
57 ),
58 None,
59 );
60 self.client
61 .get(
62 &url,
63 crate::Message {
64 body: None,
65 content_type: None,
66 },
67 )
68 .await
69 }
70}