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
107
108
109
110
/*
* 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 CustomFieldBaseAllOf {
/// [Opt In](/docs/input-output-options). The description of the custom field.
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// *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>>,
/// Only relevant for custom fields of type ‘Number’. This field dictates the number of places after the decimal to round to, i.e. 0 is integer values, 1 rounds to the nearest tenth, and so on. Must be between 0 and 6, inclusive. For percentage format, this may be unintuitive, as a value of 0.25 has a precision of 0, while a value of 0.251 has a precision of 1. This is due to 0.25 being displayed as 25%. The identifier format will always have a precision of 0.
#[serde(rename = "precision", skip_serializing_if = "Option::is_none")]
pub precision: Option<i32>,
/// The format of this custom field.
#[serde(rename = "format", skip_serializing_if = "Option::is_none")]
pub format: Option<Format>,
/// ISO 4217 currency code to format this custom field. This will be null if the `format` is not `currency`.
#[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")]
pub currency_code: Option<String>,
/// This is the string that appears next to the custom field value. This will be null if the `format` is not `custom`.
#[serde(rename = "custom_label", skip_serializing_if = "Option::is_none")]
pub custom_label: Option<String>,
/// Only relevant for custom fields with `custom` format. This depicts where to place the custom label. This will be null if the `format` is not `custom`.
#[serde(
rename = "custom_label_position",
skip_serializing_if = "Option::is_none"
)]
pub custom_label_position: Option<CustomLabelPosition>,
/// This flag describes whether this custom field is available to every container in the workspace. Before project-specific custom fields, this field was always true.
#[serde(
rename = "is_global_to_workspace",
skip_serializing_if = "Option::is_none"
)]
pub is_global_to_workspace: Option<bool>,
/// *Conditional*. This flag describes whether a follower of a task with this field should receive inbox notifications from changes to this field.
#[serde(
rename = "has_notifications_enabled",
skip_serializing_if = "Option::is_none"
)]
pub has_notifications_enabled: Option<bool>,
}
impl CustomFieldBaseAllOf {
pub fn new() -> CustomFieldBaseAllOf {
CustomFieldBaseAllOf {
description: None,
enum_options: None,
precision: None,
format: None,
currency_code: None,
custom_label: None,
custom_label_position: None,
is_global_to_workspace: None,
has_notifications_enabled: None,
}
}
}
/// The format of this custom field.
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Serialize,
Deserialize
)]
pub enum Format {
#[serde(rename = "currency")]
Currency,
#[serde(rename = "identifier")]
Identifier,
#[serde(rename = "percentage")]
Percentage,
#[serde(rename = "custom")]
Custom,
#[serde(rename = "none")]
None,
}
/// Only relevant for custom fields with `custom` format. This depicts where to place the custom label. This will be null if the `format` is not `custom`.
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Serialize,
Deserialize
)]
pub enum CustomLabelPosition {
#[serde(rename = "prefix")]
Prefix,
#[serde(rename = "suffix")]
Suffix,
}