API-MailboxOrg

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

make of the Package, you should contact the Copyright Holder and seek
a different licensing arrangement. 

Definitions

    "Copyright Holder" means the individual(s) or organization(s)
    named in the copyright notice for the entire Package.

    "Contributor" means any party that has contributed code or other
    material to the Package, in accordance with the Copyright Holder's
    procedures.

    "You" and "your" means any person who would like to copy,
    distribute, or modify the Package.

    "Package" means the collection of files distributed by the
    Copyright Holder, and derivatives of that collection and/or of
    those files. A given Package may consist of either the Standard
    Version, or a Modified Version.

    "Distribute" means providing a copy of the Package or making it

LICENSE  view on Meta::CPAN

    Holder. 

    "Original License" means this Artistic License as Distributed with
    the Standard Version of the Package, in its current version or as
    it may be modified by The Perl Foundation in the future.

    "Source" form means the source code, documentation source, and
    configuration files for the Package.

    "Compiled" form means the compiled bytecode, object code, binary,
    or any other form resulting from mechanical transformation or
    translation of the Source form.


Permission for Use and Modification Without Distribution

(1)  You are permitted to use the Standard Version and create and use
Modified Versions for any purpose without restriction, provided that
you do not Distribute the Modified Version.


Permissions for Redistribution of the Standard Version

(2)  You may Distribute verbatim copies of the Source form of the
Standard Version of this Package in any medium without restriction,
either gratis or for a Distributor Fee, provided that you duplicate
all of the original copyright notices and associated disclaimers.  At
your discretion, such verbatim copies may or may not include a
Compiled form of the Package.

(3)  You may apply any bug fixes, portability changes, and other
modifications made available from the Copyright Holder.  The resulting
Package will still be considered the Standard Version, and as such
will be subject to the Original License.


Distribution of Modified Versions of the Package as Source 

(4)  You may Distribute your Modified Version as Source (either gratis
or for a Distributor Fee, and with or without a Compiled form of the
Modified Version) provided that you clearly document how it differs
from the Standard Version, including, but not limited to, documenting
any non-standard features, executables, or modules, and provided that
you do at least ONE of the following:

    (a)  make the Modified Version available to the Copyright Holder
    of the Standard Version, under the Original License, so that the
    Copyright Holder may include your modifications in the Standard
    Version.

    (b)  ensure that installation of your Modified Version does not
    prevent the user installing or running the Standard Version. In
    addition, the Modified Version must bear a name that is different

LICENSE  view on Meta::CPAN


    (c)  allow anyone who receives a copy of the Modified Version to
    make the Source form of the Modified Version available to others
    under
		
	(i)  the Original License or

	(ii)  a license that permits the licensee to freely copy,
	modify and redistribute the Modified Version using the same
	licensing terms that apply to the copy that the licensee
	received, and requires that the Source form of the Modified
	Version, and of any works derived from it, be made freely
	available in that license fees are prohibited but Distributor
	Fees are allowed.


Distribution of Compiled Forms of the Standard Version 
or Modified Versions without the Source

(5)  You may Distribute Compiled forms of the Standard Version without
the Source, provided that you include complete instructions on how to
get the Source of the Standard Version.  Such instructions must be
valid at the time of your distribution.  If these instructions, at any
time while you are carrying out such distribution, become invalid, you
must provide new instructions on demand or cease further distribution.
If you provide valid instructions or cease distribution within thirty
days after you become aware that the instructions are invalid, then
you do not forfeit any of your rights under this license.

(6)  You may Distribute a Modified Version in Compiled form without
the Source, provided that you comply with Section 4 with respect to
the Source of the Modified Version.


Aggregating or Linking the Package 

(7)  You may aggregate the Package (either the Standard Version or
Modified Version) with other packages and Distribute the resulting
aggregation provided that you do not charge a licensing fee for the
Package.  Distributor Fees are permitted, and licensing fees for other
components in the aggregation are permitted. The terms of this license
apply to the use and Distribution of the Standard or Modified Versions
as included in the aggregation.

(8) You are permitted to link Modified and Standard Versions with
other works, to embed the Package in a larger work of your own, or to
build stand-alone binary or bytecode versions of applications that
include the Package, and Distribute the result without restriction,
provided the result does not expose a direct interface to the Package.


Items That are Not Considered Part of a Modified Version 

(9) Works (including, but not limited to, modules and scripts) that
merely extend or make use of the Package, do not, by themselves, cause
the Package to be a Modified Version.  In addition, such works are not
considered parts of the Package itself, and are not subject to the
terms of this license.

LICENSE  view on Meta::CPAN

(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
infringed by the Package. If you institute patent litigation
(including a cross-claim or counterclaim) against any party alleging
that the Package constitutes direct or contributory patent
infringement, then this Artistic License to you shall terminate on the
date that such litigation is filed.

(14)  Disclaimer of Warranty:
THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED

MANIFEST  view on Meta::CPAN

lib/API/MailboxOrg/API/Backup.pm
lib/API/MailboxOrg/API/Base.pm
lib/API/MailboxOrg/API/Blacklist.pm
lib/API/MailboxOrg/API/Capabilities.pm
lib/API/MailboxOrg/API/Context.pm
lib/API/MailboxOrg/API/Domain.pm
lib/API/MailboxOrg/API/Hello.pm
lib/API/MailboxOrg/API/Invoice.pm
lib/API/MailboxOrg/API/Mail.pm
lib/API/MailboxOrg/API/Mailinglist.pm
lib/API/MailboxOrg/API/Passwordreset.pm
lib/API/MailboxOrg/API/Spamprotect.pm
lib/API/MailboxOrg/API/Test.pm
lib/API/MailboxOrg/API/Utils.pm
lib/API/MailboxOrg/API/Validate.pm
lib/API/MailboxOrg/API/Videochat.pm
lib/API/MailboxOrg/APIBase.pm
lib/API/MailboxOrg/Types.pm
perlcritic.rc
t/001_base.t
t/002_hello-world.t
t/author-critic.t
t/author-no-bom.t
t/author-no-tabs.t
t/author-pod-coverage.t
t/author-pod-syntax.t
t/types/001_hashref_restricted.t
t/types/002_boolean.t

META.json  view on Meta::CPAN

   "license" : [
      "artistic_2"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
      "version" : 2
   },
   "name" : "API-MailboxOrg",
   "prereqs" : {
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "develop" : {
         "requires" : {
            "Pod::Coverage::TrustPod" : "0",
            "Test::BOM" : "0",
            "Test::More" : "0.88",
            "Test::NoTabs" : "0",
            "Test::Perl::Critic" : "0",
            "Test::Pod" : "1.41",
            "Test::Pod::Coverage" : "1.08"
         }
      },
      "runtime" : {
         "requires" : {
            "Carp" : "0",
            "IO::Socket::SSL" : "0",
            "JSON::PP" : "0",
            "Mojolicious" : "8",
            "Moo" : "1.003001",
            "MooX::Singleton" : "0",
            "Params::ValidationCompiler" : "0.30",
            "Scalar::Util" : "0",
            "Type::Library" : "1.012",
            "Type::Utils" : "1.012",
            "Types::Mojo" : "0.04",
            "Types::Standard" : "1.012",
            "perl" : "5.024"
         }
      },
      "test" : {
         "requires" : {
            "Pod::Coverage::TrustPod" : "0",
            "Test::Exception" : "0",
            "Test::More" : "0",
            "Test::RequiresInternet" : "0",
            "Test::Spec" : "0"
         }
      }
   },
   "provides" : {
      "API::MailboxOrg" : {
         "file" : "lib/API/MailboxOrg.pm",
         "version" : "v1.0.2"
      },
      "API::MailboxOrg::API::Account" : {

META.json  view on Meta::CPAN

         "version" : "v1.0.2"
      },
      "API::MailboxOrg::API::Mail" : {
         "file" : "lib/API/MailboxOrg/API/Mail.pm",
         "version" : "v1.0.2"
      },
      "API::MailboxOrg::API::Mailinglist" : {
         "file" : "lib/API/MailboxOrg/API/Mailinglist.pm",
         "version" : "v1.0.2"
      },
      "API::MailboxOrg::API::Passwordreset" : {
         "file" : "lib/API/MailboxOrg/API/Passwordreset.pm",
         "version" : "v1.0.2"
      },
      "API::MailboxOrg::API::Spamprotect" : {
         "file" : "lib/API/MailboxOrg/API/Spamprotect.pm",
         "version" : "v1.0.2"
      },
      "API::MailboxOrg::API::Test" : {
         "file" : "lib/API/MailboxOrg/API/Test.pm",
         "version" : "v1.0.2"
      },

META.json  view on Meta::CPAN

      "API::MailboxOrg::APIBase" : {
         "file" : "lib/API/MailboxOrg/APIBase.pm",
         "version" : "v1.0.2"
      },
      "API::MailboxOrg::Types" : {
         "file" : "lib/API/MailboxOrg/Types.pm",
         "version" : "v1.0.2"
      }
   },
   "release_status" : "stable",
   "resources" : {
      "bugtracker" : {
         "web" : "https://github.com/perlservices/API-MailboxOrg/issues"
      },
      "homepage" : "https://github.com/perlservices/API-MailboxOrg",
      "repository" : {
         "type" : "git",
         "url" : "git://github.com/perlservices/API-MailboxOrg.git",
         "web" : "https://github.com/perlservices/API-MailboxOrg"
      }
   },

META.yml  view on Meta::CPAN

---
abstract: 'Perl library to work with the API for the Mailbox.org API'
author:
  - 'Renee Baecker <reneeb@cpan.org>'
build_requires:
  Pod::Coverage::TrustPod: '0'
  Test::Exception: '0'
  Test::More: '0'
  Test::RequiresInternet: '0'
  Test::Spec: '0'
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010'
license: artistic_2
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: API-MailboxOrg
provides:
  API::MailboxOrg:

META.yml  view on Meta::CPAN

    version: v1.0.2
  API::MailboxOrg::API::Invoice:
    file: lib/API/MailboxOrg/API/Invoice.pm
    version: v1.0.2
  API::MailboxOrg::API::Mail:
    file: lib/API/MailboxOrg/API/Mail.pm
    version: v1.0.2
  API::MailboxOrg::API::Mailinglist:
    file: lib/API/MailboxOrg/API/Mailinglist.pm
    version: v1.0.2
  API::MailboxOrg::API::Passwordreset:
    file: lib/API/MailboxOrg/API/Passwordreset.pm
    version: v1.0.2
  API::MailboxOrg::API::Spamprotect:
    file: lib/API/MailboxOrg/API/Spamprotect.pm
    version: v1.0.2
  API::MailboxOrg::API::Test:
    file: lib/API/MailboxOrg/API/Test.pm
    version: v1.0.2
  API::MailboxOrg::API::Utils:
    file: lib/API/MailboxOrg/API/Utils.pm
    version: v1.0.2

META.yml  view on Meta::CPAN

    version: v1.0.2
  API::MailboxOrg::API::Videochat:
    file: lib/API/MailboxOrg/API/Videochat.pm
    version: v1.0.2
  API::MailboxOrg::APIBase:
    file: lib/API/MailboxOrg/APIBase.pm
    version: v1.0.2
  API::MailboxOrg::Types:
    file: lib/API/MailboxOrg/Types.pm
    version: v1.0.2
requires:
  Carp: '0'
  IO::Socket::SSL: '0'
  JSON::PP: '0'
  Mojolicious: '8'
  Moo: '1.003001'
  MooX::Singleton: '0'
  Params::ValidationCompiler: '0.30'
  Scalar::Util: '0'
  Type::Library: '1.012'
  Type::Utils: '1.012'
  Types::Mojo: '0.04'
  Types::Standard: '1.012'
  perl: '5.024'
resources:
  bugtracker: https://github.com/perlservices/API-MailboxOrg/issues
  homepage: https://github.com/perlservices/API-MailboxOrg
  repository: git://github.com/perlservices/API-MailboxOrg.git
version: 1.0.2
x_contributors:
  - 'reneeb <info@perl-services.de>'
x_generated_by_perl: v5.30.0
x_serialization_backend: 'YAML::Tiny version 1.73'

Makefile.PL  view on Meta::CPAN

    "Scalar::Util" => 0,
    "Type::Library" => "1.012",
    "Type::Utils" => "1.012",
    "Types::Mojo" => "0.04",
    "Types::Standard" => "1.012"
  },
  "TEST_REQUIRES" => {
    "Pod::Coverage::TrustPod" => 0,
    "Test::Exception" => 0,
    "Test::More" => 0,
    "Test::RequiresInternet" => 0,
    "Test::Spec" => 0
  },
  "VERSION" => "1.0.2",
  "test" => {
    "TESTS" => "t/*.t t/types/*.t"
  }
);


my %FallbackPrereqs = (

Makefile.PL  view on Meta::CPAN

  "IO::Socket::SSL" => 0,
  "JSON::PP" => 0,
  "Mojolicious" => 8,
  "Moo" => "1.003001",
  "MooX::Singleton" => 0,
  "Params::ValidationCompiler" => "0.30",
  "Pod::Coverage::TrustPod" => 0,
  "Scalar::Util" => 0,
  "Test::Exception" => 0,
  "Test::More" => 0,
  "Test::RequiresInternet" => 0,
  "Test::Spec" => 0,
  "Type::Library" => "1.012",
  "Type::Utils" => "1.012",
  "Types::Mojo" => "0.04",
  "Types::Standard" => "1.012"
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};

README  view on Meta::CPAN

      * hello

      * invoice

      * mail

      * mailinglist

      * password

      * passwordreset

      * spamprotect

      * test

      * user

      * utils

      * validate

cpanfile  view on Meta::CPAN

# This file is generated by Dist::Zilla::Plugin::SyncCPANfile v0.02
# Do not edit this file directly. To change prereqs, edit the `dist.ini` file.

requires "Carp" => "0";
requires "IO::Socket::SSL" => "0";
requires "JSON::PP" => "0";
requires "Mojolicious" => "8";
requires "Moo" => "1.003001";
requires "MooX::Singleton" => "0";
requires "Params::ValidationCompiler" => "0.30";
requires "Scalar::Util" => "0";
requires "Type::Library" => "1.012";
requires "Type::Utils" => "1.012";
requires "Types::Mojo" => "0.04";
requires "Types::Standard" => "1.012";
requires "perl" => "5.024";

on 'test' => sub {
    requires "Pod::Coverage::TrustPod" => "0";
    requires "Test::Exception" => "0";
    requires "Test::More" => "0";
    requires "Test::RequiresInternet" => "0";
    requires "Test::Spec" => "0";
};

on 'configure' => sub {
    requires "ExtUtils::MakeMaker" => "0";
};

on 'develop' => sub {
    requires "Pod::Coverage::TrustPod" => "0";
    requires "Test::BOM" => "0";
    requires "Test::More" => "0.88";
    requires "Test::NoTabs" => "0";
    requires "Test::Perl::Critic" => "0";
    requires "Test::Pod" => "1.41";
    requires "Test::Pod::Coverage" => "1.08";
};

dist.ini  view on Meta::CPAN

MooX::Singleton = 0
Mojolicious     = 8
Params::ValidationCompiler = 0.30
Scalar::Util    = 0
Type::Library   = 1.012
Type::Utils     = 1.012
Types::Mojo     = 0.04
Types::Standard = 1.012
perl            = 5.024

[Prereqs / TestRequires]
Test::Spec              = 0
Test::More              = 0
Test::Exception         = 0
Test::RequiresInternet  = 0
Pod::Coverage::TrustPod = 0

example/list_videochats.pl  view on Meta::CPAN

use warnings;

use API::MailboxOrg;
use Data::Printer;

my $api = API::MailboxOrg->new(
    user     => 'test@example.tld',
    password => 'a_password',
);

my $result = $api->videochat->list( mail => 'test@example.tld' );

p $result;

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

use Carp;
use Moo;
use Mojo::File;
use Mojo::Loader qw(find_modules load_class);
use Mojo::UserAgent;
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   => (

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

=item * hello

=item * invoice

=item * mail

=item * mailinglist

=item * password

=item * passwordreset

=item * spamprotect

=item * test

=item * user

=item * utils

=item *   validate

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'add' => validation_for(
        params => {
            account      => { type => Str, optional => 0 },
            password     => { type => Str, optional => 0 },
            plan         => { type => Enum[qw(basic profi profixl reseller)], optional => 0 },
            tarifflimits => { type => HashRefRestricted[qw(basic profi profixl reseller)], optional => 1 },
            memo         => { type => Str, optional => 1 },

        },
    ),
    'del' => validation_for(
        params => {
            account => { type => Str, optional => 0 },

        },
    ),
    'get' => validation_for(
        params => {
            account => { type => Str, optional => 0 },

        },
    ),
    'set' => validation_for(
        params => {
            account                    => { type => Str, optional => 0 },
            password                   => { type => Str, optional => 1 },
            plan                       => { type => Enum[qw(basic profi profixl reseller)], optional => 1 },
            memo                       => { type => Str, optional => 1 },
            address_payment_first_name => { type => Str, optional => 1 },
            address_payment_last_name  => { type => Str, optional => 1 },
            address_payment_street     => { type => Str, optional => 1 },
            address_payment_zipcode    => { type => Str, optional => 1 },
            address_payment_town       => { type => Str, optional => 1 },
            av_contract_accept_name    => { type => Str, optional => 1 },
            tarifflimits               => { type => HashRefRestricted[qw(basic profi profixl reseller)], optional => 1 },

        },
    ),

);


sub add ($self, %params) {
    my $validator = $validators{'add'};
    %params       = $validator->(%params) if $validator;

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

        user     => $user,
        password => $password,
    );

=head1 METHODS

=head2 add

Creates a new account

Available for reseller

Parameters:

=over 4

=item * account

=item * password

=item * plan

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

=back

returns: array

    $api->account->add(%params);

=head2 del

Deletes an existing account

Available for admin, reseller

Parameters:

=over 4

=item * account

=back

returns: boolean

    $api->account->del(%params);

=head2 get

Returns information about an account

Available for admin, reseller, account

Parameters:

=over 4

=item * account

=back

returns: array

    $api->account->get(%params);

=head2 list

Returns a list of all accounts that can be administrated

Available for admin, reseller

returns: array

    $api->account->list(%params);

=head2 set

Eigenschaften eines Accounts verändern

Available for admin, reseller

Parameters:

=over 4

=item * account

=item * password

=item * plan

=item * memo

=item * address_payment_first_name

=item * address_payment_last_name

=item * address_payment_street

=item * address_payment_zipcode

=item * address_payment_town

=item * av_contract_accept_name

=item * tarifflimits

=back

returns: array

    $api->account->set(%params);

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'backup_import' => validation_for(
        params => {
            mail   => { type => Str, optional => 0 },
            id     => { type => Int, optional => 0 },
            time   => { type => Int, optional => 0 },
            filter => { type => Str, optional => 0 },

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'auth' => validation_for(
        params => {
            user => { type => Str, optional => 0 },
            pass => { type => Str, optional => 0 },

        },

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'add' => validation_for(
        params => {
            mail        => { type => Str, optional => 0 },
            add_address => { type => Str, optional => 0 },

        },
    ),
    'del' => validation_for(
        params => {
            mail           => { type => Str, optional => 0 },
            delete_address => { type => Str, optional => 0 },

        },
    ),
    'list' => validation_for(
        params => {
            mail => { type => Str, optional => 0 },

        },
    ),

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


    my $api      = API::MailboxOrg->new(
        user     => $user,
        password => $password,
    );

=head1 METHODS

=head2 add

Adds an address to the blacklist

Available for admin, account, domain, mail

Parameters:

=over 4

=item * mail

=item * add_address

=back

returns: array

    $api->blacklist->add(%params);

=head2 del

Deletes an address from the blacklist

Available for admin, account, domain, mail

Parameters:

=over 4

=item * mail

=item * delete_address

=back

returns: array

    $api->blacklist->del(%params);

=head2 list

Lists all blacklist entries

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'set' => validation_for(
        params => {
            mail         => { type => Str, optional => 0 },
            capabilities => { type => ArrayRef[Enum[qw(MAIL_SPAMPROTECTION MAIL_BLACKLIST MAIL_BACKUPRECOVER MAIL_OTP MAIL_PASSWORDRESET_SMS BMBO_VIDEOCHAT)]], optional => 0 },

        },

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

        user     => $user,
        password => $password,
    );

=head1 METHODS

=head2 set

Modifies email capabilities

Available for admin, reseller, account, domain

Parameters:

=over 4

=item * mail

=item * capabilities

=back

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'list' => validation_for(
        params => {
            account => { type => Str, optional => 0 },

        },
    ),

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

        user     => $user,
        password => $password,
    );

=head1 METHODS

=head2 list

Returns a list of Context-IDs and associated domains

Available for admin, reseller, account

Parameters:

=over 4

=item * account

=back

returns: array

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'add' => validation_for(
        params => {
            account               => { type => Str, optional => 0 },
            domain                => { type => Str, optional => 0 },
            password              => { type => Str, optional => 0 },
            context_id            => { type => Str, optional => 1 },

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

        user     => $user,
        password => $password,
    );

=head1 METHODS

=head2 add

Adds a domain

Available for admin, reseller, account

Parameters:

=over 4

=item * account

=item * domain

=item * password

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

=back

returns: array

    $api->domain->add(%params);

=head2 del

Removes a domain from an account

Available for admin, reseller, account

Parameters:

=over 4

=item * account

=item * domain

=back

returns: boolean

    $api->domain->del(%params);

=head2 get

Returns details about a domain

Available for admin, reseller, account, domain

Parameters:

=over 4

=item * domain

=back

returns: array

    $api->domain->get(%params);

=head2 list

Returns a list of all existing domains

Available for admin, reseller, account

Parameters:

=over 4

=item * account

=item * filter

=back

returns: array

    $api->domain->list(%params);

=head2 set

Modifies domain properties

Available for admin, reseller, account, domain, account, account

Parameters:

=over 4

=item * domain

=item * password

=item * context_id

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (

);


sub innerworld ($self, %params) {
    my $validator = $validators{'innerworld'};

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

        user     => $user,
        password => $password,
    );

=head1 METHODS

=head2 innerworld

Returns the string 'Hello Inner-World!' if called from a valid session

Available for admin, reseller, account, domain, mail

returns: string

    $api->hello->innerworld(%params);

=head2 world

Returns the string 'Hello World!'

returns: string

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'get' => validation_for(
        params => {
            token => { type => Str, optional => 0 },

        },
    ),

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

=back

returns: array

    $api->invoice->get(%params);

=head2 list

Returns a list of downloadable invoices

Available for admin, reseller, account

Parameters:

=over 4

=item * account

=back

returns: array

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'add' => validation_for(
        params => {
            mail                   => { type => Str, optional => 0 },
            password               => { type => Str, optional => 0 },
            password_hash          => { type => Str, optional => 1 },
            plan                   => { type => Enum[qw(light standard premium)], optional => 0 },

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


    my $api      = API::MailboxOrg->new(
        user     => $user,
        password => $password,
    );

=head1 METHODS

=head2 add

Adds an e-mail address

Available for admin, account, domain

Parameters:

=over 4

=item * mail

=item * password

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

=item * skip_welcome_mail

=back

returns: array

    $api->mail->add(%params);

=head2 del

Deletes an e-mail address

Available for admin, reseller, account, domain

Parameters:

=over 4

=item * mail

=back

returns: boolean

    $api->mail->del(%params);

=head2 get

Returns e-mail address details

Available for admin, reseller, account, domain, mail

Parameters:

=over 4

=item * mail

=back

returns: array

    $api->mail->get(%params);

=head2 list

Returns a list of e-mail addresses + configuration information

Available for admin, reseller, account, domain

Parameters:

=over 4

=item * domain

=back

returns: array

    $api->mail->list(%params);

=head2 register

Adds an e-mail address (using a predefined token)

Parameters:

=over 4

=item * token

=item * mail

=item * password

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

=item * lang

=back

returns: boolean

    $api->mail->register(%params);

=head2 set

Modifies e-mail address properties

Available for admin, reseller, account, domain, mail, domain

Parameters:

=over 4

=item * mail

=item * password

=item * password_hash

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'add' => validation_for(
        params => {
            mailinglist => { type => Str, optional => 0 },
            password    => { type => Str, optional => 0 },
            account     => { type => Str, optional => 0 },
            adminmail   => { type => Str, optional => 1 },

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

package API::MailboxOrg::API::Passwordreset;

# ABSTRACT: MailboxOrg::API::Passwordreset

# ---
# This class is auto-generated by bin/get_mailbox_api.pl
# ---

use v5.24;

use strict;
use warnings;

use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'listmethods' => validation_for(
        params => {
            mail => { type => Str, optional => 0 },

        },
    ),

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


);


sub listmethods ($self, %params) {
    my $validator = $validators{'listmethods'};
    %params       = $validator->(%params) if $validator;

    my %opt = ();

    return $self->_request( 'mail.passwordreset.listmethods', \%params, \%opt );
}

sub sendsms ($self, %params) {
    my $validator = $validators{'sendsms'};
    %params       = $validator->(%params) if $validator;

    my %opt = ();

    return $self->_request( 'mail.passwordreset.sendsms', \%params, \%opt );
}

sub setpassword ($self, %params) {
    my $validator = $validators{'setpassword'};
    %params       = $validator->(%params) if $validator;

    my %opt = ();

    return $self->_request( 'mail.passwordreset.setpassword', \%params, \%opt );
}


1;

__END__

=pod

=encoding UTF-8

=head1 NAME

API::MailboxOrg::API::Passwordreset - MailboxOrg::API::Passwordreset

=head1 VERSION

version 1.0.2

=head1 SYNOPSIS

    use API::MailboxOrg;

    my $user     = '1234abc';

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


    my $api      = API::MailboxOrg->new(
        user     => $user,
        password => $password,
    );

=head1 METHODS

=head2 listmethods

Returns a list of available password reset methods for the given user

Parameters:

=over 4

=item * mail

=back

returns: array

    $api->passwordreset->listmethods(%params);

=head2 sendsms

Send a password reset token by SMS

Parameters:

=over 4

=item * mail

=item * cell_phone

=back

returns: boolean

    $api->passwordreset->sendsms(%params);

=head2 setpassword

Set a new password using a password reset token

Parameters:

=over 4

=item * mail

=item * token

=item * password

=back

returns: boolean

    $api->passwordreset->setpassword(%params);

=head1 AUTHOR

Renee Baecker <reneeb@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2022 by Renee Baecker.

This is free software, licensed under:

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'get' => validation_for(
        params => {
            mail => { type => Str, optional => 0 },

        },
    ),

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'accountallowed' => validation_for(
        params => {
            account => { type => Str, optional => 0 },

        },
    ),

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'validator' => validation_for(
        params => {
            value => { type => Str, optional => 0 },
            type  => { type => Enum[qw(hostname domain mailhost mail account pass pass2 memo user contextid name)], optional => 0 },

        },

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'spf' => validation_for(
        params => {
            domain => { type => Str, optional => 0 },

        },
    ),

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

        user     => $user,
        password => $password,
    );

=head1 METHODS

=head2 spf

Returns SPF details about a domain

Available for admin, reseller, account, domain

Parameters:

=over 4

=item * domain

=back

returns: array

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


use Moo;
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef);
use API::MailboxOrg::Types qw(HashRefRestricted Boolean);
use Params::ValidationCompiler qw(validation_for);

extends 'API::MailboxOrg::APIBase';

with 'MooX::Singleton';

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

our $VERSION = '1.0.2'; # VERSION

my %validators = (
    'add' => validation_for(
        params => {
            mail      => { type => Str, optional => 0 },
            room_name => { type => Str, optional => 0 },
            room_memo => { type => Str, optional => 1 },

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


    my $api      = API::MailboxOrg->new(
        user     => $user,
        password => $password,
    );

=head1 METHODS

=head2 add

Add a new video channel for an e-mail address

Available for admin, account, domain, mail

Parameters:

=over 4

=item * mail

=item * room_name

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

=item * room_memo

=back

returns: boolean

    $api->videochat->add(%params);

=head2 del

Delete a video channel from an e-mail address

Available for admin, account, domain, mail

Parameters:

=over 4

=item * mail

=item * room_id

=back

returns: boolean

    $api->videochat->del(%params);

=head2 list

List all video channels from an e-mail address

Available for admin, account, domain, mail

Parameters:

=over 4

=item * mail

=back

returns: array

    $api->videochat->list(%params);

=head2 update

Update a video channel for an e-mail address

Available for admin, account, domain, mail

Parameters:

=over 4

=item * mail

=item * room_id

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


use strict;
use warnings;

use Carp;
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,
    };

    $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 ?
            $auth_result->{session} :
            croak 'Could not login: ' . $auth_result;

        $api->_set_token( $token );
    }

    my %header = ( 'Content-Type' => 'application/json' );
    $header{'HPLS-AUTH'} = $api->token if $api->token;

    my $uri = join '/',
        $api->host,
        $api->base_uri;

    my $tx = $api->client->post(
        $uri,
        \%header,
        json => $rpc_data,
    );

    my $response = $tx->res;

    if ( $tx->error ) {
        carp $tx->error->{message};
        return;
    }

    my $data = $response->json;

    if ( $data->{error} ) {
        carp $data->{error}->{message};
        return;
    }

    return $data->{result};
}

1;

__END__

=pod

=encoding UTF-8

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

            a => 1,
            b => 1,
            # a key 'c' would cause a 'die'
        },
    );

=head1 TYPES

=head2 HashRefRestricted[`a]

This expects a hash reference. You can restrict the allowed keys

=head2 Boolean

A JSON::PP::Boolean object.

=head1 COERCIONS

These coercions are defined.

=head2 To Boolean

t/001_base.t  view on Meta::CPAN

    $base . '::API::Backup'        => [qw/backup_import list/],
    $base . '::API::Base'          => [qw/auth deauth search/],
    $base . '::API::Blacklist'     => [qw/add del list/],
    $base . '::API::Capabilities'  => [qw/set/],
    $base . '::API::Context'       => [qw/list/],
    $base . '::API::Domain'        => [qw/add del get list set/],
    $base . '::API::Hello'         => [qw/innerworld world/],
    $base . '::API::Invoice'       => [qw/get list/],
    $base . '::API::Mailinglist'   => [qw/add del get list set/],
    $base . '::API::Mail'          => [qw/add del get list register set/],
    $base . '::API::Passwordreset' => [qw/listmethods sendsms setpassword/],
    $base . '::API::Spamprotect'   => [qw/get set/],
    $base . '::API::Test'          => [qw/accountallowed domainallowed/],
    $base . '::API::Utils'         => [qw/validator/],
    $base . '::API::Validate'      => [qw/spf/],
    $base . '::API::Videochat'     => [qw/add del update list/],
};

for my $mod ( sort keys %{$methods} ) {
    use_ok $mod;
}



( run in 0.849 second using v1.01-cache-2.11-cpan-49f99fa48dc )