File: Notification.pm

package info (click to toggle)
libmastodon-client-perl 0.017-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 336 kB
  • sloc: perl: 1,525; makefile: 9
file content (84 lines) | stat: -rw-r--r-- 1,711 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package Mastodon::Entity::Notification;

use strict;
use warnings;

our $VERSION = '0.017';

use Moo;
with 'Mastodon::Role::Entity';

use Types::Standard qw( Int Enum );
use Mastodon::Types qw( Status DateTime Account );

has account    => ( is => 'ro', isa => Account, );
has created_at => ( is => 'ro', isa => DateTime, );
has id         => ( is => 'ro', isa => Int, );
has status     => ( is => 'ro', isa => Status, required => 1, coerce => 1, );
has type       => ( is => 'ro', isa => Enum[qw(
  mention reblog favourite follow
)], );

1;

=encoding utf8

=head1 NAME

Mastodon::Entity::Notification - A Mastodon notification

=head1 DESCRIPTION

This object should not be manually created. It is intended to be generated
from the data received from a Mastodon server using the coercions in
L<Mastodon::Types>.

For current information, see the
L<Mastodon API documentation|https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#notification>

=head1 ATTRIBUTES

=over 4

=item B<id>

The notification ID.

=item B<type>

One of: "mention", "reblog", "favourite", "follow".

=item B<created_at>

The time the notification was created.

=item B<account>

The Account sending the notification to the user as a
L<Mastodon::Entity::Account> object.

=item B<status>

The Status associated with the notification, if applicable. As a
L<Mastodon::Entity::Status> object.

=back

=head1 AUTHOR

=over 4

=item *

José Joaquín Atria <jjatria@cpan.org>

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by José Joaquín Atria.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut