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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
* Asana
*
* This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/developer-docs/master/defs/asana_oas.yaml).
*
* The version of the OpenAPI document: 1.0
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CustomFieldCompact {
/// Globally unique identifier of the resource, as a string.
#[serde(rename = "gid", skip_serializing_if = "Option::is_none")]
pub gid: Option<String>,
/// The base type of this resource.
#[serde(rename = "resource_type", skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
/// The name of the custom field.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// The type of the custom field. Must be one of the given values.
#[serde(
rename = "resource_subtype",
skip_serializing_if = "Option::is_none"
)]
pub resource_subtype: Option<ResourceSubtype>,
/// *Deprecated: new integrations should prefer the resource_subtype field.* The type of the custom field. Must be one of the given values.
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub _type: Option<Type>,
/// *Conditional*. Only relevant for custom fields of type `enum`. This array specifies the possible values which an `enum` custom field can adopt. To modify the enum options, refer to [working with enum options](/docs/create-an-enum-option).
#[serde(rename = "enum_options", skip_serializing_if = "Option::is_none")]
pub enum_options: Option<Vec<crate::models::EnumOption>>,
/// *Conditional*. Determines if the custom field is enabled or not.
#[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
/// *Conditional*. This number is the value of a number custom field.
#[serde(rename = "number_value", skip_serializing_if = "Option::is_none")]
pub number_value: Option<f32>,
/// *Conditional*. This string is the value of a text custom field.
#[serde(rename = "text_value", skip_serializing_if = "Option::is_none")]
pub text_value: Option<String>,
/// A string representation for the value of the custom field. Integrations that don't require the underlying type should use this field to read values. Using this field will future-proof an app against new custom field types.
#[serde(rename = "display_value", skip_serializing_if = "Option::is_none")]
pub display_value: Option<String>,
}
impl CustomFieldCompact {
pub fn new() -> CustomFieldCompact {
CustomFieldCompact {
gid: None,
resource_type: None,
name: None,
resource_subtype: None,
_type: None,
enum_options: None,
enabled: None,
number_value: None,
text_value: None,
display_value: None,
}
}
}
/// The type of the custom field. Must be one of the given values.
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Serialize,
Deserialize
)]
pub enum ResourceSubtype {
#[serde(rename = "text")]
Text,
#[serde(rename = "enum")]
_Enum,
#[serde(rename = "number")]
Number,
}
/// *Deprecated: new integrations should prefer the resource_subtype field.* The type of the custom field. Must be one of the given values.
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Serialize,
Deserialize
)]
pub enum Type {
#[serde(rename = "text")]
Text,
#[serde(rename = "enum")]
_Enum,
#[serde(rename = "number")]
Number,
}