gitbundle_sdk/models/
repo_content_output.rs

1/*
2 * GitBundle API
3 *
4 * GitBundle API documentation.
5 *
6 * The version of the OpenAPI document: 3.3.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RepoContentOutput {
17    #[serde(rename = "commit_url", skip_serializing_if = "Option::is_none")]
18    pub commit_url: Option<String>,
19    #[serde(rename = "latest_commit", skip_serializing_if = "Option::is_none")]
20    pub latest_commit: Option<Box<models::Commit>>,
21    #[serde(rename = "name")]
22    pub name: String,
23    #[serde(rename = "path")]
24    pub path: String,
25    #[serde(rename = "repo_url", skip_serializing_if = "Option::is_none")]
26    pub repo_url: Option<String>,
27    #[serde(rename = "sha")]
28    pub sha: String,
29    #[serde(rename = "type")]
30    pub r#type: models::RepoContentType,
31    #[serde(rename = "content")]
32    pub content: Box<models::RepoContent>,
33    #[serde(rename = "total_commits")]
34    pub total_commits: i64,
35}
36
37impl RepoContentOutput {
38    pub fn new(
39        name: String,
40        path: String,
41        sha: String,
42        r#type: models::RepoContentType,
43        content: models::RepoContent,
44        total_commits: i64,
45    ) -> RepoContentOutput {
46        RepoContentOutput {
47            commit_url: None,
48            latest_commit: None,
49            name,
50            path,
51            repo_url: None,
52            sha,
53            r#type,
54            content: Box::new(content),
55            total_commits,
56        }
57    }
58}