1// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2// See LICENSE.txt for license information.
3
4package model
5
6type GlobalRetentionPolicy struct {
7	MessageDeletionEnabled bool  `json:"message_deletion_enabled"`
8	FileDeletionEnabled    bool  `json:"file_deletion_enabled"`
9	MessageRetentionCutoff int64 `json:"message_retention_cutoff"`
10	FileRetentionCutoff    int64 `json:"file_retention_cutoff"`
11}
12
13type RetentionPolicy struct {
14	ID           string `db:"Id" json:"id"`
15	DisplayName  string `json:"display_name"`
16	PostDuration *int64 `json:"post_duration"`
17}
18
19type RetentionPolicyWithTeamAndChannelIDs struct {
20	RetentionPolicy
21	TeamIDs    []string `json:"team_ids"`
22	ChannelIDs []string `json:"channel_ids"`
23}
24
25type RetentionPolicyWithTeamAndChannelCounts struct {
26	RetentionPolicy
27	ChannelCount int64 `json:"channel_count"`
28	TeamCount    int64 `json:"team_count"`
29}
30
31type RetentionPolicyChannel struct {
32	PolicyID  string `db:"PolicyId"`
33	ChannelID string `db:"ChannelId"`
34}
35
36type RetentionPolicyTeam struct {
37	PolicyID string `db:"PolicyId"`
38	TeamID   string `db:"TeamId"`
39}
40
41type RetentionPolicyWithTeamAndChannelCountsList struct {
42	Policies   []*RetentionPolicyWithTeamAndChannelCounts `json:"policies"`
43	TotalCount int64                                      `json:"total_count"`
44}
45
46type RetentionPolicyForTeam struct {
47	TeamID       string `db:"Id" json:"team_id"`
48	PostDuration int64  `json:"post_duration"`
49}
50
51type RetentionPolicyForTeamList struct {
52	Policies   []*RetentionPolicyForTeam `json:"policies"`
53	TotalCount int64                     `json:"total_count"`
54}
55
56type RetentionPolicyForChannel struct {
57	ChannelID    string `db:"Id" json:"channel_id"`
58	PostDuration int64  `json:"post_duration"`
59}
60
61type RetentionPolicyForChannelList struct {
62	Policies   []*RetentionPolicyForChannel `json:"policies"`
63	TotalCount int64                        `json:"total_count"`
64}
65
66type RetentionPolicyCursor struct {
67	ChannelPoliciesDone bool
68	TeamPoliciesDone    bool
69	GlobalPoliciesDone  bool
70}
71