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
|
|
1064
|
|
|
2
|
|
|
|
|
8
|
|
10
|
|
|
|
|
|
|
use strict; |
11
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
40
|
|
12
|
2
|
|
|
2
|
|
9
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
46
|
|
13
|
|
|
|
|
|
|
use Moo; |
14
|
2
|
|
|
2
|
|
9
|
use Types::Standard qw(Enum Str Int InstanceOf ArrayRef); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
14
|
|
15
|
2
|
|
|
2
|
|
634
|
use API::MailboxOrg::Types qw(HashRefRestricted Boolean); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
18
|
|
16
|
2
|
|
|
2
|
|
2249
|
use Params::ValidationCompiler qw(validation_for); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
13
|
|
17
|
2
|
|
|
2
|
|
881
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
127
|
|
18
|
|
|
|
|
|
|
extends 'API::MailboxOrg::APIBase'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
with 'MooX::Singleton'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use feature 'signatures'; |
23
|
2
|
|
|
2
|
|
12
|
no warnings 'experimental::signatures'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
159
|
|
24
|
2
|
|
|
2
|
|
11
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
577
|
|
25
|
|
|
|
|
|
|
our $VERSION = '1.0.1'; # 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.1 |
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 |