aws_sdk_iotthingsgraph/operation/search_entities/_search_entities_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 SearchEntitiesInput {
6 /// <p>The entity types for which to search.</p>
7 pub entity_types: ::std::option::Option<::std::vec::Vec<crate::types::EntityType>>,
8 /// <p>Optional filter to apply to the search. Valid filters are <code>NAME</code> <code>NAMESPACE</code>, <code>SEMANTIC_TYPE_PATH</code> and <code>REFERENCED_ENTITY_ID</code>. <code>REFERENCED_ENTITY_ID</code> filters on entities that are used by the entity in the result set. For example, you can filter on the ID of a property that is used in a state.</p>
9 /// <p>Multiple filters function as OR criteria in the query. Multiple values passed inside the filter function as AND criteria.</p>
10 pub filters: ::std::option::Option<::std::vec::Vec<crate::types::EntityFilter>>,
11 /// <p>The string that specifies the next page of results. Use this when you're paginating results.</p>
12 pub next_token: ::std::option::Option<::std::string::String>,
13 /// <p>The maximum number of results to return in the response.</p>
14 pub max_results: ::std::option::Option<i32>,
15 /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
16 pub namespace_version: ::std::option::Option<i64>,
17}
18impl SearchEntitiesInput {
19 /// <p>The entity types for which to search.</p>
20 ///
21 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.entity_types.is_none()`.
22 pub fn entity_types(&self) -> &[crate::types::EntityType] {
23 self.entity_types.as_deref().unwrap_or_default()
24 }
25 /// <p>Optional filter to apply to the search. Valid filters are <code>NAME</code> <code>NAMESPACE</code>, <code>SEMANTIC_TYPE_PATH</code> and <code>REFERENCED_ENTITY_ID</code>. <code>REFERENCED_ENTITY_ID</code> filters on entities that are used by the entity in the result set. For example, you can filter on the ID of a property that is used in a state.</p>
26 /// <p>Multiple filters function as OR criteria in the query. Multiple values passed inside the filter function as AND criteria.</p>
27 ///
28 /// 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()`.
29 pub fn filters(&self) -> &[crate::types::EntityFilter] {
30 self.filters.as_deref().unwrap_or_default()
31 }
32 /// <p>The string that specifies the next page of results. Use this when you're paginating results.</p>
33 pub fn next_token(&self) -> ::std::option::Option<&str> {
34 self.next_token.as_deref()
35 }
36 /// <p>The maximum number of results to return in the response.</p>
37 pub fn max_results(&self) -> ::std::option::Option<i32> {
38 self.max_results
39 }
40 /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
41 pub fn namespace_version(&self) -> ::std::option::Option<i64> {
42 self.namespace_version
43 }
44}
45impl SearchEntitiesInput {
46 /// Creates a new builder-style object to manufacture [`SearchEntitiesInput`](crate::operation::search_entities::SearchEntitiesInput).
47 pub fn builder() -> crate::operation::search_entities::builders::SearchEntitiesInputBuilder {
48 crate::operation::search_entities::builders::SearchEntitiesInputBuilder::default()
49 }
50}
51
52/// A builder for [`SearchEntitiesInput`](crate::operation::search_entities::SearchEntitiesInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct SearchEntitiesInputBuilder {
56 pub(crate) entity_types: ::std::option::Option<::std::vec::Vec<crate::types::EntityType>>,
57 pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::EntityFilter>>,
58 pub(crate) next_token: ::std::option::Option<::std::string::String>,
59 pub(crate) max_results: ::std::option::Option<i32>,
60 pub(crate) namespace_version: ::std::option::Option<i64>,
61}
62impl SearchEntitiesInputBuilder {
63 /// Appends an item to `entity_types`.
64 ///
65 /// To override the contents of this collection use [`set_entity_types`](Self::set_entity_types).
66 ///
67 /// <p>The entity types for which to search.</p>
68 pub fn entity_types(mut self, input: crate::types::EntityType) -> Self {
69 let mut v = self.entity_types.unwrap_or_default();
70 v.push(input);
71 self.entity_types = ::std::option::Option::Some(v);
72 self
73 }
74 /// <p>The entity types for which to search.</p>
75 pub fn set_entity_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EntityType>>) -> Self {
76 self.entity_types = input;
77 self
78 }
79 /// <p>The entity types for which to search.</p>
80 pub fn get_entity_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EntityType>> {
81 &self.entity_types
82 }
83 /// Appends an item to `filters`.
84 ///
85 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
86 ///
87 /// <p>Optional filter to apply to the search. Valid filters are <code>NAME</code> <code>NAMESPACE</code>, <code>SEMANTIC_TYPE_PATH</code> and <code>REFERENCED_ENTITY_ID</code>. <code>REFERENCED_ENTITY_ID</code> filters on entities that are used by the entity in the result set. For example, you can filter on the ID of a property that is used in a state.</p>
88 /// <p>Multiple filters function as OR criteria in the query. Multiple values passed inside the filter function as AND criteria.</p>
89 pub fn filters(mut self, input: crate::types::EntityFilter) -> Self {
90 let mut v = self.filters.unwrap_or_default();
91 v.push(input);
92 self.filters = ::std::option::Option::Some(v);
93 self
94 }
95 /// <p>Optional filter to apply to the search. Valid filters are <code>NAME</code> <code>NAMESPACE</code>, <code>SEMANTIC_TYPE_PATH</code> and <code>REFERENCED_ENTITY_ID</code>. <code>REFERENCED_ENTITY_ID</code> filters on entities that are used by the entity in the result set. For example, you can filter on the ID of a property that is used in a state.</p>
96 /// <p>Multiple filters function as OR criteria in the query. Multiple values passed inside the filter function as AND criteria.</p>
97 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EntityFilter>>) -> Self {
98 self.filters = input;
99 self
100 }
101 /// <p>Optional filter to apply to the search. Valid filters are <code>NAME</code> <code>NAMESPACE</code>, <code>SEMANTIC_TYPE_PATH</code> and <code>REFERENCED_ENTITY_ID</code>. <code>REFERENCED_ENTITY_ID</code> filters on entities that are used by the entity in the result set. For example, you can filter on the ID of a property that is used in a state.</p>
102 /// <p>Multiple filters function as OR criteria in the query. Multiple values passed inside the filter function as AND criteria.</p>
103 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EntityFilter>> {
104 &self.filters
105 }
106 /// <p>The string that specifies the next page of results. Use this when you're paginating results.</p>
107 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108 self.next_token = ::std::option::Option::Some(input.into());
109 self
110 }
111 /// <p>The string that specifies the next page of results. Use this when you're paginating results.</p>
112 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113 self.next_token = input;
114 self
115 }
116 /// <p>The string that specifies the next page of results. Use this when you're paginating results.</p>
117 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
118 &self.next_token
119 }
120 /// <p>The maximum number of results to return in the response.</p>
121 pub fn max_results(mut self, input: i32) -> Self {
122 self.max_results = ::std::option::Option::Some(input);
123 self
124 }
125 /// <p>The maximum number of results to return in the response.</p>
126 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
127 self.max_results = input;
128 self
129 }
130 /// <p>The maximum number of results to return in the response.</p>
131 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
132 &self.max_results
133 }
134 /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
135 pub fn namespace_version(mut self, input: i64) -> Self {
136 self.namespace_version = ::std::option::Option::Some(input);
137 self
138 }
139 /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
140 pub fn set_namespace_version(mut self, input: ::std::option::Option<i64>) -> Self {
141 self.namespace_version = input;
142 self
143 }
144 /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
145 pub fn get_namespace_version(&self) -> &::std::option::Option<i64> {
146 &self.namespace_version
147 }
148 /// Consumes the builder and constructs a [`SearchEntitiesInput`](crate::operation::search_entities::SearchEntitiesInput).
149 pub fn build(
150 self,
151 ) -> ::std::result::Result<crate::operation::search_entities::SearchEntitiesInput, ::aws_smithy_types::error::operation::BuildError> {
152 ::std::result::Result::Ok(crate::operation::search_entities::SearchEntitiesInput {
153 entity_types: self.entity_types,
154 filters: self.filters,
155 next_token: self.next_token,
156 max_results: self.max_results,
157 namespace_version: self.namespace_version,
158 })
159 }
160}