| 1 | package WWW::LogicBoxes::Role::Command::Domain; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 37 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 37 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 37 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 37 | ▶ | use MooseX::Params::Validate; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 37 | ▶ | use WWW::LogicBoxes::Types qw( Bool DomainName DomainNames Int InvoiceOption PrivateNameServer Str ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 37 | ▶ | use WWW::LogicBoxes::Domain::Factory; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 37 | ▶ | use Try::Tiny; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 37 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 37 | ▶ | use Readonly; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | 37 | Readonly my $DOMAIN_DETAIL_OPTIONS => [qw( All )]; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 37 | requires 'submit'; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 37 | our $VERSION = '1.2.0'; # VERSION | |||||||||||||||||||||||||||
| 22 | # ABSTRACT: Domain API Calls | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | sub get_domain_by_id { | ||||||||||||||||||||||||||||
| 25 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_domain_by_id: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 26 | 0 | my ( $domain_id ) = pos_validated_list( \@_, { isa => Int } ); | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | return try { | ||||||||||||||||||||||||||||
| 29 | 0 | ▶ | my $response = $self->submit({ | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 30 | method => 'domains__details', | ||||||||||||||||||||||||||||
| 31 | params => { | ||||||||||||||||||||||||||||
| 32 | 'order-id' => $domain_id, | ||||||||||||||||||||||||||||
| 33 | 'options' => $DOMAIN_DETAIL_OPTIONS, | ||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | }); | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | return WWW::LogicBoxes::Domain::Factory->construct_from_response( $response ); | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | catch { | ||||||||||||||||||||||||||||
| 40 | 0 | ▶ | if( $_ =~ m/^No Entity found for Entityid/ ) { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | 0 | return; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 0 | croak $_; | |||||||||||||||||||||||||||
| 45 | 0 | }; | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | sub get_domain_by_name { | ||||||||||||||||||||||||||||
| 49 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_domain_by_name: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 50 | 0 | my ( $domain_name ) = pos_validated_list( \@_, { isa => DomainName } ); | |||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | return try { | ||||||||||||||||||||||||||||
| 53 | 0 | ▶ | my $response = $self->submit({ | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 54 | method => 'domains__details_by_name', | ||||||||||||||||||||||||||||
| 55 | params => { | ||||||||||||||||||||||||||||
| 56 | 'domain-name' => $domain_name, | ||||||||||||||||||||||||||||
| 57 | 'options' => $DOMAIN_DETAIL_OPTIONS, | ||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | }); | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | 0 | return WWW::LogicBoxes::Domain::Factory->construct_from_response( $response ); | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | catch { | ||||||||||||||||||||||||||||
| 64 | 0 | ▶ | if( $_ =~ m/^Website doesn't exist for/ ) { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 65 | 0 | return; | |||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 0 | croak $_; | |||||||||||||||||||||||||||
| 69 | 0 | }; | |||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | sub update_domain_contacts { | ||||||||||||||||||||||||||||
| 73 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
update_domain_contacts: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 74 | 0 | my ( %args ) = validated_hash( | |||||||||||||||||||||||||||
| 75 | \@_, | ||||||||||||||||||||||||||||
| 76 | id => { isa => Int }, | ||||||||||||||||||||||||||||
| 77 | registrant_contact_id => { isa => Int, optional => 1 }, | ||||||||||||||||||||||||||||
| 78 | admin_contact_id => { isa => Int, optional => 1 }, | ||||||||||||||||||||||||||||
| 79 | technical_contact_id => { isa => Int, optional => 1 }, | ||||||||||||||||||||||||||||
| 80 | billing_contact_id => { isa => Int, optional => 1 }, | ||||||||||||||||||||||||||||
| 81 | ); | ||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | return try { | ||||||||||||||||||||||||||||
| 84 | 0 | ▶ | my $original_domain = $self->get_domain_by_id( $args{id} ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | 0 | ▶ | if( !$original_domain ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 87 | 0 | croak 'No such domain exists'; | |||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 0 | my $contact_mapping = { | |||||||||||||||||||||||||||
| 91 | registrant_contact_id => 'reg-contact-id', | ||||||||||||||||||||||||||||
| 92 | admin_contact_id => 'admin-contact-id', | ||||||||||||||||||||||||||||
| 93 | technical_contact_id => 'tech-contact-id', | ||||||||||||||||||||||||||||
| 94 | billing_contact_id => 'billing-contact-id', | ||||||||||||||||||||||||||||
| 95 | }; | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | 0 | my $num_changes = 0; | |||||||||||||||||||||||||||
| 98 | 0 | my $contacts_to_update; | |||||||||||||||||||||||||||
| 99 | 0 | for my $contact_type ( keys %{ $contact_mapping } ) { | |||||||||||||||||||||||||||
| 100 | 0 | ▶ | if( $args{$contact_type} && $args{$contact_type} != $original_domain->$contact_type ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$args{$contact_type} and $args{$contact_type} != $original_domain->$contact_type
MC/DC0%0/2
$args{$contact_type} and $args{$contact_type} != $original_domain->$contact_type
$args{$contact_type}
$args{$contact_type} != $original_domain->$contact_type
Truth table0%0/3
A and B
A= $args{$contact_type}B= $args{$contact_type} != $original_domain->$contact_type
| |||||||||||||||||||||||||||||
| 101 | 0 | $contacts_to_update->{ $contact_mapping->{ $contact_type } } = $args{ $contact_type }; | |||||||||||||||||||||||||||
| 102 | 0 | $num_changes++; | |||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||
| 104 | else { | ||||||||||||||||||||||||||||
| 105 | 0 | $contacts_to_update->{ $contact_mapping->{ $contact_type } } = $original_domain->$contact_type; | |||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | 0 | ▶ | if( $num_changes == 0 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 110 | 0 | return $original_domain; | |||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | $self->submit({ | ||||||||||||||||||||||||||||
| 114 | method => 'domains__modify_contact', | ||||||||||||||||||||||||||||
| 115 | params => { | ||||||||||||||||||||||||||||
| 116 | 'order-id' => $args{id}, | ||||||||||||||||||||||||||||
| 117 | 0 | %{ $contacts_to_update } | |||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||
| 119 | }); | ||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | 0 | return $self->get_domain_by_id( $args{id} ); | |||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||
| 123 | catch { | ||||||||||||||||||||||||||||
| 124 | ## no critic (ControlStructures::ProhibitCascadingIfElse) | ||||||||||||||||||||||||||||
| 125 | 0 | ▶ | if( $_ =~ m/{registrantcontactid=registrantcontactid is invalid}/ ) { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=5 SCAR=34.0
Branch: 4 branches
| |||||||||||||||||||||||||||||
| 126 | 0 | croak 'Invalid registrant_contact_id specified'; | |||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||
| 128 | elsif( $_ =~ m/{admincontactid=admincontactid is invalid}/ ) { | ||||||||||||||||||||||||||||
| 129 | 0 | croak 'Invalid admin_contact_id specified'; | |||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||
| 131 | elsif( $_ =~ m/{techcontactid=techcontactid is invalid}/ ) { | ||||||||||||||||||||||||||||
| 132 | 0 | croak 'Invalid technical_contact_id specified'; | |||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||
| 134 | elsif( $_ =~ m/{billingcontactid=billingcontactid is invalid}/ ) { | ||||||||||||||||||||||||||||
| 135 | 0 | croak 'Invalid billing_contact_id specified'; | |||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||
| 137 | ## use critic | ||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | 0 | croak $_; | |||||||||||||||||||||||||||
| 140 | 0 | }; | |||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||
| 143 | sub enable_domain_lock_by_id { | ||||||||||||||||||||||||||||
| 144 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
enable_domain_lock_by_id: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 145 | 0 | my ( $domain_id ) = pos_validated_list( \@_, { isa => Int } ); | |||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | return try { | ||||||||||||||||||||||||||||
| 148 | 0 | ▶ | $self->submit({ | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 149 | method => 'domains__enable_theft_protection', | ||||||||||||||||||||||||||||
| 150 | params => { | ||||||||||||||||||||||||||||
| 151 | 'order-id' => $domain_id, | ||||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||
| 153 | }); | ||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||
| 155 | 0 | return $self->get_domain_by_id( $domain_id ); | |||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||
| 157 | catch { | ||||||||||||||||||||||||||||
| 158 | 0 | ▶ | if( $_ =~ m/^No Entity found for Entityid/ ) { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 159 | 0 | croak 'No such domain'; | |||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||
| 162 | 0 | croak $_; | |||||||||||||||||||||||||||
| 163 | 0 | }; | |||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||
| 166 | sub disable_domain_lock_by_id { | ||||||||||||||||||||||||||||
| 167 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
disable_domain_lock_by_id: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 168 | 0 | my ( $domain_id ) = pos_validated_list( \@_, { isa => Int } ); | |||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||
| 170 | return try { | ||||||||||||||||||||||||||||
| 171 | 0 | ▶ | $self->submit({ | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 172 | method => 'domains__disable_theft_protection', | ||||||||||||||||||||||||||||
| 173 | params => { | ||||||||||||||||||||||||||||
| 174 | 'order-id' => $domain_id, | ||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||
| 176 | }); | ||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | 0 | return $self->get_domain_by_id( $domain_id ); | |||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||
| 180 | catch { | ||||||||||||||||||||||||||||
| 181 | 0 | ▶ | if( $_ =~ m/^No Entity found for Entityid/ ) { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 182 | 0 | croak 'No such domain'; | |||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||
| 185 | 0 | croak $_; | |||||||||||||||||||||||||||
| 186 | 0 | }; | |||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||
| 189 | sub enable_domain_privacy { | ||||||||||||||||||||||||||||
| 190 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
enable_domain_privacy: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 191 | 0 | my ( %args ) = validated_hash( | |||||||||||||||||||||||||||
| 192 | \@_, | ||||||||||||||||||||||||||||
| 193 | id => { isa => Int }, | ||||||||||||||||||||||||||||
| 194 | reason => { isa => Str, optional => 1 }, | ||||||||||||||||||||||||||||
| 195 | ); | ||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | 0 | ▶ | $args{reason} //= 'Enabling Domain Privacy'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$args{"reason"} //= "Enabling Domain Privacy"
MC/DC0%0/1
$args{"reason"} //= "Enabling Domain Privacy"
$args{"reason"}
Truth table0%0/2
A
A= $args{"reason"}
| |||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||
| 199 | return $self->_set_domain_privacy( | ||||||||||||||||||||||||||||
| 200 | id => $args{id}, | ||||||||||||||||||||||||||||
| 201 | status => 1, | ||||||||||||||||||||||||||||
| 202 | reason => $args{reason}, | ||||||||||||||||||||||||||||
| 203 | 0 | ); | |||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||
| 206 | sub disable_domain_privacy { | ||||||||||||||||||||||||||||
| 207 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
disable_domain_privacy: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 208 | 0 | my ( %args ) = validated_hash( | |||||||||||||||||||||||||||
| 209 | \@_, | ||||||||||||||||||||||||||||
| 210 | id => { isa => Int }, | ||||||||||||||||||||||||||||
| 211 | reason => { isa => Str, optional => 1 }, | ||||||||||||||||||||||||||||
| 212 | ); | ||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||
| 214 | 0 | ▶ | $args{reason} //= 'Disabling Domain Privacy'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$args{"reason"} //= "Disabling Domain Privacy"
MC/DC0%0/1
$args{"reason"} //= "Disabling Domain Privacy"
$args{"reason"}
Truth table0%0/2
A
A= $args{"reason"}
| |||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||
| 216 | return try { | ||||||||||||||||||||||||||||
| 217 | return $self->_set_domain_privacy( | ||||||||||||||||||||||||||||
| 218 | id => $args{id}, | ||||||||||||||||||||||||||||
| 219 | status => 0, | ||||||||||||||||||||||||||||
| 220 | reason => $args{reason}, | ||||||||||||||||||||||||||||
| 221 | 0 | ▶ | ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||
| 223 | catch { | ||||||||||||||||||||||||||||
| 224 | 0 | ▶ | if( $_ =~ m/^Privacy Protection not Purchased/ ) { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 225 | 0 | return $self->get_domain_by_id( $args{id} ); | |||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||
| 228 | 0 | croak $_; | |||||||||||||||||||||||||||
| 229 | 0 | }; | |||||||||||||||||||||||||||
| 230 | } | ||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||
| 232 | sub _set_domain_privacy { | ||||||||||||||||||||||||||||
| 233 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
_set_domain_privacy: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 234 | 0 | my ( %args ) = validated_hash( | |||||||||||||||||||||||||||
| 235 | \@_, | ||||||||||||||||||||||||||||
| 236 | id => { isa => Int }, | ||||||||||||||||||||||||||||
| 237 | status => { isa => Bool }, | ||||||||||||||||||||||||||||
| 238 | reason => { isa => Str }, | ||||||||||||||||||||||||||||
| 239 | ); | ||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||
| 241 | return try { | ||||||||||||||||||||||||||||
| 242 | $self->submit({ | ||||||||||||||||||||||||||||
| 243 | method => 'domains__modify_privacy_protection', | ||||||||||||||||||||||||||||
| 244 | params => { | ||||||||||||||||||||||||||||
| 245 | 'order-id' => $args{id}, | ||||||||||||||||||||||||||||
| 246 | 'protect-privacy' => $args{status} ? 'true' : 'false', | ||||||||||||||||||||||||||||
| 247 | 'reason' => $args{reason}, | ||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||
| 249 | 0 | ▶ | }); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||
| 251 | 0 | return $self->get_domain_by_id( $args{id} ); | |||||||||||||||||||||||||||
| 252 | } | ||||||||||||||||||||||||||||
| 253 | catch { | ||||||||||||||||||||||||||||
| 254 | 0 | ▶ | if( $_ =~ m/^No Entity found for Entityid/ ) { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 255 | 0 | croak 'No such domain'; | |||||||||||||||||||||||||||
| 256 | } | ||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||
| 258 | 0 | croak $_; | |||||||||||||||||||||||||||
| 259 | 0 | }; | |||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||
| 262 | sub update_domain_nameservers { | ||||||||||||||||||||||||||||
| 263 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
update_domain_nameservers: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 264 | 0 | my ( %args ) = validated_hash( | |||||||||||||||||||||||||||
| 265 | \@_, | ||||||||||||||||||||||||||||
| 266 | id => { isa => Int }, | ||||||||||||||||||||||||||||
| 267 | nameservers => { isa => DomainNames }, | ||||||||||||||||||||||||||||
| 268 | ); | ||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||
| 270 | return try { | ||||||||||||||||||||||||||||
| 271 | $self->submit({ | ||||||||||||||||||||||||||||
| 272 | method => 'domains__modify_ns', | ||||||||||||||||||||||||||||
| 273 | params => { | ||||||||||||||||||||||||||||
| 274 | 'order-id' => $args{id}, | ||||||||||||||||||||||||||||
| 275 | 'ns' => $args{nameservers}, | ||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||
| 277 | 0 | ▶ | }); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 278 | |||||||||||||||||||||||||||||
| 279 | 0 | return $self->get_domain_by_id( $args{id} ); | |||||||||||||||||||||||||||
| 280 | } | ||||||||||||||||||||||||||||
| 281 | catch { | ||||||||||||||||||||||||||||
| 282 | 0 | ▶ | if( $_ =~ m/^No Entity found for Entityid/ ) { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=4 SCAR=30.0
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 283 | 0 | croak 'No such domain'; | |||||||||||||||||||||||||||
| 284 | } | ||||||||||||||||||||||||||||
| 285 | elsif( $_ =~ m/is not a valid Nameserver/ ) { | ||||||||||||||||||||||||||||
| 286 | 0 | croak 'Invalid nameservers provided'; | |||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||
| 288 | elsif( $_ =~ m/Same value for new and old NameServers/ ) { | ||||||||||||||||||||||||||||
| 289 | 0 | return $self->get_domain_by_id( $args{id} ); | |||||||||||||||||||||||||||
| 290 | } | ||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||
| 292 | 0 | croak $_; | |||||||||||||||||||||||||||
| 293 | 0 | }; | |||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||
| 296 | sub renew_domain { | ||||||||||||||||||||||||||||
| 297 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
renew_domain: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 298 | 0 | my ( %args ) = validated_hash( | |||||||||||||||||||||||||||
| 299 | \@_, | ||||||||||||||||||||||||||||
| 300 | id => { isa => Int }, | ||||||||||||||||||||||||||||
| 301 | years => { isa => Int }, | ||||||||||||||||||||||||||||
| 302 | is_private => { isa => Bool, optional => 1 }, | ||||||||||||||||||||||||||||
| 303 | invoice_option => { isa => InvoiceOption, default => 'NoInvoice' }, | ||||||||||||||||||||||||||||
| 304 | ); | ||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||
| 306 | return try { | ||||||||||||||||||||||||||||
| 307 | 0 | ▶ | my $domain = $self->get_domain_by_id( $args{id} ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||
| 308 | |||||||||||||||||||||||||||||
| 309 | 0 | ▶ | if( !$domain ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 310 | 0 | croak 'No such domain'; | |||||||||||||||||||||||||||
| 311 | } | ||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||
| 313 | 0 | ▶ | $domain->status eq 'Deleted' and croak 'Domain is already deleted'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||
| 315 | $self->submit({ | ||||||||||||||||||||||||||||
| 316 | method => 'domains__renew', | ||||||||||||||||||||||||||||
| 317 | params => { | ||||||||||||||||||||||||||||
| 318 | 'order-id' => $args{id}, | ||||||||||||||||||||||||||||
| 319 | 'years' => $args{years}, | ||||||||||||||||||||||||||||
| 320 | 'exp-date' => $domain->expiration_date->epoch, | ||||||||||||||||||||||||||||
| 321 | 'invoice-option' => $args{invoice_option}, | ||||||||||||||||||||||||||||
| 322 | 0 | ▶ | 'purchase-privacy' => $args{is_private} // $domain->is_private, | ||||||||||||||||||||||||||
|
Condition0%0/3
$args{"is_private"} // $domain->is_private
MC/DC0%0/2
$args{"is_private"} // $domain->is_private
$args{"is_private"}
$domain->is_private
Truth table0%0/3
A // B
A= $args{"is_private"}B= $domain->is_private
| |||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||
| 324 | }); | ||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||
| 326 | 0 | return $self->get_domain_by_id( $args{id} ); | |||||||||||||||||||||||||||
| 327 | } | ||||||||||||||||||||||||||||
| 328 | catch { | ||||||||||||||||||||||||||||
| 329 | 0 | ▶ | if( $_ =~ m/^No Entity found for Entityid/ ) { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 330 | 0 | croak 'No such domain'; | |||||||||||||||||||||||||||
| 331 | } | ||||||||||||||||||||||||||||
| 332 | elsif( $_ =~ m/A Domain Name cannot be extended beyond/ ) { | ||||||||||||||||||||||||||||
| 333 | 0 | croak 'Unable to renew, would violate max registration length'; | |||||||||||||||||||||||||||
| 334 | } | ||||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||
| 336 | 0 | croak $_; | |||||||||||||||||||||||||||
| 337 | 0 | }; | |||||||||||||||||||||||||||
| 338 | } | ||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||
| 340 | 37 | 1; | |||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||
| 342 | __END__ | ||||||||||||||||||||||||||||
| 343 | =pod | ||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||
| 345 | =head1 NAME | ||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||
| 347 | WWW::LogicBoxes::Role::Command::Domain - Domain Related Operations | ||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||
| 349 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||
| 351 | use WWW::LogicBoxes; | ||||||||||||||||||||||||||||
| 352 | use WWW::LogicBoxes::Contact; | ||||||||||||||||||||||||||||
| 353 | use WWW::LogicBoxes::Domain; | ||||||||||||||||||||||||||||
| 354 | |||||||||||||||||||||||||||||
| 355 | my $logic_boxes = WWW::LogicBoxes->new( ... ); | ||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||
| 357 | # Retrieval | ||||||||||||||||||||||||||||
| 358 | my $domain = $logic_boxes->get_domain_by_id( 42 ); | ||||||||||||||||||||||||||||
| 359 | my $domain = $logic_boxes->get_domain_by_domain( 'test-domain.com' ); | ||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||
| 361 | # Update Contacts | ||||||||||||||||||||||||||||
| 362 | my $contacts = { | ||||||||||||||||||||||||||||
| 363 | registrant_contact => WWW::LogicBoxes::Contact->new( ... ), | ||||||||||||||||||||||||||||
| 364 | admin_contact => WWW::LogicBoxes::Contact->new( ... ), | ||||||||||||||||||||||||||||
| 365 | technical_contact => WWW::LogicBoxes::Contact->new( ... ), | ||||||||||||||||||||||||||||
| 366 | billing_contact => WWW::LogicBoxes::Contact->new( ... ), | ||||||||||||||||||||||||||||
| 367 | }; | ||||||||||||||||||||||||||||
| 368 | |||||||||||||||||||||||||||||
| 369 | $logic_boxes->update_domain_contacts( | ||||||||||||||||||||||||||||
| 370 | id => $domain->id, | ||||||||||||||||||||||||||||
| 371 | registrant_contact_id => $contacts->{registrant_contact}->id, | ||||||||||||||||||||||||||||
| 372 | admin_contact_id => $contacts->{admin_contact}->id, | ||||||||||||||||||||||||||||
| 373 | technical_contact_id => $contacts->{technical_contact}->id, | ||||||||||||||||||||||||||||
| 374 | billing_contact_id => $contacts->{billing_contact}->id, | ||||||||||||||||||||||||||||
| 375 | ); | ||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||
| 377 | # Domain Locking | ||||||||||||||||||||||||||||
| 378 | $logic_boxes->enable_domain_lock_by_id( $domain->id ); | ||||||||||||||||||||||||||||
| 379 | $logic_boxes->disable_domain_lock_by_id( $domain->id ); | ||||||||||||||||||||||||||||
| 380 | |||||||||||||||||||||||||||||
| 381 | # Domain Privacy | ||||||||||||||||||||||||||||
| 382 | $logic_boxes->enable_domain_privacy( | ||||||||||||||||||||||||||||
| 383 | id => $domain->id, | ||||||||||||||||||||||||||||
| 384 | reason => 'Enabling Domain Privacy', | ||||||||||||||||||||||||||||
| 385 | ); | ||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||
| 387 | $logic_boxes->disable_domain_privacy( | ||||||||||||||||||||||||||||
| 388 | id => $domain->id, | ||||||||||||||||||||||||||||
| 389 | reason => 'Disabling Domain Privacy', | ||||||||||||||||||||||||||||
| 390 | ); | ||||||||||||||||||||||||||||
| 391 | |||||||||||||||||||||||||||||
| 392 | # Nameservers | ||||||||||||||||||||||||||||
| 393 | $logic_boxes->update_domain_nameservers( | ||||||||||||||||||||||||||||
| 394 | id => $domain->id, | ||||||||||||||||||||||||||||
| 395 | nameservers => [ 'ns1.logicboxes.com', 'ns1.logicboxes.com' ], | ||||||||||||||||||||||||||||
| 396 | ); | ||||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||
| 398 | # Renewals | ||||||||||||||||||||||||||||
| 399 | $logic_boxes->renew_domain( | ||||||||||||||||||||||||||||
| 400 | id => $domain->id, | ||||||||||||||||||||||||||||
| 401 | years => 1, | ||||||||||||||||||||||||||||
| 402 | is_private => 1, | ||||||||||||||||||||||||||||
| 403 | invoice_option => 'NoInvoice', | ||||||||||||||||||||||||||||
| 404 | ); | ||||||||||||||||||||||||||||
| 405 | |||||||||||||||||||||||||||||
| 406 | =head1 REQUIRES | ||||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||
| 408 | submit | ||||||||||||||||||||||||||||
| 409 | |||||||||||||||||||||||||||||
| 410 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 411 | |||||||||||||||||||||||||||||
| 412 | Implements domain related operations with the L<LogicBoxes's|http://www.logicboxes.com> API. | ||||||||||||||||||||||||||||
| 413 | |||||||||||||||||||||||||||||
| 414 | =head2 See Also | ||||||||||||||||||||||||||||
| 415 | |||||||||||||||||||||||||||||
| 416 | =over 4 | ||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||
| 418 | =item For Domain Registration please see L<WWW::LogicBoxes::Role::Command::Domain::Registration> | ||||||||||||||||||||||||||||
| 419 | |||||||||||||||||||||||||||||
| 420 | =item For Domain Availability please see L<WWW::LogicBoxes::Role::Command::Domain::Availability> | ||||||||||||||||||||||||||||
| 421 | |||||||||||||||||||||||||||||
| 422 | =item For Private Nameservers please see L<WWW::LogicBoxes::Role::Command::Domain::PrivateNameServer> | ||||||||||||||||||||||||||||
| 423 | |||||||||||||||||||||||||||||
| 424 | =back | ||||||||||||||||||||||||||||
| 425 | |||||||||||||||||||||||||||||
| 426 | =head1 METHODS | ||||||||||||||||||||||||||||
| 427 | |||||||||||||||||||||||||||||
| 428 | =head2 get_domain_by_id | ||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||
| 430 | use WWW::LogicBoxes; | ||||||||||||||||||||||||||||
| 431 | use WWW::LogicBoxes::Domain; | ||||||||||||||||||||||||||||
| 432 | |||||||||||||||||||||||||||||
| 433 | my $logic_boxes = WWW::LogicBoxes->new( ... ); | ||||||||||||||||||||||||||||
| 434 | my $domain = $logic_boxes->get_domain_by_id( 42 ); | ||||||||||||||||||||||||||||
| 435 | |||||||||||||||||||||||||||||
| 436 | Given a Integer L<domain|WWW::LogicBoxes::Domain> id, returns a matching L<WWW::LogicBoxes::Domain> from L<LogicBoxes|http://www.logicobxes.com>. In the event of no matching L<domain|WWW::LogicBoxes::Domain>, returns undef. | ||||||||||||||||||||||||||||
| 437 | |||||||||||||||||||||||||||||
| 438 | B<NOTE> For domain transfers that are in progress a L<domain_transfer|WWW::LogicBoxes::DomainTransfer> record will be returned. | ||||||||||||||||||||||||||||
| 439 | |||||||||||||||||||||||||||||
| 440 | =head2 get_domain_by_name | ||||||||||||||||||||||||||||
| 441 | |||||||||||||||||||||||||||||
| 442 | use WWW::LogicBoxes; | ||||||||||||||||||||||||||||
| 443 | use WWW::LogicBoxes::Domain; | ||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||
| 445 | my $logic_boxes = WWW::LogicBoxes->new( ... ); | ||||||||||||||||||||||||||||
| 446 | my $domain = $logic_boxes->get_domain_by_domain( 'test-domain.com' ); | ||||||||||||||||||||||||||||
| 447 | |||||||||||||||||||||||||||||
| 448 | Given a full L<domain|WWW::LogicBoxes::Domain> name, returns a matching L<WWW::LogicBoxes::Domain> from L<LogicBoxes|http://www.logicobxes.com>. In the event of no matching L<domain|WWW::LogicBoxes::Domain>, returns undef, | ||||||||||||||||||||||||||||
| 449 | |||||||||||||||||||||||||||||
| 450 | B<NOTE> For domain transfers that are in progress a L<domain_transfer|WWW::LogicBoxes::DomainTransfer> record will be returned. | ||||||||||||||||||||||||||||
| 451 | |||||||||||||||||||||||||||||
| 452 | =head2 update_domain_contacts | ||||||||||||||||||||||||||||
| 453 | |||||||||||||||||||||||||||||
| 454 | use WWW::LogicBoxes; | ||||||||||||||||||||||||||||
| 455 | use WWW::LogicBoxes::Contact; | ||||||||||||||||||||||||||||
| 456 | use WWW::LogicBoxes::Domain; | ||||||||||||||||||||||||||||
| 457 | |||||||||||||||||||||||||||||
| 458 | my $logic_boxes = WWW::LogicBoxes->new( ... ); | ||||||||||||||||||||||||||||
| 459 | |||||||||||||||||||||||||||||
| 460 | # Update Contacts | ||||||||||||||||||||||||||||
| 461 | my $contacts = { | ||||||||||||||||||||||||||||
| 462 | registrant_contact => WWW::LogicBoxes::Contact->new( ... ), | ||||||||||||||||||||||||||||
| 463 | admin_contact => WWW::LogicBoxes::Contact->new( ... ), | ||||||||||||||||||||||||||||
| 464 | technical_contact => WWW::LogicBoxes::Contact->new( ... ), | ||||||||||||||||||||||||||||
| 465 | billing_contact => WWW::LogicBoxes::Contact->new( ... ), | ||||||||||||||||||||||||||||
| 466 | }; | ||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||
| 468 | $logic_boxes->update_domain_contacts( | ||||||||||||||||||||||||||||
| 469 | id => $domain->id, | ||||||||||||||||||||||||||||
| 470 | registrant_contact_id => $contacts->{registrant_contact}->id, | ||||||||||||||||||||||||||||
| 471 | admin_contact_id => $contacts->{admin_contact}->id, | ||||||||||||||||||||||||||||
| 472 | technical_contact_id => $contacts->{technical_contact}->id, | ||||||||||||||||||||||||||||
| 473 | billing_contact_id => $contacts->{billing_contact}->id, | ||||||||||||||||||||||||||||
| 474 | ); | ||||||||||||||||||||||||||||
| 475 | |||||||||||||||||||||||||||||
| 476 | Given a L<domain|WWW::LogicBoxes::Domain> id and optionally a L<contact|WWW::LogicBoxes::Contact> id for registrant_contact_id, admin_contact_id, technical_contact_id, and/or billing_contact_id, updates the L<domain|WWW::LogicBoxes::Domain> contacts. This method is smart enough to not request a change if the contact hasn't been updated and consumers need only specify the elements that are changing. | ||||||||||||||||||||||||||||
| 477 | |||||||||||||||||||||||||||||
| 478 | =head2 enable_domain_lock_by_id | ||||||||||||||||||||||||||||
| 479 | |||||||||||||||||||||||||||||
| 480 | use WWW::LogicBoxes; | ||||||||||||||||||||||||||||
| 481 | use WWW::LogicBoxes::Domain; | ||||||||||||||||||||||||||||
| 482 | |||||||||||||||||||||||||||||
| 483 | my $logic_boxes = WWW::LogicBoxes->new( ... ); | ||||||||||||||||||||||||||||
| 484 | $logic_boxes->enable_domain_lock_by_id( $domain->id ); | ||||||||||||||||||||||||||||
| 485 | |||||||||||||||||||||||||||||
| 486 | Given an Integer L<domain|WWW::LogicBoxes::Domain> id, locks the L<domain|WWW::LogicBoxes::Domain> so that it can not be transfered away. | ||||||||||||||||||||||||||||
| 487 | |||||||||||||||||||||||||||||
| 488 | =head2 disable_domain_lock_by_id | ||||||||||||||||||||||||||||
| 489 | |||||||||||||||||||||||||||||
| 490 | use WWW::LogicBoxes; | ||||||||||||||||||||||||||||
| 491 | use WWW::LogicBoxes::Domain; | ||||||||||||||||||||||||||||
| 492 | |||||||||||||||||||||||||||||
| 493 | my $logic_boxes = WWW::LogicBoxes->new( ... ); | ||||||||||||||||||||||||||||
| 494 | $logic_boxes->disable_domain_lock_by_id( $domain->id ); | ||||||||||||||||||||||||||||
| 495 | |||||||||||||||||||||||||||||
| 496 | Given an Integer L<domain|WWW::LogicBoxes::Domain> id, unlocks the L<domain|WWW::LogicBoxes::Domain> so that it can be transfered away. | ||||||||||||||||||||||||||||
| 497 | |||||||||||||||||||||||||||||
| 498 | =head2 enable_domain_privacy | ||||||||||||||||||||||||||||
| 499 | |||||||||||||||||||||||||||||
| 500 | use WWW::LogicBoxes; | ||||||||||||||||||||||||||||
| 501 | use WWW::LogicBoxes::Domain; | ||||||||||||||||||||||||||||
| 502 | |||||||||||||||||||||||||||||
| 503 | my $logic_boxes = WWW::LogicBoxes->new( ... ); | ||||||||||||||||||||||||||||
| 504 | $logic_boxes->enable_domain_privacy( | ||||||||||||||||||||||||||||
| 505 | id => $domain->id, | ||||||||||||||||||||||||||||
| 506 | reason => 'Enabling Domain Privacy', | ||||||||||||||||||||||||||||
| 507 | ); | ||||||||||||||||||||||||||||
| 508 | |||||||||||||||||||||||||||||
| 509 | Given an Integer L<domain|WWW::LogicBoxes::Domain> id and an optional reason ( defaults to "Enabling Domain Privacy" ), enables WHOIS Privacy Protect for the L<domain|WWW::LogicBoxes::Domain>. | ||||||||||||||||||||||||||||
| 510 | |||||||||||||||||||||||||||||
| 511 | =head2 disable_domain_privacy | ||||||||||||||||||||||||||||
| 512 | |||||||||||||||||||||||||||||
| 513 | use WWW::LogicBoxes; | ||||||||||||||||||||||||||||
| 514 | use WWW::LogicBoxes::Domain; | ||||||||||||||||||||||||||||
| 515 | |||||||||||||||||||||||||||||
| 516 | my $logic_boxes = WWW::LogicBoxes->new( ... ); | ||||||||||||||||||||||||||||
| 517 | $logic_boxes->disable_domain_privacy( | ||||||||||||||||||||||||||||
| 518 | id => $domain->id, | ||||||||||||||||||||||||||||
| 519 | reason => 'Disabling Domain Privacy', | ||||||||||||||||||||||||||||
| 520 | ); | ||||||||||||||||||||||||||||
| 521 | |||||||||||||||||||||||||||||
| 522 | Given an Integer L<domain|WWW::LogicBoxes::Domain> id and an optional reason ( defaults to "Disabling Domain Privacy" ), disabled WHOIS Privacy Protect for the L<domain|WWW::LogicBoxes::Domain>. | ||||||||||||||||||||||||||||
| 523 | |||||||||||||||||||||||||||||
| 524 | =head2 update_domain_nameservers | ||||||||||||||||||||||||||||
| 525 | |||||||||||||||||||||||||||||
| 526 | use WWW::LogicBoxes; | ||||||||||||||||||||||||||||
| 527 | use WWW::LogicBoxes::Domain; | ||||||||||||||||||||||||||||
| 528 | |||||||||||||||||||||||||||||
| 529 | my $logic_boxes = WWW::LogicBoxes->new( ... ); | ||||||||||||||||||||||||||||
| 530 | $logic_boxes->update_domain_nameservers( | ||||||||||||||||||||||||||||
| 531 | id => $domain->id, | ||||||||||||||||||||||||||||
| 532 | nameservers => [ 'ns1.logicboxes.com', 'ns1.logicboxes.com' ], | ||||||||||||||||||||||||||||
| 533 | ); | ||||||||||||||||||||||||||||
| 534 | |||||||||||||||||||||||||||||
| 535 | Given an Integer L<domain|WWW::LogicBoxes::Domain> id and an ArrayRef of nameserver hostnames, sets the L<domain|WWW::LogicBoxes::Domain>'s authoritative nameservers. | ||||||||||||||||||||||||||||
| 536 | |||||||||||||||||||||||||||||
| 537 | =head2 renew_domain | ||||||||||||||||||||||||||||
| 538 | |||||||||||||||||||||||||||||
| 539 | use WWW::LogicBoxes; | ||||||||||||||||||||||||||||
| 540 | use WWW::LogicBooxes::Domain; | ||||||||||||||||||||||||||||
| 541 | |||||||||||||||||||||||||||||
| 542 | my $logic_boxes = WWW::LogicBoxe->new( ... ); | ||||||||||||||||||||||||||||
| 543 | $logic_boxes->renew_domain( | ||||||||||||||||||||||||||||
| 544 | id => $domain->id, | ||||||||||||||||||||||||||||
| 545 | years => 1, | ||||||||||||||||||||||||||||
| 546 | is_private => 1, | ||||||||||||||||||||||||||||
| 547 | invoice_option => 'NoInvoice', | ||||||||||||||||||||||||||||
| 548 | ); | ||||||||||||||||||||||||||||
| 549 | |||||||||||||||||||||||||||||
| 550 | Extends the registration term for the specified domain by the specified number of years. Note, there is a limit as to how far into the future the expiration_date can be and it's specific to each TLD, see L<http://manage.logicboxes.com/kb/servlet/KBServlet/faq1375.html> for details. | ||||||||||||||||||||||||||||
| 551 | |||||||||||||||||||||||||||||
| 552 | Arguments: | ||||||||||||||||||||||||||||
| 553 | |||||||||||||||||||||||||||||
| 554 | =over 4 | ||||||||||||||||||||||||||||
| 555 | |||||||||||||||||||||||||||||
| 556 | =item id | ||||||||||||||||||||||||||||
| 557 | |||||||||||||||||||||||||||||
| 558 | The domain id to renew | ||||||||||||||||||||||||||||
| 559 | |||||||||||||||||||||||||||||
| 560 | =item years | ||||||||||||||||||||||||||||
| 561 | |||||||||||||||||||||||||||||
| 562 | The number of years | ||||||||||||||||||||||||||||
| 563 | |||||||||||||||||||||||||||||
| 564 | =item is_private | ||||||||||||||||||||||||||||
| 565 | |||||||||||||||||||||||||||||
| 566 | This is optional, if not specified then the current privacy status of the domain will be used. If there is no charge for domain privacy in your reseller panel then this field doesn't really matter. However, if there is a cost for it and you don't pass is_private => 1 then the domain privacy will be cancelled since it's term will not match the registration term. | ||||||||||||||||||||||||||||
| 567 | |||||||||||||||||||||||||||||
| 568 | =item invoice_option | ||||||||||||||||||||||||||||
| 569 | |||||||||||||||||||||||||||||
| 570 | See L<WWW::LogicBoxes::DomainRequest/invoice_option> for additional details about Invoicing Options. Defaults to NoInvoice. | ||||||||||||||||||||||||||||
| 571 | |||||||||||||||||||||||||||||
| 572 | =back | ||||||||||||||||||||||||||||
| 573 | |||||||||||||||||||||||||||||
| 574 | Returns an instance of the domain object. | ||||||||||||||||||||||||||||
| 575 | |||||||||||||||||||||||||||||
| 576 | =cut | ||||||||||||||||||||||||||||