aws_sdk_connect/operation/search_contacts/
_search_contacts_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 SearchContactsInput {
6    /// <p>The identifier of Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
7    pub instance_id: ::std::option::Option<::std::string::String>,
8    /// <p>Time range that you want to search results.</p>
9    pub time_range: ::std::option::Option<crate::types::SearchContactsTimeRange>,
10    /// <p>The search criteria to be used to return contacts.</p>
11    pub search_criteria: ::std::option::Option<crate::types::SearchCriteria>,
12    /// <p>The maximum number of results to return per page.</p>
13    pub max_results: ::std::option::Option<i32>,
14    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
15    pub next_token: ::std::option::Option<::std::string::String>,
16    /// <p>Specifies a field to sort by and a sort order.</p>
17    pub sort: ::std::option::Option<crate::types::Sort>,
18}
19impl SearchContactsInput {
20    /// <p>The identifier of Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
21    pub fn instance_id(&self) -> ::std::option::Option<&str> {
22        self.instance_id.as_deref()
23    }
24    /// <p>Time range that you want to search results.</p>
25    pub fn time_range(&self) -> ::std::option::Option<&crate::types::SearchContactsTimeRange> {
26        self.time_range.as_ref()
27    }
28    /// <p>The search criteria to be used to return contacts.</p>
29    pub fn search_criteria(&self) -> ::std::option::Option<&crate::types::SearchCriteria> {
30        self.search_criteria.as_ref()
31    }
32    /// <p>The maximum number of results to return per page.</p>
33    pub fn max_results(&self) -> ::std::option::Option<i32> {
34        self.max_results
35    }
36    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
37    pub fn next_token(&self) -> ::std::option::Option<&str> {
38        self.next_token.as_deref()
39    }
40    /// <p>Specifies a field to sort by and a sort order.</p>
41    pub fn sort(&self) -> ::std::option::Option<&crate::types::Sort> {
42        self.sort.as_ref()
43    }
44}
45impl SearchContactsInput {
46    /// Creates a new builder-style object to manufacture [`SearchContactsInput`](crate::operation::search_contacts::SearchContactsInput).
47    pub fn builder() -> crate::operation::search_contacts::builders::SearchContactsInputBuilder {
48        crate::operation::search_contacts::builders::SearchContactsInputBuilder::default()
49    }
50}
51
52/// A builder for [`SearchContactsInput`](crate::operation::search_contacts::SearchContactsInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct SearchContactsInputBuilder {
56    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
57    pub(crate) time_range: ::std::option::Option<crate::types::SearchContactsTimeRange>,
58    pub(crate) search_criteria: ::std::option::Option<crate::types::SearchCriteria>,
59    pub(crate) max_results: ::std::option::Option<i32>,
60    pub(crate) next_token: ::std::option::Option<::std::string::String>,
61    pub(crate) sort: ::std::option::Option<crate::types::Sort>,
62}
63impl SearchContactsInputBuilder {
64    /// <p>The identifier of Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
65    /// This field is required.
66    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.instance_id = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The identifier of Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
71    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.instance_id = input;
73        self
74    }
75    /// <p>The identifier of Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
76    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
77        &self.instance_id
78    }
79    /// <p>Time range that you want to search results.</p>
80    /// This field is required.
81    pub fn time_range(mut self, input: crate::types::SearchContactsTimeRange) -> Self {
82        self.time_range = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>Time range that you want to search results.</p>
86    pub fn set_time_range(mut self, input: ::std::option::Option<crate::types::SearchContactsTimeRange>) -> Self {
87        self.time_range = input;
88        self
89    }
90    /// <p>Time range that you want to search results.</p>
91    pub fn get_time_range(&self) -> &::std::option::Option<crate::types::SearchContactsTimeRange> {
92        &self.time_range
93    }
94    /// <p>The search criteria to be used to return contacts.</p>
95    pub fn search_criteria(mut self, input: crate::types::SearchCriteria) -> Self {
96        self.search_criteria = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>The search criteria to be used to return contacts.</p>
100    pub fn set_search_criteria(mut self, input: ::std::option::Option<crate::types::SearchCriteria>) -> Self {
101        self.search_criteria = input;
102        self
103    }
104    /// <p>The search criteria to be used to return contacts.</p>
105    pub fn get_search_criteria(&self) -> &::std::option::Option<crate::types::SearchCriteria> {
106        &self.search_criteria
107    }
108    /// <p>The maximum number of results to return per page.</p>
109    pub fn max_results(mut self, input: i32) -> Self {
110        self.max_results = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>The maximum number of results to return per page.</p>
114    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
115        self.max_results = input;
116        self
117    }
118    /// <p>The maximum number of results to return per page.</p>
119    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
120        &self.max_results
121    }
122    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
123    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.next_token = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
128    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.next_token = input;
130        self
131    }
132    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
133    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
134        &self.next_token
135    }
136    /// <p>Specifies a field to sort by and a sort order.</p>
137    pub fn sort(mut self, input: crate::types::Sort) -> Self {
138        self.sort = ::std::option::Option::Some(input);
139        self
140    }
141    /// <p>Specifies a field to sort by and a sort order.</p>
142    pub fn set_sort(mut self, input: ::std::option::Option<crate::types::Sort>) -> Self {
143        self.sort = input;
144        self
145    }
146    /// <p>Specifies a field to sort by and a sort order.</p>
147    pub fn get_sort(&self) -> &::std::option::Option<crate::types::Sort> {
148        &self.sort
149    }
150    /// Consumes the builder and constructs a [`SearchContactsInput`](crate::operation::search_contacts::SearchContactsInput).
151    pub fn build(
152        self,
153    ) -> ::std::result::Result<crate::operation::search_contacts::SearchContactsInput, ::aws_smithy_types::error::operation::BuildError> {
154        ::std::result::Result::Ok(crate::operation::search_contacts::SearchContactsInput {
155            instance_id: self.instance_id,
156            time_range: self.time_range,
157            search_criteria: self.search_criteria,
158            max_results: self.max_results,
159            next_token: self.next_token,
160            sort: self.sort,
161        })
162    }
163}