asana 0.1.1

asana bindings for rust
Documentation
/*
 * 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 CustomFieldResponse {
    /// 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>,
    /// [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>,
    /// 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>,
    #[serde(rename = "enum_value", skip_serializing_if = "Option::is_none")]
    pub enum_value: Option<Box<crate::models::EnumOption>>,
}

impl CustomFieldResponse {
    pub fn new() -> CustomFieldResponse {
        CustomFieldResponse {
            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,
            description: None,
            precision: None,
            format: None,
            currency_code: None,
            custom_label: None,
            custom_label_position: None,
            is_global_to_workspace: None,
            has_notifications_enabled: None,
            enum_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,
}
/// 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,
}