File Coverage

blib/lib/Net/API/Telegram/InlineQueryResultCachedSticker.pm
Criterion Covered Total %
statement 7 13 53.8
branch n/a
condition n/a
subroutine 3 9 33.3
pod 6 6 100.0
total 16 28 57.1


line stmt bran cond sub pod time code
1             # -*- perl -*-
2             ##----------------------------------------------------------------------------
3             ## Telegram API - ~/lib/Net/API/Telegram/InlineQueryResultCachedSticker.pm
4             ## Version 0.1
5             ## Copyright(c) 2019 Jacques Deguest
6             ## Author: Jacques Deguest <jack@deguest.jp>
7             ## Created 2019/05/29
8             ## Modified 2019/11/01
9             ## All rights reserved
10             ##
11             ## This program is free software; you can redistribute it and/or modify it
12             ## under the same terms as Perl itself.
13             ##----------------------------------------------------------------------------
14             package Net::API::Telegram::InlineQueryResultCachedSticker;
15             BEGIN
16             {
17 1     1   1061 use strict;
  1         2  
  1         37  
18 1     1   6 use parent qw( Net::API::Telegram::Generic );
  1         3  
  1         6  
19 1     1   210 our( $VERSION ) = '0.1';
20             };
21              
22 0     0 1   sub download { return( shift->_download( @_ ) ); }
23              
24 0     0 1   sub id { return( shift->_set_get_scalar( 'id', @_ ) ); }
25              
26 0     0 1   sub input_message_content { return( shift->_set_get_object( 'input_message_content', 'Net::API::Telegram::InputMessageContent', @_ ) ); }
27              
28 0     0 1   sub reply_markup { return( shift->_set_get_object( 'reply_markup', 'Net::API::Telegram::InlineKeyboardMarkup', @_ ) ); }
29              
30 0     0 1   sub sticker_file_id { return( shift->_set_get_scalar( 'sticker_file_id', @_ ) ); }
31              
32 0     0 1   sub type { return( shift->_set_get_scalar( 'type', @_ ) ); }
33              
34             1;
35              
36             __END__
37              
38             =encoding utf-8
39              
40             =head1 NAME
41              
42             Net::API::Telegram::InlineQueryResultCachedSticker - A link to a sticker stored on the Telegram servers
43              
44             =head1 SYNOPSIS
45              
46             my $msg = Net::API::Telegram::InlineQueryResultCachedSticker->new( %data ) ||
47             die( Net::API::Telegram::InlineQueryResultCachedSticker->error, "\n" );
48              
49             =head1 DESCRIPTION
50              
51             L<Net::API::Telegram::InlineQueryResultCachedSticker> is a Telegram Message Object as defined here L<https://core.telegram.org/bots/api#inlinequeryresultcachedsticker>
52              
53             This module has been automatically generated from Telegram API documentation by the script scripts/telegram-doc2perl-methods.pl.
54              
55             =head1 METHODS
56              
57             =over 4
58              
59             =item B<new>( {INIT HASH REF}, %PARAMETERS )
60              
61             B<new>() will create a new object for the package, pass any argument it might receive
62             to the special standard routine B<init> that I<must> exist.
63             Then it returns what returns B<init>().
64              
65             The valid parameters are as follow. Methods available here are also parameters to the B<new> method.
66              
67             =over 8
68              
69             =item * I<verbose>
70              
71             =item * I<debug>
72              
73             =back
74              
75             =item B<download>( file_id, [ file extension ] )
76              
77             Given a file id like sticker_file_id, this will call the B<getFile>() method from the parent L<Net::API::Telegram> package and receive a L<Net::API::Telegram::File> object in return, which contains a file path valid for only one hour according to Telegram api here L<https://core.telegram.org/bots/api#getfile>. With this file path, this B<download> method will issue a http get request and retrieve the file and save it locally in a temproary file generated by L<File::Temp>. If an extension is provided, it will be appended to the temproary file name such as C<myfile.jpg> otherwise the extension will be gussed from the mime type returned by the Telegram http server, if any.
78              
79             This method returns undef() on error and sets a L<Net::API::Telegram::Error> or, on success, returns a hash reference with the following properties:
80              
81             =over 8
82              
83             =item I<filepath>
84              
85             The full path to the temporary file
86              
87             =item I<mime>
88              
89             The mime type returned by the server.
90              
91             =item I<response>
92              
93             The L<HTTP::Response>
94              
95             =item I<size>
96              
97             The size in bytes of the file fetched
98              
99             =back
100             =item B<download>( )
101              
102              
103              
104             =item B<id>( String )
105              
106             Unique identifier for this result, 1-64 bytes
107              
108             =item B<input_message_content>( L<Net::API::Telegram::InputMessageContent> )
109              
110             Optional. Content of the message to be sent instead of the sticker
111              
112             =item B<reply_markup>( L<Net::API::Telegram::InlineKeyboardMarkup> )
113              
114             Optional. Inline keyboard attached to the message
115              
116             =item B<sticker_file_id>( String )
117              
118             A valid file identifier of the sticker
119              
120             =item B<type>( String )
121              
122             Type of the result, must be sticker
123              
124             =back
125              
126             =head1 COPYRIGHT
127              
128             Copyright (c) 2000-2019 DEGUEST Pte. Ltd.
129              
130             =head1 AUTHOR
131              
132             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
133              
134             =head1 SEE ALSO
135              
136             L<Net::API::Telegram>
137              
138             =head1 COPYRIGHT & LICENSE
139              
140             Copyright (c) 2018-2019 DEGUEST Pte. Ltd.
141              
142             You can use, copy, modify and redistribute this package and associated
143             files under the same terms as Perl itself.
144              
145             =cut
146