mattermost_rust_client/models/data_retention_policy_create.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 DataRetentionPolicyCreate {
16 /// The display name for this retention policy.
17 #[serde(rename = "display_name")]
18 pub display_name: String,
19 /// The number of days a message will be retained before being deleted by this policy. If this value is less than 0, the policy has infinite retention (i.e. messages are never deleted).
20 #[serde(rename = "post_duration")]
21 pub post_duration: i32,
22 /// The IDs of the teams to which this policy should be applied.
23 #[serde(rename = "team_ids", skip_serializing_if = "Option::is_none")]
24 pub team_ids: Option<Vec<String>>,
25 /// The IDs of the channels to which this policy should be applied.
26 #[serde(rename = "channel_ids", skip_serializing_if = "Option::is_none")]
27 pub channel_ids: Option<Vec<String>>,
28}
29
30impl DataRetentionPolicyCreate {
31 pub fn new(display_name: String, post_duration: i32) -> DataRetentionPolicyCreate {
32 DataRetentionPolicyCreate {
33 display_name,
34 post_duration,
35 team_ids: None,
36 channel_ids: None,
37 }
38 }
39}
40
41