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
use crate::Client;
use crate::ClientResult;
pub struct CustomFields {
pub client: Client,
}
impl CustomFields {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
CustomFields { client }
}
/**
* Get an employee's custom fields.
*
* This function performs a `GET` to the `/v1/employees/{employee_id}/custom_fields` endpoint.
*
* Returns a list of the employee's custom fields.
*/
pub async fn get_employee(
&self,
employee_id: &str,
) -> ClientResult<crate::Response<crate::types::GetEmployeeCustomFieldsResponse>> {
let url = self.client.url(
&format!(
"/v1/employees/{}/custom_fields",
crate::progenitor_support::encode_path(employee_id),
),
None,
);
self.client
.get(
&url,
crate::Message {
body: None,
content_type: None,
},
)
.await
}
/**
* Get the custom fields of a company.
*
* This function performs a `GET` to the `/v1/companies/{company_id}/custom_fields` endpoint.
*
* Returns a list of the custom fields of the company. Useful when you need to know the schema of custom fields for an entire company
*/
pub async fn get_company(
&self,
company_id: &str,
) -> ClientResult<crate::Response<crate::types::GetCompanyCustomFieldsResponse>> {
let url = self.client.url(
&format!(
"/v1/companies/{}/custom_fields",
crate::progenitor_support::encode_path(company_id),
),
None,
);
self.client
.get(
&url,
crate::Message {
body: None,
content_type: None,
},
)
.await
}
}