aws_sdk_ec2/operation/allocate_hosts/
_allocate_hosts_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AllocateHostsOutput {
7 pub host_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
9 _request_id: Option<String>,
10}
11impl AllocateHostsOutput {
12 pub fn host_ids(&self) -> &[::std::string::String] {
16 self.host_ids.as_deref().unwrap_or_default()
17 }
18}
19impl ::aws_types::request_id::RequestId for AllocateHostsOutput {
20 fn request_id(&self) -> Option<&str> {
21 self._request_id.as_deref()
22 }
23}
24impl AllocateHostsOutput {
25 pub fn builder() -> crate::operation::allocate_hosts::builders::AllocateHostsOutputBuilder {
27 crate::operation::allocate_hosts::builders::AllocateHostsOutputBuilder::default()
28 }
29}
30
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct AllocateHostsOutputBuilder {
35 pub(crate) host_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
36 _request_id: Option<String>,
37}
38impl AllocateHostsOutputBuilder {
39 pub fn host_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45 let mut v = self.host_ids.unwrap_or_default();
46 v.push(input.into());
47 self.host_ids = ::std::option::Option::Some(v);
48 self
49 }
50 pub fn set_host_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
52 self.host_ids = input;
53 self
54 }
55 pub fn get_host_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
57 &self.host_ids
58 }
59 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
60 self._request_id = Some(request_id.into());
61 self
62 }
63
64 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
65 self._request_id = request_id;
66 self
67 }
68 pub fn build(self) -> crate::operation::allocate_hosts::AllocateHostsOutput {
70 crate::operation::allocate_hosts::AllocateHostsOutput {
71 host_ids: self.host_ids,
72 _request_id: self._request_id,
73 }
74 }
75}