mattermost_rust_client/models/
search_posts_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 SearchPostsRequest {
16    /// The search terms as inputed by the user. To search for posts from a user include `from:someusername`, using a user's username. To search in a specific channel include `in:somechannel`, using the channel name (not the display name).
17    #[serde(rename = "terms")]
18    pub terms: String,
19    /// Set to true if an Or search should be performed vs an And search.
20    #[serde(rename = "is_or_search")]
21    pub is_or_search: bool,
22    /// Offset from UTC of user timezone for date searches.
23    #[serde(rename = "time_zone_offset", skip_serializing_if = "Option::is_none")]
24    pub time_zone_offset: Option<i32>,
25    /// Set to true if deleted channels should be included in the search. (archived channels)
26    #[serde(rename = "include_deleted_channels", skip_serializing_if = "Option::is_none")]
27    pub include_deleted_channels: Option<bool>,
28    /// The page to select. (Only works with Elasticsearch)
29    #[serde(rename = "page", skip_serializing_if = "Option::is_none")]
30    pub page: Option<i32>,
31    /// The number of posts per page. (Only works with Elasticsearch)
32    #[serde(rename = "per_page", skip_serializing_if = "Option::is_none")]
33    pub per_page: Option<i32>,
34}
35
36impl SearchPostsRequest {
37    pub fn new(terms: String, is_or_search: bool) -> SearchPostsRequest {
38        SearchPostsRequest {
39            terms,
40            is_or_search,
41            time_zone_offset: None,
42            include_deleted_channels: None,
43            page: None,
44            per_page: None,
45        }
46    }
47}
48
49