aws_sdk_imagebuilder/types/
_distribution_configuration.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DistributionConfiguration {
7 pub arn: ::std::option::Option<::std::string::String>,
9 pub name: ::std::option::Option<::std::string::String>,
11 pub description: ::std::option::Option<::std::string::String>,
13 pub distributions: ::std::option::Option<::std::vec::Vec<crate::types::Distribution>>,
15 pub timeout_minutes: i32,
17 pub date_created: ::std::option::Option<::std::string::String>,
19 pub date_updated: ::std::option::Option<::std::string::String>,
21 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
23}
24impl DistributionConfiguration {
25 pub fn arn(&self) -> ::std::option::Option<&str> {
27 self.arn.as_deref()
28 }
29 pub fn name(&self) -> ::std::option::Option<&str> {
31 self.name.as_deref()
32 }
33 pub fn description(&self) -> ::std::option::Option<&str> {
35 self.description.as_deref()
36 }
37 pub fn distributions(&self) -> &[crate::types::Distribution] {
41 self.distributions.as_deref().unwrap_or_default()
42 }
43 pub fn timeout_minutes(&self) -> i32 {
45 self.timeout_minutes
46 }
47 pub fn date_created(&self) -> ::std::option::Option<&str> {
49 self.date_created.as_deref()
50 }
51 pub fn date_updated(&self) -> ::std::option::Option<&str> {
53 self.date_updated.as_deref()
54 }
55 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
57 self.tags.as_ref()
58 }
59}
60impl DistributionConfiguration {
61 pub fn builder() -> crate::types::builders::DistributionConfigurationBuilder {
63 crate::types::builders::DistributionConfigurationBuilder::default()
64 }
65}
66
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
69#[non_exhaustive]
70pub struct DistributionConfigurationBuilder {
71 pub(crate) arn: ::std::option::Option<::std::string::String>,
72 pub(crate) name: ::std::option::Option<::std::string::String>,
73 pub(crate) description: ::std::option::Option<::std::string::String>,
74 pub(crate) distributions: ::std::option::Option<::std::vec::Vec<crate::types::Distribution>>,
75 pub(crate) timeout_minutes: ::std::option::Option<i32>,
76 pub(crate) date_created: ::std::option::Option<::std::string::String>,
77 pub(crate) date_updated: ::std::option::Option<::std::string::String>,
78 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
79}
80impl DistributionConfigurationBuilder {
81 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83 self.arn = ::std::option::Option::Some(input.into());
84 self
85 }
86 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.arn = input;
89 self
90 }
91 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
93 &self.arn
94 }
95 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97 self.name = ::std::option::Option::Some(input.into());
98 self
99 }
100 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102 self.name = input;
103 self
104 }
105 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
107 &self.name
108 }
109 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 self.description = ::std::option::Option::Some(input.into());
112 self
113 }
114 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.description = input;
117 self
118 }
119 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
121 &self.description
122 }
123 pub fn distributions(mut self, input: crate::types::Distribution) -> Self {
129 let mut v = self.distributions.unwrap_or_default();
130 v.push(input);
131 self.distributions = ::std::option::Option::Some(v);
132 self
133 }
134 pub fn set_distributions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Distribution>>) -> Self {
136 self.distributions = input;
137 self
138 }
139 pub fn get_distributions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Distribution>> {
141 &self.distributions
142 }
143 pub fn timeout_minutes(mut self, input: i32) -> Self {
146 self.timeout_minutes = ::std::option::Option::Some(input);
147 self
148 }
149 pub fn set_timeout_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
151 self.timeout_minutes = input;
152 self
153 }
154 pub fn get_timeout_minutes(&self) -> &::std::option::Option<i32> {
156 &self.timeout_minutes
157 }
158 pub fn date_created(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.date_created = ::std::option::Option::Some(input.into());
161 self
162 }
163 pub fn set_date_created(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.date_created = input;
166 self
167 }
168 pub fn get_date_created(&self) -> &::std::option::Option<::std::string::String> {
170 &self.date_created
171 }
172 pub fn date_updated(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174 self.date_updated = ::std::option::Option::Some(input.into());
175 self
176 }
177 pub fn set_date_updated(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179 self.date_updated = input;
180 self
181 }
182 pub fn get_date_updated(&self) -> &::std::option::Option<::std::string::String> {
184 &self.date_updated
185 }
186 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
192 let mut hash_map = self.tags.unwrap_or_default();
193 hash_map.insert(k.into(), v.into());
194 self.tags = ::std::option::Option::Some(hash_map);
195 self
196 }
197 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
199 self.tags = input;
200 self
201 }
202 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
204 &self.tags
205 }
206 pub fn build(self) -> ::std::result::Result<crate::types::DistributionConfiguration, ::aws_smithy_types::error::operation::BuildError> {
210 ::std::result::Result::Ok(crate::types::DistributionConfiguration {
211 arn: self.arn,
212 name: self.name,
213 description: self.description,
214 distributions: self.distributions,
215 timeout_minutes: self.timeout_minutes.ok_or_else(|| {
216 ::aws_smithy_types::error::operation::BuildError::missing_field(
217 "timeout_minutes",
218 "timeout_minutes was not specified but it is required when building DistributionConfiguration",
219 )
220 })?,
221 date_created: self.date_created,
222 date_updated: self.date_updated,
223 tags: self.tags,
224 })
225 }
226}