/*
 * Gitea API.
 *
 * This documentation describes the Gitea API.
 *
 * The version of the OpenAPI document: 1.17.3
 * 
 * Generated by: https://openapi-generator.tech
 */

/// ContentsResponse : ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ContentsResponse {
    #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
    pub _links: Option<Box<crate::models::FileLinksResponse>>,
    /// `content` is populated when `type` is `file`, otherwise null
    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
    pub content: Option<String>,
    #[serde(rename = "download_url", skip_serializing_if = "Option::is_none")]
    pub download_url: Option<String>,
    /// `encoding` is populated when `type` is `file`, otherwise null
    #[serde(rename = "encoding", skip_serializing_if = "Option::is_none")]
    pub encoding: Option<String>,
    #[serde(rename = "git_url", skip_serializing_if = "Option::is_none")]
    pub git_url: Option<String>,
    #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")]
    pub html_url: Option<String>,
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    #[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
    pub sha: Option<String>,
    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
    pub size: Option<i64>,
    /// `submodule_git_url` is populated when `type` is `submodule`, otherwise null
    #[serde(rename = "submodule_git_url", skip_serializing_if = "Option::is_none")]
    pub submodule_git_url: Option<String>,
    /// `target` is populated when `type` is `symlink`, otherwise null
    #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
    pub target: Option<String>,
    /// `type` will be `file`, `dir`, `symlink`, or `submodule`
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
}

impl ContentsResponse {
    /// ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content
    pub fn new() -> ContentsResponse {
        ContentsResponse {
            _links: None,
            content: None,
            download_url: None,
            encoding: None,
            git_url: None,
            html_url: None,
            name: None,
            path: None,
            sha: None,
            size: None,
            submodule_git_url: None,
            target: None,
            r#type: None,
            url: None,
        }
    }
}


