line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Async::Webservice::Common::Types; |
2
|
|
|
|
|
|
|
$Net::Async::Webservice::Common::Types::VERSION = '1.0.2'; |
3
|
|
|
|
|
|
|
{ |
4
|
|
|
|
|
|
|
$Net::Async::Webservice::Common::Types::DIST = 'Net-Async-Webservice-Common'; |
5
|
|
|
|
|
|
|
} |
6
|
3
|
|
|
3
|
|
20
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
109
|
|
7
|
3
|
|
|
3
|
|
19
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
137
|
|
8
|
|
|
|
|
|
|
use Type::Library |
9
|
3
|
|
|
|
|
35
|
-base, |
10
|
|
|
|
|
|
|
-declare => qw( AsyncUserAgent SyncUserAgent |
11
|
|
|
|
|
|
|
HTTPRequest |
12
|
3
|
|
|
3
|
|
2760
|
); |
|
3
|
|
|
|
|
79868
|
|
13
|
3
|
|
|
3
|
|
5657
|
use Type::Utils -all; |
|
3
|
|
|
|
|
13409
|
|
|
3
|
|
|
|
|
34
|
|
14
|
3
|
|
|
3
|
|
15731
|
use namespace::autoclean; |
|
3
|
|
|
|
|
49779
|
|
|
3
|
|
|
|
|
20
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# ABSTRACT: common types for async webservice clients |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
duck_type AsyncUserAgent, [qw(GET POST do_request)]; |
20
|
|
|
|
|
|
|
duck_type SyncUserAgent, [qw(get post request)]; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
coerce AsyncUserAgent, from SyncUserAgent, via { |
23
|
|
|
|
|
|
|
require Net::Async::Webservice::Common::SyncAgentWrapper; |
24
|
|
|
|
|
|
|
Net::Async::Webservice::Common::SyncAgentWrapper->new({ua=>$_}); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
class_type HTTPRequest, { class => 'HTTP::Request' }; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=pod |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=encoding UTF-8 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 NAME |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Net::Async::Webservice::Common::Types - common types for async webservice clients |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 VERSION |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
version 1.0.2 |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 Types |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 C<AsyncUserAgent> |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Duck type, any object with a C<do_request>, C<GET> and C<POST> |
51
|
|
|
|
|
|
|
methods. Coerced from L</SyncUserAgent> via |
52
|
|
|
|
|
|
|
L<Net::Async::Webservice::Common::SyncAgentWrapper>. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 C<SyncUserAgent> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Duck type, any object with a C<request>, C<get> and C<post> methods. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 C<HTTPRequest> |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Class type for L<HTTP::Request>. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 AUTHOR |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Net-a-porter.com. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
71
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |