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 ProjectStatusResponse {
    /// 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 title of the project status update.
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    #[serde(rename = "author", skip_serializing_if = "Option::is_none")]
    pub author: Option<Box<crate::models::UserCompact>>,
    /// The time at which this project status was last modified. *Note: This does not currently reflect any changes in associations such as comments that may have been added or removed from the project status.*
    #[serde(rename = "modified_at", skip_serializing_if = "Option::is_none")]
    pub modified_at: Option<serde_json::Value>,
    /// The text content of the status update.
    #[serde(rename = "text")]
    pub text: String,
    /// [Opt In](/docs/input-output-options). The text content of the status update with formatting as HTML.
    #[serde(rename = "html_text", skip_serializing_if = "Option::is_none")]
    pub html_text: Option<String>,
    /// The color associated with the status update.
    #[serde(rename = "color")]
    pub color: Color,
    /// The time at which this resource was created.
    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")]
    pub created_by: Option<Box<crate::models::UserCompact>>,
}

impl ProjectStatusResponse {
    pub fn new(text: String, color: Color) -> ProjectStatusResponse {
        ProjectStatusResponse {
            gid: None,
            resource_type: None,
            title: None,
            author: None,
            modified_at: None,
            text,
            html_text: None,
            color,
            created_at: None,
            created_by: None,
        }
    }
}

/// The color associated with the status update.
#[derive(
    Clone,
    Copy,
    Debug,
    Eq,
    PartialEq,
    Ord,
    PartialOrd,
    Hash,
    Serialize,
    Deserialize
)]
pub enum Color {
    #[serde(rename = "green")]
    Green,
    #[serde(rename = "yellow")]
    Yellow,
    #[serde(rename = "red")]
    Red,
    #[serde(rename = "blue")]
    Blue,
}