line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Fastly::BelongsToServiceAndVersion; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
17
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
95
|
|
4
|
4
|
|
|
4
|
|
11
|
use base qw(Net::Fastly::Model); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
217
|
|
5
|
4
|
|
|
4
|
|
16
|
use URI::Escape; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
1009
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Net::Fastly::BelongsToServiceAndVersion - base class for classes that belong to a service and a version |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub _get_path { |
14
|
0
|
|
|
0
|
|
|
my $class = shift; |
15
|
0
|
|
|
|
|
|
my $service = shift; |
16
|
0
|
|
|
|
|
|
my $version = shift; |
17
|
0
|
|
|
|
|
|
my $name = shift; |
18
|
0
|
|
|
|
|
|
return "/service/$service/version/$version/".$class->_path."/".uri_escape($name); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _post_path { |
22
|
0
|
|
|
0
|
|
|
my $class = shift; |
23
|
0
|
|
|
|
|
|
my %opts = @_; |
24
|
0
|
|
|
|
|
|
return "/service/".$opts{service_id}."/version/".$opts{version}."/".$class->_path; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _put_path { |
28
|
0
|
|
|
0
|
|
|
my $class = shift; |
29
|
0
|
|
|
|
|
|
my $obj = shift; |
30
|
0
|
|
|
|
|
|
return $class->_get_path($obj->service_id, $obj->version_number, $obj->name); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 service |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Get the service object for this version |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub service { |
40
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
41
|
0
|
|
0
|
|
|
|
return $self->{_service} ||= $self->_fetcher->_get("Net::Fastly::Service", $self->service_id); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 version |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Get the version object for this object |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub version { |
51
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
52
|
0
|
|
0
|
|
|
|
return $self->{_version} ||= $self->_fetcher->_get("Net::Fastly::Version", $self->service_id, $self->version_number); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 version_number |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Get the version number for this object. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
sub version_number { |
61
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
62
|
0
|
|
|
|
|
|
return $self->{version}; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |