openapi-github 0.1.0

OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
Documentation
/*
 * GitHub's official OpenAPI spec + Octokit extension
 *
 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
 *
 * The version of the OpenAPI document: 16.6.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// Page : The configuration for GitHub Pages for a repository.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Page {
    /// The API address for accessing this Page resource.
    #[serde(rename = "url")]
    pub url: String,
    /// The status of the most recent build of the Page.
    #[serde(rename = "status", deserialize_with = "Option::deserialize")]
    pub status: Option<Status>,
    /// The Pages site's custom domain
    #[serde(rename = "cname", deserialize_with = "Option::deserialize")]
    pub cname: Option<String>,
    /// The state if the domain is verified
    #[serde(rename = "protected_domain_state", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub protected_domain_state: Option<Option<ProtectedDomainState>>,
    /// The timestamp when a pending domain becomes unverified.
    #[serde(rename = "pending_domain_unverified_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub pending_domain_unverified_at: Option<Option<String>>,
    /// Whether the Page has a custom 404 page.
    #[serde(rename = "custom_404")]
    pub custom_404: bool,
    /// The web address the Page can be accessed from.
    #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")]
    pub html_url: Option<String>,
    /// The process in which the Page will be built.
    #[serde(rename = "build_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub build_type: Option<Option<BuildType>>,
    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
    pub source: Option<Box<models::PagesSourceHash>>,
    /// Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site.
    #[serde(rename = "public")]
    pub public: bool,
    #[serde(rename = "https_certificate", skip_serializing_if = "Option::is_none")]
    pub https_certificate: Option<Box<models::PagesHttpsCertificate>>,
    /// Whether https is enabled on the domain
    #[serde(rename = "https_enforced", skip_serializing_if = "Option::is_none")]
    pub https_enforced: Option<bool>,
}

impl Page {
    /// The configuration for GitHub Pages for a repository.
    pub fn new(url: String, status: Option<Status>, cname: Option<String>, custom_404: bool, public: bool) -> Page {
        Page {
            url,
            status,
            cname,
            protected_domain_state: None,
            pending_domain_unverified_at: None,
            custom_404,
            html_url: None,
            build_type: None,
            source: None,
            public,
            https_certificate: None,
            https_enforced: None,
        }
    }
}
/// The status of the most recent build of the Page.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "built")]
    Built,
    #[serde(rename = "building")]
    Building,
    #[serde(rename = "errored")]
    Errored,
}

impl Default for Status {
    fn default() -> Status {
        Self::Built
    }
}
/// The state if the domain is verified
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProtectedDomainState {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "verified")]
    Verified,
    #[serde(rename = "unverified")]
    Unverified,
}

impl Default for ProtectedDomainState {
    fn default() -> ProtectedDomainState {
        Self::Pending
    }
}
/// The process in which the Page will be built.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BuildType {
    #[serde(rename = "legacy")]
    Legacy,
    #[serde(rename = "workflow")]
    Workflow,
}

impl Default for BuildType {
    fn default() -> BuildType {
        Self::Legacy
    }
}