aws_sdk_ec2/operation/release_hosts/
_release_hosts_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 ReleaseHostsOutput {
6    /// <p>The IDs of the Dedicated Hosts that were successfully released.</p>
7    pub successful: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>The IDs of the Dedicated Hosts that could not be released, including an error message.</p>
9    pub unsuccessful: ::std::option::Option<::std::vec::Vec<crate::types::UnsuccessfulItem>>,
10    _request_id: Option<String>,
11}
12impl ReleaseHostsOutput {
13    /// <p>The IDs of the Dedicated Hosts that were successfully released.</p>
14    ///
15    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.successful.is_none()`.
16    pub fn successful(&self) -> &[::std::string::String] {
17        self.successful.as_deref().unwrap_or_default()
18    }
19    /// <p>The IDs of the Dedicated Hosts that could not be released, including an error message.</p>
20    ///
21    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.unsuccessful.is_none()`.
22    pub fn unsuccessful(&self) -> &[crate::types::UnsuccessfulItem] {
23        self.unsuccessful.as_deref().unwrap_or_default()
24    }
25}
26impl ::aws_types::request_id::RequestId for ReleaseHostsOutput {
27    fn request_id(&self) -> Option<&str> {
28        self._request_id.as_deref()
29    }
30}
31impl ReleaseHostsOutput {
32    /// Creates a new builder-style object to manufacture [`ReleaseHostsOutput`](crate::operation::release_hosts::ReleaseHostsOutput).
33    pub fn builder() -> crate::operation::release_hosts::builders::ReleaseHostsOutputBuilder {
34        crate::operation::release_hosts::builders::ReleaseHostsOutputBuilder::default()
35    }
36}
37
38/// A builder for [`ReleaseHostsOutput`](crate::operation::release_hosts::ReleaseHostsOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct ReleaseHostsOutputBuilder {
42    pub(crate) successful: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43    pub(crate) unsuccessful: ::std::option::Option<::std::vec::Vec<crate::types::UnsuccessfulItem>>,
44    _request_id: Option<String>,
45}
46impl ReleaseHostsOutputBuilder {
47    /// Appends an item to `successful`.
48    ///
49    /// To override the contents of this collection use [`set_successful`](Self::set_successful).
50    ///
51    /// <p>The IDs of the Dedicated Hosts that were successfully released.</p>
52    pub fn successful(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        let mut v = self.successful.unwrap_or_default();
54        v.push(input.into());
55        self.successful = ::std::option::Option::Some(v);
56        self
57    }
58    /// <p>The IDs of the Dedicated Hosts that were successfully released.</p>
59    pub fn set_successful(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
60        self.successful = input;
61        self
62    }
63    /// <p>The IDs of the Dedicated Hosts that were successfully released.</p>
64    pub fn get_successful(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
65        &self.successful
66    }
67    /// Appends an item to `unsuccessful`.
68    ///
69    /// To override the contents of this collection use [`set_unsuccessful`](Self::set_unsuccessful).
70    ///
71    /// <p>The IDs of the Dedicated Hosts that could not be released, including an error message.</p>
72    pub fn unsuccessful(mut self, input: crate::types::UnsuccessfulItem) -> Self {
73        let mut v = self.unsuccessful.unwrap_or_default();
74        v.push(input);
75        self.unsuccessful = ::std::option::Option::Some(v);
76        self
77    }
78    /// <p>The IDs of the Dedicated Hosts that could not be released, including an error message.</p>
79    pub fn set_unsuccessful(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UnsuccessfulItem>>) -> Self {
80        self.unsuccessful = input;
81        self
82    }
83    /// <p>The IDs of the Dedicated Hosts that could not be released, including an error message.</p>
84    pub fn get_unsuccessful(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UnsuccessfulItem>> {
85        &self.unsuccessful
86    }
87    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
88        self._request_id = Some(request_id.into());
89        self
90    }
91
92    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
93        self._request_id = request_id;
94        self
95    }
96    /// Consumes the builder and constructs a [`ReleaseHostsOutput`](crate::operation::release_hosts::ReleaseHostsOutput).
97    pub fn build(self) -> crate::operation::release_hosts::ReleaseHostsOutput {
98        crate::operation::release_hosts::ReleaseHostsOutput {
99            successful: self.successful,
100            unsuccessful: self.unsuccessful,
101            _request_id: self._request_id,
102        }
103    }
104}