line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::LogicBoxes::Domain::Factory; |
2
|
|
|
|
|
|
|
|
3
|
39
|
|
|
39
|
|
382
|
use strict; |
|
39
|
|
|
|
|
109
|
|
|
39
|
|
|
|
|
1400
|
|
4
|
39
|
|
|
39
|
|
237
|
use warnings; |
|
39
|
|
|
|
|
86
|
|
|
39
|
|
|
|
|
1187
|
|
5
|
|
|
|
|
|
|
|
6
|
39
|
|
|
39
|
|
18748
|
use WWW::LogicBoxes::Domain; |
|
39
|
|
|
|
|
193
|
|
|
39
|
|
|
|
|
2010
|
|
7
|
39
|
|
|
39
|
|
27259
|
use WWW::LogicBoxes::DomainTransfer; |
|
39
|
|
|
|
|
212
|
|
|
39
|
|
|
|
|
2089
|
|
8
|
|
|
|
|
|
|
|
9
|
39
|
|
|
39
|
|
427
|
use Carp; |
|
39
|
|
|
|
|
101
|
|
|
39
|
|
|
|
|
8121
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.11.0'; # VERSION |
12
|
|
|
|
|
|
|
# ABSTRACT: Domain Factory for Building Domain Objects from Responses |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub construct_from_response { |
15
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
16
|
0
|
|
|
|
|
|
my $response = shift; |
17
|
|
|
|
|
|
|
|
18
|
0
|
0
|
|
|
|
|
if( !$response ) { |
19
|
0
|
|
|
|
|
|
return; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
|
if( $response->{actiontype} ) { |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# actiontype is an undocumented return value. I spoke with a LogicBoxes |
25
|
|
|
|
|
|
|
# engineer who told me that it identifies an action that has been |
26
|
|
|
|
|
|
|
# requested but not yet completed - their API is asynchronous and a |
27
|
|
|
|
|
|
|
# successful call simply means an action has been queued for processing. |
28
|
|
|
|
|
|
|
# |
29
|
|
|
|
|
|
|
# Furthermore, the range of values for actiontype is not well defined - |
30
|
|
|
|
|
|
|
# new values are added routinely as needed. Accordingly, we need to be |
31
|
|
|
|
|
|
|
# lenient in looking at this value. |
32
|
|
|
|
|
|
|
# |
33
|
|
|
|
|
|
|
# In general, the only actiontype we need to concern ourselves with is |
34
|
|
|
|
|
|
|
# AddtransferDomain, which means the domain is in the process of being |
35
|
|
|
|
|
|
|
# transfered to LogicBoxes. That gets a different class constructed for |
36
|
|
|
|
|
|
|
# it. All other values should be treated normally. |
37
|
|
|
|
|
|
|
# |
38
|
|
|
|
|
|
|
# Known values include: |
39
|
|
|
|
|
|
|
# AddtransferDomain - domain is being transferred in |
40
|
|
|
|
|
|
|
# DelDomain - a domain is being deleted |
41
|
|
|
|
|
|
|
# ModContact - a contact is being updated |
42
|
|
|
|
|
|
|
# ParkDomain - a domain has expired and is being parked at the |
43
|
|
|
|
|
|
|
# registrar for the redemption period. |
44
|
|
|
|
|
|
|
# RenewDomain - a domain is being renewed |
45
|
|
|
|
|
|
|
|
46
|
0
|
0
|
|
|
|
|
if( $response->{actiontype} eq 'AddTransferDomain' ) { |
47
|
0
|
|
|
|
|
|
return WWW::LogicBoxes::DomainTransfer->construct_from_response( $response ); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
else { |
50
|
0
|
|
|
|
|
|
return WWW::LogicBoxes::Domain->construct_from_response( $response ); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
else { |
54
|
0
|
|
|
|
|
|
return WWW::LogicBoxes::Domain->construct_from_response( $response ); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |