aws_sdk_amplify/operation/start_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_job::_start_job_output::StartJobOutputBuilder;
3
4pub use crate::operation::start_job::_start_job_input::StartJobInputBuilder;
5
6impl crate::operation::start_job::builders::StartJobInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::start_job::StartJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_job::StartJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartJob`.
24///
25/// <p>Starts a new job for a branch of an Amplify app.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct StartJobFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::start_job::builders::StartJobInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::start_job::StartJobOutput, crate::operation::start_job::StartJobError>
33    for StartJobFluentBuilder
34{
35    fn send(
36        self,
37        config_override: crate::config::Builder,
38    ) -> crate::client::customize::internal::BoxFuture<
39        crate::client::customize::internal::SendResult<crate::operation::start_job::StartJobOutput, crate::operation::start_job::StartJobError>,
40    > {
41        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42    }
43}
44impl StartJobFluentBuilder {
45    /// Creates a new `StartJobFluentBuilder`.
46    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
47        Self {
48            handle,
49            inner: ::std::default::Default::default(),
50            config_override: ::std::option::Option::None,
51        }
52    }
53    /// Access the StartJob as a reference.
54    pub fn as_input(&self) -> &crate::operation::start_job::builders::StartJobInputBuilder {
55        &self.inner
56    }
57    /// Sends the request and returns the response.
58    ///
59    /// If an error occurs, an `SdkError` will be returned with additional details that
60    /// can be matched against.
61    ///
62    /// By default, any retryable failures will be retried twice. Retry behavior
63    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
64    /// set when configuring the client.
65    pub async fn send(
66        self,
67    ) -> ::std::result::Result<
68        crate::operation::start_job::StartJobOutput,
69        ::aws_smithy_runtime_api::client::result::SdkError<
70            crate::operation::start_job::StartJobError,
71            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
72        >,
73    > {
74        let input = self
75            .inner
76            .build()
77            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78        let runtime_plugins = crate::operation::start_job::StartJob::operation_runtime_plugins(
79            self.handle.runtime_plugins.clone(),
80            &self.handle.conf,
81            self.config_override,
82        );
83        crate::operation::start_job::StartJob::orchestrate(&runtime_plugins, input).await
84    }
85
86    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87    pub fn customize(
88        self,
89    ) -> crate::client::customize::CustomizableOperation<crate::operation::start_job::StartJobOutput, crate::operation::start_job::StartJobError, Self>
90    {
91        crate::client::customize::CustomizableOperation::new(self)
92    }
93    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
94        self.set_config_override(::std::option::Option::Some(config_override.into()));
95        self
96    }
97
98    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
99        self.config_override = config_override;
100        self
101    }
102    /// <p>The unique ID for an Amplify app.</p>
103    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.inner = self.inner.app_id(input.into());
105        self
106    }
107    /// <p>The unique ID for an Amplify app.</p>
108    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.inner = self.inner.set_app_id(input);
110        self
111    }
112    /// <p>The unique ID for an Amplify app.</p>
113    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
114        self.inner.get_app_id()
115    }
116    /// <p>The name of the branch to use for the job.</p>
117    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.branch_name(input.into());
119        self
120    }
121    /// <p>The name of the branch to use for the job.</p>
122    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.inner = self.inner.set_branch_name(input);
124        self
125    }
126    /// <p>The name of the branch to use for the job.</p>
127    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_branch_name()
129    }
130    /// <p>The unique ID for an existing job. This is required if the value of <code>jobType</code> is <code>RETRY</code>.</p>
131    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.job_id(input.into());
133        self
134    }
135    /// <p>The unique ID for an existing job. This is required if the value of <code>jobType</code> is <code>RETRY</code>.</p>
136    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_job_id(input);
138        self
139    }
140    /// <p>The unique ID for an existing job. This is required if the value of <code>jobType</code> is <code>RETRY</code>.</p>
141    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
142        self.inner.get_job_id()
143    }
144    /// <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>
145    /// <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>
146    pub fn job_type(mut self, input: crate::types::JobType) -> Self {
147        self.inner = self.inner.job_type(input);
148        self
149    }
150    /// <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>
151    /// <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>
152    pub fn set_job_type(mut self, input: ::std::option::Option<crate::types::JobType>) -> Self {
153        self.inner = self.inner.set_job_type(input);
154        self
155    }
156    /// <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>
157    /// <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>
158    pub fn get_job_type(&self) -> &::std::option::Option<crate::types::JobType> {
159        self.inner.get_job_type()
160    }
161    /// <p>A descriptive reason for starting the job.</p>
162    pub fn job_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.job_reason(input.into());
164        self
165    }
166    /// <p>A descriptive reason for starting the job.</p>
167    pub fn set_job_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_job_reason(input);
169        self
170    }
171    /// <p>A descriptive reason for starting the job.</p>
172    pub fn get_job_reason(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_job_reason()
174    }
175    /// <p>The commit ID from a third-party repository provider for the job.</p>
176    pub fn commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.commit_id(input.into());
178        self
179    }
180    /// <p>The commit ID from a third-party repository provider for the job.</p>
181    pub fn set_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_commit_id(input);
183        self
184    }
185    /// <p>The commit ID from a third-party repository provider for the job.</p>
186    pub fn get_commit_id(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_commit_id()
188    }
189    /// <p>The commit message from a third-party repository provider for the job.</p>
190    pub fn commit_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.commit_message(input.into());
192        self
193    }
194    /// <p>The commit message from a third-party repository provider for the job.</p>
195    pub fn set_commit_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_commit_message(input);
197        self
198    }
199    /// <p>The commit message from a third-party repository provider for the job.</p>
200    pub fn get_commit_message(&self) -> &::std::option::Option<::std::string::String> {
201        self.inner.get_commit_message()
202    }
203    /// <p>The commit date and time for the job.</p>
204    pub fn commit_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
205        self.inner = self.inner.commit_time(input);
206        self
207    }
208    /// <p>The commit date and time for the job.</p>
209    pub fn set_commit_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
210        self.inner = self.inner.set_commit_time(input);
211        self
212    }
213    /// <p>The commit date and time for the job.</p>
214    pub fn get_commit_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
215        self.inner.get_commit_time()
216    }
217}