| 1 | package WG::API; | ||
| 2 | |||
| 3 | 6 | ▶ | use Modern::Perl '2015'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 6 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | =encoding utf8 | ||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | WG::API - Module for work with Wargaming.net Public API | ||
| 11 | |||
| 12 | =head1 VERSION | ||
| 13 | |||
| 14 | Version v0.11 | ||
| 15 | |||
| 16 | =cut | ||
| 17 | |||
| 18 | 6 | our $VERSION = 'v0.11'; | |
| 19 | |||
| 20 | =head1 SYNOPSIS | ||
| 21 | |||
| 22 | Wargaming.net Public API is a set of API methods that provide access to Wargaming.net content, including in-game and game-related content, as well as player statistics. | ||
| 23 | |||
| 24 | This module provide access to WG Public API | ||
| 25 | |||
| 26 | use WG::API; | ||
| 27 | |||
| 28 | my $wg = WG::API->new( application_id => 'demo' ); | ||
| 29 | ... | ||
| 30 | my $player = $wg->net( language => 'en' )->account_info( account_id => '1' ); | ||
| 31 | |||
| 32 | =head1 ATTRIBUTES | ||
| 33 | |||
| 34 | =over 1 | ||
| 35 | |||
| 36 | =item I<application_id*> | ||
| 37 | |||
| 38 | Rerquired application id: L<https://developers.wargaming.net/documentation/guide/getting-started/> | ||
| 39 | |||
| 40 | =back | ||
| 41 | |||
| 42 | =cut | ||
| 43 | |||
| 44 | 6 | has application_id => ( | |
| 45 | is => 'ro', | ||
| 46 | require => 1, | ||
| 47 | ); | ||
| 48 | |||
| 49 | =head1 METHODS | ||
| 50 | |||
| 51 | =over 1 | ||
| 52 | |||
| 53 | =item B<wot> | ||
| 54 | |||
| 55 | Returns a WoT instance | ||
| 56 | |||
| 57 | =back | ||
| 58 | |||
| 59 | =cut | ||
| 60 | |||
| 61 | #@returns WG::API::WoT | ||
| 62 | sub wot { | ||
| 63 | 2 | ▶ | my $self = shift; |
|
Subroutine
wot: called CC=1 SCAR=0.0
Pod
documented
| |||
| 64 | |||
| 65 | 2 | require WG::API::WoT; | |
| 66 | |||
| 67 | 2 | return WG::API::WoT->new( | |
| 68 | application_id => $self->application_id, | ||
| 69 | @_, | ||
| 70 | ); | ||
| 71 | } | ||
| 72 | |||
| 73 | =over 1 | ||
| 74 | |||
| 75 | =item B<wowp> | ||
| 76 | |||
| 77 | Returns a WoWp instance | ||
| 78 | |||
| 79 | =back | ||
| 80 | |||
| 81 | =cut | ||
| 82 | |||
| 83 | #@returns WG::API::WoWp | ||
| 84 | sub wowp { | ||
| 85 | 2 | ▶ | my $self = shift; |
|
Subroutine
wowp: called CC=1 SCAR=0.0
Pod
documented
| |||
| 86 | |||
| 87 | 2 | require WG::API::WoWp; | |
| 88 | |||
| 89 | 2 | return WG::API::WoWp->new( | |
| 90 | application_id => $self->application_id, | ||
| 91 | @_, | ||
| 92 | ); | ||
| 93 | } | ||
| 94 | |||
| 95 | =over 1 | ||
| 96 | |||
| 97 | =item B<wows> | ||
| 98 | |||
| 99 | Returns a WoWs instance | ||
| 100 | |||
| 101 | =back | ||
| 102 | |||
| 103 | =cut | ||
| 104 | |||
| 105 | #@returns WG::API::WoWs | ||
| 106 | sub wows { | ||
| 107 | 2 | ▶ | my $self = shift; |
|
Subroutine
wows: called CC=1 SCAR=0.0
Pod
documented
| |||
| 108 | |||
| 109 | 2 | require WG::API::WoWs; | |
| 110 | |||
| 111 | 2 | return WG::API::WoWs->new( | |
| 112 | application_id => $self->application_id, | ||
| 113 | @_, | ||
| 114 | ); | ||
| 115 | } | ||
| 116 | |||
| 117 | =over 1 | ||
| 118 | |||
| 119 | =item B<net> | ||
| 120 | |||
| 121 | Returns a NET instance | ||
| 122 | |||
| 123 | =back | ||
| 124 | |||
| 125 | =cut | ||
| 126 | |||
| 127 | #@returns WG::API::NET | ||
| 128 | sub net { | ||
| 129 | 3 | ▶ | my $self = shift; |
|
Subroutine
net: called CC=1 SCAR=0.0
Pod
documented
| |||
| 130 | |||
| 131 | 3 | require WG::API::NET; | |
| 132 | |||
| 133 | 3 | return WG::API::NET->new( | |
| 134 | application_id => $self->application_id, | ||
| 135 | @_, | ||
| 136 | ); | ||
| 137 | } | ||
| 138 | |||
| 139 | =over 1 | ||
| 140 | |||
| 141 | =item B<auth> | ||
| 142 | |||
| 143 | Return a Auth instance | ||
| 144 | |||
| 145 | =back | ||
| 146 | |||
| 147 | =cut | ||
| 148 | |||
| 149 | #@returns WG::API::Auth | ||
| 150 | sub auth { | ||
| 151 | 2 | ▶ | my $self = shift; |
|
Subroutine
auth: called CC=1 SCAR=0.0
Pod
documented
| |||
| 152 | |||
| 153 | 2 | require WG::API::Auth; | |
| 154 | |||
| 155 | 2 | return WG::API::Auth->new( | |
| 156 | application_id => $self->application_id, | ||
| 157 | @_, | ||
| 158 | ); | ||
| 159 | } | ||
| 160 | |||
| 161 | =head1 BUGS | ||
| 162 | |||
| 163 | Please report any bugs or feature requests to C<cynovg at cpan.org>, or through the web interface at L<https://gitlab.com/cynovg/WG-API/issues>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. | ||
| 164 | |||
| 165 | =head1 SUPPORT | ||
| 166 | |||
| 167 | You can find documentation for this module with the perldoc command. | ||
| 168 | |||
| 169 | perldoc WG::API | ||
| 170 | |||
| 171 | You can also look for information at: | ||
| 172 | |||
| 173 | =over 4 | ||
| 174 | |||
| 175 | =item * RT: Gitlab's request tracker (report bugs here) | ||
| 176 | |||
| 177 | L<https://gitlab.com/cynovg/WG-API/issues> | ||
| 178 | |||
| 179 | =item * AnnoCPAN: Annotated CPAN documentation | ||
| 180 | |||
| 181 | L<http://annocpan.org/dist/WG-API> | ||
| 182 | |||
| 183 | =item * CPAN Ratings | ||
| 184 | |||
| 185 | L<http://cpanratings.perl.org/d/WG-API> | ||
| 186 | |||
| 187 | =item * Search CPAN | ||
| 188 | |||
| 189 | L<https://metacpan.org/pod/WG::API> | ||
| 190 | |||
| 191 | =back | ||
| 192 | |||
| 193 | |||
| 194 | =head1 ACKNOWLEDGEMENTS | ||
| 195 | |||
| 196 | ... | ||
| 197 | |||
| 198 | =head1 SEE ALSO | ||
| 199 | |||
| 200 | WG API Reference L<https://developers.wargaming.net/> | ||
| 201 | |||
| 202 | =head1 AUTHOR | ||
| 203 | |||
| 204 | Cyrill Novgorodcev , C<< <cynovg at cpan.org> >> | ||
| 205 | |||
| 206 | =head1 LICENSE AND COPYRIGHT | ||
| 207 | |||
| 208 | Copyright 2015 Cyrill Novgorodcev. | ||
| 209 | |||
| 210 | This program is free software; you can redistribute it and/or modify it | ||
| 211 | under the terms of the the Artistic License (2.0). You may obtain a | ||
| 212 | copy of the full license at: | ||
| 213 | |||
| 214 | L<http://www.perlfoundation.org/artistic_license_2_0> | ||
| 215 | |||
| 216 | Any use, modification, and distribution of the Standard or Modified | ||
| 217 | Versions is governed by this Artistic License. By using, modifying or | ||
| 218 | distributing the Package, you accept this license. Do not use, modify, | ||
| 219 | or distribute the Package, if you do not accept this license. | ||
| 220 | |||
| 221 | If your Modified Version has been derived from a Modified Version made | ||
| 222 | by someone other than you, you are nevertheless required to ensure that | ||
| 223 | your Modified Version complies with the requirements of this license. | ||
| 224 | |||
| 225 | This license does not grant you the right to use any trademark, service | ||
| 226 | mark, tradename, or logo of the Copyright Holder. | ||
| 227 | |||
| 228 | This license includes the non-exclusive, worldwide, free-of-charge | ||
| 229 | patent license to make, have made, use, offer to sell, sell, import and | ||
| 230 | otherwise transfer the Package with respect to any patent claims | ||
| 231 | licensable by the Copyright Holder that are necessarily infringed by the | ||
| 232 | Package. If you institute patent litigation (including a cross-claim or | ||
| 233 | counterclaim) against any party alleging that the Package constitutes | ||
| 234 | direct or contributory patent infringement, then this Artistic License | ||
| 235 | to you shall terminate on the date that such litigation is filed. | ||
| 236 | |||
| 237 | Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER | ||
| 238 | AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. | ||
| 239 | THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
| 240 | PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY | ||
| 241 | YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR | ||
| 242 | CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR | ||
| 243 | CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, | ||
| 244 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 245 | |||
| 246 | |||
| 247 | =cut | ||
| 248 | |||
| 249 | 6 | 1; # End of WG::API | |