openapi_github/models/
pulls_create_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 PullsCreateRequest {
16    /// The title of the new pull request. Required unless `issue` is specified.
17    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
18    pub title: Option<String>,
19    /// The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`.
20    #[serde(rename = "head")]
21    pub head: String,
22    /// The name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization.
23    #[serde(rename = "head_repo", skip_serializing_if = "Option::is_none")]
24    pub head_repo: Option<String>,
25    /// The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository.
26    #[serde(rename = "base")]
27    pub base: String,
28    /// The contents of the pull request.
29    #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
30    pub body: Option<String>,
31    /// Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request.
32    #[serde(rename = "maintainer_can_modify", skip_serializing_if = "Option::is_none")]
33    pub maintainer_can_modify: Option<bool>,
34    /// Indicates whether the pull request is a draft. See \"[Draft Pull Requests](https://docs.github.com/articles/about-pull-requests#draft-pull-requests)\" in the GitHub Help documentation to learn more.
35    #[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
36    pub draft: Option<bool>,
37    /// An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request. Required unless `title` is specified.
38    #[serde(rename = "issue", skip_serializing_if = "Option::is_none")]
39    pub issue: Option<i64>,
40}
41
42impl PullsCreateRequest {
43    pub fn new(head: String, base: String) -> PullsCreateRequest {
44        PullsCreateRequest {
45            title: None,
46            head,
47            head_repo: None,
48            base,
49            body: None,
50            maintainer_can_modify: None,
51            draft: None,
52            issue: None,
53        }
54    }
55}
56