line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
# ABSTRACT: MailboxOrg::API::Passwordreset |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# --- |
5
|
|
|
|
|
|
|
# This class is auto-generated by bin/get_mailbox_api.pl |
6
|
|
|
|
|
|
|
# --- |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use v5.24; |
9
|
2
|
|
|
2
|
|
998
|
|
|
2
|
|
|
|
|
6
|
|
10
|
|
|
|
|
|
|
use strict; |
11
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
36
|
|
12
|
2
|
|
|
2
|
|
8
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
42
|
|
13
|
|
|
|
|
|
|
use Moo; |
14
|
2
|
|
|
2
|
|
9
|
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
15
|
2
|
|
|
2
|
|
550
|
use API::MailboxOrg::Types qw(HashRefRestricted Boolean); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
17
|
|
16
|
2
|
|
|
2
|
|
2037
|
use Params::ValidationCompiler qw(validation_for); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
17
|
2
|
|
|
2
|
|
686
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
118
|
|
18
|
|
|
|
|
|
|
extends 'API::MailboxOrg::APIBase'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
with 'MooX::Singleton'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use feature 'signatures'; |
23
|
2
|
|
|
2
|
|
10
|
no warnings 'experimental::signatures'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
156
|
|
24
|
2
|
|
|
2
|
|
9
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
534
|
|
25
|
|
|
|
|
|
|
our $VERSION = '1.0.2'; # VERSION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my %validators = ( |
28
|
|
|
|
|
|
|
'listmethods' => validation_for( |
29
|
|
|
|
|
|
|
params => { |
30
|
|
|
|
|
|
|
mail => { type => Str, optional => 0 }, |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
), |
34
|
|
|
|
|
|
|
'sendsms' => validation_for( |
35
|
|
|
|
|
|
|
params => { |
36
|
|
|
|
|
|
|
mail => { type => Str, optional => 0 }, |
37
|
|
|
|
|
|
|
cell_phone => { type => Str, optional => 0 }, |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
), |
41
|
|
|
|
|
|
|
'setpassword' => validation_for( |
42
|
|
|
|
|
|
|
params => { |
43
|
|
|
|
|
|
|
mail => { type => Str, optional => 0 }, |
44
|
|
|
|
|
|
|
token => { type => Str, optional => 0 }, |
45
|
|
|
|
|
|
|
password => { type => Str, optional => 0 }, |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
), |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $validator = $validators{'listmethods'}; |
54
|
0
|
|
|
0
|
1
|
|
%params = $validator->(%params) if $validator; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
|
56
|
0
|
0
|
|
|
|
|
my %opt = (); |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
return $self->_request( 'mail.passwordreset.listmethods', \%params, \%opt ); |
59
|
|
|
|
|
|
|
} |
60
|
0
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
my $validator = $validators{'sendsms'}; |
62
|
|
|
|
|
|
|
%params = $validator->(%params) if $validator; |
63
|
0
|
|
|
0
|
1
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my %opt = (); |
65
|
0
|
0
|
|
|
|
|
|
66
|
|
|
|
|
|
|
return $self->_request( 'mail.passwordreset.sendsms', \%params, \%opt ); |
67
|
0
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
my $validator = $validators{'setpassword'}; |
70
|
|
|
|
|
|
|
%params = $validator->(%params) if $validator; |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
0
|
1
|
|
my %opt = (); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
|
|
74
|
0
|
0
|
|
|
|
|
return $self->_request( 'mail.passwordreset.setpassword', \%params, \%opt ); |
75
|
|
|
|
|
|
|
} |
76
|
0
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=pod |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=encoding UTF-8 |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 NAME |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
API::MailboxOrg::API::Passwordreset - MailboxOrg::API::Passwordreset |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 VERSION |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
version 1.0.2 |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 SYNOPSIS |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
use API::MailboxOrg; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
my $user = '1234abc'; |
98
|
|
|
|
|
|
|
my $password = '1234abc'; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
my $api = API::MailboxOrg->new( |
101
|
|
|
|
|
|
|
user => $user, |
102
|
|
|
|
|
|
|
password => $password, |
103
|
|
|
|
|
|
|
); |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 METHODS |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head2 listmethods |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Returns a list of available password reset methods for the given user |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Parameters: |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=over 4 |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=item * mail |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=back |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
returns: array |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
$api->passwordreset->listmethods(%params); |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head2 sendsms |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Send a password reset token by SMS |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Parameters: |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=over 4 |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=item * mail |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=item * cell_phone |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=back |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
returns: boolean |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
$api->passwordreset->sendsms(%params); |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head2 setpassword |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
Set a new password using a password reset token |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Parameters: |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=over 4 |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=item * mail |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item * token |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item * password |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=back |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
returns: boolean |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
$api->passwordreset->setpassword(%params); |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=head1 AUTHOR |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Renee Baecker <reneeb@cpan.org> |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
This software is Copyright (c) 2022 by Renee Baecker. |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
This is free software, licensed under: |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=cut |