| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package WWW::VastAI::API::User; |
|
2
|
|
|
|
|
|
|
our $VERSION = '0.001'; |
|
3
|
|
|
|
|
|
|
# ABSTRACT: Current-user access for Vast.ai |
|
4
|
|
|
|
|
|
|
|
|
5
|
10
|
|
|
10
|
|
69
|
use Moo; |
|
|
10
|
|
|
|
|
19
|
|
|
|
10
|
|
|
|
|
63
|
|
|
6
|
10
|
|
|
10
|
|
9051
|
use WWW::VastAI::User; |
|
|
10
|
|
|
|
|
40
|
|
|
|
10
|
|
|
|
|
355
|
|
|
7
|
10
|
|
|
10
|
|
88
|
use namespace::clean; |
|
|
10
|
|
|
|
|
18
|
|
|
|
10
|
|
|
|
|
76
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has client => ( |
|
10
|
|
|
|
|
|
|
is => 'ro', |
|
11
|
|
|
|
|
|
|
required => 1, |
|
12
|
|
|
|
|
|
|
weak_ref => 1, |
|
13
|
|
|
|
|
|
|
); |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub current { |
|
16
|
1
|
|
|
1
|
1
|
1467
|
my ($self) = @_; |
|
17
|
1
|
|
|
|
|
8
|
my $result = $self->client->request_op('getCurrentUser'); |
|
18
|
1
|
50
|
33
|
|
|
11
|
my $user = ref $result eq 'HASH' ? ($result->{user} || $result) : $result; |
|
19
|
1
|
|
|
|
|
38
|
return WWW::VastAI::User->new( |
|
20
|
|
|
|
|
|
|
client => $self->client, |
|
21
|
|
|
|
|
|
|
data => $user, |
|
22
|
|
|
|
|
|
|
); |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |