aws_sdk_imagebuilder/operation/distribute_image/
_distribute_image_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DistributeImageInput {
6 pub source_image: ::std::option::Option<::std::string::String>,
8 pub distribution_configuration_arn: ::std::option::Option<::std::string::String>,
10 pub execution_role: ::std::option::Option<::std::string::String>,
12 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14 pub client_token: ::std::option::Option<::std::string::String>,
16 pub logging_configuration: ::std::option::Option<crate::types::ImageLoggingConfiguration>,
18}
19impl DistributeImageInput {
20 pub fn source_image(&self) -> ::std::option::Option<&str> {
22 self.source_image.as_deref()
23 }
24 pub fn distribution_configuration_arn(&self) -> ::std::option::Option<&str> {
26 self.distribution_configuration_arn.as_deref()
27 }
28 pub fn execution_role(&self) -> ::std::option::Option<&str> {
30 self.execution_role.as_deref()
31 }
32 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
34 self.tags.as_ref()
35 }
36 pub fn client_token(&self) -> ::std::option::Option<&str> {
38 self.client_token.as_deref()
39 }
40 pub fn logging_configuration(&self) -> ::std::option::Option<&crate::types::ImageLoggingConfiguration> {
42 self.logging_configuration.as_ref()
43 }
44}
45impl DistributeImageInput {
46 pub fn builder() -> crate::operation::distribute_image::builders::DistributeImageInputBuilder {
48 crate::operation::distribute_image::builders::DistributeImageInputBuilder::default()
49 }
50}
51
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct DistributeImageInputBuilder {
56 pub(crate) source_image: ::std::option::Option<::std::string::String>,
57 pub(crate) distribution_configuration_arn: ::std::option::Option<::std::string::String>,
58 pub(crate) execution_role: ::std::option::Option<::std::string::String>,
59 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
60 pub(crate) client_token: ::std::option::Option<::std::string::String>,
61 pub(crate) logging_configuration: ::std::option::Option<crate::types::ImageLoggingConfiguration>,
62}
63impl DistributeImageInputBuilder {
64 pub fn source_image(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.source_image = ::std::option::Option::Some(input.into());
68 self
69 }
70 pub fn set_source_image(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.source_image = input;
73 self
74 }
75 pub fn get_source_image(&self) -> &::std::option::Option<::std::string::String> {
77 &self.source_image
78 }
79 pub fn distribution_configuration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.distribution_configuration_arn = ::std::option::Option::Some(input.into());
83 self
84 }
85 pub fn set_distribution_configuration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87 self.distribution_configuration_arn = input;
88 self
89 }
90 pub fn get_distribution_configuration_arn(&self) -> &::std::option::Option<::std::string::String> {
92 &self.distribution_configuration_arn
93 }
94 pub fn execution_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97 self.execution_role = ::std::option::Option::Some(input.into());
98 self
99 }
100 pub fn set_execution_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102 self.execution_role = input;
103 self
104 }
105 pub fn get_execution_role(&self) -> &::std::option::Option<::std::string::String> {
107 &self.execution_role
108 }
109 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
115 let mut hash_map = self.tags.unwrap_or_default();
116 hash_map.insert(k.into(), v.into());
117 self.tags = ::std::option::Option::Some(hash_map);
118 self
119 }
120 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
122 self.tags = input;
123 self
124 }
125 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
127 &self.tags
128 }
129 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132 self.client_token = ::std::option::Option::Some(input.into());
133 self
134 }
135 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.client_token = input;
138 self
139 }
140 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
142 &self.client_token
143 }
144 pub fn logging_configuration(mut self, input: crate::types::ImageLoggingConfiguration) -> Self {
146 self.logging_configuration = ::std::option::Option::Some(input);
147 self
148 }
149 pub fn set_logging_configuration(mut self, input: ::std::option::Option<crate::types::ImageLoggingConfiguration>) -> Self {
151 self.logging_configuration = input;
152 self
153 }
154 pub fn get_logging_configuration(&self) -> &::std::option::Option<crate::types::ImageLoggingConfiguration> {
156 &self.logging_configuration
157 }
158 pub fn build(
160 self,
161 ) -> ::std::result::Result<crate::operation::distribute_image::DistributeImageInput, ::aws_smithy_types::error::operation::BuildError> {
162 ::std::result::Result::Ok(crate::operation::distribute_image::DistributeImageInput {
163 source_image: self.source_image,
164 distribution_configuration_arn: self.distribution_configuration_arn,
165 execution_role: self.execution_role,
166 tags: self.tags,
167 client_token: self.client_token,
168 logging_configuration: self.logging_configuration,
169 })
170 }
171}