NAME

Regru::API::Role::Client - REG.API v2 "client" role

VERSION

version 0.003

SYNOPSIS

# in some namespace package
package Regru::API::Dummy;

use strict;
use warnings;
use Moo;

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

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

sub available_methods {[qw(foo bar baz)]}

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

DESCRIPTION

Any class or role that consumes this role will able to execute requests to REG.API v2.

ATTRIBUTES

username

Account name of the user to access to website https://www.reg.com. Required.

password

Account password of the user to access to website https://www.reg.com or an alternative password for API defined at Reseller settings page. Required.

io_encoding

Defines encoding that will be used for data exchange between the Service and the Client. At the moment REG.API v2 supports the following encodings: utf8, cp1251, koi8-r, koi8-u, cp866. Optional. Default value is utf8.

lang

Defines the language which will be used in error messages. At the moment REG.API v2 supports the following languages: English (en), Russian (ru) and Thai (th). Optional. Default value is en.

debug

Enables the debug mode. Prints some garbage.

namespace

Used internally.

endpoint

REG.API v2 endpoint url. There's no needs to change it. Although it might be overridden by setting environment variable:

export REGRU_API_ENDPOINT=https://api.example.com

Default value is

https://api.reg.ru/api/regru2

METHODS

namespace_methods

Dynamically creates methods-shortcuts in in namespaces (categories) for requests to appropriate REG.API v2 functions.

api_request

Performs an API request to REG.API service. Returns a Regru::API::Response object.

to_namespace

Used internally.

SEE ALSO

Regru::API

Regru::API::Role::Namespace

Regru::API::Role::Serializer

Regru::API::Role::UserAgent

Regru::API::Role::Loggable

Regru::API::Response

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/regru/regru-api-perl/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHORS

  • Polina Shubina <shubina@reg.ru>

  • Anton Gerasimov <a.gerasimov@reg.ru>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by REG.RU LLC.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.