blib/lib/WWW/eNom.pm

filter: Statementstmt 91.4% 32 / 35 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod n/a totaltotal 86.9% 40 / 46 CC 2 SCAR 6.9
CC
2
Cov
86%
_build_uri
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/WWW/eNom/IRTPDetail.pm ↑ Summary blib/lib/WWW/eNom/PhoneNumber.pm »
1 package WWW::eNom;
2  
3 42 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 42 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 42 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 42 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 42 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 42 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 42 ▶use WWW::eNom::Types qw( Bool Str ResponseType URI );
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 42 ▶use URI;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 42 our $VERSION = 'v2.6.0'; # VERSION
16 # ABSTRACT: Interact with eNom, Inc.'s Reseller API
17  
18 42 has username => (
19 is => 'ro',
20 isa => Str,
21 required => 1,
22 );
23  
24 42 has password => (
25 is => 'ro',
26 isa => Str,
27 required => 1,
28 );
29  
30 42 has test => (
31 is => 'ro',
32 isa => Bool,
33 default => 0,
34 );
35  
36 42 has response_type => (
37 is => 'rw',
38 isa => ResponseType,
39 default => 'xml_simple',
40 );
41  
42 42 has _uri => (
43 isa => URI,
44 is => 'ro',
45 lazy => 1,
46 builder => '_build_uri',
47 );
48  
49 42 with 'WWW::eNom::Role::Command';
50  
51 sub _build_uri {
52 0 ▶ my $self = shift;
Subroutine _build_uri: not called CC=2 SCAR=17.9
53  
54 0 ▶ my $subdomain = $self->test ? 'resellertest' : 'reseller';
Branch: 1 branch
BranchTrueFalseTotal
$self->test ? : 0 0 0
55 0 return URI->new("https://$subdomain.enom.com/interface.asp");
56 }
57  
58 42 1;
59  
60 __END__
61  
62 =pod
63  
64 =encoding utf8
65  
66 =head1 NAME
67  
68 WWW::eNom - Interact with eNom, Inc.'s reseller API
69  
70 =head1 SYNOPSIS
71  
72 use WWW::eNom;
73  
74 my $eNom = WWW::eNom->new(
75 username => "resellid",
76 password => "resellpw",
77 response_type => "xml_simple", # Optional, defaults to xml_simple
78 test => 1 # Optional, defaults to 0 ( production )
79 );
80  
81 # Check If Domains Are Available
82 my $domain_availabilities = $eNom->check_domain_availability(
83 slds => [qw( cpan drzigman brainstormincubator )],
84 tlds => [qw( com net org )],
85 suggestions => 0,
86 );
87  
88 =head1 DESCRIPTION
89  
90 L<WWW::eNom> is a module for interacting with the L<eNom|https://www.enom.com> API. eNom is a domain registrar and the API performs operations such as checking domain availability, purchasing domains, and managing them.
91  
92 This module is broken down into two primary components (documented below). These are L<WWW::eNom/COMMANDS> which are used for making requests and L<WWW::eNom/OBJECTS> which are used to represent data. Below these, documentation for the L<WWW::eNom> module is included.
93  
94 =head1 COMMANDS
95  
96 Commands are how operations are performed using the L<WWW:eNom> API. They are separated into related operations, for documentation on the specific command please see the linked pages.
97  
98 =head2 L<Raw|WWW::eNom::Role::Command::Raw>
99  
100 Love level direct access to the eNom API. You rarely want to make use of this and instead want to use the abstracted commands outline below.
101  
102 =head2 L<Contact|WWW::eNom::Role::Command::Contact>
103  
104 Contact retrieval.
105  
106 =over 4
107  
108 =item L<get_contacts_by_domain_name|WWW::eNom::Role::Command::Contact/get_contacts_by_domain_name>
109  
110 =item L<update_contacts_for_domain_name|WWW::eNom::Role::Command::Contact/update_contacts_for_domain_name>
111  
112 =back
113  
114 =head2 L<Domain Availability|WWW::eNom::Role::Command::Domain::Availability>
115  
116 Use for checking to see if a domain is available for registration as well as getting suggestions of other potentially relevant domains.
117  
118 =over 4
119  
120 =item L<check_domain_availability|WWW::eNom::Role::Command::Domain::Availability/check_domain_availability>
121  
122 =item L<suggest_domain_names|WWW::eNom::Role::Command::Domain::Availability/suggest_domain_names>
123  
124 =back
125  
126 =head2 L<Domain Registration|WWW::eNom::Role::Command::Domain::Registration>
127  
128 New Domain Registration.
129  
130 =over 4
131  
132 =item L<register_domain|WWW::eNom::Role::Command::Domain::Registration/register_domain>
133  
134 =back
135  
136 =head2 L<Domain Transfer|WWW::eNom::Role::Command::Domain::Transfer>
137  
138 New Domain Transfers.
139  
140 =over 4
141  
142 =item L<transfer_domain|WWW::eNom::Role::Command::Domain::Transfer/transfer_domain>
143  
144 =item L<get_transfer_by_order_id|WWW::eNom::Role::Command::Domain::Transfer/get_transfer_by_order_id>
145  
146 =item L<get_transfer_by_name|WWW::eNom::Role::Command::Domain::Transfer/get_transfer_by_name>
147  
148 =item L<get_transfer_order_id_from_parent_order_id|WWW::eNom::Role::Command::Domain::Transfer/get_transfer_order_id_from_parent_order_id>
149  
150 =back
151  
152 =head2 L<Domain|WWW::eNom::Role::Command::Domain>
153  
154 Domain retrieval and management.
155  
156 =over 4
157  
158 =item L<get_domain_by_name|WWW::eNom::Role::Command::Domain/get_domain_by_name>
159  
160 =item L<get_is_domain_locked_by_name|WWW::eNom::Role::Command::Domain/get_is_domain_locked_by_name>
161  
162 =item L<enable_domain_lock_by_name|WWW::eNom::Role::Command::Domain/enable_domain_lock_by_name>
163  
164 =item L<disable_domain_lock_by_name|WWW::eNom::Role::Command::Domain/disable_domain_lock_by_name>
165  
166 =item L<get_domain_name_servers_by_name|WWW::eNom::Role::Command::Domain/get_domain_name_servers_by_name>
167  
168 =item L<update_nameservers_for_domain_name|WWW::eNom::Role::Command::Domain/update_nameservers_for_domain_name>
169  
170 =item L<get_is_domain_auto_renew_by_name|WWW::eNom::Role::Command::Domain/get_is_domain_auto_renew_by_name>
171  
172 =item L<enable_domain_auto_renew_by_name|WWW::eNom::Role::Command::Domain/enable_domain_auto_renew_by_name>
173  
174 =item L<disable_domain_auto_renew_by_name|WWW::eNom::Role::Command::Domain/disable_domain_auto_renew_by_name>
175  
176 =item L<get_domain_created_date_by_name|WWW::eNom::Role::Command::Domain/get_domain_created_date_by_name>
177  
178 =item L<renew_domain|WWW::eNom::Role::Command::Domain/renew_domain>
179  
180 =item L<email_epp_key_by_name|WWW::eNom::Role::Command::Domain/email_epp_key_by_name>
181  
182 =back
183  
184 =head2 L<Service|WWW::eNom::Role::Command::Service>
185  
186 Addon products that can be sold along with domains.
187  
188 =head3 Domain Privacy
189  
190 =over 4
191  
192 =item L<get_domain_privacy_wholesale_price|WWW::eNom::Role::Command::Service/get_domain_privacy_wholesale_price>
193  
194 =item L<purchase_domain_privacy_for_domain|WWW::eNom::Role::Command::Service/purchase_domain_privacy_for_domain>
195  
196 =item L<get_is_privacy_purchased_by_name|WWW::eNom::Role::Command::Service/get_is_privacy_purchased_by_name>
197  
198 =item L<enable_privacy_by_name|WWW::eNom::Role::Command::Service/enable_privacy_by_name>
199  
200 =item L<disable_privacy_by_name|WWW::eNom::Role::Command::Service/disable_privacy_by_name>
201  
202 =item L<get_is_privacy_auto_renew_by_name|WWW::eNom::Role::Command::Service/get_is_privacy_auto_renew_by_name>
203  
204 =item L<get_privacy_expiration_date_by_name|WWW::eNom::Role::Command::Service/get_privacy_expiration_date_by_name>
205  
206 =item L<enable_privacy_auto_renew_for_domain|WWW::eNom::Role::Command::Service/enable_privacy_auto_renew_for_domain>
207  
208 =item L<disable_privacy_auto_renew_for_domain|WWW::eNom::Role::Command::Service/disable_privacy_auto_renew_for_domain>
209  
210 =item L<renew_privacy|WWW::eNom::Role::Command::Service/renew_privacy>
211  
212 =back
213  
214 =head2 L<Private Nameservers|WWW::eNom::Role::Command::Domain::PrivateNameServer>
215  
216 Management of Private Name Servers.
217  
218 =over 4
219  
220 =item L<create_private_nameserver|WWW::eNom::Role::Command::Domain::PrivateNameServer/create_private_nameserver>
221  
222 =item L<update_private_nameserver_ip|WWW::eNom::Role::Command::Domain::PrivateNameServer/update_private_nameserver_ip>
223  
224 =item L<retrieve_private_nameserver_by_name|WWW::eNom::Role::Command::Domain::PrivateNameServer/retrieve_private_nameserver_by_name>
225  
226 =item L<delete_private_nameserver|WWW::eNom::Role::Command::Domain::PrivateNameServer/delete_private_nameserver>
227  
228 =back
229  
230 =head1 OBJECTS
231  
232 Rather than working with messy XML objects or HashRefs, WWW::eNom implements a series of L<Moose> objects for making requests and processing responses. All commands that take an object have coercion so a HashRef can be used in it's place.
233  
234 =head2 L<WWW::eNom>
235  
236 Primary interface to eNom. Documented further below.
237  
238 =head2 L<WWW::eNom::Contact>
239  
240 WHOIS data contacts. Typically (with few exceptions) domains contain a Registrant, Admin, Technical, and Billing contact.
241  
242 =head2 L<WWW::eNom::Domain>
243  
244 A registered domain and all of the domain's related information.
245  
246 =head2 L<WWW::eNom::DomainTransfer>
247  
248 An in progress domain transfer and all of it's related information.
249  
250 =head2 L<WWW::eNom::DomainRequest::Registration>
251  
252 Request to register a domain.
253  
254 =head2 L<WWW::eNom::DomainRequest::Transfer>
255  
256 Request to transfer a domain.
257  
258 =head2 L<WWW::eNom::PrivateNameServer>
259  
260 Private nameservers.
261  
262 =head2 L<WWW::eNom::IRTPDetail>
263  
264 Details about an in progress IRTP Verification (due to a change in registrant contact). The IRTP Process is rather complex and eNom acts as a Designated Agent, see L<WWW::eNom::IRTPDetail> for more information about this.
265  
266 =head1 WITH
267  
268 =over 4
269  
270 =item L<WWW::eNom::Role::Command>
271  
272 =back
273  
274 =head1 ATTRIBUTES
275  
276 =head2 B<username>
277  
278 eNom Reseller ID
279  
280 =head2 B<password>
281  
282 eNom Reseller Password
283  
284 =head2 test
285  
286 Boolean that defaults to false. If true, requests will be sent to the eNom test endpoint rather than production.
287  
288 =head2 response_type
289  
290 Defaults to 'xml_simple'. Valid values include:
291  
292 =over 4
293  
294 =item xml
295  
296 =item xml_simple
297  
298 =item html
299  
300 =item text
301  
302 =back
303  
304 It should be noted that this setting is really only relevant when making L<Raw|WWW::eNom::Role::Command::Raw> requests of the eNom API. When doing so this attribute defines the format of the responses.
305  
306 =head1 METHODS
307  
308 =head2 new
309  
310 my $eNom = WWW::eNom->new(
311 username => "resellid",
312 password => "resellpw",
313 response_type => "xml_simple", # Optional, defaults to xml_simple
314 test => 1 # Optional, defaults to 0 ( production )
315 );
316  
317 Constructs a new object for interacting with the eNom API. If the "test" parameter is given, then the API calls will be made to the test server instead of the live one.
318  
319 As of v0.3.1, an optional "response_type" parameter is supported. For the sake of backward compatibility, the default is "xml_simple"; see below for an explanation of this response type. Use of any other valid option will lead to the return of string responses straight from the eNom API. These options are:
320  
321 =head1 RELEASE NOTE
322  
323 As of v1.0.0, this module has been renamed to WWW::eNom. Net::eNom is now a thin wrapper to preserve backward compatibility.
324  
325 =head1 AUTHOR
326  
327 Robert Stone, C<< <drzigman AT cpan DOT org> >>
328  
329 Original version by Simon Cozens C<< <simon at simon-cozens.org> >>.
330 Then maintained and expanded by Richard Simões, C<< <rsimoes AT cpan DOT org> >>.
331  
332 =head1 COPYRIGHT & LICENSE
333  
334 Copyright © 2016 Robert Stone. This module is released under the terms of the B<MIT License> and may be modified and/or redistributed under the same or any compatible license.
335  
336 =cut
« blib/lib/WWW/eNom/IRTPDetail.pm ↑ Summary blib/lib/WWW/eNom/PhoneNumber.pm »