line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Recruit::CarSensor::Pref; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
985
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
113
|
|
4
|
3
|
|
|
3
|
|
17
|
use base qw( WebService::Recruit::CarSensor::Base ); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
253
|
|
5
|
3
|
|
|
3
|
|
18
|
use vars qw( $VERSION ); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
120
|
|
6
|
3
|
|
|
3
|
|
17
|
use Class::Accessor::Fast; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
19
|
|
7
|
3
|
|
|
3
|
|
92
|
use Class::Accessor::Children::Fast; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
27
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.0.2'; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
0
|
1
|
0
|
sub http_method { 'GET'; } |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
1
|
0
|
sub url { 'http://webservice.recruit.co.jp/carsensor/pref/v1/'; } |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
1
|
55
|
sub query_class { 'WebService::Recruit::CarSensor::Pref::Query'; } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub query_fields { [ |
18
|
3
|
|
|
3
|
0
|
39
|
'key', 'code', 'large_area' |
19
|
|
|
|
|
|
|
]; } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub default_param { { |
22
|
1
|
|
|
1
|
1
|
578
|
'format' => 'xml' |
23
|
|
|
|
|
|
|
}; } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub notnull_param { [ |
26
|
0
|
|
|
0
|
1
|
0
|
'key' |
27
|
|
|
|
|
|
|
]; } |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
1
|
0
|
sub elem_class { 'WebService::Recruit::CarSensor::Pref::Element'; } |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
3
|
1
|
36
|
sub root_elem { 'results'; } |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub elem_fields { { |
34
|
3
|
|
|
3
|
0
|
51
|
'error' => ['message'], |
35
|
|
|
|
|
|
|
'large_area' => ['code', 'name'], |
36
|
|
|
|
|
|
|
'pref' => ['code', 'name', 'large_area'], |
37
|
|
|
|
|
|
|
'results' => ['api_version', 'results_available', 'results_returned', 'results_start', 'pref', 'api_version', 'error'], |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
}; } |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub force_array { [ |
42
|
0
|
|
|
0
|
1
|
|
'pref' |
43
|
|
|
|
|
|
|
]; } |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# __PACKAGE__->mk_query_accessors(); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
@WebService::Recruit::CarSensor::Pref::Query::ISA = qw( Class::Accessor::Fast ); |
48
|
|
|
|
|
|
|
WebService::Recruit::CarSensor::Pref::Query->mk_accessors( @{query_fields()} ); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# __PACKAGE__->mk_elem_accessors(); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
@WebService::Recruit::CarSensor::Pref::Element::ISA = qw( Class::Accessor::Children::Fast ); |
53
|
|
|
|
|
|
|
WebService::Recruit::CarSensor::Pref::Element->mk_ro_accessors( root_elem() ); |
54
|
|
|
|
|
|
|
WebService::Recruit::CarSensor::Pref::Element->mk_child_ro_accessors( %{elem_fields()} ); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 NAME |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
WebService::Recruit::CarSensor::Pref - CarSensor.net Web Service "pref" API |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 SYNOPSIS |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
use WebService::Recruit::CarSensor; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
my $service = WebService::Recruit::CarSensor->new(); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
my $param = { |
67
|
|
|
|
|
|
|
'key' => $ENV{'WEBSERVICE_RECRUIT_KEY'}, |
68
|
|
|
|
|
|
|
}; |
69
|
|
|
|
|
|
|
my $res = $service->pref( %$param ); |
70
|
|
|
|
|
|
|
my $data = $res->root; |
71
|
|
|
|
|
|
|
print "api_version: $data->api_version\n"; |
72
|
|
|
|
|
|
|
print "results_available: $data->results_available\n"; |
73
|
|
|
|
|
|
|
print "results_returned: $data->results_returned\n"; |
74
|
|
|
|
|
|
|
print "results_start: $data->results_start\n"; |
75
|
|
|
|
|
|
|
print "pref: $data->pref\n"; |
76
|
|
|
|
|
|
|
print "...\n"; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 DESCRIPTION |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This module is a interface for the C API. |
81
|
|
|
|
|
|
|
It accepts following query parameters to make an request. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
my $param = { |
84
|
|
|
|
|
|
|
'key' => 'XXXXXXXX', |
85
|
|
|
|
|
|
|
'code' => '02', |
86
|
|
|
|
|
|
|
'large_area' => 'XXXXXXXX', |
87
|
|
|
|
|
|
|
}; |
88
|
|
|
|
|
|
|
my $res = $service->pref( %$param ); |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
C<$service> above is an instance of L. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 METHODS |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 root |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This returns the root element of the response. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
my $root = $res->root; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
You can retrieve each element by the following accessors. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
$root->api_version |
103
|
|
|
|
|
|
|
$root->results_available |
104
|
|
|
|
|
|
|
$root->results_returned |
105
|
|
|
|
|
|
|
$root->results_start |
106
|
|
|
|
|
|
|
$root->pref |
107
|
|
|
|
|
|
|
$root->pref->[0]->code |
108
|
|
|
|
|
|
|
$root->pref->[0]->name |
109
|
|
|
|
|
|
|
$root->pref->[0]->large_area |
110
|
|
|
|
|
|
|
$root->pref->[0]->large_area->code |
111
|
|
|
|
|
|
|
$root->pref->[0]->large_area->name |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head2 xml |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
This returns the raw response context itself. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
print $res->xml, "\n"; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head2 code |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
This returns the response status code. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
my $code = $res->code; # usually "200" when succeeded |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head2 is_error |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
This returns true value when the response has an error. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
die 'error!' if $res->is_error; |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 SEE ALSO |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
L |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 AUTHOR |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
RECRUIT Media Technology Labs |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 COPYRIGHT |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Copyright 2008 RECRUIT Media Technology Labs |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=cut |
145
|
|
|
|
|
|
|
1; |