aws_sdk_ec2/operation/deregister_image/
_deregister_image_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeregisterImageOutput {
6    /// <p>Returns <code>true</code> if the request succeeds; otherwise, it returns an error.</p>
7    pub r#return: ::std::option::Option<bool>,
8    /// <p>The deletion result for each snapshot associated with the AMI, including the snapshot ID and its success or error code.</p>
9    pub delete_snapshot_results: ::std::option::Option<::std::vec::Vec<crate::types::DeleteSnapshotReturnCode>>,
10    _request_id: Option<String>,
11}
12impl DeregisterImageOutput {
13    /// <p>Returns <code>true</code> if the request succeeds; otherwise, it returns an error.</p>
14    pub fn r#return(&self) -> ::std::option::Option<bool> {
15        self.r#return
16    }
17    /// <p>The deletion result for each snapshot associated with the AMI, including the snapshot ID and its success or error code.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.delete_snapshot_results.is_none()`.
20    pub fn delete_snapshot_results(&self) -> &[crate::types::DeleteSnapshotReturnCode] {
21        self.delete_snapshot_results.as_deref().unwrap_or_default()
22    }
23}
24impl ::aws_types::request_id::RequestId for DeregisterImageOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl DeregisterImageOutput {
30    /// Creates a new builder-style object to manufacture [`DeregisterImageOutput`](crate::operation::deregister_image::DeregisterImageOutput).
31    pub fn builder() -> crate::operation::deregister_image::builders::DeregisterImageOutputBuilder {
32        crate::operation::deregister_image::builders::DeregisterImageOutputBuilder::default()
33    }
34}
35
36/// A builder for [`DeregisterImageOutput`](crate::operation::deregister_image::DeregisterImageOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct DeregisterImageOutputBuilder {
40    pub(crate) r#return: ::std::option::Option<bool>,
41    pub(crate) delete_snapshot_results: ::std::option::Option<::std::vec::Vec<crate::types::DeleteSnapshotReturnCode>>,
42    _request_id: Option<String>,
43}
44impl DeregisterImageOutputBuilder {
45    /// <p>Returns <code>true</code> if the request succeeds; otherwise, it returns an error.</p>
46    pub fn r#return(mut self, input: bool) -> Self {
47        self.r#return = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>Returns <code>true</code> if the request succeeds; otherwise, it returns an error.</p>
51    pub fn set_return(mut self, input: ::std::option::Option<bool>) -> Self {
52        self.r#return = input;
53        self
54    }
55    /// <p>Returns <code>true</code> if the request succeeds; otherwise, it returns an error.</p>
56    pub fn get_return(&self) -> &::std::option::Option<bool> {
57        &self.r#return
58    }
59    /// Appends an item to `delete_snapshot_results`.
60    ///
61    /// To override the contents of this collection use [`set_delete_snapshot_results`](Self::set_delete_snapshot_results).
62    ///
63    /// <p>The deletion result for each snapshot associated with the AMI, including the snapshot ID and its success or error code.</p>
64    pub fn delete_snapshot_results(mut self, input: crate::types::DeleteSnapshotReturnCode) -> Self {
65        let mut v = self.delete_snapshot_results.unwrap_or_default();
66        v.push(input);
67        self.delete_snapshot_results = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>The deletion result for each snapshot associated with the AMI, including the snapshot ID and its success or error code.</p>
71    pub fn set_delete_snapshot_results(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DeleteSnapshotReturnCode>>) -> Self {
72        self.delete_snapshot_results = input;
73        self
74    }
75    /// <p>The deletion result for each snapshot associated with the AMI, including the snapshot ID and its success or error code.</p>
76    pub fn get_delete_snapshot_results(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DeleteSnapshotReturnCode>> {
77        &self.delete_snapshot_results
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`DeregisterImageOutput`](crate::operation::deregister_image::DeregisterImageOutput).
89    pub fn build(self) -> crate::operation::deregister_image::DeregisterImageOutput {
90        crate::operation::deregister_image::DeregisterImageOutput {
91            r#return: self.r#return,
92            delete_snapshot_results: self.delete_snapshot_results,
93            _request_id: self._request_id,
94        }
95    }
96}