| 1 | package Mastodon::Entity::Attachment; | ||
| 2 | |||
| 3 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 3 | our $VERSION = '0.018'; # TRIAL | |
| 7 | |||
| 8 | 3 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 3 | with 'Mastodon::Role::Entity'; | |
| 10 | |||
| 11 | 3 | ▶ | use Types::Standard qw( Maybe Enum Int ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 3 | ▶ | use Mastodon::Types qw( URI ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 3 | has id => ( is => 'ro', isa => Int, ); | |
| 15 | 3 | has preview_url => ( is => 'ro', isa => URI, coerce => 1, required => 1, ); | |
| 16 | 3 | has remote_url => ( is => 'ro', isa => Maybe [URI], coerce => 1, ); | |
| 17 | 3 | has text_url => ( is => 'ro', isa => Maybe [URI], coerce => 1, ); | |
| 18 | 3 | has url => ( is => 'ro', isa => URI, coerce => 1, ); | |
| 19 | 3 | has type => ( is => 'ro', isa => Enum[qw( image video gifv )], ); | |
| 20 | |||
| 21 | 3 | 1; | |
| 22 | |||
| 23 | =encoding utf8 | ||
| 24 | |||
| 25 | =head1 NAME | ||
| 26 | |||
| 27 | Mastodon::Entity::Attachment - A Mastodon media attachment | ||
| 28 | |||
| 29 | =head1 DESCRIPTION | ||
| 30 | |||
| 31 | This object should not be manually created. It is intended to be generated | ||
| 32 | from the data received from a Mastodon server using the coercions in | ||
| 33 | L<Mastodon::Types>. | ||
| 34 | |||
| 35 | For current information, see the | ||
| 36 | L<Mastodon API documentation|https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#attachment> | ||
| 37 | |||
| 38 | =head1 ATTRIBUTES | ||
| 39 | |||
| 40 | =over 4 | ||
| 41 | |||
| 42 | =item B<id> | ||
| 43 | |||
| 44 | ID of the attachment. | ||
| 45 | |||
| 46 | =item B<type> | ||
| 47 | |||
| 48 | One of: "image", "video", "gifv". | ||
| 49 | |||
| 50 | =item B<url> | ||
| 51 | |||
| 52 | URL of the locally hosted version of the image. | ||
| 53 | |||
| 54 | =item B<remote_url> | ||
| 55 | |||
| 56 | For remote images, the remote URL of the original image. | ||
| 57 | |||
| 58 | =item B<preview_url> | ||
| 59 | |||
| 60 | URL of the preview image | ||
| 61 | |||
| 62 | =item B<text_url> | ||
| 63 | |||
| 64 | Shorter URL for the image, for insertion into text (only present on local | ||
| 65 | images). | ||
| 66 | |||
| 67 | =back | ||
| 68 | |||
| 69 | =head1 AUTHOR | ||
| 70 | |||
| 71 | =over 4 | ||
| 72 | |||
| 73 | =item * | ||
| 74 | |||
| 75 | José Joaquín Atria <jjatria@cpan.org> | ||
| 76 | |||
| 77 | =back | ||
| 78 | |||
| 79 | =head1 COPYRIGHT AND LICENSE | ||
| 80 | |||
| 81 | This software is copyright (c) 2017 by José Joaquín Atria. | ||
| 82 | |||
| 83 | This is free software; you can redistribute it and/or modify it under | ||
| 84 | the same terms as the Perl 5 programming language system itself. | ||
| 85 | |||
| 86 | =cut | ||