aws_sdk_networkmanager/operation/get_sites/
_get_sites_input.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 GetSitesInput {
6    /// <p>The ID of the global network.</p>
7    pub global_network_id: ::std::option::Option<::std::string::String>,
8    /// <p>One or more site IDs. The maximum is 10.</p>
9    pub site_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10    /// <p>The maximum number of results to return.</p>
11    pub max_results: ::std::option::Option<i32>,
12    /// <p>The token for the next page of results.</p>
13    pub next_token: ::std::option::Option<::std::string::String>,
14}
15impl GetSitesInput {
16    /// <p>The ID of the global network.</p>
17    pub fn global_network_id(&self) -> ::std::option::Option<&str> {
18        self.global_network_id.as_deref()
19    }
20    /// <p>One or more site IDs. The maximum is 10.</p>
21    ///
22    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.site_ids.is_none()`.
23    pub fn site_ids(&self) -> &[::std::string::String] {
24        self.site_ids.as_deref().unwrap_or_default()
25    }
26    /// <p>The maximum number of results to return.</p>
27    pub fn max_results(&self) -> ::std::option::Option<i32> {
28        self.max_results
29    }
30    /// <p>The token for the next page of results.</p>
31    pub fn next_token(&self) -> ::std::option::Option<&str> {
32        self.next_token.as_deref()
33    }
34}
35impl GetSitesInput {
36    /// Creates a new builder-style object to manufacture [`GetSitesInput`](crate::operation::get_sites::GetSitesInput).
37    pub fn builder() -> crate::operation::get_sites::builders::GetSitesInputBuilder {
38        crate::operation::get_sites::builders::GetSitesInputBuilder::default()
39    }
40}
41
42/// A builder for [`GetSitesInput`](crate::operation::get_sites::GetSitesInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct GetSitesInputBuilder {
46    pub(crate) global_network_id: ::std::option::Option<::std::string::String>,
47    pub(crate) site_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
48    pub(crate) max_results: ::std::option::Option<i32>,
49    pub(crate) next_token: ::std::option::Option<::std::string::String>,
50}
51impl GetSitesInputBuilder {
52    /// <p>The ID of the global network.</p>
53    /// This field is required.
54    pub fn global_network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.global_network_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The ID of the global network.</p>
59    pub fn set_global_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.global_network_id = input;
61        self
62    }
63    /// <p>The ID of the global network.</p>
64    pub fn get_global_network_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.global_network_id
66    }
67    /// Appends an item to `site_ids`.
68    ///
69    /// To override the contents of this collection use [`set_site_ids`](Self::set_site_ids).
70    ///
71    /// <p>One or more site IDs. The maximum is 10.</p>
72    pub fn site_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        let mut v = self.site_ids.unwrap_or_default();
74        v.push(input.into());
75        self.site_ids = ::std::option::Option::Some(v);
76        self
77    }
78    /// <p>One or more site IDs. The maximum is 10.</p>
79    pub fn set_site_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
80        self.site_ids = input;
81        self
82    }
83    /// <p>One or more site IDs. The maximum is 10.</p>
84    pub fn get_site_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
85        &self.site_ids
86    }
87    /// <p>The maximum number of results to return.</p>
88    pub fn max_results(mut self, input: i32) -> Self {
89        self.max_results = ::std::option::Option::Some(input);
90        self
91    }
92    /// <p>The maximum number of results to return.</p>
93    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
94        self.max_results = input;
95        self
96    }
97    /// <p>The maximum number of results to return.</p>
98    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
99        &self.max_results
100    }
101    /// <p>The token for the next page of results.</p>
102    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.next_token = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The token for the next page of results.</p>
107    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.next_token = input;
109        self
110    }
111    /// <p>The token for the next page of results.</p>
112    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
113        &self.next_token
114    }
115    /// Consumes the builder and constructs a [`GetSitesInput`](crate::operation::get_sites::GetSitesInput).
116    pub fn build(self) -> ::std::result::Result<crate::operation::get_sites::GetSitesInput, ::aws_smithy_types::error::operation::BuildError> {
117        ::std::result::Result::Ok(crate::operation::get_sites::GetSitesInput {
118            global_network_id: self.global_network_id,
119            site_ids: self.site_ids,
120            max_results: self.max_results,
121            next_token: self.next_token,
122        })
123    }
124}