Skip to content

Commit

Permalink
shop namespace stub
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu-Wu committed Jun 23, 2014
1 parent 4effb63 commit 6196f84
Show file tree
Hide file tree
Showing 4 changed files with 202 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ Revision history for Perl distribution Regru-API.

{{$NEXT}}

[ FEATURES ]
- added new REG.API namespace "shop"

[ DOCUMENTATION ]
- missed namespaces ("hosting" and "shop") mentioned at front page

[ TESTS ]
- updated tests

0.043 Tue Nov 26 08:25:06 2013 +0000

[ FEATURES ]
Expand Down
2 changes: 1 addition & 1 deletion dist.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; basic settings
name = Regru-API
version = 0.043
version = 0.044
author = Polina Shubina <shubina@reg.ru>
author = Anton Gerasimov <a.gerasimov@reg.ru>
license = Perl_5
Expand Down
27 changes: 27 additions & 0 deletions lib/Regru/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ sub available_namespaces {[qw(
folder
service
hosting
shop
)]}

sub _get_namespace_handler {
Expand Down Expand Up @@ -234,6 +235,28 @@ Invoice management methods.
See L<Regru::API::Bill> for details and
L<REG.API Invoice management functions|https://www.reg.com/support/help/API-version2#bill_fn>.
=item B<hosting>
Hosting management methods.
# suppose we already have a client
$client->hosting->set_jelastic_refill_url(
url => 'http://mysite.com?service_id=<service_id>&email=<email>'
);
See L<Regru::API::Hosting> for details and
L<REG.API Hosting management functions|https://www.reg.com/support/help/api2#hosting_functions>.
=item B<shop>
Domain shop management methods.
# suppose we already have a client
$client->shop->get_info();
See L<Regru::API::Shop> for details and
L<REG.API Domain shop management functions|https://www.reg.com/support/help/api2#shop_functions>.
=back
=head2 Methods accessibility
Expand Down Expand Up @@ -510,6 +533,10 @@ L<Regru::API::User>
L<Regru::API::Zone>
L<Regru::API::Hosting>
L<Regru::API::Shop>
L<Regru::API::Response>
L<REG.API Common functions|https://www.reg.com/support/help/API-version2#tests_fn>
Expand Down
165 changes: 165 additions & 0 deletions lib/Regru/API/Shop.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
package Regru::API::Shop;

# ABSTRACT: REG.API v2 domain shop management functions

use strict;
use warnings;
use Moo;
use namespace::autoclean;

# VERSION
# AUTHORITY

with 'Regru::API::Role::Client';

has '+namespace' => (
default => sub { 'shop' },
);

sub available_methods {[qw(
nop
add_lot
update_lot
delete_lot
get_info
get_lot_list
get_category_list
get_suggested_tags
)]}

__PACKAGE__->namespace_methods;
__PACKAGE__->meta->make_immutable;

1; # End of Regru::API::Shop

__END__
=pod
=head1 DESCRIPTION
REG.API domain shop management.
=apimethod nop
For testing purposes. Scope: B<clients>. Typical usage:
$resp = $client->shop->nop;
Returns success response.
More info at L<Shop management: nop|https://www.reg.com/support/help/api2#shop_nop>.
=apimethod add_lot
...
Scope B<clients>. Typical usage:
$resp = $client->shop->add_lot(
);
Returns..
More info at L<Shop management: add_lot|https://www.reg.com/support/help/api2#shop_add_lot>.
=apimethod update_lot
...
Scope B<clients>. Typical usage:
$resp = $client->shop->update_lot(
);
Returns..
More info at L<Shop management: update_lot|https://www.reg.com/support/help/api2#shop_update_lot>.
=apimethod delete_lot
...
Scope B<clients>. Typical usage:
$resp = $client->shop->delete_lot(
);
Returns..
More info at L<Shop management: delete_lot|https://www.reg.com/support/help/api2#shop_delete_lot>.
=apimethod get_info
...
Scope B<clients>. Typical usage:
$resp = $client->shop->get_info(
);
Returns..
More info at L<Shop management: get_info|https://www.reg.com/support/help/api2#shop_get_info>.
=apimethod get_lot_list
...
Scope B<clients>. Typical usage:
$resp = $client->shop->get_lot_list(
);
Returns..
More info at L<Shop management: |https://www.reg.com/support/help/api2#shop_get_lot_list>.
=apimethod get_category_list
...
Scope B<clients>. Typical usage:
$resp = $client->shop->get_category_list(
);
Returns..
More info at L<Shop management: get_category_list|https://www.reg.com/support/help/api2#shop_get_category_list>.
=apimethod get_suggested_tags
...
Scope B<clients>. Typical usage:
$resp = $client->shop->get_suggested_tags(
);
Returns..
More info at L<Shop management: get_suggested_tags|https://www.reg.com/support/help/api2#shop_get_suggested_tags>.
=attr namespace
Always returns the name of category: C<shop>. For internal uses only.
=head1 SEE ALSO
L<Regru::API>
L<Regru::API::Role::Client>
L<REG.API Domain shop management|https://www.reg.com/support/help/api2#shop_functions>
L<REG.API Common error codes|https://www.reg.com/support/help/api2#common_errors>.
=cut

0 comments on commit 6196f84

Please sign in to comment.