| 1 | package API::MailboxOrg::API::Mail; | ||||||||||
| 2 | |||||||||||
| 3 | # ABSTRACT: MailboxOrg::API::Mail | ||||||||||
| 4 | |||||||||||
| 5 | # --- | ||||||||||
| 6 | # This class is auto-generated by bin/get_mailbox_api.pl | ||||||||||
| 7 | # --- | ||||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | use v5.24; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 2 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 2 | ▶ | use Types::Standard qw(Enum Str Int InstanceOf ArrayRef); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 2 | ▶ | use API::MailboxOrg::Types qw(HashRefRestricted Boolean); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 2 | ▶ | use Params::ValidationCompiler qw(validation_for); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | |||||||||||
| 19 | 2 | extends 'API::MailboxOrg::APIBase'; | |||||||||
| 20 | |||||||||||
| 21 | 2 | with 'MooX::Singleton'; | |||||||||
| 22 | |||||||||||
| 23 | 2 | ▶ | use feature 'signatures'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 2 | ▶ | no warnings 'experimental::signatures'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | |||||||||||
| 26 | 2 | our $VERSION = '1.0.2'; # VERSION | |||||||||
| 27 | |||||||||||
| 28 | 2 | my %validators = ( | |||||||||
| 29 | 'add' => validation_for( | ||||||||||
| 30 | params => { | ||||||||||
| 31 | mail => { type => Str, optional => 0 }, | ||||||||||
| 32 | password => { type => Str, optional => 0 }, | ||||||||||
| 33 | password_hash => { type => Str, optional => 1 }, | ||||||||||
| 34 | plan => { type => Enum[qw(light standard premium)], optional => 0 }, | ||||||||||
| 35 | additional_mail_quota => { type => Str, optional => 1 }, | ||||||||||
| 36 | additional_cloud_quota => { type => Str, optional => 1 }, | ||||||||||
| 37 | first_name => { type => Str, optional => 0 }, | ||||||||||
| 38 | last_name => { type => Str, optional => 0 }, | ||||||||||
| 39 | inboxsave => { type => Boolean, optional => 0 }, | ||||||||||
| 40 | forwards => { type => ArrayRef, optional => 0 }, | ||||||||||
| 41 | memo => { type => Str, optional => 1 }, | ||||||||||
| 42 | catchall => { type => Boolean, optional => 1 }, | ||||||||||
| 43 | create_own_context => { type => Boolean, optional => 1 }, | ||||||||||
| 44 | title => { type => Str, optional => 1 }, | ||||||||||
| 45 | birthday => { type => Str, optional => 1 }, | ||||||||||
| 46 | position => { type => Str, optional => 1 }, | ||||||||||
| 47 | department => { type => Str, optional => 1 }, | ||||||||||
| 48 | company => { type => Str, optional => 1 }, | ||||||||||
| 49 | street => { type => Str, optional => 1 }, | ||||||||||
| 50 | postal_code => { type => Str, optional => 1 }, | ||||||||||
| 51 | city => { type => Str, optional => 1 }, | ||||||||||
| 52 | phone => { type => Str, optional => 1 }, | ||||||||||
| 53 | fax => { type => Str, optional => 1 }, | ||||||||||
| 54 | cell_phone => { type => Str, optional => 1 }, | ||||||||||
| 55 | recover => { type => Boolean, optional => 1 }, | ||||||||||
| 56 | skip_welcome_mail => { type => Boolean, optional => 1 }, | ||||||||||
| 57 | |||||||||||
| 58 | }, | ||||||||||
| 59 | ), | ||||||||||
| 60 | 'del' => validation_for( | ||||||||||
| 61 | params => { | ||||||||||
| 62 | mail => { type => Str, optional => 0 }, | ||||||||||
| 63 | |||||||||||
| 64 | }, | ||||||||||
| 65 | ), | ||||||||||
| 66 | 'get' => validation_for( | ||||||||||
| 67 | params => { | ||||||||||
| 68 | mail => { type => Str, optional => 0 }, | ||||||||||
| 69 | |||||||||||
| 70 | }, | ||||||||||
| 71 | ), | ||||||||||
| 72 | 'list' => validation_for( | ||||||||||
| 73 | params => { | ||||||||||
| 74 | domain => { type => Str, optional => 0 }, | ||||||||||
| 75 | |||||||||||
| 76 | }, | ||||||||||
| 77 | ), | ||||||||||
| 78 | 'register' => validation_for( | ||||||||||
| 79 | params => { | ||||||||||
| 80 | token => { type => Str, optional => 0 }, | ||||||||||
| 81 | mail => { type => Str, optional => 0 }, | ||||||||||
| 82 | password => { type => Str, optional => 0 }, | ||||||||||
| 83 | alternate_mail => { type => Str, optional => 1 }, | ||||||||||
| 84 | first_name => { type => Str, optional => 0 }, | ||||||||||
| 85 | last_name => { type => Str, optional => 0 }, | ||||||||||
| 86 | lang => { type => Enum[qw(de en fr)], optional => 1 }, | ||||||||||
| 87 | |||||||||||
| 88 | }, | ||||||||||
| 89 | ), | ||||||||||
| 90 | 'set' => validation_for( | ||||||||||
| 91 | params => { | ||||||||||
| 92 | mail => { type => Str, optional => 0 }, | ||||||||||
| 93 | password => { type => Str, optional => 1 }, | ||||||||||
| 94 | password_hash => { type => Str, optional => 1 }, | ||||||||||
| 95 | plan => { type => Enum[qw(MAIL MAILXL MAILXXL MAILXXXL Office OfficeXL OfficeXXL OfficeXXXL light standard premium)], optional => 1 }, | ||||||||||
| 96 | additional_mail_quota => { type => Str, optional => 1 }, | ||||||||||
| 97 | additional_cloud_quota => { type => Str, optional => 1 }, | ||||||||||
| 98 | first_name => { type => Str, optional => 1 }, | ||||||||||
| 99 | last_name => { type => Str, optional => 1 }, | ||||||||||
| 100 | inboxsave => { type => Boolean, optional => 1 }, | ||||||||||
| 101 | forwards => { type => ArrayRef, optional => 1 }, | ||||||||||
| 102 | aliases => { type => ArrayRef, optional => 1 }, | ||||||||||
| 103 | alternate_mail => { type => Str, optional => 1 }, | ||||||||||
| 104 | memo => { type => Str, optional => 1 }, | ||||||||||
| 105 | active => { type => Boolean, optional => 1 }, | ||||||||||
| 106 | title => { type => Str, optional => 1 }, | ||||||||||
| 107 | birthday => { type => Str, optional => 1 }, | ||||||||||
| 108 | position => { type => Str, optional => 1 }, | ||||||||||
| 109 | department => { type => Str, optional => 1 }, | ||||||||||
| 110 | company => { type => Str, optional => 1 }, | ||||||||||
| 111 | street => { type => Str, optional => 1 }, | ||||||||||
| 112 | postal_code => { type => Str, optional => 1 }, | ||||||||||
| 113 | city => { type => Str, optional => 1 }, | ||||||||||
| 114 | phone => { type => Str, optional => 1 }, | ||||||||||
| 115 | fax => { type => Str, optional => 1 }, | ||||||||||
| 116 | cell_phone => { type => Str, optional => 1 }, | ||||||||||
| 117 | |||||||||||
| 118 | }, | ||||||||||
| 119 | ), | ||||||||||
| 120 | |||||||||||
| 121 | ); | ||||||||||
| 122 | |||||||||||
| 123 | |||||||||||
| 124 | 0 | ▶ | sub add ($self, %params) { | ||||||||
|
Subroutine
add: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 125 | 0 | my $validator = $validators{'add'}; | |||||||||
| 126 | 0 | ▶ | %params = $validator->(%params) if $validator; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 127 | |||||||||||
| 128 | 0 | my %opt = (needs_auth => 1); | |||||||||
| 129 | |||||||||||
| 130 | 0 | return $self->_request( 'mail.add', \%params, \%opt ); | |||||||||
| 131 | } | ||||||||||
| 132 | |||||||||||
| 133 | 0 | ▶ | sub del ($self, %params) { | ||||||||
|
Subroutine
del: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 134 | 0 | my $validator = $validators{'del'}; | |||||||||
| 135 | 0 | ▶ | %params = $validator->(%params) if $validator; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 136 | |||||||||||
| 137 | 0 | my %opt = (needs_auth => 1); | |||||||||
| 138 | |||||||||||
| 139 | 0 | return $self->_request( 'mail.del', \%params, \%opt ); | |||||||||
| 140 | } | ||||||||||
| 141 | |||||||||||
| 142 | 0 | ▶ | sub get ($self, %params) { | ||||||||
|
Subroutine
get: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 143 | 0 | my $validator = $validators{'get'}; | |||||||||
| 144 | 0 | ▶ | %params = $validator->(%params) if $validator; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 145 | |||||||||||
| 146 | 0 | my %opt = (needs_auth => 1); | |||||||||
| 147 | |||||||||||
| 148 | 0 | return $self->_request( 'mail.get', \%params, \%opt ); | |||||||||
| 149 | } | ||||||||||
| 150 | |||||||||||
| 151 | 0 | ▶ | sub list ($self, %params) { | ||||||||
|
Subroutine
list: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 152 | 0 | my $validator = $validators{'list'}; | |||||||||
| 153 | 0 | ▶ | %params = $validator->(%params) if $validator; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 154 | |||||||||||
| 155 | 0 | my %opt = (needs_auth => 1); | |||||||||
| 156 | |||||||||||
| 157 | 0 | return $self->_request( 'mail.list', \%params, \%opt ); | |||||||||
| 158 | } | ||||||||||
| 159 | |||||||||||
| 160 | 0 | ▶ | sub register ($self, %params) { | ||||||||
|
Subroutine
register: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 161 | 0 | my $validator = $validators{'register'}; | |||||||||
| 162 | 0 | ▶ | %params = $validator->(%params) if $validator; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 163 | |||||||||||
| 164 | 0 | my %opt = (); | |||||||||
| 165 | |||||||||||
| 166 | 0 | return $self->_request( 'mail.register', \%params, \%opt ); | |||||||||
| 167 | } | ||||||||||
| 168 | |||||||||||
| 169 | 0 | ▶ | sub set ($self, %params) { | ||||||||
|
Subroutine
set: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 170 | 0 | my $validator = $validators{'set'}; | |||||||||
| 171 | 0 | ▶ | %params = $validator->(%params) if $validator; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 172 | |||||||||||
| 173 | 0 | my %opt = (needs_auth => 1); | |||||||||
| 174 | |||||||||||
| 175 | 0 | return $self->_request( 'mail.set', \%params, \%opt ); | |||||||||
| 176 | } | ||||||||||
| 177 | |||||||||||
| 178 | |||||||||||
| 179 | 2 | 1; | |||||||||
| 180 | |||||||||||
| 181 | __END__ | ||||||||||