1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* GitHub's official OpenAPI spec + Octokit extension
*
* OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
*
* The version of the OpenAPI document: 16.6.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReposCreateDeploymentRequest {
/// The ref to deploy. This can be a branch, tag, or SHA.
#[serde(rename = "ref")]
pub r#ref: String,
/// Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).
#[serde(rename = "task", skip_serializing_if = "Option::is_none")]
pub task: Option<String>,
/// Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.
#[serde(rename = "auto_merge", skip_serializing_if = "Option::is_none")]
pub auto_merge: Option<bool>,
/// The [status](https://docs.github.com/rest/commits/statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.
#[serde(rename = "required_contexts", skip_serializing_if = "Option::is_none")]
pub required_contexts: Option<Vec<String>>,
#[serde(rename = "payload", skip_serializing_if = "Option::is_none")]
pub payload: Option<Box<models::ReposCreateDeploymentRequestPayload>>,
/// Name for the target deployment environment (e.g., `production`, `staging`, `qa`).
#[serde(rename = "environment", skip_serializing_if = "Option::is_none")]
pub environment: Option<String>,
/// Short description of the deployment.
#[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub description: Option<Option<String>>,
/// Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`
#[serde(rename = "transient_environment", skip_serializing_if = "Option::is_none")]
pub transient_environment: Option<bool>,
/// Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.
#[serde(rename = "production_environment", skip_serializing_if = "Option::is_none")]
pub production_environment: Option<bool>,
}
impl ReposCreateDeploymentRequest {
pub fn new(r#ref: String) -> ReposCreateDeploymentRequest {
ReposCreateDeploymentRequest {
r#ref,
task: None,
auto_merge: None,
required_contexts: None,
payload: None,
environment: None,
description: None,
transient_environment: None,
production_environment: None,
}
}
}