blib/lib/WWW/LogicBoxes/DomainRequest/Transfer.pm

filter: Statementstmt 92.0% 23 / 25 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 100% 1 / 1 totaltotal 81.0% 30 / 37 CC 3 SCAR 15.4
CC
3
Cov
79%
construct_request
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.7
« blib/lib/WWW/LogicBoxes/Role/Command/Contact.pm ↑ Summary blib/lib/WWW/LogicBoxes/Contact/US.pm »
1 package WWW::LogicBoxes::DomainRequest::Transfer;
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( Str );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 39 extends 'WWW::LogicBoxes::DomainRequest';
13  
14 39 our $VERSION = '1.2.0'; # VERSION
15 # ABSTRACT: Domain Transfer Request
16  
17 39 has epp_key => (
18 is => 'ro',
19 isa => Str,
20 required => 0,
21 predicate => 'has_epp_key',
22 );
23  
24 sub construct_request {
25 0 ▶ my $self = shift;
Subroutine construct_request: not called CC=3 SCAR=24.8
Pod documented
26  
27 return {
28 0 ▶ 'domain-name' => $self->name,
Branch: 2 branches
BranchTrueFalseTotal
$self->has_epp_key ? : 0 0 0
$self->is_private ? : 0 0 0
29 ns => $self->ns,
30 'customer-id' => $self->customer_id,
31 'reg-contact-id' => $self->registrant_contact_id,
32 'admin-contact-id' => $self->admin_contact_id,
33 'tech-contact-id' => $self->technical_contact_id,
34 'billing-contact-id' => $self->billing_contact_id,
35 'invoice-option' => $self->invoice_option,
36 $self->has_epp_key ? ( 'auth-code' => $self->epp_key ) : ( ),
37 $self->is_private ? (
38 'protect-privacy' => 'true',
39 'purchase-privacy' => 'true',
40 ) : ( ),
41 };
42 }
43  
44 39 __PACKAGE__->meta->make_immutable;
45 39 1;
46  
47 __END__
48 =pod
49  
50 =head1 NAME
51  
52 WWW::LogicBoxes::DomainRequest::Transfer - Representation of Domain Transfer Request
53  
54 =head1 SYNOPSIS
55  
56 use WWW::LogicBoxes;
57 use WWW::LogicBoxes::Customer;
58 use WWW::LogicBoxes::Contact;
59 use WWW::LogicBoxes::DomainTransfer;
60 use WWW::LogicBoxes::DomainRequest::Transfer;
61  
62 my $logic_boxes = WWW::LogicBoxes->new( ... );
63 my $customer = WWW:::LogicBoxes::Customer->new( ... ); # Valid LogicBoxes Customer
64  
65 my $registrant_contact = WWW::LogicBoxes::Contact->new( ... ); # Valid LogicBoxes Contact
66 my $admin_contact = WWW::LogicBoxes::Contact->new( ... ); # Valid LogicBoxes Contact
67 my $technical_contact = WWW::LogicBoxes::Contact->new( ... ); # Valid LogicBoxes Contact
68 my $billing_contact = WWW::LogicBoxes::Contact->new( ... ); # Valid LogicBoxes Contact
69  
70 my $transfer_request = WWW::LogicBoxes::DomainRequest::Transfer->new(
71 name => 'test-domain.com',
72 customer_id => $customer->id,
73 ns => [ 'ns1.logicboxes.com', 'ns2.logicboxes.com' ],
74 registrant_contact_id => $registrant_contact->id,
75 admin_contact_id => $admin_contact->id,
76 technical_contact_id => $technical_contact->id,
77 billing_contact_id => $billing_contact->id,
78 invoice_option => 'NoInvoice',
79 );
80  
81 my $transfer_domain = $logic_boxes->transfer_domain( request => $transfer_request );
82  
83 =head1 EXTENDS
84  
85 L<WWW::LogicBoxes::DomainRequest>
86  
87 =head1 DESCRIPTION
88  
89 WWW::LogicBoxes::DomainRequest::Transfer is a representation of all the data needed in order to complete a domain transfer. It is used when requesting a new domain transfer from L<LogicBoxes|http://www.logicboxes.com>.
90  
91 =head1 ATTRIBUTES
92  
93 All of the existing L<WWW::LogicBoxes::DomainRequest> attributes remain unchanged with one addition attribute.
94  
95 =head2 B<epp_key>
96  
97 The epp_key (what L<LogicBoxes|http://www.logicboxes.com> calls the auth code) to register this L<domain transfer|WWW::LogicBoxes::DomainTransfer> for. This need not be specified at this point, and a predicate of has_epp_key is provied.
98  
99 =head1 METHODS
100  
101 This method is used internally, it's fairly unlikely that consumers will ever call it directly.
102  
103 =head2 construct_request
104  
105 my $logic_boxes = WWW::LogicBoxes->new( ... );
106 my $transfer_request = WWW::LogicBoxes::DomainRequest::Transfer->new( ... );
107  
108 my $response = $logic_boxes->submit({
109 method => 'domains__transfer',
110 params => $transfer_request->consturct_request(),
111 });
112  
113 Converts $self into a HashRef suitable for requesting a domain transfer with L<LogicBoxes|http://www.logicboxes.com>.
114  
115 =cut
« blib/lib/WWW/LogicBoxes/Role/Command/Contact.pm ↑ Summary blib/lib/WWW/LogicBoxes/Contact/US.pm »