Skip to main content

gitbundle_sdk/models/
repo_commit_file_action.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 RepoCommitFileAction {
17    #[serde(rename = "action")]
18    pub action: models::CommitFileActionType,
19    #[serde(rename = "encoding", skip_serializing_if = "Option::is_none")]
20    pub encoding: Option<models::RepoFileContentEncodingType>,
21    #[serde(rename = "path")]
22    pub path: String,
23    #[serde(rename = "payload")]
24    pub payload: String,
25    #[serde(rename = "sha")]
26    pub sha: String,
27}
28
29impl RepoCommitFileAction {
30    pub fn new(
31        action: models::CommitFileActionType,
32        path: String,
33        payload: String,
34        sha: String,
35    ) -> RepoCommitFileAction {
36        RepoCommitFileAction {
37            action,
38            encoding: None,
39            path,
40            payload,
41            sha,
42        }
43    }
44}