aws_sdk_lightsail/operation/get_load_balancers/_get_load_balancers_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 GetLoadBalancersOutput {
6 /// <p>An array of LoadBalancer objects describing your load balancers.</p>
7 pub load_balancers: ::std::option::Option<::std::vec::Vec<crate::types::LoadBalancer>>,
8 /// <p>The token to advance to the next page of results from your request.</p>
9 /// <p>A next page token is not returned if there are no more results to display.</p>
10 /// <p>To get the next page of results, perform another <code>GetLoadBalancers</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
11 pub next_page_token: ::std::option::Option<::std::string::String>,
12 _request_id: Option<String>,
13}
14impl GetLoadBalancersOutput {
15 /// <p>An array of LoadBalancer objects describing your load balancers.</p>
16 ///
17 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.load_balancers.is_none()`.
18 pub fn load_balancers(&self) -> &[crate::types::LoadBalancer] {
19 self.load_balancers.as_deref().unwrap_or_default()
20 }
21 /// <p>The token to advance to the next page of results from your request.</p>
22 /// <p>A next page token is not returned if there are no more results to display.</p>
23 /// <p>To get the next page of results, perform another <code>GetLoadBalancers</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
24 pub fn next_page_token(&self) -> ::std::option::Option<&str> {
25 self.next_page_token.as_deref()
26 }
27}
28impl ::aws_types::request_id::RequestId for GetLoadBalancersOutput {
29 fn request_id(&self) -> Option<&str> {
30 self._request_id.as_deref()
31 }
32}
33impl GetLoadBalancersOutput {
34 /// Creates a new builder-style object to manufacture [`GetLoadBalancersOutput`](crate::operation::get_load_balancers::GetLoadBalancersOutput).
35 pub fn builder() -> crate::operation::get_load_balancers::builders::GetLoadBalancersOutputBuilder {
36 crate::operation::get_load_balancers::builders::GetLoadBalancersOutputBuilder::default()
37 }
38}
39
40/// A builder for [`GetLoadBalancersOutput`](crate::operation::get_load_balancers::GetLoadBalancersOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct GetLoadBalancersOutputBuilder {
44 pub(crate) load_balancers: ::std::option::Option<::std::vec::Vec<crate::types::LoadBalancer>>,
45 pub(crate) next_page_token: ::std::option::Option<::std::string::String>,
46 _request_id: Option<String>,
47}
48impl GetLoadBalancersOutputBuilder {
49 /// Appends an item to `load_balancers`.
50 ///
51 /// To override the contents of this collection use [`set_load_balancers`](Self::set_load_balancers).
52 ///
53 /// <p>An array of LoadBalancer objects describing your load balancers.</p>
54 pub fn load_balancers(mut self, input: crate::types::LoadBalancer) -> Self {
55 let mut v = self.load_balancers.unwrap_or_default();
56 v.push(input);
57 self.load_balancers = ::std::option::Option::Some(v);
58 self
59 }
60 /// <p>An array of LoadBalancer objects describing your load balancers.</p>
61 pub fn set_load_balancers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LoadBalancer>>) -> Self {
62 self.load_balancers = input;
63 self
64 }
65 /// <p>An array of LoadBalancer objects describing your load balancers.</p>
66 pub fn get_load_balancers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LoadBalancer>> {
67 &self.load_balancers
68 }
69 /// <p>The token to advance to the next page of results from your request.</p>
70 /// <p>A next page token is not returned if there are no more results to display.</p>
71 /// <p>To get the next page of results, perform another <code>GetLoadBalancers</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
72 pub fn next_page_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73 self.next_page_token = ::std::option::Option::Some(input.into());
74 self
75 }
76 /// <p>The token to advance to the next page of results from your request.</p>
77 /// <p>A next page token is not returned if there are no more results to display.</p>
78 /// <p>To get the next page of results, perform another <code>GetLoadBalancers</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
79 pub fn set_next_page_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80 self.next_page_token = input;
81 self
82 }
83 /// <p>The token to advance to the next page of results from your request.</p>
84 /// <p>A next page token is not returned if there are no more results to display.</p>
85 /// <p>To get the next page of results, perform another <code>GetLoadBalancers</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
86 pub fn get_next_page_token(&self) -> &::std::option::Option<::std::string::String> {
87 &self.next_page_token
88 }
89 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
90 self._request_id = Some(request_id.into());
91 self
92 }
93
94 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
95 self._request_id = request_id;
96 self
97 }
98 /// Consumes the builder and constructs a [`GetLoadBalancersOutput`](crate::operation::get_load_balancers::GetLoadBalancersOutput).
99 pub fn build(self) -> crate::operation::get_load_balancers::GetLoadBalancersOutput {
100 crate::operation::get_load_balancers::GetLoadBalancersOutput {
101 load_balancers: self.load_balancers,
102 next_page_token: self.next_page_token,
103 _request_id: self._request_id,
104 }
105 }
106}