aws_sdk_amplify/operation/start_job/
_start_job_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request structure for the start job request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct StartJobInput {
7    /// <p>The unique ID for an Amplify app.</p>
8    pub app_id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the branch to use for the job.</p>
10    pub branch_name: ::std::option::Option<::std::string::String>,
11    /// <p>The unique ID for an existing job. This is required if the value of <code>jobType</code> is <code>RETRY</code>.</p>
12    pub job_id: ::std::option::Option<::std::string::String>,
13    /// <p>Describes the type for the job. The job type <code>RELEASE</code> starts a new job with the latest change from the specified branch. This value is available only for apps that are connected to a repository.</p>
14    /// <p>The job type <code>RETRY</code> retries an existing job. If the job type value is <code>RETRY</code>, the <code>jobId</code> is also required.</p>
15    pub job_type: ::std::option::Option<crate::types::JobType>,
16    /// <p>A descriptive reason for starting the job.</p>
17    pub job_reason: ::std::option::Option<::std::string::String>,
18    /// <p>The commit ID from a third-party repository provider for the job.</p>
19    pub commit_id: ::std::option::Option<::std::string::String>,
20    /// <p>The commit message from a third-party repository provider for the job.</p>
21    pub commit_message: ::std::option::Option<::std::string::String>,
22    /// <p>The commit date and time for the job.</p>
23    pub commit_time: ::std::option::Option<::aws_smithy_types::DateTime>,
24}
25impl StartJobInput {
26    /// <p>The unique ID for an Amplify app.</p>
27    pub fn app_id(&self) -> ::std::option::Option<&str> {
28        self.app_id.as_deref()
29    }
30    /// <p>The name of the branch to use for the job.</p>
31    pub fn branch_name(&self) -> ::std::option::Option<&str> {
32        self.branch_name.as_deref()
33    }
34    /// <p>The unique ID for an existing job. This is required if the value of <code>jobType</code> is <code>RETRY</code>.</p>
35    pub fn job_id(&self) -> ::std::option::Option<&str> {
36        self.job_id.as_deref()
37    }
38    /// <p>Describes the type for the job. The job type <code>RELEASE</code> starts a new job with the latest change from the specified branch. This value is available only for apps that are connected to a repository.</p>
39    /// <p>The job type <code>RETRY</code> retries an existing job. If the job type value is <code>RETRY</code>, the <code>jobId</code> is also required.</p>
40    pub fn job_type(&self) -> ::std::option::Option<&crate::types::JobType> {
41        self.job_type.as_ref()
42    }
43    /// <p>A descriptive reason for starting the job.</p>
44    pub fn job_reason(&self) -> ::std::option::Option<&str> {
45        self.job_reason.as_deref()
46    }
47    /// <p>The commit ID from a third-party repository provider for the job.</p>
48    pub fn commit_id(&self) -> ::std::option::Option<&str> {
49        self.commit_id.as_deref()
50    }
51    /// <p>The commit message from a third-party repository provider for the job.</p>
52    pub fn commit_message(&self) -> ::std::option::Option<&str> {
53        self.commit_message.as_deref()
54    }
55    /// <p>The commit date and time for the job.</p>
56    pub fn commit_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
57        self.commit_time.as_ref()
58    }
59}
60impl StartJobInput {
61    /// Creates a new builder-style object to manufacture [`StartJobInput`](crate::operation::start_job::StartJobInput).
62    pub fn builder() -> crate::operation::start_job::builders::StartJobInputBuilder {
63        crate::operation::start_job::builders::StartJobInputBuilder::default()
64    }
65}
66
67/// A builder for [`StartJobInput`](crate::operation::start_job::StartJobInput).
68#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
69#[non_exhaustive]
70pub struct StartJobInputBuilder {
71    pub(crate) app_id: ::std::option::Option<::std::string::String>,
72    pub(crate) branch_name: ::std::option::Option<::std::string::String>,
73    pub(crate) job_id: ::std::option::Option<::std::string::String>,
74    pub(crate) job_type: ::std::option::Option<crate::types::JobType>,
75    pub(crate) job_reason: ::std::option::Option<::std::string::String>,
76    pub(crate) commit_id: ::std::option::Option<::std::string::String>,
77    pub(crate) commit_message: ::std::option::Option<::std::string::String>,
78    pub(crate) commit_time: ::std::option::Option<::aws_smithy_types::DateTime>,
79}
80impl StartJobInputBuilder {
81    /// <p>The unique ID for an Amplify app.</p>
82    /// This field is required.
83    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.app_id = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The unique ID for an Amplify app.</p>
88    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.app_id = input;
90        self
91    }
92    /// <p>The unique ID for an Amplify app.</p>
93    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
94        &self.app_id
95    }
96    /// <p>The name of the branch to use for the job.</p>
97    /// This field is required.
98    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.branch_name = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The name of the branch to use for the job.</p>
103    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.branch_name = input;
105        self
106    }
107    /// <p>The name of the branch to use for the job.</p>
108    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
109        &self.branch_name
110    }
111    /// <p>The unique ID for an existing job. This is required if the value of <code>jobType</code> is <code>RETRY</code>.</p>
112    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.job_id = ::std::option::Option::Some(input.into());
114        self
115    }
116    /// <p>The unique ID for an existing job. This is required if the value of <code>jobType</code> is <code>RETRY</code>.</p>
117    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.job_id = input;
119        self
120    }
121    /// <p>The unique ID for an existing job. This is required if the value of <code>jobType</code> is <code>RETRY</code>.</p>
122    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
123        &self.job_id
124    }
125    /// <p>Describes the type for the job. The job type <code>RELEASE</code> starts a new job with the latest change from the specified branch. This value is available only for apps that are connected to a repository.</p>
126    /// <p>The job type <code>RETRY</code> retries an existing job. If the job type value is <code>RETRY</code>, the <code>jobId</code> is also required.</p>
127    /// This field is required.
128    pub fn job_type(mut self, input: crate::types::JobType) -> Self {
129        self.job_type = ::std::option::Option::Some(input);
130        self
131    }
132    /// <p>Describes the type for the job. The job type <code>RELEASE</code> starts a new job with the latest change from the specified branch. This value is available only for apps that are connected to a repository.</p>
133    /// <p>The job type <code>RETRY</code> retries an existing job. If the job type value is <code>RETRY</code>, the <code>jobId</code> is also required.</p>
134    pub fn set_job_type(mut self, input: ::std::option::Option<crate::types::JobType>) -> Self {
135        self.job_type = input;
136        self
137    }
138    /// <p>Describes the type for the job. The job type <code>RELEASE</code> starts a new job with the latest change from the specified branch. This value is available only for apps that are connected to a repository.</p>
139    /// <p>The job type <code>RETRY</code> retries an existing job. If the job type value is <code>RETRY</code>, the <code>jobId</code> is also required.</p>
140    pub fn get_job_type(&self) -> &::std::option::Option<crate::types::JobType> {
141        &self.job_type
142    }
143    /// <p>A descriptive reason for starting the job.</p>
144    pub fn job_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.job_reason = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>A descriptive reason for starting the job.</p>
149    pub fn set_job_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.job_reason = input;
151        self
152    }
153    /// <p>A descriptive reason for starting the job.</p>
154    pub fn get_job_reason(&self) -> &::std::option::Option<::std::string::String> {
155        &self.job_reason
156    }
157    /// <p>The commit ID from a third-party repository provider for the job.</p>
158    pub fn commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.commit_id = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>The commit ID from a third-party repository provider for the job.</p>
163    pub fn set_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.commit_id = input;
165        self
166    }
167    /// <p>The commit ID from a third-party repository provider for the job.</p>
168    pub fn get_commit_id(&self) -> &::std::option::Option<::std::string::String> {
169        &self.commit_id
170    }
171    /// <p>The commit message from a third-party repository provider for the job.</p>
172    pub fn commit_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.commit_message = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The commit message from a third-party repository provider for the job.</p>
177    pub fn set_commit_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.commit_message = input;
179        self
180    }
181    /// <p>The commit message from a third-party repository provider for the job.</p>
182    pub fn get_commit_message(&self) -> &::std::option::Option<::std::string::String> {
183        &self.commit_message
184    }
185    /// <p>The commit date and time for the job.</p>
186    pub fn commit_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
187        self.commit_time = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>The commit date and time for the job.</p>
191    pub fn set_commit_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
192        self.commit_time = input;
193        self
194    }
195    /// <p>The commit date and time for the job.</p>
196    pub fn get_commit_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
197        &self.commit_time
198    }
199    /// Consumes the builder and constructs a [`StartJobInput`](crate::operation::start_job::StartJobInput).
200    pub fn build(self) -> ::std::result::Result<crate::operation::start_job::StartJobInput, ::aws_smithy_types::error::operation::BuildError> {
201        ::std::result::Result::Ok(crate::operation::start_job::StartJobInput {
202            app_id: self.app_id,
203            branch_name: self.branch_name,
204            job_id: self.job_id,
205            job_type: self.job_type,
206            job_reason: self.job_reason,
207            commit_id: self.commit_id,
208            commit_message: self.commit_message,
209            commit_time: self.commit_time,
210        })
211    }
212}