blib/lib/WebService/Mattermost/V4/API/Object/DataRetentionPolicy.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 6 | 16 | 37.5 |
branch | 0 | 4 | 0.0 |
condition | n/a | ||
subroutine | 2 | 8 | 25.0 |
pod | n/a | ||
total | 8 | 28 | 28.5 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package WebService::Mattermost::V4::API::Object::DataRetentionPolicy; 2: 3: # ABSTRACT: A data retention item. 4: 5: use Moo; 6: use Types::Standard qw(Bool Maybe InstanceOf Int); 7: 8: extends 'WebService::Mattermost::V4::API::Object'; 9: 10: ################################################################################ 11: 12: has [ qw( 13: message_deletion_enabled 14: file_deletion_enabled 15: ) ] => (is => 'ro', isa => Maybe[Bool], lazy => 1, builder => 1); 16: 17: has [ qw( 18: message_retention_cutoff 19: file_retention_cutoff 20: ) ] => (is => 'ro', isa => Maybe[Int], lazy => 1, builder => 1); 21: 22: has [ qw( 23: files_kept_until 24: messages_kept_until 25: ) ] => (is => 'ro', isa => Maybe[InstanceOf['DateTime']], lazy => 1, builder => 1); 26: 27: ################################################################################ 28: 29: sub _build_message_deletion_enabled { shift->raw_data->{message_deletion_enabled} } 30: sub _build_file_deletion_enabled { shift->raw_data->{file_deletion_enabled} } 31: sub _build_message_retention_cutoff { shift->raw_data->{message_retention_cutoff} } 32: sub _build_file_retention_cutoff { shift->raw_data->{file_retention_cutoff} } 33: 34: sub _build_files_kept_until { 35: my $self = shift; 36: 37: return unless $self->file_retention_cutoff; 38: return $self->_from_epoch($self->file_retention_cutoff); 39: } 40: 41: sub _build_messages_kept_until { 42: my $self = shift; 43: 44: return unless $self->message_retention_cutoff; 45: return $self->_from_epoch($self->message_retention_cutoff); 46: } 47: 48: ################################################################################ 49: 50: 1; 51: 52: __END__ 53: 54: =pod 55: 56: =encoding UTF-8 57: 58: =head1 NAME 59: 60: WebService::Mattermost::V4::API::Object::DataRetentionPolicy - A data retention item. 61: 62: =head1 VERSION 63: 64: version 0.28 65: 66: =head1 DESCRIPTION 67: 68: A data retention policy. 69: 70: =head2 ATTRIBUTES 71: 72: =over 4 73: 74: =item C<message_deletion_enabled> 75: 76: =item C<file_deletion_enabled> 77: 78: =item C<message_retention_cutoff> 79: 80: UNIX timestamp. 81: 82: =item C<file_retention_cutoff> 83: 84: UNIX timestamp. 85: 86: =item C<messages_kept_until> 87: 88: DateTime. 89: 90: =item C<files_kept_until> 91: 92: DateTime. 93: 94: =back 95: 96: =head1 AUTHOR 97: 98: Mike Jones <mike@netsplit.org.uk> 99: 100: =head1 COPYRIGHT AND LICENSE 101: 102: This software is Copyright (c) 2020 by Mike Jones. 103: 104: This is free software, licensed under: 105: 106: The MIT (X11) License 107: 108: =cut 109: |