File Coverage

blib/lib/WebService/Mattermost/V4/API/Object/Channel/Member.pm
Criterion Covered Total %
statement 6 15 40.0
branch n/a
condition n/a
subroutine 2 9 22.2
pod n/a
total 8 24 33.3


line stmt bran cond sub pod time code
1             package WebService::Mattermost::V4::API::Object::Channel::Member;
2:

3: # ABSTRACT: A channel member item. 4:
5: use Moo;
6: use Types::Standard qw(HashRef InstanceOf Int Maybe Str);
7:
8: extends 'WebService::Mattermost::V4::API::Object';
9: with qw(
10: WebService::Mattermost::V4::API::Object::Role::BelongingToUser
11: WebService::Mattermost::V4::API::Object::Role::BelongingToChannel
12: WebService::Mattermost::V4::API::Object::Role::Roles
13: );
14:
15: ################################################################################
16:
17: has notify_props => (is => 'ro', isa => Maybe[HashRef], lazy => 1, builder => 1);
18: has last_update_at => (is => 'ro', isa => Maybe[Int], lazy => 1, builder => 1);
19: has last_viewed_at => (is => 'ro', isa => Maybe[Int], lazy => 1, builder => 1);
20: has mention_count => (is => 'ro', isa => Maybe[Int], lazy => 1, builder => 1);
21: has msg_count => (is => 'ro', isa => Maybe[Int], lazy => 1, builder => 1);
22: has last_update => (is => 'ro', isa => Maybe[InstanceOf['DateTime']], lazy => 1, builder => 1);
23: has last_viewed => (is => 'ro', isa => Maybe[InstanceOf['DateTime']], lazy => 1, builder => 1);
24:
25: ################################################################################
26:
27: sub _build_notify_props { shift->raw_data->{notify_props} }
28: sub _build_last_update_at { shift->raw_data->{last_update_at} }
29: sub _build_last_viewed_at { shift->raw_data->{last_viewed_at} }
30: sub _build_mention_count { shift->raw_data->{mention_count} }
31: sub _build_msg_count { shift->raw_data->{msg_count} }
32:
33: sub _build_last_update {
34: my $self = shift;
35:
36: return $self->_from_epoch($self->last_update);
37: }
38:
39: sub _build_last_viewed {
40: my $self = shift;
41:
42: return $self->_from_epoch($self->last_update);
43: }
44:
45: ################################################################################
46:
47: 1;
48:
49: __END__
50:
51: =pod
52:
53: =encoding UTF-8
54:
55: =head1 NAME
56:
57: WebService::Mattermost::V4::API::Object::Channel::Member - A channel member item.
58:
59: =head1 VERSION
60:
61: version 0.28
62:
63: =head1 DESCRIPTION
64:
65: A member of a channel.
66:
67: =head2 ATTRIBUTES
68:
69: =over 4
70:
71: =item C<notify_props>
72:
73: =item C<last_update_at>
74:
75: UNIX timestamp.
76:
77: =item C<last_viewed_at>
78:
79: UNIX timestamp.
80:
81: =item C<mention_count>
82:
83: =item C<msg_count>
84:
85: =item C<last_update>
86:
87: DateTime.
88:
89: =item C<last_viewed>
90:
91: DateTime.
92:
93: =back
94:
95: =head1 SEE ALSO
96:
97: =over 4
98:
99: =item L<WebService::Mattermost::V4::API::Object::Role::BelongingToUser>
100:
101: =item L<WebService::Mattermost::V4::API::Object::Role::BelongingToChannel>
102:
103: =item L<WebService::Mattermost::V4::API::Object::Role::Roles>
104:
105: =back
106:
107: =head1 AUTHOR
108:
109: Mike Jones <mike@netsplit.org.uk>
110:
111: =head1 COPYRIGHT AND LICENSE
112:
113: This software is Copyright (c) 2020 by Mike Jones.
114:
115: This is free software, licensed under:
116:
117: The MIT (X11) License
118:
119: =cut
120: