aws_sdk_amplify/operation/start_deployment/
_start_deployment_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 a deployment request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct StartDeploymentInput {
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 deployment job.</p>
10    pub branch_name: ::std::option::Option<::std::string::String>,
11    /// <p>The job ID for this deployment that is generated by the <code>CreateDeployment</code> request.</p>
12    pub job_id: ::std::option::Option<::std::string::String>,
13    /// <p>The source URL for the deployment that is used when calling <code>StartDeployment</code> without <code>CreateDeployment</code>. The source URL can be either an HTTP GET URL that is publicly accessible and downloads a single .zip file, or an Amazon S3 bucket and prefix.</p>
14    pub source_url: ::std::option::Option<::std::string::String>,
15    /// <p>The type of source specified by the <code>sourceURL</code>. If the value is <code>ZIP</code>, the source is a .zip file. If the value is <code>BUCKET_PREFIX</code>, the source is an Amazon S3 bucket and prefix. If no value is specified, the default is <code>ZIP</code>.</p>
16    pub source_url_type: ::std::option::Option<crate::types::SourceUrlType>,
17}
18impl StartDeploymentInput {
19    /// <p>The unique ID for an Amplify app.</p>
20    pub fn app_id(&self) -> ::std::option::Option<&str> {
21        self.app_id.as_deref()
22    }
23    /// <p>The name of the branch to use for the deployment job.</p>
24    pub fn branch_name(&self) -> ::std::option::Option<&str> {
25        self.branch_name.as_deref()
26    }
27    /// <p>The job ID for this deployment that is generated by the <code>CreateDeployment</code> request.</p>
28    pub fn job_id(&self) -> ::std::option::Option<&str> {
29        self.job_id.as_deref()
30    }
31    /// <p>The source URL for the deployment that is used when calling <code>StartDeployment</code> without <code>CreateDeployment</code>. The source URL can be either an HTTP GET URL that is publicly accessible and downloads a single .zip file, or an Amazon S3 bucket and prefix.</p>
32    pub fn source_url(&self) -> ::std::option::Option<&str> {
33        self.source_url.as_deref()
34    }
35    /// <p>The type of source specified by the <code>sourceURL</code>. If the value is <code>ZIP</code>, the source is a .zip file. If the value is <code>BUCKET_PREFIX</code>, the source is an Amazon S3 bucket and prefix. If no value is specified, the default is <code>ZIP</code>.</p>
36    pub fn source_url_type(&self) -> ::std::option::Option<&crate::types::SourceUrlType> {
37        self.source_url_type.as_ref()
38    }
39}
40impl StartDeploymentInput {
41    /// Creates a new builder-style object to manufacture [`StartDeploymentInput`](crate::operation::start_deployment::StartDeploymentInput).
42    pub fn builder() -> crate::operation::start_deployment::builders::StartDeploymentInputBuilder {
43        crate::operation::start_deployment::builders::StartDeploymentInputBuilder::default()
44    }
45}
46
47/// A builder for [`StartDeploymentInput`](crate::operation::start_deployment::StartDeploymentInput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct StartDeploymentInputBuilder {
51    pub(crate) app_id: ::std::option::Option<::std::string::String>,
52    pub(crate) branch_name: ::std::option::Option<::std::string::String>,
53    pub(crate) job_id: ::std::option::Option<::std::string::String>,
54    pub(crate) source_url: ::std::option::Option<::std::string::String>,
55    pub(crate) source_url_type: ::std::option::Option<crate::types::SourceUrlType>,
56}
57impl StartDeploymentInputBuilder {
58    /// <p>The unique ID for an Amplify app.</p>
59    /// This field is required.
60    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.app_id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The unique ID for an Amplify app.</p>
65    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.app_id = input;
67        self
68    }
69    /// <p>The unique ID for an Amplify app.</p>
70    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.app_id
72    }
73    /// <p>The name of the branch to use for the deployment job.</p>
74    /// This field is required.
75    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.branch_name = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The name of the branch to use for the deployment job.</p>
80    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.branch_name = input;
82        self
83    }
84    /// <p>The name of the branch to use for the deployment job.</p>
85    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
86        &self.branch_name
87    }
88    /// <p>The job ID for this deployment that is generated by the <code>CreateDeployment</code> request.</p>
89    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.job_id = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>The job ID for this deployment that is generated by the <code>CreateDeployment</code> request.</p>
94    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.job_id = input;
96        self
97    }
98    /// <p>The job ID for this deployment that is generated by the <code>CreateDeployment</code> request.</p>
99    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
100        &self.job_id
101    }
102    /// <p>The source URL for the deployment that is used when calling <code>StartDeployment</code> without <code>CreateDeployment</code>. The source URL can be either an HTTP GET URL that is publicly accessible and downloads a single .zip file, or an Amazon S3 bucket and prefix.</p>
103    pub fn source_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.source_url = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The source URL for the deployment that is used when calling <code>StartDeployment</code> without <code>CreateDeployment</code>. The source URL can be either an HTTP GET URL that is publicly accessible and downloads a single .zip file, or an Amazon S3 bucket and prefix.</p>
108    pub fn set_source_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.source_url = input;
110        self
111    }
112    /// <p>The source URL for the deployment that is used when calling <code>StartDeployment</code> without <code>CreateDeployment</code>. The source URL can be either an HTTP GET URL that is publicly accessible and downloads a single .zip file, or an Amazon S3 bucket and prefix.</p>
113    pub fn get_source_url(&self) -> &::std::option::Option<::std::string::String> {
114        &self.source_url
115    }
116    /// <p>The type of source specified by the <code>sourceURL</code>. If the value is <code>ZIP</code>, the source is a .zip file. If the value is <code>BUCKET_PREFIX</code>, the source is an Amazon S3 bucket and prefix. If no value is specified, the default is <code>ZIP</code>.</p>
117    pub fn source_url_type(mut self, input: crate::types::SourceUrlType) -> Self {
118        self.source_url_type = ::std::option::Option::Some(input);
119        self
120    }
121    /// <p>The type of source specified by the <code>sourceURL</code>. If the value is <code>ZIP</code>, the source is a .zip file. If the value is <code>BUCKET_PREFIX</code>, the source is an Amazon S3 bucket and prefix. If no value is specified, the default is <code>ZIP</code>.</p>
122    pub fn set_source_url_type(mut self, input: ::std::option::Option<crate::types::SourceUrlType>) -> Self {
123        self.source_url_type = input;
124        self
125    }
126    /// <p>The type of source specified by the <code>sourceURL</code>. If the value is <code>ZIP</code>, the source is a .zip file. If the value is <code>BUCKET_PREFIX</code>, the source is an Amazon S3 bucket and prefix. If no value is specified, the default is <code>ZIP</code>.</p>
127    pub fn get_source_url_type(&self) -> &::std::option::Option<crate::types::SourceUrlType> {
128        &self.source_url_type
129    }
130    /// Consumes the builder and constructs a [`StartDeploymentInput`](crate::operation::start_deployment::StartDeploymentInput).
131    pub fn build(
132        self,
133    ) -> ::std::result::Result<crate::operation::start_deployment::StartDeploymentInput, ::aws_smithy_types::error::operation::BuildError> {
134        ::std::result::Result::Ok(crate::operation::start_deployment::StartDeploymentInput {
135            app_id: self.app_id,
136            branch_name: self.branch_name,
137            job_id: self.job_id,
138            source_url: self.source_url,
139            source_url_type: self.source_url_type,
140        })
141    }
142}