Mattermost/V4/API/Object/DataRetentionPolicy.pm

filter: Statementstmt 52.3% 11 / 21 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 25.0% 2 / 8 Podpod n/a totaltotal 39.3% 13 / 33 CC 3 SCAR 12.2
CC
3
Cov
44%
_build_files_kept_until
6.0
_build_messages_kept_until
6.0
_build_message_deletion_enabled
2.0
CRAP 3.4
« Mattermost/V4/API/Resource/Jobs.pm ↑ Summary Mattermost/V4/API/Object/Plugin.pm »
1 package WebService::Mattermost::V4::API::Object::DataRetentionPolicy;
2  
3 # ABSTRACT: A data retention item.
4  
5 12 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Types::Standard qw(Bool Maybe InstanceOf Int);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 12 extends 'WebService::Mattermost::V4::API::Object';
9  
10 ################################################################################
11  
12 12 has [ qw(
13 message_deletion_enabled
14 file_deletion_enabled
15 ) ] => (is => 'ro', isa => Maybe[Bool], lazy => 1, builder => 1);
16  
17 12 has [ qw(
18 message_retention_cutoff
19 file_retention_cutoff
20 ) ] => (is => 'ro', isa => Maybe[Int], lazy => 1, builder => 1);
21  
22 12 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 0 ▶sub _build_message_deletion_enabled { shift->raw_data->{message_deletion_enabled} }
Subroutine _build_message_deletion_enabled: not called CC=1 SCAR=6.9
30 0 ▶sub _build_file_deletion_enabled { shift->raw_data->{file_deletion_enabled} }
Subroutine _build_file_deletion_enabled: not called CC=1 SCAR=6.9
31 0 ▶sub _build_message_retention_cutoff { shift->raw_data->{message_retention_cutoff} }
Subroutine _build_message_retention_cutoff: not called CC=1 SCAR=6.9
32 0 ▶sub _build_file_retention_cutoff { shift->raw_data->{file_retention_cutoff} }
Subroutine _build_file_retention_cutoff: not called CC=1 SCAR=6.9
33  
34 sub _build_files_kept_until {
35 0 ▶ my $self = shift;
Subroutine _build_files_kept_until: not called CC=2 SCAR=17.9
36  
37 0 ▶ return unless $self->file_retention_cutoff;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->file_retention_cutoff 0 0 0
38 0 return $self->_from_epoch($self->file_retention_cutoff);
39 }
40  
41 sub _build_messages_kept_until {
42 0 ▶ my $self = shift;
Subroutine _build_messages_kept_until: not called CC=2 SCAR=17.9
43  
44 0 ▶ return unless $self->message_retention_cutoff;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->message_retention_cutoff 0 0 0
45 0 return $self->_from_epoch($self->message_retention_cutoff);
46 }
47  
48 ################################################################################
49  
50 12 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
« Mattermost/V4/API/Resource/Jobs.pm ↑ Summary Mattermost/V4/API/Object/Plugin.pm »