forem_openapi_client 1.0.1

Access Forem articles, users and other resources via API. For a real-world example of Forem in action, check out [DEV](https://www.dev.to). All endpoints can be accessed with the 'api-key' header and a accept header, but some of them are accessible publicly without authentication. Dates and date times, unless otherwise specified, must be in the [RFC 3339](https://tools.ietf.org/html/rfc3339) format. Generated at 2023-04-10T05:06:38.929104+00:00
Documentation
/*
 * Forem API V1
 *
 * Access Forem articles, users and other resources via API.         For a real-world example of Forem in action, check out [DEV](https://www.dev.to).         All endpoints can be accessed with the 'api-key' header and a accept header, but         some of them are accessible publicly without authentication.          Dates and date times, unless otherwise specified, must be in         the [RFC 3339](https://tools.ietf.org/html/rfc3339) format.
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ApiPagesPostRequest {
    /// Title of the page
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// Used to link to this page in URLs, must be unique and URL-safe
    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
    pub slug: Option<String>,
    /// For internal use, helps similar pages from one another
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The text (in markdown) of the ad (required)
    #[serde(rename = "body_markdown", skip_serializing_if = "Option::is_none")]
    pub body_markdown: Option<String>,
    /// For JSON pages, the JSON body
    #[serde(rename = "body_json", skip_serializing_if = "Option::is_none")]
    pub body_json: Option<String>,
    /// If true, the page is available at '/{slug}' instead of '/page/{slug}', use with caution
    #[serde(rename = "is_top_level_path", skip_serializing_if = "Option::is_none")]
    pub is_top_level_path: Option<bool>,
    /// Controls what kind of layout the page is rendered in
    #[serde(rename = "template", skip_serializing_if = "Option::is_none")]
    pub template: Option<Template>,
}

impl ApiPagesPostRequest {
    pub fn new() -> ApiPagesPostRequest {
        ApiPagesPostRequest {
            title: None,
            slug: None,
            description: None,
            body_markdown: None,
            body_json: None,
            is_top_level_path: None,
            template: None,
        }
    }
}

/// Controls what kind of layout the page is rendered in
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Template {
    #[serde(rename = "contained")]
    Contained,
    #[serde(rename = "full_within_layout")]
    FullWithinLayout,
    #[serde(rename = "nav_bar_included")]
    NavBarIncluded,
    #[serde(rename = "json")]
    Json,
}

impl Default for Template {
    fn default() -> Template {
        Self::Contained
    }
}