Skip to main content

gitbundle_sdk/models/
commit_tag.rs

1/*
2 * GitBundle API
3 *
4 * GitBundle API documentation.
5 *
6 * The version of the OpenAPI document: 3.4.1
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 CommitTag {
17    #[serde(
18        rename = "commit",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub commit: Option<Option<Box<models::Commit>>>,
24    #[serde(rename = "is_annotated")]
25    pub is_annotated: bool,
26    #[serde(
27        rename = "message",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub message: Option<Option<String>>,
33    #[serde(rename = "name")]
34    pub name: String,
35    #[serde(rename = "sha")]
36    pub sha: String,
37    #[serde(
38        rename = "tagger",
39        default,
40        with = "::serde_with::rust::double_option",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub tagger: Option<Option<Box<models::Identity>>>,
44    #[serde(
45        rename = "title",
46        default,
47        with = "::serde_with::rust::double_option",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub title: Option<Option<String>>,
51}
52
53impl CommitTag {
54    pub fn new(is_annotated: bool, name: String, sha: String) -> CommitTag {
55        CommitTag {
56            commit: None,
57            is_annotated,
58            message: None,
59            name,
60            sha,
61            tagger: None,
62            title: None,
63        }
64    }
65}