Skip to main content

asana/model/
enum_option_request.rs

1use serde::{Serialize, Deserialize};
2use super::EnumOptionBase;
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct EnumOptionRequest {
5    #[serde(flatten)]
6    pub enum_option_base: EnumOptionBase,
7    ///An existing enum option within this custom field after which the new enum option should be inserted. Cannot be provided together with before_enum_option.
8    #[serde(skip_serializing_if = "Option::is_none")]
9    pub insert_after: Option<String>,
10    ///An existing enum option within this custom field before which the new enum option should be inserted. Cannot be provided together with after_enum_option.
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub insert_before: Option<String>,
13}
14impl std::fmt::Display for EnumOptionRequest {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16        write!(f, "{}", serde_json::to_string(self).unwrap())
17    }
18}
19impl std::ops::Deref for EnumOptionRequest {
20    type Target = EnumOptionBase;
21    fn deref(&self) -> &Self::Target {
22        &self.enum_option_base
23    }
24}
25impl std::ops::DerefMut for EnumOptionRequest {
26    fn deref_mut(&mut self) -> &mut Self::Target {
27        &mut self.enum_option_base
28    }
29}