blib/lib/WWW/LogicBoxes/DomainTransfer.pm

filter: Statementstmt 76.9% 40 / 52 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 100% 1 / 1 totaltotal 72.0% 49 / 68 CC 5 SCAR 25.0
CC
5
Cov
69%
construct_from_response
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 12.2
« blib/lib/WWW/LogicBoxes/Domain/Factory.pm ↑ Summary blib/lib/WWW/LogicBoxes/Role/Command/Domain.pm »
1 package WWW::LogicBoxes::DomainTransfer;
2  
3 39 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 39 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 39 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 39 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 39 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 39 ▶use WWW::LogicBoxes::Types qw( Bool DateTime DomainName DomainNames DomainStatus Int PrivateNameServers Str VerificationStatus );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 39 ▶use WWW::LogicBoxes::PrivateNameServer;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 39 ▶use DateTime;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 39 our $VERSION = '1.1.0'; # VERSION
17 # ABSTRACT: LogicBoxes Domain Transfer In Progress Representation
18  
19 39 has id => (
20 is => 'ro',
21 isa => Int,
22 required => 1,
23 );
24  
25 39 has name => (
26 is => 'ro',
27 isa => DomainName,
28 required => 1,
29 );
30  
31 39 has customer_id => (
32 is => 'ro',
33 isa => Int,
34 required => 1,
35 );
36  
37 39 has status => (
38 is => 'ro',
39 isa => DomainStatus,
40 required => 1,
41 );
42  
43 39 has transfer_status => (
44 is => 'ro',
45 isa => Str,
46 required => 1,
47 );
48  
49 39 has verification_status => (
50 is => 'ro',
51 isa => VerificationStatus,
52 required => 1,
53 );
54  
55 39 has ns => (
56 is => 'ro',
57 isa => DomainNames,
58 required => 1,
59 );
60  
61 39 has registrant_contact_id => (
62 is => 'ro',
63 isa => Int,
64 required => 1,
65 );
66  
67 39 has admin_contact_id => (
68 is => 'ro',
69 isa => Int,
70 required => 1,
71 );
72  
73 39 has technical_contact_id => (
74 is => 'ro',
75 isa => Int,
76 required => 1,
77 );
78  
79 39 has billing_contact_id => (
80 is => 'ro',
81 isa => Int,
82 required => 1,
83 );
84  
85 39 has epp_key => (
86 is => 'ro',
87 isa => Str,
88 required => 0,
89 predicate => 'has_epp_key',
90 );
91  
92 39 has private_nameservers => (
93 is => 'ro',
94 isa => PrivateNameServers,
95 required => 0,
96 predicate => 'has_private_nameservers',
97 );
98  
99 sub construct_from_response {
100 0 ▶ my $self = shift;
Subroutine construct_from_response: not called CC=5 SCAR=34.0
Pod documented
101 0 my $response = shift;
102  
103 0 ▶ if( !$response ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($response) 0 0 0
104 0 return;
105 }
106  
107 0 my @private_nameservers;
108 0 for my $private_nameserver_name ( keys %{ $response->{cns} } ) {
109 push @private_nameservers, WWW::LogicBoxes::PrivateNameServer->new(
110 domain_id => $response->{orderid},
111 name => $private_nameserver_name,
112 0 ips => $response->{cns}{$private_nameserver_name},
113 );
114 }
115  
116 return $self->new(
117 id => $response->{orderid},
118 name => $response->{domainname},
119 customer_id => $response->{customerid},
120 status => $response->{currentstatus},
121 transfer_status => $response->{actionstatusdesc},
122 verification_status => $response->{raaVerificationStatus},
123 0 ▶ ns => [ map { $response->{ $_ } } sort ( grep { $_ =~ m/^ns/ } keys %{ $response } ) ],
Branch: 2 branches
BranchTrueFalseTotal
$response->{'domsecret'} ? : 0 0 0
scalar @private_nameservers ? : 0 0 0
124 registrant_contact_id => $response->{registrantcontactid},
125 admin_contact_id => $response->{admincontactid},
126 technical_contact_id => $response->{techcontactid},
127 billing_contact_id => $response->{billingcontactid},
128 0 $response->{domsecret} ? ( epp_key => $response->{domsecret} ) : ( ),
129 scalar @private_nameservers ? ( private_nameservers => \@private_nameservers ) : ( ),
130 );
131 }
132  
133 39 __PACKAGE__->meta->make_immutable;
134 39 1;
135  
136 __END__
137 =pod
138  
139 =head1 NAME
140  
141 WWW::LogicBoxes::DomainTransfer - Representation of a Domain Transfer In Progress
142  
143 =head1 SYNOPSIS
144  
145 use WWW::LogicBoxes;
146  
147 my $logic_boxes = WWW::LogicBoxes->new( ... );
148  
149 my $domain_transfer = $logic_boxes->get_domain_by_name( 'in-progress-transfer.com' );
150  
151 print 'Status of Domain Transfer is ' . $domain_transfer->transfer_status . "\n";
152  
153 =head1 DESCRIPTION
154  
155 Represents L<LogicBoxes|http://www.logicboxes.com> domains transfers that are in progress.
156  
157 =head1 ATTRIBUTES
158  
159 =head2 B<id>
160  
161 The order_id of the domain in L<LogicBoxes|http://www.logicboxes.com>'s system.
162  
163 =head2 B<name>
164  
165 The full domain name ( test-domain.com ).
166  
167 =head2 B<customer_id>
168  
169 The id of the L<customer|WWW::LogicBoxes::Customer> who owns this domain in L<LogicBoxes|http://www.logicboxes.com>.
170  
171 =head2 B<status>
172  
173 Current status of the domain with L<LogicBoxes|http://www.logicboxes.com>. Will be one of the following values:
174  
175 =over 4
176  
177 =item InActive
178  
179 =item Active
180  
181 =item Suspended
182  
183 =item Pending Delete Restorable
184  
185 =item Deleted
186  
187 =item Archived
188  
189 =back
190  
191 =head2 B<transfer_status>
192  
193 A human readable string indicating what part of the transfer flow we are currently in. A non exahustive list of possible values incldue:
194  
195 =over 4
196  
197 =item Transfer waiting for Losing Registrar Approval
198  
199 =item Transfer waiting for Admin Contact Approval
200  
201 =back
202  
203 =head2 B<verification_status>
204  
205 According to ICANN rules, all new gTLD domains that were registered after January 1st, 2014 must be verified. verification_status describes the current state of this verification and will be one of the following values:
206  
207 =over 4
208  
209 =item Verified
210  
211 =item Pending
212  
213 =item Suspended
214  
215 =back
216  
217 For details on the ICANN policy please see the riveting ICANN Registrar Agreement L<https://www.icann.org/resources/pages/approved-with-specs-2013-09-17-en>.
218  
219 =head2 B<ns>
220  
221 ArrayRef of Domain Names that are the authorizative nameservers for this domain.
222  
223 =head2 B<registrant_contact_id>
224  
225 A L<Contact|WWW::LogicBoxes::Contact> id for the Registrant.
226  
227 =head2 B<admin_contact_id>
228  
229 A L<Contact|WWW::LogicBoxes::Contact> id for the Admin.
230  
231 =head2 B<technical_contact_id>
232  
233 A L<Contact|WWW::LogicBoxes::Contact> id for the Technical.
234  
235 =head2 B<billing_contact_id>
236  
237 A L<Contact|WWW::LogicBoxes::Contact> id for the Billing.
238  
239 =head2 B<epp_key>
240  
241 The secret key needed in order to transfer a domain to another registrar, if it has been provided. Predicate of has_epp_key.
242  
243 =head2 private_nameserves
244  
245 ArrayRef of L<WWW::LogicBoxes::PrivateNameServer> objects that contains any created private name servers. Predicate of has_private_nameservers.
246  
247 =head1 METHODS
248  
249 These methods are used internally, it's fairly unlikely that consumers will ever call them directly.
250  
251 =head2 construct_from_response
252  
253 my $logic_boxes = WWW::LogicBoxes->new( ... );
254  
255 my $response = $logic_boxes->submit({
256 method => 'domains__details_by_name',
257 params => {
258 'domain-name' => 'test-domain.com',
259 'options' => [qw( All )],
260 },
261 });
262  
263 my $domain = WWW::LogicBoxes::DomainTransfer->construct_from_response( $response );
264  
265 Constructs an instance of $self from a L<LogicBoxes|http://www.logicboxes.com> response.
266  
267 =cut
« blib/lib/WWW/LogicBoxes/Domain/Factory.pm ↑ Summary blib/lib/WWW/LogicBoxes/Role/Command/Domain.pm »