line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Store::REST::Bag; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
4
|
1
|
|
|
1
|
|
247
|
use JSON; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
96
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
7
|
1
|
|
|
1
|
|
460
|
use Catmandu::Store::REST::API; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
265
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'Catmandu::Bag'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has api => (is => 'lazy'); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub _build_api { |
14
|
0
|
|
|
0
|
|
|
my $self = shift; |
15
|
0
|
|
|
|
|
|
return Catmandu::Store::REST::API->new( |
16
|
|
|
|
|
|
|
base_url => $self->store->base_url, |
17
|
|
|
|
|
|
|
query_string => $self->store->query_string, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub generator { |
22
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
23
|
0
|
|
|
|
|
|
Catmandu::NotImplemented->throw('Generator not implemented.'); |
24
|
0
|
|
|
|
|
|
return undef; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub get { |
28
|
|
|
|
|
|
|
my ($self, $id) = @_; |
29
|
|
|
|
|
|
|
return $self->api->get($id); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub add { |
33
|
|
|
|
|
|
|
my ($self, $data) = @_; |
34
|
|
|
|
|
|
|
return $self->api->post($data); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub delete { |
38
|
|
|
|
|
|
|
my ($self, $id) = @_; |
39
|
|
|
|
|
|
|
return $self->api->delete($id); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub update { |
43
|
0
|
|
|
0
|
0
|
|
my ($self, $id, $data) = @_; |
44
|
0
|
|
|
|
|
|
return $self->api->put($id, $data); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub delete_all { |
48
|
|
|
|
|
|
|
my $self = shift; |
49
|
|
|
|
|
|
|
Catmandu::NotImplemented->throw('Deleting all items not implemented.'); |
50
|
|
|
|
|
|
|
return undef; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |