aws_sdk_applicationdiscovery/operation/describe_agents/
_describe_agents_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 DescribeAgentsInput {
6    /// <p>The agent or the collector IDs for which you want information. If you specify no IDs, the system returns information about all agents/collectors associated with your user.</p>
7    pub agent_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>You can filter the request using various logical operators and a <i>key</i>-<i>value</i> format. For example:</p>
9    /// <p><code>{"key": "collectionStatus", "value": "STARTED"}</code></p>
10    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
11    /// <p>The total number of agents/collectors to return in a single page of output. The maximum value is 100.</p>
12    pub max_results: ::std::option::Option<i32>,
13    /// <p>Token to retrieve the next set of results. For example, if you previously specified 100 IDs for <code>DescribeAgentsRequest$agentIds</code> but set <code>DescribeAgentsRequest$maxResults</code> to 10, you received a set of 10 results along with a token. Use that token in this query to get the next set of 10.</p>
14    pub next_token: ::std::option::Option<::std::string::String>,
15}
16impl DescribeAgentsInput {
17    /// <p>The agent or the collector IDs for which you want information. If you specify no IDs, the system returns information about all agents/collectors associated with your user.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.agent_ids.is_none()`.
20    pub fn agent_ids(&self) -> &[::std::string::String] {
21        self.agent_ids.as_deref().unwrap_or_default()
22    }
23    /// <p>You can filter the request using various logical operators and a <i>key</i>-<i>value</i> format. For example:</p>
24    /// <p><code>{"key": "collectionStatus", "value": "STARTED"}</code></p>
25    ///
26    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
27    pub fn filters(&self) -> &[crate::types::Filter] {
28        self.filters.as_deref().unwrap_or_default()
29    }
30    /// <p>The total number of agents/collectors to return in a single page of output. The maximum value is 100.</p>
31    pub fn max_results(&self) -> ::std::option::Option<i32> {
32        self.max_results
33    }
34    /// <p>Token to retrieve the next set of results. For example, if you previously specified 100 IDs for <code>DescribeAgentsRequest$agentIds</code> but set <code>DescribeAgentsRequest$maxResults</code> to 10, you received a set of 10 results along with a token. Use that token in this query to get the next set of 10.</p>
35    pub fn next_token(&self) -> ::std::option::Option<&str> {
36        self.next_token.as_deref()
37    }
38}
39impl DescribeAgentsInput {
40    /// Creates a new builder-style object to manufacture [`DescribeAgentsInput`](crate::operation::describe_agents::DescribeAgentsInput).
41    pub fn builder() -> crate::operation::describe_agents::builders::DescribeAgentsInputBuilder {
42        crate::operation::describe_agents::builders::DescribeAgentsInputBuilder::default()
43    }
44}
45
46/// A builder for [`DescribeAgentsInput`](crate::operation::describe_agents::DescribeAgentsInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct DescribeAgentsInputBuilder {
50    pub(crate) agent_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
51    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
52    pub(crate) max_results: ::std::option::Option<i32>,
53    pub(crate) next_token: ::std::option::Option<::std::string::String>,
54}
55impl DescribeAgentsInputBuilder {
56    /// Appends an item to `agent_ids`.
57    ///
58    /// To override the contents of this collection use [`set_agent_ids`](Self::set_agent_ids).
59    ///
60    /// <p>The agent or the collector IDs for which you want information. If you specify no IDs, the system returns information about all agents/collectors associated with your user.</p>
61    pub fn agent_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        let mut v = self.agent_ids.unwrap_or_default();
63        v.push(input.into());
64        self.agent_ids = ::std::option::Option::Some(v);
65        self
66    }
67    /// <p>The agent or the collector IDs for which you want information. If you specify no IDs, the system returns information about all agents/collectors associated with your user.</p>
68    pub fn set_agent_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
69        self.agent_ids = input;
70        self
71    }
72    /// <p>The agent or the collector IDs for which you want information. If you specify no IDs, the system returns information about all agents/collectors associated with your user.</p>
73    pub fn get_agent_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
74        &self.agent_ids
75    }
76    /// Appends an item to `filters`.
77    ///
78    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
79    ///
80    /// <p>You can filter the request using various logical operators and a <i>key</i>-<i>value</i> format. For example:</p>
81    /// <p><code>{"key": "collectionStatus", "value": "STARTED"}</code></p>
82    pub fn filters(mut self, input: crate::types::Filter) -> Self {
83        let mut v = self.filters.unwrap_or_default();
84        v.push(input);
85        self.filters = ::std::option::Option::Some(v);
86        self
87    }
88    /// <p>You can filter the request using various logical operators and a <i>key</i>-<i>value</i> format. For example:</p>
89    /// <p><code>{"key": "collectionStatus", "value": "STARTED"}</code></p>
90    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
91        self.filters = input;
92        self
93    }
94    /// <p>You can filter the request using various logical operators and a <i>key</i>-<i>value</i> format. For example:</p>
95    /// <p><code>{"key": "collectionStatus", "value": "STARTED"}</code></p>
96    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
97        &self.filters
98    }
99    /// <p>The total number of agents/collectors to return in a single page of output. The maximum value is 100.</p>
100    pub fn max_results(mut self, input: i32) -> Self {
101        self.max_results = ::std::option::Option::Some(input);
102        self
103    }
104    /// <p>The total number of agents/collectors to return in a single page of output. The maximum value is 100.</p>
105    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
106        self.max_results = input;
107        self
108    }
109    /// <p>The total number of agents/collectors to return in a single page of output. The maximum value is 100.</p>
110    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
111        &self.max_results
112    }
113    /// <p>Token to retrieve the next set of results. For example, if you previously specified 100 IDs for <code>DescribeAgentsRequest$agentIds</code> but set <code>DescribeAgentsRequest$maxResults</code> to 10, you received a set of 10 results along with a token. Use that token in this query to get the next set of 10.</p>
114    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.next_token = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>Token to retrieve the next set of results. For example, if you previously specified 100 IDs for <code>DescribeAgentsRequest$agentIds</code> but set <code>DescribeAgentsRequest$maxResults</code> to 10, you received a set of 10 results along with a token. Use that token in this query to get the next set of 10.</p>
119    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.next_token = input;
121        self
122    }
123    /// <p>Token to retrieve the next set of results. For example, if you previously specified 100 IDs for <code>DescribeAgentsRequest$agentIds</code> but set <code>DescribeAgentsRequest$maxResults</code> to 10, you received a set of 10 results along with a token. Use that token in this query to get the next set of 10.</p>
124    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
125        &self.next_token
126    }
127    /// Consumes the builder and constructs a [`DescribeAgentsInput`](crate::operation::describe_agents::DescribeAgentsInput).
128    pub fn build(
129        self,
130    ) -> ::std::result::Result<crate::operation::describe_agents::DescribeAgentsInput, ::aws_smithy_types::error::operation::BuildError> {
131        ::std::result::Result::Ok(crate::operation::describe_agents::DescribeAgentsInput {
132            agent_ids: self.agent_ids,
133            filters: self.filters,
134            max_results: self.max_results,
135            next_token: self.next_token,
136        })
137    }
138}