github.com/wgh-/mattermost-server@v4.8.0-rc2+incompatible/model/data_retention_policy.go (about) 1 // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. 2 // See License.txt for license information. 3 4 package model 5 6 import ( 7 "encoding/json" 8 "io" 9 ) 10 11 type DataRetentionPolicy struct { 12 MessageDeletionEnabled bool `json:"message_deletion_enabled"` 13 FileDeletionEnabled bool `json:"file_deletion_enabled"` 14 MessageRetentionCutoff int64 `json:"message_retention_cutoff"` 15 FileRetentionCutoff int64 `json:"file_retention_cutoff"` 16 } 17 18 func (me *DataRetentionPolicy) ToJson() string { 19 b, _ := json.Marshal(me) 20 return string(b) 21 } 22 23 func DataRetentionPolicyFromJson(data io.Reader) *DataRetentionPolicy { 24 var me *DataRetentionPolicy 25 json.NewDecoder(data).Decode(&me) 26 return me 27 }