API-MailboxOrg

 view release on metacpan or  search on metacpan

lib/API/MailboxOrg/APIBase.pm  view on Meta::CPAN

no warnings 'experimental::signatures';

our $VERSION = '1.0.2'; # VERSION

has api      => ( is => 'ro', isa => Object, required => 1 );
has json_rpc => ( is => 'ro', isa => Str, default => sub { '2.0' } );

state $request_id = 1;

sub _request ( $self, $method, $params = {}, $opts = {} ) {
    my $rpc_data = {
        jsonrpc => $self->json_rpc,
        id      => $request_id++,
        method  => $method,
    };

    $rpc_data->{params} = $params->%* ? $params : "";

    my $api = $self->api;

    if ( $opts->{needs_auth} && !$api->token ) {
        my $auth_result = $api->base->auth(
            user => $api->user,
            pass => $api->password,
        );

        my $token = ref $auth_result ?

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.043 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )