gitbundle_sdk/models/stage_context.rs
1/*
2 * GitBundle API
3 *
4 * GitBundle API documentation.
5 *
6 * The version of the OpenAPI document: 3.4.1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct StageContext {
17 /// Including all vars, priority from low to high, higher priority key could override lower priority key 1. The predefined variables for github/gitlab. 2. The web ui configured vars or envs, exclude secrets.
18 #[serde(rename = "all", skip_serializing_if = "Option::is_none")]
19 pub all: Option<std::collections::HashMap<String, String>>,
20 /// Contains variables set in a workflow, job, or step. Static data eg: env.ENV_NAME Value is encoded with base64 standard
21 #[serde(rename = "env", skip_serializing_if = "Option::is_none")]
22 pub env: Option<std::collections::HashMap<String, String>>,
23 #[serde(
24 rename = "github",
25 default,
26 with = "::serde_with::rust::double_option",
27 skip_serializing_if = "Option::is_none"
28 )]
29 pub github: Option<Option<Box<models::GithubContext>>>,
30 /// Contains the inputs of a reusable or manually triggered workflow. Runtime data eg: ${{inputs.INPUT_NAME}} value is jobs.<job_id>.with  TODO: the value need specific type?
31 #[serde(rename = "inputs", skip_serializing_if = "Option::is_none")]
32 pub inputs: Option<std::collections::HashMap<String, serde_json::Value>>,
33 /// Information about the currently running job. Runtime data refer to JobContext. Converted to serde_json::Value for recursively inject variables
34 #[serde(
35 rename = "job",
36 default,
37 with = "::serde_with::rust::double_option",
38 skip_serializing_if = "Option::is_none"
39 )]
40 pub job: Option<Option<Box<models::JobContext>>>,
41 /// For reusable workflows only, contains outputs of jobs from the reusable workflow. Runtime data Initialized when stage is pushed into queue. Updated when stage is updated by api or else. key: job name or stage name value: JobsContext, refer to [Github docs](https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#jobs-context). Converted to serde_json::Value for recursively inject variables
42 #[serde(rename = "jobs", skip_serializing_if = "Option::is_none")]
43 pub jobs: Option<std::collections::HashMap<String, models::JobsContext>>,
44 #[serde(rename = "matrix", skip_serializing_if = "Option::is_none")]
45 pub matrix: Option<std::collections::HashMap<String, String>>,
46 /// Contains the outputs of all jobs that are defined as a dependency of the current job. Runtime data key: job name value: JobsContext. Converted to serde_json::Value for recursively inject variables.
47 #[serde(rename = "needs", skip_serializing_if = "Option::is_none")]
48 pub needs: Option<std::collections::HashMap<String, models::JobsContext>>,
49 /// Information about the runner that is running the current job. Runtime data Refer to RunnerContext. Converted to serde_json::Value for recursively inject variables.
50 #[serde(rename = "runner", skip_serializing_if = "Option::is_none")]
51 pub runner: Option<Box<models::RunnerContext>>,
52 /// Contains the names and values of secrets that are available to a workflow run. Sensitive data, only available to the job that will be scheduling. eg: github: secrets.SECRET_NAME gitlab: $SECRET_NAME, secret.SECRET_NAME Value is encoded with base64 standard
53 #[serde(rename = "secrets", skip_serializing_if = "Option::is_none")]
54 pub secrets: Option<std::collections::HashMap<String, String>>,
55 /// Information about the steps that have been run in the current job. Runtime data key: step id (set in step yaml) value: refer to StepsContext. Converted to serde_json::Value for recursively inject variables.
56 #[serde(rename = "steps", skip_serializing_if = "Option::is_none")]
57 pub steps: Option<std::collections::HashMap<String, models::StepsContext>>,
58 #[serde(rename = "strategy", skip_serializing_if = "Option::is_none")]
59 pub strategy: Option<Box<models::StrategyContext>>,
60 /// Contains variables set at the repository, organization, or environment levels. Static data eg: gitlab: variables.VAR_NAME github: vars.VAR_NAME Value is encoded with base64 standard
61 #[serde(rename = "vars", skip_serializing_if = "Option::is_none")]
62 pub vars: Option<std::collections::HashMap<String, String>>,
63}
64
65impl StageContext {
66 pub fn new() -> StageContext {
67 StageContext {
68 all: None,
69 env: None,
70 github: None,
71 inputs: None,
72 job: None,
73 jobs: None,
74 matrix: None,
75 needs: None,
76 runner: None,
77 secrets: None,
78 steps: None,
79 strategy: None,
80 vars: None,
81 }
82 }
83}