aws_sdk_amplify/operation/create_deployment/
_create_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 create a new deployment request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateDeploymentInput {
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>An optional file map that contains the file name as the key and the file content md5 hash as the value. If this argument is provided, the service will generate a unique upload URL per file. Otherwise, the service will only generate a single upload URL for the zipped files.</p>
12    pub file_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
13}
14impl CreateDeploymentInput {
15    /// <p>The unique ID for an Amplify app.</p>
16    pub fn app_id(&self) -> ::std::option::Option<&str> {
17        self.app_id.as_deref()
18    }
19    /// <p>The name of the branch to use for the job.</p>
20    pub fn branch_name(&self) -> ::std::option::Option<&str> {
21        self.branch_name.as_deref()
22    }
23    /// <p>An optional file map that contains the file name as the key and the file content md5 hash as the value. If this argument is provided, the service will generate a unique upload URL per file. Otherwise, the service will only generate a single upload URL for the zipped files.</p>
24    pub fn file_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
25        self.file_map.as_ref()
26    }
27}
28impl CreateDeploymentInput {
29    /// Creates a new builder-style object to manufacture [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
30    pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
31        crate::operation::create_deployment::builders::CreateDeploymentInputBuilder::default()
32    }
33}
34
35/// A builder for [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct CreateDeploymentInputBuilder {
39    pub(crate) app_id: ::std::option::Option<::std::string::String>,
40    pub(crate) branch_name: ::std::option::Option<::std::string::String>,
41    pub(crate) file_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
42}
43impl CreateDeploymentInputBuilder {
44    /// <p>The unique ID for an Amplify app.</p>
45    /// This field is required.
46    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.app_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The unique ID for an Amplify app.</p>
51    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.app_id = input;
53        self
54    }
55    /// <p>The unique ID for an Amplify app.</p>
56    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.app_id
58    }
59    /// <p>The name of the branch to use for the job.</p>
60    /// This field is required.
61    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.branch_name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of the branch to use for the job.</p>
66    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.branch_name = input;
68        self
69    }
70    /// <p>The name of the branch to use for the job.</p>
71    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.branch_name
73    }
74    /// Adds a key-value pair to `file_map`.
75    ///
76    /// To override the contents of this collection use [`set_file_map`](Self::set_file_map).
77    ///
78    /// <p>An optional file map that contains the file name as the key and the file content md5 hash as the value. If this argument is provided, the service will generate a unique upload URL per file. Otherwise, the service will only generate a single upload URL for the zipped files.</p>
79    pub fn file_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
80        let mut hash_map = self.file_map.unwrap_or_default();
81        hash_map.insert(k.into(), v.into());
82        self.file_map = ::std::option::Option::Some(hash_map);
83        self
84    }
85    /// <p>An optional file map that contains the file name as the key and the file content md5 hash as the value. If this argument is provided, the service will generate a unique upload URL per file. Otherwise, the service will only generate a single upload URL for the zipped files.</p>
86    pub fn set_file_map(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
87        self.file_map = input;
88        self
89    }
90    /// <p>An optional file map that contains the file name as the key and the file content md5 hash as the value. If this argument is provided, the service will generate a unique upload URL per file. Otherwise, the service will only generate a single upload URL for the zipped files.</p>
91    pub fn get_file_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
92        &self.file_map
93    }
94    /// Consumes the builder and constructs a [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
95    pub fn build(
96        self,
97    ) -> ::std::result::Result<crate::operation::create_deployment::CreateDeploymentInput, ::aws_smithy_types::error::operation::BuildError> {
98        ::std::result::Result::Ok(crate::operation::create_deployment::CreateDeploymentInput {
99            app_id: self.app_id,
100            branch_name: self.branch_name,
101            file_map: self.file_map,
102        })
103    }
104}