mattermost_rust_client/models/search_users_request.rs
1/*
2 * Mattermost API Reference
3 *
4 * There is also a work-in-progress [Postman API reference](https://documenter.getpostman.com/view/4508214/RW8FERUn).
5 *
6 * The version of the OpenAPI document: 4.0.0
7 * Contact: feedback@mattermost.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct SearchUsersRequest {
16 /// The term to match against username, full name, nickname and email
17 #[serde(rename = "term")]
18 pub term: String,
19 /// If provided, only search users on this team
20 #[serde(rename = "team_id", skip_serializing_if = "Option::is_none")]
21 pub team_id: Option<String>,
22 /// If provided, only search users not on this team
23 #[serde(rename = "not_in_team_id", skip_serializing_if = "Option::is_none")]
24 pub not_in_team_id: Option<String>,
25 /// If provided, only search users in this channel
26 #[serde(rename = "in_channel_id", skip_serializing_if = "Option::is_none")]
27 pub in_channel_id: Option<String>,
28 /// If provided, only search users not in this channel. Must specifiy `team_id` when using this option
29 #[serde(rename = "not_in_channel_id", skip_serializing_if = "Option::is_none")]
30 pub not_in_channel_id: Option<String>,
31 /// If provided, only search users in this group. Must have `manage_system` permission.
32 #[serde(rename = "in_group_id", skip_serializing_if = "Option::is_none")]
33 pub in_group_id: Option<String>,
34 /// When used with `not_in_channel_id` or `not_in_team_id`, returns only the users that are allowed to join the channel or team based on its group constrains.
35 #[serde(rename = "group_constrained", skip_serializing_if = "Option::is_none")]
36 pub group_constrained: Option<bool>,
37 /// When `true`, include deactivated users in the results
38 #[serde(rename = "allow_inactive", skip_serializing_if = "Option::is_none")]
39 pub allow_inactive: Option<bool>,
40 /// Set this to `true` if you would like to search for users that are not on a team. This option takes precendence over `team_id`, `in_channel_id`, and `not_in_channel_id`.
41 #[serde(rename = "without_team", skip_serializing_if = "Option::is_none")]
42 pub without_team: Option<bool>,
43 /// The maximum number of users to return in the results __Available as of server version 5.6. Defaults to `100` if not provided or on an earlier server version.__
44 #[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
45 pub limit: Option<i32>,
46}
47
48impl SearchUsersRequest {
49 pub fn new(term: String) -> SearchUsersRequest {
50 SearchUsersRequest {
51 term,
52 team_id: None,
53 not_in_team_id: None,
54 in_channel_id: None,
55 not_in_channel_id: None,
56 in_group_id: None,
57 group_constrained: None,
58 allow_inactive: None,
59 without_team: None,
60 limit: None,
61 }
62 }
63}
64
65