API-MailboxOrg

 view release on metacpan or  search on metacpan

CONTRIBUTING.md  view on Meta::CPAN

```

The project uses [`Dist::Zilla`](https://metacpan.org/pod/Dist::Zilla) to
build the distribution, hence this will need to be installed before
continuing:

```
$ cpanm Dist::Zilla
```

To install the required prequisite packages, run the following set of
commands:

```
$ dzil authordeps --missing | cpanm
$ dzil listdeps --author --missing | cpanm
```

The distribution can be tested like so:

```

LICENSE  view on Meta::CPAN


General Provisions

(10)  Any use, modification, and distribution of the Standard or
Modified Versions is governed by this Artistic License. By using,
modifying or distributing the Package, you accept this license. Do not
use, modify, or distribute the Package, if you do not accept this
license.

(11)  If your Modified Version has been derived from a Modified
Version made by someone other than you, you are nevertheless required
to ensure that your Modified Version complies with the requirements of
this license.

(12)  This license does not grant you the right to use any trademark,
service mark, tradename, or logo of the Copyright Holder.

(13)  This license includes the non-exclusive, worldwide,
free-of-charge patent license to make, have made, use, offer to sell,
sell, import and otherwise transfer the Package with respect to any
patent claims licensable by the Copyright Holder that are necessarily

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

use Mojo::Util qw(decamelize);
use Scalar::Util qw(weaken);
use Types::Mojo qw(:all);
use Types::Standard qw(Str);

use feature 'signatures';
no warnings 'experimental::signatures';

our $VERSION = '1.0.2'; # VERSION

has user     => ( is => 'ro', isa => Str, required => 1 );
has password => ( is => 'ro', isa => Str, required => 1 );
has token    => ( is => 'rwp', isa => Str );
has host     => ( is => 'ro', isa => MojoURL["https?"], default => sub { 'https://api.mailbox.org' }, coerce => 1 );
has base_uri => ( is => 'ro', isa => Str, default => sub { 'v1/' } );

has client   => (
    is      => 'ro',
    lazy    => 1,
    isa     => MojoUserAgent,
    default => sub {
        Mojo::UserAgent->new

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

use Moo;
use Params::ValidationCompiler qw(validation_for);
use Types::Mojo qw(:all);
use Types::Standard qw(Str Object Int);

use feature 'signatures';
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,
    };



( run in 0.548 second using v1.01-cache-2.11-cpan-0a6323c29d9 )