line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use v5.24; |
3
|
2
|
|
|
2
|
|
112036
|
|
|
2
|
|
|
|
|
17
|
|
4
|
|
|
|
|
|
|
# ABSTRACT: Perl library to work with the API for the Mailbox.org API |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use strict; |
7
|
2
|
|
|
2
|
|
22
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
54
|
|
8
|
2
|
|
|
2
|
|
8
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
50
|
|
9
|
|
|
|
|
|
|
use Carp; |
10
|
2
|
|
|
2
|
|
8
|
use Moo; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
127
|
|
11
|
2
|
|
|
2
|
|
510
|
use Mojo::File; |
|
2
|
|
|
|
|
9273
|
|
|
2
|
|
|
|
|
12
|
|
12
|
2
|
|
|
2
|
|
1883
|
use Mojo::Loader qw(find_modules load_class); |
|
2
|
|
|
|
|
177575
|
|
|
2
|
|
|
|
|
86
|
|
13
|
2
|
|
|
2
|
|
369
|
use Mojo::UserAgent; |
|
2
|
|
|
|
|
3768
|
|
|
2
|
|
|
|
|
113
|
|
14
|
2
|
|
|
2
|
|
450
|
use Mojo::Util qw(decamelize); |
|
2
|
|
|
|
|
177548
|
|
|
2
|
|
|
|
|
32
|
|
15
|
2
|
|
|
2
|
|
76
|
use Scalar::Util qw(weaken); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
79
|
|
16
|
2
|
|
|
2
|
|
10
|
use Types::Mojo qw(:all); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
82
|
|
17
|
2
|
|
|
2
|
|
370
|
use Types::Standard qw(Str); |
|
2
|
|
|
|
|
111966
|
|
|
2
|
|
|
|
|
28
|
|
18
|
2
|
|
|
2
|
|
6889
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
17
|
|
19
|
|
|
|
|
|
|
use feature 'signatures'; |
20
|
2
|
|
|
2
|
|
1334
|
no warnings 'experimental::signatures'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
189
|
|
21
|
2
|
|
|
2
|
|
11
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
510
|
|
22
|
|
|
|
|
|
|
our $VERSION = '1.0.1'; # VERSION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has user => ( is => 'ro', isa => Str, required => 1 ); |
25
|
|
|
|
|
|
|
has password => ( is => 'ro', isa => Str, required => 1 ); |
26
|
|
|
|
|
|
|
has token => ( is => 'rwp', isa => Str ); |
27
|
|
|
|
|
|
|
has host => ( is => 'ro', isa => MojoURL["https?"], default => sub { 'https://api.mailbox.org' }, coerce => 1 ); |
28
|
|
|
|
|
|
|
has base_uri => ( is => 'ro', isa => Str, default => sub { 'v1/' } ); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
has client => ( |
31
|
|
|
|
|
|
|
is => 'ro', |
32
|
|
|
|
|
|
|
lazy => 1, |
33
|
|
|
|
|
|
|
isa => MojoUserAgent, |
34
|
|
|
|
|
|
|
default => sub { |
35
|
|
|
|
|
|
|
Mojo::UserAgent->new |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my @modules = find_modules $package . '::API', { recursive => 1 }; |
40
|
2
|
|
|
2
|
|
6
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
3
|
|
41
|
2
|
|
|
|
|
18
|
for my $module ( @modules ) { |
42
|
|
|
|
|
|
|
load_class( $module ); |
43
|
2
|
|
|
|
|
10804
|
|
44
|
34
|
|
|
|
|
910
|
my $base = (split /::/, $module)[-1]; |
45
|
|
|
|
|
|
|
|
46
|
34
|
|
|
|
|
1767
|
no strict 'refs'; ## no critic |
47
|
|
|
|
|
|
|
*{ $package . '::' . decamelize( $base ) } = sub ($api) { |
48
|
2
|
|
|
2
|
|
12
|
weaken $api; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
297
|
|
49
|
34
|
|
|
1
|
|
186
|
state $object //= $module->instance( |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1062
|
|
|
1
|
|
|
|
|
3
|
|
50
|
1
|
|
|
|
|
4
|
api => $api, |
51
|
1
|
|
33
|
|
|
11
|
); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
return $object; |
54
|
|
|
|
|
|
|
}; |
55
|
1
|
|
|
|
|
26
|
} |
56
|
34
|
|
|
|
|
189
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__PACKAGE__->_load_namespace; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=pod |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=encoding UTF-8 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 NAME |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
API::MailboxOrg - Perl library to work with the API for the Mailbox.org API |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 VERSION |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
version 1.0.1 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 SYNOPSIS |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
use API::MailboxOrg; |
78
|
|
|
|
|
|
|
use Data::Printer; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
my $api = API::MailboxOrg->new( |
81
|
|
|
|
|
|
|
user => 'test_name@example.tld', |
82
|
|
|
|
|
|
|
password => 'test1234567789', |
83
|
|
|
|
|
|
|
); |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
my $all_videochats = $api->videochat->list( |
86
|
|
|
|
|
|
|
mail => 'test_name@example.tld', |
87
|
|
|
|
|
|
|
); |
88
|
|
|
|
|
|
|
p $all_videochats; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 INFO |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This is still pretty alpha. The API of this distribution might change. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=over 4 |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * base_uri |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
I<(optional)> Default: C</v1> |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item * client |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
I<(optional)> A C<Mojo::UserAgent> compatible user agent. By default a new object of C<Mojo::UserAgent> |
105
|
|
|
|
|
|
|
is created. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=item * host |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
I<(optional)> This is the URL to Mailbox.org API. Defaults to C<https://api.mailbox.org> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=item * token |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
After authenticating, this will be the auth id. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=back |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 METHODS |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=over 4 |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=item * account |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=item * backup |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=item * base |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=item * blacklist |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=item * capabilities |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=item * context |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=item * domain |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=item * hello |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item * invoice |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item * mail |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=item * mailinglist |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=item * password |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=item * passwordreset |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item * spamprotect |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=item * test |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item * user |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item * utils |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=item * validate |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item * videochat |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=back |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=head1 MORE INFOS |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
The Mailbox.org API documentation is available at L<https://api.mailbox.org/v1/doc/methods/index.html>. |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=head1 AUTHOR |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
Renee Baecker <reneeb@cpan.org> |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
This software is Copyright (c) 2022 by Renee Baecker. |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
This is free software, licensed under: |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=cut |