line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::EveOnline::EveCentral::Request::History; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Games::EveOnline::EveCentral::Request::History::VERSION = '0.001'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Create a request for the history endpoint. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
38750
|
use Moo 1.003001; |
|
1
|
|
|
|
|
17002
|
|
|
1
|
|
|
|
|
7
|
|
11
|
1
|
|
|
1
|
|
2469
|
use MooX::Types::MooseLike 0.25; |
|
1
|
|
|
|
|
1422
|
|
|
1
|
|
|
|
|
42
|
|
12
|
1
|
|
|
1
|
|
786
|
use MooX::StrictConstructor 0.006; |
|
1
|
|
|
|
|
11859
|
|
|
1
|
|
|
|
|
8
|
|
13
|
1
|
|
|
1
|
|
32093
|
use MooX::Types::MooseLike::Base qw(AnyOf Enum Int Str Undef); |
|
1
|
|
|
|
|
6010
|
|
|
1
|
|
|
|
|
138
|
|
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
33
|
use 5.012; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
50
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
extends 'Games::EveOnline::EveCentral::Request'; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
1039
|
use Readonly 1.03; |
|
1
|
|
|
|
|
3489
|
|
|
1
|
|
|
|
|
497
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Readonly::Scalar my $ENDPOINT => 'history'; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has 'type_id' => ( |
26
|
|
|
|
|
|
|
is => 'ro', |
27
|
|
|
|
|
|
|
isa => Int, |
28
|
|
|
|
|
|
|
required => 1 |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has 'location_type' => ( |
32
|
|
|
|
|
|
|
is => 'ro', |
33
|
|
|
|
|
|
|
isa => Enum['system', 'region'], |
34
|
|
|
|
|
|
|
predicate => 1 |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
has 'location' => ( |
38
|
|
|
|
|
|
|
is => 'ro', |
39
|
|
|
|
|
|
|
isa => AnyOf[Int, Str] |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
has 'bid' => ( |
43
|
|
|
|
|
|
|
is => 'ro', |
44
|
|
|
|
|
|
|
isa => Enum['buy', 'sell'], |
45
|
|
|
|
|
|
|
required => 1 |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
has '_path' => ( |
49
|
|
|
|
|
|
|
is => 'lazy', |
50
|
|
|
|
|
|
|
isa => Str, |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub request { |
56
|
1
|
|
|
1
|
1
|
491
|
my $self = shift; |
57
|
1
|
|
|
|
|
5
|
my $path = $self->_path; |
58
|
|
|
|
|
|
|
|
59
|
1
|
|
|
|
|
58
|
return $self->http_request($path); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub BUILD { |
65
|
8
|
|
|
8
|
0
|
18754
|
my $self = shift; |
66
|
8
|
|
|
|
|
25
|
my $location = $self->location; |
67
|
|
|
|
|
|
|
|
68
|
8
|
100
|
|
|
|
95
|
if ($self->has_location_type()) { |
69
|
5
|
100
|
66
|
|
|
108
|
if (not defined $location or $location eq '') { |
70
|
1
|
|
|
|
|
17
|
die "Location must be provided."; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub _build__path { |
76
|
4
|
|
|
4
|
|
720
|
my $self = shift; |
77
|
|
|
|
|
|
|
|
78
|
4
|
|
|
|
|
12
|
my $path = $ENDPOINT . '/'; |
79
|
|
|
|
|
|
|
|
80
|
4
|
|
|
|
|
14
|
$path .= 'for/type/' . $self->type_id; |
81
|
|
|
|
|
|
|
|
82
|
4
|
100
|
|
|
|
22
|
if (defined $self->location_type) { |
83
|
2
|
|
|
|
|
6
|
$path .= '/' . $self->location_type; |
84
|
2
|
|
|
|
|
6
|
$path .= '/' . $self->location; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
4
|
100
|
|
|
|
18
|
my $bid = $self->bid eq 'buy'? 1 : 0; |
88
|
4
|
|
|
|
|
8
|
$path .= '/bid/' . $bid; |
89
|
|
|
|
|
|
|
|
90
|
4
|
|
|
|
|
88
|
return $path; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; # End of Games::EveOnline::EveCentral::Request::History |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
__END__ |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=pod |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 NAME |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Games::EveOnline::EveCentral::Request::History - Create a request for the history endpoint. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 VERSION |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
version 0.001 |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 SYNOPSIS |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
my $req = Games::EveOnline::EveCentral::Request::History->new( |
111
|
|
|
|
|
|
|
type_id => 34, # Mandatory. |
112
|
|
|
|
|
|
|
hours => 1, # defaults to 360 |
113
|
|
|
|
|
|
|
min_q => 10000, # defaults to 1 |
114
|
|
|
|
|
|
|
system => 30000142, |
115
|
|
|
|
|
|
|
regions => 10000002, # or [10000002, 10000003], |
116
|
|
|
|
|
|
|
)->request; |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 DESCRIPTION |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
This class is used to create HTTP::Request objects suitable to call the |
121
|
|
|
|
|
|
|
`history` method on EVE Central. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Please take care to only use valid type ids. |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Examples: |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=over 4 |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=item * L<http://api.eve-central.com/api/history/for/type/34/system/Amarr/bid/1> |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=item * L<http://api.eve-central.com/api/history/for/type/34/region/The%20Forge/bid/0> |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=back |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=for test_synopsis no strict 'vars' |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head1 METHODS |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head2 request |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Returns an HTTP::Request object which can be used to call the 'history' |
142
|
|
|
|
|
|
|
endpoint. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=begin private |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=end private |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head1 AUTHOR |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
Pedro Figueiredo, C<< <me at pedrofigueiredo.org> >> |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 BUGS |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Please report any bugs or feature requests through the web interface at |
155
|
|
|
|
|
|
|
L<https://github.com/pfig/games-eveonline-evecentral/issues>. I will be |
156
|
|
|
|
|
|
|
notified, and then you'll automatically be notified of progress on your bug as |
157
|
|
|
|
|
|
|
I make changes. |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head1 SUPPORT |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
perldoc Games::EveOnline::EveCentral |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
You can also look for information at: |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=over 4 |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=item * GitHub Issues (report bugs here) |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
L<https://github.com/pfig/games-eveonline-evecentral/issues> |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
L<http://annocpan.org/dist/Games-EveOnline-EveCentral> |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=item * CPAN Ratings |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
L<http://cpanratings.perl.org/d/Games-EveOnline-EveCentral> |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=item * CPAN |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
L<http://metacpan.org/module/Games::EveOnline::EveCentral> |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=back |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=over 4 |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=item * The people behind EVE Central. |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
L<http://eve-central.com/> |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=back |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
Copyright 2013 Pedro Figueiredo. |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
202
|
|
|
|
|
|
|
under the terms of the Artistic License. |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=head1 AUTHOR |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
Pedro Figueiredo <me@pedrofigueiredo.org> |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
This software is copyright (c) 2013 by Pedro Figueiredo. |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
215
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=cut |