NAME

Regru::API::Role::Client - something that makes requests to API

VERSION

version 0.051

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 reg.com website. Required. Should be passed at instance create time. Although it might be changed at runtime.

password

Account password of the user to access to reg.com website or an alternative password for API defined at Reseller settings page. Required. Should be passed at instance create time. Although it might be changed at runtime.

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: en (English), ru (Russian) and th (Thai). Optional. Default value is en.

debug

A few messages will be printed to STDERR. Default value is 0 (suppressed debug activity).

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.