File Coverage

blib/lib/WWW/LogicBoxes/IRTPDetail.pm
Criterion Covered Total %
statement 21 25 84.0
branch 0 4 0.0
condition n/a
subroutine 7 8 87.5
pod 1 1 100.0
total 29 38 76.3


line stmt bran cond sub pod time code
1             package WWW::LogicBoxes::IRTPDetail;
2              
3 40     40   351625 use strict;
  40         103  
  40         1305  
4 40     40   226 use warnings;
  40         91  
  40         1093  
5              
6 40     40   663 use Moose;
  40         145361  
  40         1049  
7 40     40   264422 use MooseX::StrictConstructor;
  40         25521  
  40         288  
8 40     40   125536 use namespace::autoclean;
  40         98  
  40         346  
9              
10 40     40   4119 use WWW::LogicBoxes::Types qw( Bool DateTime IRTPFOAStatus IRTPStatus Int Str );
  40         95  
  40         332  
11              
12 40     40   449669 use DateTime;
  40         15962972  
  40         10587  
13              
14             our $VERSION = '1.10.1'; # VERSION
15             # ABSTRACT: Detailed Information About An In Progress IRTP Verification
16              
17             has 'is_transfer_locked' => (
18             is => 'ro',
19             isa => Bool,
20             required => 1,
21             );
22              
23             has 'expiration_date' => (
24             is => 'ro',
25             isa => DateTime,
26             required => 1,
27             );
28              
29             has 'gaining_foa_status' => (
30             is => 'ro',
31             isa => IRTPFOAStatus,
32             required => 1,
33             );
34              
35             has 'losing_foa_status' => (
36             is => 'ro',
37             isa => IRTPFOAStatus,
38             required => 1,
39             );
40              
41             has 'status' => (
42             is => 'ro',
43             isa => IRTPStatus,
44             required => 1,
45             );
46              
47             has 'message' => (
48             is => 'ro',
49             isa => Str,
50             predicate => 'has_message',
51             );
52              
53             has 'proposed_registrant_contact_id' => (
54             is => 'ro',
55             isa => Int,
56             required => 1,
57             );
58              
59             sub construct_from_response {
60 0     0 1   my $self = shift;
61 0           my $response = shift;
62              
63 0 0         (!$response) and return;
64              
65             return $self->new(
66             is_transfer_locked => ($response->{'sixty-day-lock-status'} eq 'true'),
67             expiration_date => DateTime->from_epoch( epoch => $response->{expiry} ),
68             gaining_foa_status => $response->{'gaining-foa-status'},
69             losing_foa_status => $response->{'losing-foa-status'},
70             status => $response->{'task-status'},
71             proposed_registrant_contact_id => $response->{'gaining-contact-info'}{id},
72 0 0         $response->{message} ? ( message => $response->{message} ) : ( ),
73             );
74             }
75              
76             __PACKAGE__->meta->make_immutable;
77             1;
78              
79             __END__
80             =pod
81              
82             =head1 NAME
83              
84             WWW::LogicBoxes::IRTPDetail - Detailed Information About An In Progress IRTP Verification
85              
86             =head1 SYNOPSIS
87              
88             use WWW::LogicBoxes;
89              
90             my $api = WWW::LogicBoxes->new( ... );
91             my $domain = $api->get_domain_by_name( 'test-domain.com' );
92              
93             if( $domain->has_irtp_detail ) {
94             # Output information about IRTP Verification
95             $domain->irtp_detail->is_transfer_locked;
96             ...
97             }
98              
99             =head1 DESCRIPTION
100              
101             On 2016-12-01, a new L<ICANN Inter Registrar Transfer Policy|https://www.icann.org/resources/pages/transfer-policy-2016-06-01-en> went into effect. This policy requires any material change to the registrant contact ( the name, email address, that sort of thing ), to be confirmed by both the old registrant and the new registrant. This object exists to contain all the relevant data of an in progress IRTP Verification.
102              
103             =head1 ATTRIBUTES
104              
105             =head2 B<is_transfer_locked>
106              
107             Boolean indicating if the domain will be transfer locked for 60 days after the verification is complete. This is set when the original call to L<WWW::LogicBoxes::Role::Command::Domain/update_domain_contacts> is made and is based on the value of is_transfer_locked.
108              
109             =head2 B<expiration_date>
110              
111             DateTime object that contains when this verification request will expire.
112              
113             =head2 B<gaining_foa_status>
114              
115             The verification status for the gaining registrant.
116              
117             Always takes one of the following values:
118              
119             =over 4
120              
121             =item PENDING
122              
123             =item APPROVED
124              
125             =item DISAPPROVED
126              
127             =back
128              
129             =head2 B<losing_foa_status>
130              
131             The verification status for the losing registrant.
132              
133             Always takes one of the following values:
134              
135             =over 4
136              
137             =item PENDING
138              
139             =item APPROVED
140              
141             =item DISAPPROVED
142              
143             =back
144              
145             =head2 B<status>
146              
147             Overall status of the IRTP Verification.
148              
149             =over 4
150              
151             =item PENDING
152              
153             =item REVOKED
154              
155             =item EXPIRED
156              
157             =item FAILED
158              
159             =item APPROVED
160              
161             =item SUCCESS
162              
163             =item REMOTE_FAILURE
164              
165             =back
166              
167             =head2 message
168              
169             In the event that the status is REVOKED or REMOTE_FAILURE, message will be populated with details about the issue. A predicate of has_message is provided.
170              
171             =head1 METHODS
172              
173             =head2 construct_from_response
174              
175             Construct an instance of $self from the irtp_status portion of the L<WWW::LogicBoxes::Role::Command::Domain/get_domain_by_id> response from LogicBoxes. There really isn't any reason for consumers to use this method directly.
176              
177             =cut