openapi_github/models/
repos_create_deployment_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 ReposCreateDeploymentRequest {
16    /// The ref to deploy. This can be a branch, tag, or SHA.
17    #[serde(rename = "ref")]
18    pub r#ref: String,
19    /// Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).
20    #[serde(rename = "task", skip_serializing_if = "Option::is_none")]
21    pub task: Option<String>,
22    /// Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.
23    #[serde(rename = "auto_merge", skip_serializing_if = "Option::is_none")]
24    pub auto_merge: Option<bool>,
25    /// 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.
26    #[serde(rename = "required_contexts", skip_serializing_if = "Option::is_none")]
27    pub required_contexts: Option<Vec<String>>,
28    #[serde(rename = "payload", skip_serializing_if = "Option::is_none")]
29    pub payload: Option<Box<models::ReposCreateDeploymentRequestPayload>>,
30    /// Name for the target deployment environment (e.g., `production`, `staging`, `qa`).
31    #[serde(rename = "environment", skip_serializing_if = "Option::is_none")]
32    pub environment: Option<String>,
33    /// Short description of the deployment.
34    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub description: Option<Option<String>>,
36    /// Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`
37    #[serde(rename = "transient_environment", skip_serializing_if = "Option::is_none")]
38    pub transient_environment: Option<bool>,
39    /// Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.
40    #[serde(rename = "production_environment", skip_serializing_if = "Option::is_none")]
41    pub production_environment: Option<bool>,
42}
43
44impl ReposCreateDeploymentRequest {
45    pub fn new(r#ref: String) -> ReposCreateDeploymentRequest {
46        ReposCreateDeploymentRequest {
47            r#ref,
48            task: None,
49            auto_merge: None,
50            required_contexts: None,
51            payload: None,
52            environment: None,
53            description: None,
54            transient_environment: None,
55            production_environment: None,
56        }
57    }
58}
59