openapi_github/models/
deployment_simple.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/// DeploymentSimple : A deployment created as the result of an Actions check run from a workflow that references an environment
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DeploymentSimple {
17    #[serde(rename = "url")]
18    pub url: String,
19    /// Unique identifier of the deployment
20    #[serde(rename = "id")]
21    pub id: i32,
22    #[serde(rename = "node_id")]
23    pub node_id: String,
24    /// Parameter to specify a task to execute
25    #[serde(rename = "task")]
26    pub task: String,
27    #[serde(rename = "original_environment", skip_serializing_if = "Option::is_none")]
28    pub original_environment: Option<String>,
29    /// Name for the target deployment environment.
30    #[serde(rename = "environment")]
31    pub environment: String,
32    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
33    pub description: Option<String>,
34    #[serde(rename = "created_at")]
35    pub created_at: String,
36    #[serde(rename = "updated_at")]
37    pub updated_at: String,
38    #[serde(rename = "statuses_url")]
39    pub statuses_url: String,
40    #[serde(rename = "repository_url")]
41    pub repository_url: String,
42    /// Specifies if the given environment is will no longer exist at some point in the future. Default: false.
43    #[serde(rename = "transient_environment", skip_serializing_if = "Option::is_none")]
44    pub transient_environment: Option<bool>,
45    /// Specifies if the given environment is one that end-users directly interact with. Default: false.
46    #[serde(rename = "production_environment", skip_serializing_if = "Option::is_none")]
47    pub production_environment: Option<bool>,
48    #[serde(rename = "performed_via_github_app", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
49    pub performed_via_github_app: Option<Option<Box<models::NullableIntegration>>>,
50}
51
52impl DeploymentSimple {
53    /// A deployment created as the result of an Actions check run from a workflow that references an environment
54    pub fn new(url: String, id: i32, node_id: String, task: String, environment: String, description: Option<String>, created_at: String, updated_at: String, statuses_url: String, repository_url: String) -> DeploymentSimple {
55        DeploymentSimple {
56            url,
57            id,
58            node_id,
59            task,
60            original_environment: None,
61            environment,
62            description,
63            created_at,
64            updated_at,
65            statuses_url,
66            repository_url,
67            transient_environment: None,
68            production_environment: None,
69            performed_via_github_app: None,
70        }
71    }
72}
73