Skip to main content

asana/model/
custom_field_response.rs

1use serde::{Serialize, Deserialize};
2use super::{CustomFieldBase, UserCompact};
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct CustomFieldResponse {
5    #[serde(flatten)]
6    pub custom_field_base: CustomFieldBase,
7    #[serde(skip_serializing_if = "Option::is_none")]
8    pub created_by: Option<serde_json::Value>,
9    ///*Conditional*. This flag describes whether a custom field is a formula custom field.
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub is_formula_field: Option<bool>,
12    ///*Conditional*. This flag describes whether a custom field is read only.
13    #[serde(skip_serializing_if = "Option::is_none")]
14    pub is_value_read_only: Option<bool>,
15    ///*Conditional*. Only relevant for custom fields of type `people`. This array of [compact user](/reference/users) objects reflects the values of a `people` custom field.
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub people_value: Option<Vec<UserCompact>>,
18}
19impl std::fmt::Display for CustomFieldResponse {
20    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
21        write!(f, "{}", serde_json::to_string(self).unwrap())
22    }
23}
24impl std::ops::Deref for CustomFieldResponse {
25    type Target = CustomFieldBase;
26    fn deref(&self) -> &Self::Target {
27        &self.custom_field_base
28    }
29}
30impl std::ops::DerefMut for CustomFieldResponse {
31    fn deref_mut(&mut self) -> &mut Self::Target {
32        &mut self.custom_field_base
33    }
34}