openapi_github/models/
repos_create_pages_site_request_source.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ReposCreatePagesSiteRequestSource : The source branch and directory used to publish your Pages site.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ReposCreatePagesSiteRequestSource {
17    /// The repository branch used to publish your site's source files.
18    #[serde(rename = "branch")]
19    pub branch: String,
20    /// The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. Default: `/`
21    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
22    pub path: Option<Path>,
23}
24
25impl ReposCreatePagesSiteRequestSource {
26    /// The source branch and directory used to publish your Pages site.
27    pub fn new(branch: String) -> ReposCreatePagesSiteRequestSource {
28        ReposCreatePagesSiteRequestSource {
29            branch,
30            path: None,
31        }
32    }
33}
34/// The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. Default: `/`
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Path {
37    #[serde(rename = "/")]
38    Slash,
39    #[serde(rename = "/docs")]
40    Docs,
41}
42
43impl Default for Path {
44    fn default() -> Path {
45        Self::Slash
46    }
47}
48