| 1 | package WWW::eNom::DomainAvailability; | ||
| 2 | |||
| 3 | 46 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 46 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 46 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 46 | ▶ | use MooseX::StrictConstructor; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 46 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 46 | ▶ | use WWW::eNom::Types qw( Bool DomainName ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 46 | our $VERSION = 'v2.0.0'; # VERSION | |
| 13 | # ABSTRACT: eNom Domain Availability Response | ||
| 14 | |||
| 15 | 46 | has 'name' => ( | |
| 16 | is => 'ro', | ||
| 17 | isa => DomainName, | ||
| 18 | required => 1, | ||
| 19 | ); | ||
| 20 | |||
| 21 | 46 | has 'is_available' => ( | |
| 22 | is => 'ro', | ||
| 23 | isa => Bool, | ||
| 24 | required => 1, | ||
| 25 | ); | ||
| 26 | |||
| 27 | 46 | with 'WWW::eNom::Role::ParseDomain'; | |
| 28 | |||
| 29 | 46 | __PACKAGE__->meta->make_immutable; | |
| 30 | |||
| 31 | 46 | 1; | |
| 32 | |||
| 33 | __END__ | ||
| 34 | =pod | ||
| 35 | |||
| 36 | =head1 NAME | ||
| 37 | |||
| 38 | WWW::eNom::DomainAvailability | ||
| 39 | |||
| 40 | =head1 SYNOPSIS | ||
| 41 | |||
| 42 | use WWW::eNom; | ||
| 43 | |||
| 44 | my $eNom = WWW::eNom->new( ... ); | ||
| 45 | |||
| 46 | my $domain_availabilities = $eNom->check_domain_availability( | ||
| 47 | slds => [qw( cpan drzigman brainstormincubator ], | ||
| 48 | tlds => [qw( com net org )], | ||
| 49 | suggestions => 0, | ||
| 50 | ); | ||
| 51 | |||
| 52 | for my $domain_availability (@{ $domain_availabilities }) { | ||
| 53 | if ( $domain_availability->is_available ) { | ||
| 54 | print 'Domain: ' . $domain_availability->name . " is available! :) \n"; | ||
| 55 | } | ||
| 56 | else { | ||
| 57 | print 'Domain: ' . $domain_availability->name . " is not available! :( \n"; | ||
| 58 | } | ||
| 59 | } | ||
| 60 | |||
| 61 | =head1 DESCRIPTION | ||
| 62 | |||
| 63 | Contains details about the availability of a domain. | ||
| 64 | |||
| 65 | =head1 ATTRIBUTES | ||
| 66 | |||
| 67 | =head2 B<name> | ||
| 68 | |||
| 69 | The full domain name (test-domain.com). | ||
| 70 | |||
| 71 | =head2 B<is_available> | ||
| 72 | |||
| 73 | Boolean indicating if this domain is available for registration. | ||
| 74 | |||
| 75 | =head2 sld | ||
| 76 | |||
| 77 | The portion of the domain name excluding the public_suffix, (test-domain). | ||
| 78 | |||
| 79 | =head2 public_suffix | ||
| 80 | |||
| 81 | The "root" of the domain (.com). There is an alias of tld to this attribute. | ||
| 82 | |||
| 83 | B<NOTE> For domains like test-domain.co.uk the public_suffix is .co.uk. The public suffix is what is available for someone to actually register. For additional information between the distinction between Top Level Domain and Public Suffix please see L<https://publicsuffix.org/learn/> | ||
| 84 | |||
| 85 | =cut | ||