traq 0.1.5

⚠️ Community Driven ⚠️ traQ v3 API
Documentation
/*
 * traQ v3
 *
 * traQ v3 API
 *
 * The version of the OpenAPI document: 3.0
 *
 * Generated by: https://openapi-generator.tech
 */

/// Channel : チャンネル

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Channel {
    /// チャンネルUUID
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// 親チャンネルUUID
    #[serde(rename = "parentId", deserialize_with = "Option::deserialize")]
    pub parent_id: Option<uuid::Uuid>,
    /// チャンネルがアーカイブされているかどうか
    #[serde(rename = "archived")]
    pub archived: bool,
    /// 強制通知チャンネルかどうか
    #[serde(rename = "force")]
    pub force: bool,
    /// チャンネルトピック
    #[serde(rename = "topic")]
    pub topic: String,
    /// チャンネル名
    #[serde(rename = "name")]
    pub name: String,
    /// 子チャンネルのUUID配列
    #[serde(rename = "children")]
    pub children: Vec<uuid::Uuid>,
}

impl Channel {
    /// チャンネル
    pub fn new(
        id: uuid::Uuid,
        parent_id: Option<uuid::Uuid>,
        archived: bool,
        force: bool,
        topic: String,
        name: String,
        children: Vec<uuid::Uuid>,
    ) -> Channel {
        Channel {
            id,
            parent_id,
            archived,
            force,
            topic,
            name,
            children,
        }
    }
}