File Coverage

blib/lib/Regru/API/User.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 18 18 100.0


line stmt bran cond sub pod time code
1              
2             # ABSTRACT: REG.API v2 user account management
3              
4             use strict;
5 1     1   514 use warnings;
  1         3  
  1         24  
6 1     1   4 use Moo;
  1         4  
  1         21  
7 1     1   4 use namespace::autoclean;
  1         2  
  1         6  
8 1     1   2388  
  1         2  
  1         5  
9             our $VERSION = '0.052'; # VERSION
10             our $AUTHORITY = 'cpan:CHIM'; # AUTHORITY
11              
12             with 'Regru::API::Role::Client';
13              
14             has '+namespace' => (
15             default => sub { 'user' },
16             );
17              
18             nop
19 1     1   4 create
20             get_statistics
21             get_balance
22             )]}
23              
24             __PACKAGE__->namespace_methods;
25             __PACKAGE__->meta->make_immutable;
26              
27             1; # End of Regru::API::User
28              
29              
30             =pod
31              
32             =encoding UTF-8
33              
34             =head1 NAME
35              
36             Regru::API::User - REG.API v2 user account management
37              
38             =head1 VERSION
39              
40             version 0.052
41              
42             =head1 DESCRIPTION
43              
44             REG.API account management methods such as create new user, fetch some statistics and deposit funds to an account.
45              
46             =head1 ATTRIBUTES
47              
48             =head2 namespace
49              
50             Always returns the name of category: C<user>. For internal uses only.
51              
52             =head1 REG.API METHODS
53              
54             =head2 nop
55              
56             For testing purposes. Scope: B<everyone>. Typical usage:
57              
58             $resp = $client->user->nop;
59              
60             Returns success response.
61              
62             More info at L<Account management: nop|https://www.reg.com/support/help/api2#user_nop>.
63              
64             =head2 create
65              
66             Creates a new user account. Scope: B<partners>. Typical usage:
67              
68             $resp = $client->user->create(
69             # required fields
70             user_login => 'digory',
71             user_password => 'gof4iSewvy8aK5at',
72             user_email => 'digory.kirke@wardrobe.co.uk',
73             user_country => 'GB',
74              
75             # optional extra fields
76             ...
77              
78             set_me_as_referer => 1,
79             );
80              
81             Answer will contains an C<user_id> field for newly created user account or error otherwise.
82              
83             There are a lot of optional fields related to user account so check the documentation if you wish to use them.
84             More info at L<Account management: create|https://www.reg.com/support/help/api2#user_create>.
85              
86             =head2 get_statistics
87              
88             Fetch usage statistic for current account. Scope: B<clients>. Typical usage:
89              
90             $resp = $client->user->get_statistics(
91             date_from => '2013-01-01',
92             date_till => '2013-06-30',
93             );
94              
95             Parameters C<date_from> and C<date_till> are optional. Answer will contains a set of metrics such as number of active
96             domain names, number of domain names which are subject to renewal, number of folders, etc.
97              
98             More info at L<Account management: get_statistics|https://www.reg.com/support/help/api2#user_get_statistics>.
99              
100             =head2 get_balance
101              
102             Shows a current user account balance. Scope: B<clients>. Typical usage:
103              
104             $resp = $client->user->get_balance(
105             currency => 'EUR',
106             );
107              
108             Answer will contains a set of fields like amount of available funds, amount of a blocked funds. For resellers (partners)
109             will be shown amount of available credit additionally.
110              
111             More info at L<Account management: get_balance|https://www.reg.com/support/help/api2#user_get_balance>.
112              
113             =head1 SEE ALSO
114              
115             L<Regru::API>
116              
117             L<Regru::API::Role::Client>
118              
119             L<REG.API Account management|https://www.reg.com/support/help/api2#user_functions>
120              
121             L<REG.API Common error codes|https://www.reg.com/support/help/api2#common_errors>
122              
123             =head1 BUGS
124              
125             Please report any bugs or feature requests on the bugtracker website
126             L<https://github.com/regru/regru-api-perl/issues>
127              
128             When submitting a bug or request, please include a test-file or a
129             patch to an existing test-file that illustrates the bug or desired
130             feature.
131              
132             =head1 AUTHORS
133              
134             =over 4
135              
136             =item *
137              
138             Polina Shubina <shubina@reg.ru>
139              
140             =item *
141              
142             Anton Gerasimov <a.gerasimov@reg.ru>
143              
144             =back
145              
146             =head1 COPYRIGHT AND LICENSE
147              
148             This software is copyright (c) 2013 by REG.RU LLC.
149              
150             This is free software; you can redistribute it and/or modify it under
151             the same terms as the Perl 5 programming language system itself.
152              
153             =cut