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
 */

/// CustomFieldCompactAllOf : Custom Fields store the metadata that is used in order to add user-specified information to tasks in Asana. Be sure to reference the [Custom Fields](/docs/asana-custom-fields) developer documentation for more information about how custom fields relate to various resources in Asana.  Users in Asana can [lock custom fields](https://asana.com/guide/help/premium/custom-fields#gl-lock-fields), which will make them read-only when accessed by other users. Attempting to edit a locked custom field will return HTTP error code `403 Forbidden`.

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CustomFieldCompactAllOf {
    /// 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 CustomFieldCompactAllOf {
    /// Custom Fields store the metadata that is used in order to add user-specified information to tasks in Asana. Be sure to reference the [Custom Fields](/docs/asana-custom-fields) developer documentation for more information about how custom fields relate to various resources in Asana.  Users in Asana can [lock custom fields](https://asana.com/guide/help/premium/custom-fields#gl-lock-fields), which will make them read-only when accessed by other users. Attempting to edit a locked custom field will return HTTP error code `403 Forbidden`.
    pub fn new() -> CustomFieldCompactAllOf {
        CustomFieldCompactAllOf {
            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,
}