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