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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GitCreateTreeRequestTreeInner {
    /// The file referenced in the tree.
    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// The file mode; one of `100644` for file (blob), `100755` for executable (blob), `040000` for subdirectory (tree), `160000` for submodule (commit), or `120000` for a blob that specifies the path of a symlink.
    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
    pub mode: Option<Mode>,
    /// Either `blob`, `tree`, or `commit`.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    /// The SHA1 checksum ID of the object in the tree. Also called `tree.sha`. If the value is `null` then the file will be deleted.      **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error.
    #[serde(rename = "sha", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub sha: Option<Option<String>>,
    /// The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`.      **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error.
    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
    pub content: Option<String>,
}

impl GitCreateTreeRequestTreeInner {
    pub fn new() -> GitCreateTreeRequestTreeInner {
        GitCreateTreeRequestTreeInner {
            path: None,
            mode: None,
            r#type: None,
            sha: None,
            content: None,
        }
    }
}
/// The file mode; one of `100644` for file (blob), `100755` for executable (blob), `040000` for subdirectory (tree), `160000` for submodule (commit), or `120000` for a blob that specifies the path of a symlink.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Mode {
    #[serde(rename = "100644")]
    Variant100644,
    #[serde(rename = "100755")]
    Variant100755,
    #[serde(rename = "040000")]
    Variant040000,
    #[serde(rename = "160000")]
    Variant160000,
    #[serde(rename = "120000")]
    Variant120000,
}

impl Default for Mode {
    fn default() -> Mode {
        Self::Variant100644
    }
}
/// Either `blob`, `tree`, or `commit`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "blob")]
    Blob,
    #[serde(rename = "tree")]
    Tree,
    #[serde(rename = "commit")]
    Commit,
}

impl Default for Type {
    fn default() -> Type {
        Self::Blob
    }
}