File Coverage

blib/lib/Regru/API/Shop.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 domain shop management functions
3              
4             use strict;
5 1     1   532 use warnings;
  1         2  
  1         26  
6 1     1   4 use Moo;
  1         2  
  1         20  
7 1     1   4 use namespace::autoclean;
  1         2  
  1         5  
8 1     1   2320  
  1         2  
  1         8  
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 { 'shop' },
16             );
17              
18             nop
19 1     1   4 add_lot
20             update_lot
21             delete_lot
22             get_info
23             get_lot_list
24             get_category_list
25             get_suggested_tags
26             )]}
27              
28             __PACKAGE__->namespace_methods;
29             __PACKAGE__->meta->make_immutable;
30              
31             1; # End of Regru::API::Shop
32              
33              
34             =pod
35              
36             =encoding UTF-8
37              
38             =head1 NAME
39              
40             Regru::API::Shop - REG.API v2 domain shop management functions
41              
42             =head1 VERSION
43              
44             version 0.052
45              
46             =head1 DESCRIPTION
47              
48             REG.API domain shop management.
49              
50             =head1 ATTRIBUTES
51              
52             =head2 namespace
53              
54             Always returns the name of category: C<shop>. For internal uses only.
55              
56             =head1 REG.API METHODS
57              
58             =head2 nop
59              
60             For testing purposes. Scope: B<clients>. Typical usage:
61              
62             $resp = $client->shop->nop;
63              
64             Returns success response.
65              
66             More info at L<Shop management: nop|https://www.reg.com/support/help/api2#shop_nop>.
67              
68             =head2 add_lot
69              
70             Puts one or more lots to domain shop.
71              
72             Scope B<clients>. Typical usage:
73              
74             $resp = $client->shop->add_lot(
75             description => 'great deal: two by one!',
76             category_ids => [qw( 10 15 )],
77             rent => 0,
78             keywords => [qw( foo bar baz )],
79             price => 200,
80             lots => [
81             { price => 201, rent_price => 0, dname => 'foo.com' },
82             { price => 203, rent_price => 0, dname => 'bar.net' },
83             ],
84             sold_with => '',
85             deny_bids_lower_rejected => 1,
86             lot_price_type => 'fixed',
87             );
88              
89             Returns success response if lots was added or error otherwise.
90              
91             More info at L<Shop management: add_lot|https://www.reg.com/support/help/api2#shop_add_lot>.
92              
93             =head2 update_lot
94              
95             Updates a lot entry at domain shop.
96              
97             Scope B<clients>. Typical usage:
98              
99             $resp = $client->shop->update_lot(
100             dname => 'underwood.com',
101             description => 'For the House of Cards fans only!',
102             category_ids => [qw( 4 10 )],
103             rent => 0,
104             keywords => [qw( spacey hoc vp potus )],
105             price => 2000,
106             sold_with => 'tm',
107             deny_bids_lower_rejected => 1,
108             lot_price_type => 'offer',
109             );
110              
111             Returns success response if lots was updated or error otherwise.
112              
113             More info at L<Shop management: update_lot|https://www.reg.com/support/help/api2#shop_update_lot>.
114              
115             =head2 delete_lot
116              
117             Deletes the lots from domain shop.
118              
119             Scope B<clients>. Typical usage:
120              
121             $resp = $client->shop->delete_lot(
122             dname => [qw( foo.com bar.net )],
123             );
124              
125             Returns success response if lots was deleted or error otherwise.
126              
127             More info at L<Shop management: delete_lot|https://www.reg.com/support/help/api2#shop_delete_lot>.
128              
129             =head2 get_info
130              
131             Retrieves an information on the lot.
132              
133             Scope B<clients>. Typical usage:
134              
135             $resp = $client->shop->get_info(
136             dname => 'quux.ru',
137             );
138              
139             Answer will contain the set of metrics (such as C<keywords>, C<start_price>, C<rent_price> etc) for requested
140             lot.
141              
142             More info at L<Shop management: get_info|https://www.reg.com/support/help/api2#shop_get_info>.
143              
144             =head2 get_lot_list
145              
146             Retrieves a current list of lots.
147              
148             Scope B<clients>. Typical usage:
149              
150             $resp = $client->shop->get_lot_list(
151             show_my_lots => 1,
152             itemsonpage => 25,
153             pg => 2,
154             );
155              
156             Answer will contain a C<lots> field with a list of lots and a C<lots_cnt> pointed to total available items.
157              
158             More info at L<Shop management: |https://www.reg.com/support/help/api2#shop_get_lot_list>.
159              
160             =head2 get_category_list
161              
162             Retrieves a categories/subcategories list. Categories are divided into subcategories.
163              
164             Scope B<clients>. Typical usage:
165              
166             $resp = $client->shop->get_category_list;
167              
168             Answer will contain a C<category_list> field with a list of categories each of divided into subcategories. Every
169             subcategory will contain the name and the identiefer.
170              
171             More info at L<Shop management: get_category_list|https://www.reg.com/support/help/api2#shop_get_category_list>.
172              
173             =head2 get_suggested_tags
174              
175             Retrieves a list of buzz tags.
176              
177             Scope B<clients>. Typical usage:
178              
179             $resp = $client->shop->get_suggested_tags(
180             limit => 25,
181             );
182              
183             Answer will contain a C<tags> field with a list of popular tags.
184              
185             More info at L<Shop management: get_suggested_tags|https://www.reg.com/support/help/api2#shop_get_suggested_tags>.
186              
187             =head1 SEE ALSO
188              
189             L<Regru::API>
190              
191             L<Regru::API::Role::Client>
192              
193             L<REG.API Domain shop management|https://www.reg.com/support/help/api2#shop_functions>
194              
195             L<REG.API Common error codes|https://www.reg.com/support/help/api2#common_errors>
196              
197             =head1 BUGS
198              
199             Please report any bugs or feature requests on the bugtracker website
200             L<https://github.com/regru/regru-api-perl/issues>
201              
202             When submitting a bug or request, please include a test-file or a
203             patch to an existing test-file that illustrates the bug or desired
204             feature.
205              
206             =head1 AUTHORS
207              
208             =over 4
209              
210             =item *
211              
212             Polina Shubina <shubina@reg.ru>
213              
214             =item *
215              
216             Anton Gerasimov <a.gerasimov@reg.ru>
217              
218             =back
219              
220             =head1 COPYRIGHT AND LICENSE
221              
222             This software is copyright (c) 2013 by REG.RU LLC.
223              
224             This is free software; you can redistribute it and/or modify it under
225             the same terms as the Perl 5 programming language system itself.
226              
227             =cut