aws_sdk_chimesdkmessaging/operation/search_channels/
_search_channels_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)]
5pub struct SearchChannelsInput {
6    /// <p>The <code>AppInstanceUserArn</code> of the user making the API call.</p>
7    pub chime_bearer: ::std::option::Option<::std::string::String>,
8    /// <p>A list of the <code>Field</code> objects in the channel being searched.</p>
9    pub fields: ::std::option::Option<::std::vec::Vec<crate::types::SearchField>>,
10    /// <p>The maximum number of channels that you want returned.</p>
11    pub max_results: ::std::option::Option<i32>,
12    /// <p>The token returned from previous API requests until the number of channels is reached.</p>
13    pub next_token: ::std::option::Option<::std::string::String>,
14}
15impl SearchChannelsInput {
16    /// <p>The <code>AppInstanceUserArn</code> of the user making the API call.</p>
17    pub fn chime_bearer(&self) -> ::std::option::Option<&str> {
18        self.chime_bearer.as_deref()
19    }
20    /// <p>A list of the <code>Field</code> objects in the channel being searched.</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 `.fields.is_none()`.
23    pub fn fields(&self) -> &[crate::types::SearchField] {
24        self.fields.as_deref().unwrap_or_default()
25    }
26    /// <p>The maximum number of channels that you want returned.</p>
27    pub fn max_results(&self) -> ::std::option::Option<i32> {
28        self.max_results
29    }
30    /// <p>The token returned from previous API requests until the number of channels is reached.</p>
31    pub fn next_token(&self) -> ::std::option::Option<&str> {
32        self.next_token.as_deref()
33    }
34}
35impl ::std::fmt::Debug for SearchChannelsInput {
36    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
37        let mut formatter = f.debug_struct("SearchChannelsInput");
38        formatter.field("chime_bearer", &self.chime_bearer);
39        formatter.field("fields", &self.fields);
40        formatter.field("max_results", &self.max_results);
41        formatter.field("next_token", &"*** Sensitive Data Redacted ***");
42        formatter.finish()
43    }
44}
45impl SearchChannelsInput {
46    /// Creates a new builder-style object to manufacture [`SearchChannelsInput`](crate::operation::search_channels::SearchChannelsInput).
47    pub fn builder() -> crate::operation::search_channels::builders::SearchChannelsInputBuilder {
48        crate::operation::search_channels::builders::SearchChannelsInputBuilder::default()
49    }
50}
51
52/// A builder for [`SearchChannelsInput`](crate::operation::search_channels::SearchChannelsInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
54#[non_exhaustive]
55pub struct SearchChannelsInputBuilder {
56    pub(crate) chime_bearer: ::std::option::Option<::std::string::String>,
57    pub(crate) fields: ::std::option::Option<::std::vec::Vec<crate::types::SearchField>>,
58    pub(crate) max_results: ::std::option::Option<i32>,
59    pub(crate) next_token: ::std::option::Option<::std::string::String>,
60}
61impl SearchChannelsInputBuilder {
62    /// <p>The <code>AppInstanceUserArn</code> of the user making the API call.</p>
63    pub fn chime_bearer(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.chime_bearer = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The <code>AppInstanceUserArn</code> of the user making the API call.</p>
68    pub fn set_chime_bearer(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.chime_bearer = input;
70        self
71    }
72    /// <p>The <code>AppInstanceUserArn</code> of the user making the API call.</p>
73    pub fn get_chime_bearer(&self) -> &::std::option::Option<::std::string::String> {
74        &self.chime_bearer
75    }
76    /// Appends an item to `fields`.
77    ///
78    /// To override the contents of this collection use [`set_fields`](Self::set_fields).
79    ///
80    /// <p>A list of the <code>Field</code> objects in the channel being searched.</p>
81    pub fn fields(mut self, input: crate::types::SearchField) -> Self {
82        let mut v = self.fields.unwrap_or_default();
83        v.push(input);
84        self.fields = ::std::option::Option::Some(v);
85        self
86    }
87    /// <p>A list of the <code>Field</code> objects in the channel being searched.</p>
88    pub fn set_fields(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchField>>) -> Self {
89        self.fields = input;
90        self
91    }
92    /// <p>A list of the <code>Field</code> objects in the channel being searched.</p>
93    pub fn get_fields(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchField>> {
94        &self.fields
95    }
96    /// <p>The maximum number of channels that you want returned.</p>
97    pub fn max_results(mut self, input: i32) -> Self {
98        self.max_results = ::std::option::Option::Some(input);
99        self
100    }
101    /// <p>The maximum number of channels that you want returned.</p>
102    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
103        self.max_results = input;
104        self
105    }
106    /// <p>The maximum number of channels that you want returned.</p>
107    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
108        &self.max_results
109    }
110    /// <p>The token returned from previous API requests until the number of channels is reached.</p>
111    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112        self.next_token = ::std::option::Option::Some(input.into());
113        self
114    }
115    /// <p>The token returned from previous API requests until the number of channels is reached.</p>
116    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117        self.next_token = input;
118        self
119    }
120    /// <p>The token returned from previous API requests until the number of channels is reached.</p>
121    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
122        &self.next_token
123    }
124    /// Consumes the builder and constructs a [`SearchChannelsInput`](crate::operation::search_channels::SearchChannelsInput).
125    pub fn build(
126        self,
127    ) -> ::std::result::Result<crate::operation::search_channels::SearchChannelsInput, ::aws_smithy_types::error::operation::BuildError> {
128        ::std::result::Result::Ok(crate::operation::search_channels::SearchChannelsInput {
129            chime_bearer: self.chime_bearer,
130            fields: self.fields,
131            max_results: self.max_results,
132            next_token: self.next_token,
133        })
134    }
135}
136impl ::std::fmt::Debug for SearchChannelsInputBuilder {
137    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
138        let mut formatter = f.debug_struct("SearchChannelsInputBuilder");
139        formatter.field("chime_bearer", &self.chime_bearer);
140        formatter.field("fields", &self.fields);
141        formatter.field("max_results", &self.max_results);
142        formatter.field("next_token", &"*** Sensitive Data Redacted ***");
143        formatter.finish()
144    }
145}