asana/model/
custom_field_request.rs

1use serde::{Serialize, Deserialize};
2use super::CustomFieldBase;
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct CustomFieldRequest {
5    #[serde(flatten)]
6    pub custom_field_base: CustomFieldBase,
7    ///*Allow-listed*. Instructs the API that this Custom Field is app-owned. This parameter is allow-listed to specific apps at this point in time. For apps that are not allow-listed, providing this parameter will result in a `403 Forbidden`.
8    #[serde(skip_serializing_if = "Option::is_none")]
9    pub owned_by_app: Option<bool>,
10    ///*Conditional*. Only relevant for custom fields of type `people`. This array of user GIDs reflects the users to be written to a `people` custom field. Note that *write* operations will replace existing users (if any) in the custom field with the users specified in this array.
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub people_value: Option<Vec<String>>,
13    ///*Create-Only* The workspace to create a custom field in.
14    pub workspace: String,
15}
16impl std::fmt::Display for CustomFieldRequest {
17    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
18        write!(f, "{}", serde_json::to_string(self).unwrap())
19    }
20}
21impl std::ops::Deref for CustomFieldRequest {
22    type Target = CustomFieldBase;
23    fn deref(&self) -> &Self::Target {
24        &self.custom_field_base
25    }
26}
27impl std::ops::DerefMut for CustomFieldRequest {
28    fn deref_mut(&mut self) -> &mut Self::Target {
29        &mut self.custom_field_base
30    }
31}