File Coverage

blib/lib/Net/API/Telegram/WebhookInfo.pm
Criterion Covered Total %
statement 7 15 46.6
branch n/a
condition n/a
subroutine 3 11 27.2
pod 7 7 100.0
total 17 33 51.5


line stmt bran cond sub pod time code
1             # -*- perl -*-
2             ##----------------------------------------------------------------------------
3             ## Net/API/Telegram/WebhookInfo.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::WebhookInfo;
15             BEGIN
16             {
17 1     1   1060 use strict;
  1         2  
  1         33  
18 1     1   6 use parent qw( Net::API::Telegram::Generic );
  1         2  
  1         4  
19 1     1   329 our( $VERSION ) = '0.1';
20             };
21              
22 0     0 1   sub allowed_updates { return( shift->_set_get_array( 'allowed_updates', ) ); }
23              
24 0     0 1   sub has_custom_certificate { return( shift->_set_get_scalar( 'has_custom_certificate', @_ ) ); }
25              
26 0     0 1   sub last_error_date { return( shift->_set_get_datetime( 'last_error_date', @_ ) ); }sub last_error_message { return( shift->_set_get_scalar( 'last_error_message', @_ ) ); }
  0     0 1    
27              
28 0     0 1   sub max_connections { return( shift->_set_get_number( 'max_connections', @_ ) ); }
29              
30 0     0 1   sub pending_update_count { return( shift->_set_get_number( 'pending_update_count', @_ ) ); }
31              
32 0     0 1   sub url { return( shift->_set_get_scalar( 'url', @_ ) ); }
33              
34 0     0     sub _is_boolean { return( grep( /^$_[1]$/, qw( has_custom_certificate ) ) ); }
35              
36             1;
37              
38             __END__
39              
40             =encoding utf-8
41              
42             =head1 NAME
43              
44             Net::API::Telegram::WebhookInfo - Information about the current status of a webhook
45              
46             =head1 SYNOPSIS
47              
48             my $msg = Net::API::Telegram::WebhookInfo->new( %data ) ||
49             die( Net::API::Telegram::WebhookInfo->error, "\n" );
50              
51             =head1 DESCRIPTION
52              
53             L<Net::API::Telegram::WebhookInfo> is a Telegram Message Object as defined here L<https://core.telegram.org/bots/api#webhookinfo>
54              
55             This module has been automatically generated from Telegram API documentation by the script scripts/telegram-doc2perl-methods.pl.
56              
57             =head1 METHODS
58              
59             =over 4
60              
61             =item B<new>( {INIT HASH REF}, %PARAMETERS )
62              
63             B<new>() will create a new object for the package, pass any argument it might receive
64             to the special standard routine B<init> that I<must> exist.
65             Then it returns what returns B<init>().
66              
67             The valid parameters are as follow. Methods available here are also parameters to the B<new> method.
68              
69             =over 8
70              
71             =item * I<verbose>
72              
73             =item * I<debug>
74              
75             =back
76              
77             =item B<allowed_updates>( Array of String )
78              
79             Optional. A list of update types the bot is subscribed to. Defaults to all update types
80              
81             =item B<has_custom_certificate>( Boolean )
82              
83             True, if a custom certificate was provided for webhook certificate checks
84              
85             =item B<last_error_date>( Date )
86              
87             Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
88              
89             =item B<last_error_message>( String )
90              
91             Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
92              
93             =item B<max_connections>( Integer )
94              
95             Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
96              
97             =item B<pending_update_count>( Integer )
98              
99             Number of updates awaiting delivery
100              
101             =item B<url>( String )
102              
103             Webhook URL, may be empty if webhook is not set up
104              
105             =back
106              
107             =head1 COPYRIGHT
108              
109             Copyright (c) 2000-2019 DEGUEST Pte. Ltd.
110              
111             =head1 AUTHOR
112              
113             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
114              
115             =head1 SEE ALSO
116              
117             L<Net::API::Telegram>
118              
119             =head1 COPYRIGHT & LICENSE
120              
121             Copyright (c) 2018-2019 DEGUEST Pte. Ltd.
122              
123             You can use, copy, modify and redistribute this package and associated
124             files under the same terms as Perl itself.
125              
126             =cut
127