aws_sdk_ec2/operation/export_image/
_export_image_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ExportImageInput {
6 pub client_token: ::std::option::Option<::std::string::String>,
8 pub description: ::std::option::Option<::std::string::String>,
10 pub disk_image_format: ::std::option::Option<crate::types::DiskImageFormat>,
12 pub dry_run: ::std::option::Option<bool>,
14 pub image_id: ::std::option::Option<::std::string::String>,
16 pub s3_export_location: ::std::option::Option<crate::types::ExportTaskS3LocationRequest>,
18 pub role_name: ::std::option::Option<::std::string::String>,
20 pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
22}
23impl ExportImageInput {
24 pub fn client_token(&self) -> ::std::option::Option<&str> {
26 self.client_token.as_deref()
27 }
28 pub fn description(&self) -> ::std::option::Option<&str> {
30 self.description.as_deref()
31 }
32 pub fn disk_image_format(&self) -> ::std::option::Option<&crate::types::DiskImageFormat> {
34 self.disk_image_format.as_ref()
35 }
36 pub fn dry_run(&self) -> ::std::option::Option<bool> {
38 self.dry_run
39 }
40 pub fn image_id(&self) -> ::std::option::Option<&str> {
42 self.image_id.as_deref()
43 }
44 pub fn s3_export_location(&self) -> ::std::option::Option<&crate::types::ExportTaskS3LocationRequest> {
46 self.s3_export_location.as_ref()
47 }
48 pub fn role_name(&self) -> ::std::option::Option<&str> {
50 self.role_name.as_deref()
51 }
52 pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
56 self.tag_specifications.as_deref().unwrap_or_default()
57 }
58}
59impl ExportImageInput {
60 pub fn builder() -> crate::operation::export_image::builders::ExportImageInputBuilder {
62 crate::operation::export_image::builders::ExportImageInputBuilder::default()
63 }
64}
65
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct ExportImageInputBuilder {
70 pub(crate) client_token: ::std::option::Option<::std::string::String>,
71 pub(crate) description: ::std::option::Option<::std::string::String>,
72 pub(crate) disk_image_format: ::std::option::Option<crate::types::DiskImageFormat>,
73 pub(crate) dry_run: ::std::option::Option<bool>,
74 pub(crate) image_id: ::std::option::Option<::std::string::String>,
75 pub(crate) s3_export_location: ::std::option::Option<crate::types::ExportTaskS3LocationRequest>,
76 pub(crate) role_name: ::std::option::Option<::std::string::String>,
77 pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
78}
79impl ExportImageInputBuilder {
80 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.client_token = ::std::option::Option::Some(input.into());
83 self
84 }
85 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87 self.client_token = input;
88 self
89 }
90 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
92 &self.client_token
93 }
94 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96 self.description = ::std::option::Option::Some(input.into());
97 self
98 }
99 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101 self.description = input;
102 self
103 }
104 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
106 &self.description
107 }
108 pub fn disk_image_format(mut self, input: crate::types::DiskImageFormat) -> Self {
111 self.disk_image_format = ::std::option::Option::Some(input);
112 self
113 }
114 pub fn set_disk_image_format(mut self, input: ::std::option::Option<crate::types::DiskImageFormat>) -> Self {
116 self.disk_image_format = input;
117 self
118 }
119 pub fn get_disk_image_format(&self) -> &::std::option::Option<crate::types::DiskImageFormat> {
121 &self.disk_image_format
122 }
123 pub fn dry_run(mut self, input: bool) -> Self {
125 self.dry_run = ::std::option::Option::Some(input);
126 self
127 }
128 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
130 self.dry_run = input;
131 self
132 }
133 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
135 &self.dry_run
136 }
137 pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140 self.image_id = ::std::option::Option::Some(input.into());
141 self
142 }
143 pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145 self.image_id = input;
146 self
147 }
148 pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
150 &self.image_id
151 }
152 pub fn s3_export_location(mut self, input: crate::types::ExportTaskS3LocationRequest) -> Self {
155 self.s3_export_location = ::std::option::Option::Some(input);
156 self
157 }
158 pub fn set_s3_export_location(mut self, input: ::std::option::Option<crate::types::ExportTaskS3LocationRequest>) -> Self {
160 self.s3_export_location = input;
161 self
162 }
163 pub fn get_s3_export_location(&self) -> &::std::option::Option<crate::types::ExportTaskS3LocationRequest> {
165 &self.s3_export_location
166 }
167 pub fn role_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169 self.role_name = ::std::option::Option::Some(input.into());
170 self
171 }
172 pub fn set_role_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174 self.role_name = input;
175 self
176 }
177 pub fn get_role_name(&self) -> &::std::option::Option<::std::string::String> {
179 &self.role_name
180 }
181 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
187 let mut v = self.tag_specifications.unwrap_or_default();
188 v.push(input);
189 self.tag_specifications = ::std::option::Option::Some(v);
190 self
191 }
192 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
194 self.tag_specifications = input;
195 self
196 }
197 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
199 &self.tag_specifications
200 }
201 pub fn build(self) -> ::std::result::Result<crate::operation::export_image::ExportImageInput, ::aws_smithy_types::error::operation::BuildError> {
203 ::std::result::Result::Ok(crate::operation::export_image::ExportImageInput {
204 client_token: self.client_token,
205 description: self.description,
206 disk_image_format: self.disk_image_format,
207 dry_run: self.dry_run,
208 image_id: self.image_id,
209 s3_export_location: self.s3_export_location,
210 role_name: self.role_name,
211 tag_specifications: self.tag_specifications,
212 })
213 }
214}