File Coverage

blib/lib/Net/API/Telegram/Update.pm
Criterion Covered Total %
statement 7 18 38.8
branch n/a
condition n/a
subroutine 3 14 21.4
pod 11 11 100.0
total 21 43 48.8


line stmt bran cond sub pod time code
1             # -*- perl -*-
2             ##----------------------------------------------------------------------------
3             ## Net/API/Telegram/Update.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 2020/03/28
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::Update;
15             BEGIN
16             {
17 1     1   7 use strict;
  1         2  
  1         36  
18 1     1   5 use parent qw( Net::API::Telegram::Generic );
  1         2  
  1         7  
19 1     1   350 our( $VERSION ) = '0.1';
20             };
21              
22 0     0 1   sub callback_query { return( shift->_set_get_object( 'callback_query', 'Net::API::Telegram::CallbackQuery', @_ ) ); }
23              
24 0     0 1   sub channel_post { return( shift->_set_get_object( 'channel_post', 'Net::API::Telegram::Message', @_ ) ); }
25              
26 0     0 1   sub chosen_inline_result { return( shift->_set_get_object( 'chosen_inline_result', 'Net::API::Telegram::ChosenInlineResult', @_ ) ); }
27              
28 0     0 1   sub edited_channel_post { return( shift->_set_get_object( 'edited_channel_post', 'Net::API::Telegram::Message', @_ ) ); }
29              
30 0     0 1   sub edited_message { return( shift->_set_get_object( 'edited_message', 'Net::API::Telegram::Message', @_ ) ); }
31              
32 0     0 1   sub inline_query { return( shift->_set_get_object( 'inline_query', 'Net::API::Telegram::InlineQuery', @_ ) ); }
33              
34 0     0 1   sub message { return( shift->_set_get_object( 'message', 'Net::API::Telegram::Message', @_ ) ); }
35              
36 0     0 1   sub poll { return( shift->_set_get_object( 'poll', 'Net::API::Telegram::Poll', @_ ) ); }
37              
38 0     0 1   sub pre_checkout_query { return( shift->_set_get_object( 'pre_checkout_query', 'Net::API::Telegram::PreCheckoutQuery', @_ ) ); }
39              
40 0     0 1   sub shipping_query { return( shift->_set_get_object( 'shipping_query', 'Net::API::Telegram::ShippingQuery', @_ ) ); }
41              
42 0     0 1   sub update_id { return( shift->_set_get_number( 'update_id', @_ ) ); }
43              
44             1;
45              
46             __END__
47              
48             =encoding utf-8
49              
50             =head1 NAME
51              
52             Net::API::Telegram::Update - An incoming update.At most one of the optional parameters can be present in any given update
53              
54             =head1 SYNOPSIS
55              
56             my $msg = Net::API::Telegram::Update->new( %data ) ||
57             die( Net::API::Telegram::Update->error, "\n" );
58              
59             =head1 DESCRIPTION
60              
61             L<Net::API::Telegram::Update> is a Telegram Message Object as defined here L<https://core.telegram.org/bots/api#update>
62              
63             This module has been automatically generated from Telegram API documentation by the script scripts/telegram-doc2perl-methods.pl.
64              
65             =head1 METHODS
66              
67             =over 4
68              
69             =item B<new>( {INIT HASH REF}, %PARAMETERS )
70              
71             B<new>() will create a new object for the package, pass any argument it might receive
72             to the special standard routine B<init> that I<must> exist.
73             Then it returns what returns B<init>().
74              
75             The valid parameters are as follow. Methods available here are also parameters to the B<new> method.
76              
77             =over 8
78              
79             =item * I<verbose>
80              
81             =item * I<debug>
82              
83             =back
84              
85             =item B<callback_query>( L<Net::API::Telegram::CallbackQuery> )
86              
87             Optional. New incoming callback query
88              
89             =item B<channel_post>( L<Net::API::Telegram::Message> )
90              
91             Optional. New incoming channel post of any kind — text, photo, sticker, etc.
92              
93             =item B<chosen_inline_result>( L<Net::API::Telegram::ChosenInlineResult> )
94              
95             Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.
96              
97             =item B<edited_channel_post>( L<Net::API::Telegram::Message> )
98              
99             Optional. New version of a channel post that is known to the bot and was edited
100              
101             =item B<edited_message>( L<Net::API::Telegram::Message> )
102              
103             Optional. New version of a message that is known to the bot and was edited
104              
105             =item B<inline_query>( L<Net::API::Telegram::InlineQuery> )
106              
107             Optional. New incoming inline query
108              
109             =item B<message>( L<Net::API::Telegram::Message> )
110              
111             Optional. New incoming message of any kind — text, photo, sticker, etc.
112              
113             =item B<poll>( L<Net::API::Telegram::Poll> )
114              
115             Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot
116              
117             =item B<pre_checkout_query>( L<Net::API::Telegram::PreCheckoutQuery> )
118              
119             Optional. New incoming pre-checkout query. Contains full information about checkout
120              
121             =item B<shipping_query>( L<Net::API::Telegram::ShippingQuery> )
122              
123             Optional. New incoming shipping query. Only for invoices with flexible price
124              
125             =item B<update_id>( Integer )
126              
127             The update‘s unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you’re using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
128              
129             =back
130              
131             =head1 COPYRIGHT
132              
133             Copyright (c) 2000-2019 DEGUEST Pte. Ltd.
134              
135             =head1 AUTHOR
136              
137             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
138              
139             =head1 SEE ALSO
140              
141             L<Net::API::Telegram>
142              
143             =head1 COPYRIGHT & LICENSE
144              
145             Copyright (c) 2018-2019 DEGUEST Pte. Ltd.
146              
147             You can use, copy, modify and redistribute this package and associated
148             files under the same terms as Perl itself.
149              
150             =cut
151