openapi_github/models/
repos_create_or_update_file_contents_request.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ReposCreateOrUpdateFileContentsRequest {
16    /// The commit message.
17    #[serde(rename = "message")]
18    pub message: String,
19    /// The new file content, using Base64 encoding.
20    #[serde(rename = "content")]
21    pub content: String,
22    /// **Required if you are updating a file**. The blob SHA of the file being replaced.
23    #[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
24    pub sha: Option<String>,
25    /// The branch name. Default: the repository’s default branch.
26    #[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
27    pub branch: Option<String>,
28    #[serde(rename = "committer", skip_serializing_if = "Option::is_none")]
29    pub committer: Option<Box<models::ReposCreateOrUpdateFileContentsRequestCommitter>>,
30    #[serde(rename = "author", skip_serializing_if = "Option::is_none")]
31    pub author: Option<Box<models::ReposCreateOrUpdateFileContentsRequestAuthor>>,
32}
33
34impl ReposCreateOrUpdateFileContentsRequest {
35    pub fn new(message: String, content: String) -> ReposCreateOrUpdateFileContentsRequest {
36        ReposCreateOrUpdateFileContentsRequest {
37            message,
38            content,
39            sha: None,
40            branch: None,
41            committer: None,
42            author: None,
43        }
44    }
45}
46