aws_sdk_elasticloadbalancing/operation/attach_load_balancer_to_subnets/
_attach_load_balancer_to_subnets_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the output of AttachLoadBalancerToSubnets.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AttachLoadBalancerToSubnetsOutput {
7    /// <p>The IDs of the subnets attached to the load balancer.</p>
8    pub subnets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
9    _request_id: Option<String>,
10}
11impl AttachLoadBalancerToSubnetsOutput {
12    /// <p>The IDs of the subnets attached to the load balancer.</p>
13    ///
14    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subnets.is_none()`.
15    pub fn subnets(&self) -> &[::std::string::String] {
16        self.subnets.as_deref().unwrap_or_default()
17    }
18}
19impl ::aws_types::request_id::RequestId for AttachLoadBalancerToSubnetsOutput {
20    fn request_id(&self) -> Option<&str> {
21        self._request_id.as_deref()
22    }
23}
24impl AttachLoadBalancerToSubnetsOutput {
25    /// Creates a new builder-style object to manufacture [`AttachLoadBalancerToSubnetsOutput`](crate::operation::attach_load_balancer_to_subnets::AttachLoadBalancerToSubnetsOutput).
26    pub fn builder() -> crate::operation::attach_load_balancer_to_subnets::builders::AttachLoadBalancerToSubnetsOutputBuilder {
27        crate::operation::attach_load_balancer_to_subnets::builders::AttachLoadBalancerToSubnetsOutputBuilder::default()
28    }
29}
30
31/// A builder for [`AttachLoadBalancerToSubnetsOutput`](crate::operation::attach_load_balancer_to_subnets::AttachLoadBalancerToSubnetsOutput).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct AttachLoadBalancerToSubnetsOutputBuilder {
35    pub(crate) subnets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
36    _request_id: Option<String>,
37}
38impl AttachLoadBalancerToSubnetsOutputBuilder {
39    /// Appends an item to `subnets`.
40    ///
41    /// To override the contents of this collection use [`set_subnets`](Self::set_subnets).
42    ///
43    /// <p>The IDs of the subnets attached to the load balancer.</p>
44    pub fn subnets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        let mut v = self.subnets.unwrap_or_default();
46        v.push(input.into());
47        self.subnets = ::std::option::Option::Some(v);
48        self
49    }
50    /// <p>The IDs of the subnets attached to the load balancer.</p>
51    pub fn set_subnets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
52        self.subnets = input;
53        self
54    }
55    /// <p>The IDs of the subnets attached to the load balancer.</p>
56    pub fn get_subnets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
57        &self.subnets
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    /// Consumes the builder and constructs a [`AttachLoadBalancerToSubnetsOutput`](crate::operation::attach_load_balancer_to_subnets::AttachLoadBalancerToSubnetsOutput).
69    pub fn build(self) -> crate::operation::attach_load_balancer_to_subnets::AttachLoadBalancerToSubnetsOutput {
70        crate::operation::attach_load_balancer_to_subnets::AttachLoadBalancerToSubnetsOutput {
71            subnets: self.subnets,
72            _request_id: self._request_id,
73        }
74    }
75}