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/Role/Command.pm ↑ Summary blib/lib/WWW/eNom/PhoneNumber.pm »
1 package WWW::eNom;
2  
3 40 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 40 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 40 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 40 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 40 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 40 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 40 ▶use WWW::eNom::Types qw( Bool Str ResponseType URI );
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 40 ▶use URI;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 40 our $VERSION = 'v2.0.0'; # VERSION
16 # ABSTRACT: Interact with eNom, Inc.'s Reseller API
17  
18 40 has username => (
19 is => 'ro',
20 isa => Str,
21 required => 1,
22 );
23  
24 40 has password => (
25 is => 'ro',
26 isa => Str,
27 required => 1,
28 );
29  
30 40 has test => (
31 is => 'ro',
32 isa => Bool,
33 default => 0,
34 );
35  
36 40 has response_type => (
37 is => 'rw',
38 isa => ResponseType,
39 default => 'xml_simple',
40 );
41  
42 40 has _uri => (
43 isa => URI,
44 is => 'ro',
45 lazy => 1,
46 builder => '_build_uri',
47 );
48  
49 40 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("http://$subdomain.enom.com/interface.asp");
56 }
57  
58 40 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 =back
181  
182 =head2 L<Service|WWW::eNom::Role::Command::Service>
183  
184 Addon products that can be sold along with domains.
185  
186 =head3 Domain Privacy
187  
188 =over 4
189  
190 =item L<get_domain_privacy_wholesale_price|WWW::eNom::Role::Command::Service/get_domain_privacy_wholesale_price>
191  
192 =item L<purchase_domain_privacy_for_domain|WWW::eNom::Role::Command::Service/purchase_domain_privacy_for_domain>
193  
194 =item L<get_is_privacy_purchased_by_name|WWW::eNom::Role::Command::Service/get_is_privacy_purchased_by_name>
195  
196 =item L<enable_privacy_by_name|WWW::eNom::Role::Command::Service/enable_privacy_by_name>
197  
198 =item L<disable_privacy_by_name|WWW::eNom::Role::Command::Service/disable_privacy_by_name>
199  
200 =item L<get_is_privacy_auto_renew_by_name|WWW::eNom::Role::Command::Service/get_is_privacy_auto_renew_by_name>
201  
202 =item L<get_privacy_expiration_date_by_name|WWW::eNom::Role::Command::Service/get_privacy_expiration_date_by_name>
203  
204 =item L<enable_privacy_auto_renew_for_domain|WWW::eNom::Role::Command::Service/enable_privacy_auto_renew_for_domain>
205  
206 =item L<disable_privacy_auto_renew_for_domain|WWW::eNom::Role::Command::Service/disable_privacy_auto_renew_for_domain>
207  
208 =item L<renew_privacy|WWW::eNom::Role::Command::Service/renew_privacy>
209  
210 =back
211  
212 =head2 L<Private Nameservers|WWW::eNom::Role::Command::Domain::PrivateNameServer>
213  
214 Management of Private Name Servers.
215  
216 =over 4
217  
218 =item L<create_private_nameserver|WWW::eNom::Role::Command::Domain::PrivateNameServer/create_private_nameserver>
219  
220 =item L<retrieve_private_nameserver_by_name|WWW::eNom::Role::Command::Domain::PrivateNameServer/retrieve_private_nameserver_by_name>
221  
222 =item L<delete_private_nameserver|WWW::eNom::Role::Command::Domain::PrivateNameServer/delete_private_nameserver>
223  
224 =back
225  
226 =head1 OBJECTS
227  
228 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.
229  
230 =head2 L<WWW::eNom>
231  
232 Primary interface to eNom. Documented further below.
233  
234 =head2 L<WWW::eNom::Contact>
235  
236 WHOIS data contacts. Typically (with few exceptions) domains contain a Registrant, Admin, Technical, and Billing contact.
237  
238 =head2 L<WWW::eNom::Domain>
239  
240 A registered domain and all of the domain's related information.
241  
242 =head2 L<WWW::eNom::DomainTransfer>
243  
244 An in progress domain transfer and all of it's related information.
245  
246 =head2 L<WWW::eNom::DomainRequest::Registration>
247  
248 Request to register a domain.
249  
250 =head2 L<WWW::eNom::DomainRequest::Transfer>
251  
252 Request to transfer a domain.
253  
254 =head2 L<WWW::eNom::PrivateNameServer>
255  
256 Private nameservers.
257  
258 =head1 WITH
259  
260 =over 4
261  
262 =item L<WWW::eNom::Role::Command>
263  
264 =back
265  
266 =head1 ATTRIBUTES
267  
268 =head2 B<username>
269  
270 eNom Reseller ID
271  
272 =head2 B<password>
273  
274 eNom Reseller Password
275  
276 =head2 test
277  
278 Boolean that defaults to false. If true, requests will be sent to the eNom test endpoint rather than production.
279  
280 =head2 response_type
281  
282 Defaults to 'xml_simple'. Valid values include:
283  
284 =over 4
285  
286 =item xml
287  
288 =item xml_simple
289  
290 =item html
291  
292 =item text
293  
294 =back
295  
296 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.
297  
298 =head1 METHODS
299  
300 =head2 new
301  
302 my $eNom = WWW::eNom->new(
303 username => "resellid",
304 password => "resellpw",
305 response_type => "xml_simple", # Optional, defaults to xml_simple
306 test => 1 # Optional, defaults to 0 ( production )
307 );
308  
309 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.
310  
311 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:
312  
313 =head1 RELEASE NOTE
314  
315 As of v1.0.0, this module has been renamed to WWW::eNom. Net::eNom is now a thin wrapper to preserve backward compatibility.
316  
317 =head1 AUTHOR
318  
319 Robert Stone, C<< <drzigman AT cpan DOT org> >>
320  
321 Original version by Simon Cozens C<< <simon at simon-cozens.org> >>.
322 Then maintained and expanded by Richard Simões, C<< <rsimoes AT cpan DOT org> >>.
323  
324 =head1 COPYRIGHT & LICENSE
325  
326 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.
327  
328 =cut
« blib/lib/WWW/eNom/Role/Command.pm ↑ Summary blib/lib/WWW/eNom/PhoneNumber.pm »