| 1 | package Apertur::SDK::Resource::Uploads; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use URI::Escape qw(uri_escape); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 3 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 9 | 3 | my ($class, %args) = @_; | |||||||||
| 10 | 3 | return bless { http => $args{http} }, $class; | |||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub list { | ||||||||
|
Subroutine
list: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 14 | 0 | my ($self, %params) = @_; | |||||||||
| 15 | 0 | my $qs = _build_query_string(%params); | |||||||||
| 16 | 0 | return $self->{http}->request('GET', "/api/v1/uploads$qs"); | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub recent { | ||||||||
|
Subroutine
recent: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 20 | 0 | my ($self, %params) = @_; | |||||||||
| 21 | 0 | my $qs = _build_query_string(%params); | |||||||||
| 22 | 0 | return $self->{http}->request('GET', "/api/v1/uploads/recent$qs"); | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub _build_query_string { | ||||||||
|
Subroutine
_build_query_string: not called CC=4 SCAR=30.0
| |||||||||||
| 26 | 0 | my (%params) = @_; | |||||||||
| 27 | 0 | my @parts; | |||||||||
| 28 | 0 | for my $key (sort keys %params) { | |||||||||
| 29 | 0 | ▶ | next unless defined $params{$key}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | push @parts, uri_escape($key) . '=' . uri_escape($params{$key}); | |||||||||
| 31 | } | ||||||||||
| 32 | 0 | ▶ | return @parts ? '?' . join('&', @parts) : ''; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 1 | 1; | |||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||