blib/lib/WWW/LogicBoxes/Contact/US.pm

filter: Statementstmt 60.0% 24 / 40 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 100% 2 / 2 totaltotal 59.2% 32 / 54 CC 3 SCAR 14.8
CC
3
Cov
55%
construct_from_response
12.0
construct_creation_request
2.0
BEGIN
1.0
CRAP 4.4
« blib/lib/WWW/LogicBoxes/DomainRequest/Transfer.pm ↑ Summary Build »
1 package WWW::LogicBoxes::Contact::US;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 ▶use WWW::LogicBoxes::Types qw( NexusPurpose NexusCategory );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 3 extends 'WWW::LogicBoxes::Contact';
13  
14 3 our $VERSION = '1.2.0'; # VERSION
15 # ABSTRACT: Contact for .US Registrations
16  
17 3 has 'nexus_purpose' => (
18 is => 'ro',
19 isa => NexusPurpose,
20 required => 1,
21 );
22  
23 3 has 'nexus_category' => (
24 is => 'ro',
25 isa => NexusCategory,
26 required => 1,
27 );
28  
29 sub construct_creation_request {
30 0 ▶ my $self = shift;
Subroutine construct_creation_request: not called CC=1 SCAR=6.9
Pod documented
31  
32 0 my $request = $self->SUPER::construct_creation_request();
33  
34 0 $request->{'attr-name1'} = 'purpose';
35 0 $request->{'attr-value1'} = $self->nexus_purpose;
36  
37 0 $request->{'attr-name2'} = 'category';
38 0 $request->{'attr-value2'} = $self->nexus_category;
39  
40 0 return $request;
41 }
42  
43 sub construct_from_response {
44 0 ▶ my $self = shift;
Subroutine construct_from_response: not called CC=3 SCAR=24.8
Pod documented
45 0 my $response = shift;
46  
47 0 ▶ if( !defined $response ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $response) 0 0 0
48 0 return;
49 }
50  
51 0 my $contact = WWW::LogicBoxes::Contact->construct_from_response( $response );
52  
53 0 ▶ if( !defined $contact ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $contact) 0 0 0
54 0 return;
55 }
56  
57 $self->meta->rebless_instance( $contact,
58 nexus_purpose => $response->{ApplicationPurpose},
59 nexus_category => $response->{NexusCategory},
60 0 );
61  
62  
63 0 return $contact;
64 }
65  
66 3 __PACKAGE__->meta->make_immutable;
67 3 1;
68  
69 __END__
70 =pod
71  
72 =head1 NAME
73  
74 WWW::LogicBoxes::Contact::US - Representation of Domain Contact for .us Domains
75  
76 =head1 SYNOPSIS
77  
78 use strict;
79 use warnings;
80  
81 use WWW::LogicBoxes::Customer;
82 use WWW::LogicBoxes::Contact::US;
83  
84 my $customer = WWW::LogicBoxes::Customer->new( ... ); # Valid LogicBoxes Customer
85  
86 my $contact = WWW::LogicBoxes::Contact->new(
87 id => 42,
88 name => 'Edsger Dijkstra',
89 company => 'University of Texas at Austin',
90 email => 'depth.first@search.com',
91 address1 => 'University of Texas',
92 address2 => '42 Main St',
93 city => 'Austin',
94 state => 'Texas',
95 country => 'US',
96 zipcode => '78713',
97 phone_number => '18005551212',
98 fax_number => '18005551212',
99 type => 'Contact',
100 customer_id => $customer->id,
101  
102 nexus_purpose => 'P1',
103 nexus_category => 'C11',
104 );
105  
106 =head1 EXTENDS
107  
108 L<WWW::LogicBoxes::Contact>
109  
110 =head1 DESCRIPTION
111  
112 Representation of a L<LogicBoxes|http://www.logicboxes.com> domain contact for .us TLD domains. The .us tld is special in that specific L<Nexus Data|http://www.neustar.us/the-ustld-nexus-requirements/> must be provided.
113  
114 =head1 ATTRIBUTES
115  
116 All of the existing L<WWW::LogicBoxes::Contact> attributes remain unchanged with two new attributes. The description for these values is taken from L<http://www.whois.us/whois-gui/US/faqs.html>.
117  
118 =head2 B<nexus_purpose>
119  
120 This is the B<Domain Name Application Purpose Code>, the reason this domain was registered and a bit about it's intended usage.
121  
122 Must be one of the following I<2 character> values:
123  
124 =over 4
125  
126 =item P1 - Business use for profit.
127  
128 =item P2 - Non-profit business, club, association, religious organization, etc.
129  
130 =item P3 - Personal use.
131  
132 =item P4 - Education purposes.
133  
134 =item P5 - Government purposes
135  
136 =back
137  
138 =head2 B<nexus_category>
139  
140 This is the B<Nexus Code>, it contains information about the contact and their relationship with respect to US residency.
141  
142 Must be one of the following I<2 character> values:
143  
144 =over 4
145  
146 =item C11 - A natural person who is a United States citizen.
147  
148 =item C12 - A natural person who is a permanent resident of the United States of America, or any of its possessions or territories.
149  
150 =item C21 - A US-based organization or company (A US-based organization or company formed within one of the fifty (50) U.S. states, the District of Columbia, or any of the United States possessions or territories, or organized or otherwise constituted under the laws of a state of the United States of America, the District of Columbia or any of its possessions or territories or a U.S. federal, state, or local government entity or a political subdivision thereof).
151  
152 =item C31 - A foreign entity or organization (A foreign entity or organization that has a bona fide presence in the United States of America or any of its possessions or territories who regularly engages in lawful activities (sales of goods or services or other business, commercial or non-commercial, including not-for-profit relations in the United States)).
153  
154 =item C32 - Entity has an office or other facility in the United States.
155  
156 =back
157  
158 =cut
« blib/lib/WWW/LogicBoxes/DomainRequest/Transfer.pm ↑ Summary Build »