| 1 | package Webservice::OVH::Order::Domain::Zone; | ||||||||||||
| 2 | |||||||||||||
| 3 | =encoding utf-8 | ||||||||||||
| 4 | |||||||||||||
| 5 | =head1 NAME | ||||||||||||
| 6 | |||||||||||||
| 7 | Webservice::OVH::Order::Domain::Zone | ||||||||||||
| 8 | |||||||||||||
| 9 | =head1 SYNOPSIS | ||||||||||||
| 10 | |||||||||||||
| 11 | use Webservice::OVH; | ||||||||||||
| 12 | |||||||||||||
| 13 | my $ovh = Webservice::OVH->new_from_json("credentials.json"); | ||||||||||||
| 14 | |||||||||||||
| 15 | my $existing_zones = $ovh->order->domain->zone->existing; | ||||||||||||
| 16 | |||||||||||||
| 17 | =head1 DESCRIPTION | ||||||||||||
| 18 | |||||||||||||
| 19 | Provides the possibility to order domain zones only. | ||||||||||||
| 20 | |||||||||||||
| 21 | =head1 METHODS | ||||||||||||
| 22 | |||||||||||||
| 23 | =cut | ||||||||||||
| 24 | |||||||||||||
| 25 | 36 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 26 | 36 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 27 | 36 | ▶ | use Carp qw{ carp croak }; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 28 | |||||||||||||
| 29 | 36 | our $VERSION = 0.48; | |||||||||||
| 30 | |||||||||||||
| 31 | 36 | ▶ | use Webservice::OVH::Me::Order; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 32 | |||||||||||||
| 33 | =head2 _new | ||||||||||||
| 34 | |||||||||||||
| 35 | Internal Method to create the Zone object. | ||||||||||||
| 36 | This method is not ment to be called directly. | ||||||||||||
| 37 | |||||||||||||
| 38 | =over | ||||||||||||
| 39 | |||||||||||||
| 40 | =item * Parameter: $api_wrapper - ovh api wrapper object, $module - root object | ||||||||||||
| 41 | |||||||||||||
| 42 | =item * Return: L<Webservice::OVH::Order::Domain::Zone> | ||||||||||||
| 43 | |||||||||||||
| 44 | =item * Synopsis: Webservice::OVH::Order::Domain::Zone->_new($ovh_api_wrapper, $module); | ||||||||||||
| 45 | |||||||||||||
| 46 | =back | ||||||||||||
| 47 | |||||||||||||
| 48 | =cut | ||||||||||||
| 49 | |||||||||||||
| 50 | 0 | ▶ | sub _new { | ||||||||||
|
Subroutine
_new: not called CC=3 SCAR=24.8
| |||||||||||||
| 51 | |||||||||||||
| 52 | 0 | my ( $class, %params ) = @_; | |||||||||||
| 53 | |||||||||||||
| 54 | 0 | ▶ | die "Missing module" unless $params{module}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 55 | 0 | ▶ | die "Missing wrapper" unless $params{wrapper}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 56 | |||||||||||||
| 57 | 0 | my $module = $params{module}; | |||||||||||
| 58 | 0 | my $api_wrapper = $params{wrapper}; | |||||||||||
| 59 | |||||||||||||
| 60 | 0 | my $self = bless { _module => $module, _api_wrapper => $api_wrapper }, $class; | |||||||||||
| 61 | |||||||||||||
| 62 | 0 | return $self; | |||||||||||
| 63 | } | ||||||||||||
| 64 | |||||||||||||
| 65 | =head2 _new | ||||||||||||
| 66 | |||||||||||||
| 67 | Returns an array with all available zones connected to the active account. | ||||||||||||
| 68 | |||||||||||||
| 69 | =over | ||||||||||||
| 70 | |||||||||||||
| 71 | =item * Return: L<ARRAY> | ||||||||||||
| 72 | |||||||||||||
| 73 | =item * Synopsis: my $existing_zones = $ovh->order->domain->zone->existing; | ||||||||||||
| 74 | |||||||||||||
| 75 | =back | ||||||||||||
| 76 | |||||||||||||
| 77 | =cut | ||||||||||||
| 78 | |||||||||||||
| 79 | 0 | ▶ | sub existing { | ||||||||||
|
Subroutine
existing: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 80 | |||||||||||||
| 81 | 0 | my ($self) = @_; | |||||||||||
| 82 | |||||||||||||
| 83 | 0 | my $api = $self->{_api_wrapper}; | |||||||||||
| 84 | |||||||||||||
| 85 | 0 | my $response = $api->rawCall( method => 'get', path => "/order/domain/zone", noSignature => 0 ); | |||||||||||
| 86 | 0 | ▶ | croak $response->error if $response->error; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 87 | |||||||||||||
| 88 | 0 | return $response->content; | |||||||||||
| 89 | } | ||||||||||||
| 90 | |||||||||||||
| 91 | =head2 _new | ||||||||||||
| 92 | |||||||||||||
| 93 | Gets information about a requested zone order. | ||||||||||||
| 94 | |||||||||||||
| 95 | =over | ||||||||||||
| 96 | |||||||||||||
| 97 | =item * Return: HASH | ||||||||||||
| 98 | |||||||||||||
| 99 | =item * Synopsis: my $existing_zones = $ovh->order->domain->zone->existing; | ||||||||||||
| 100 | |||||||||||||
| 101 | =back | ||||||||||||
| 102 | |||||||||||||
| 103 | =cut | ||||||||||||
| 104 | |||||||||||||
| 105 | 0 | ▶ | sub info_order { | ||||||||||
|
Subroutine
info_order: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 106 | |||||||||||||
| 107 | 0 | my ($self) = @_; | |||||||||||
| 108 | |||||||||||||
| 109 | 0 | my $api = $self->{_api_wrapper}; | |||||||||||
| 110 | |||||||||||||
| 111 | 0 | my $response = $api->rawCall( method => 'get', path => "/order/domain/zone/new", noSignature => 0 ); | |||||||||||
| 112 | 0 | ▶ | croak $response->error if $response->error; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 113 | |||||||||||||
| 114 | 0 | return $response->content; | |||||||||||
| 115 | } | ||||||||||||
| 116 | |||||||||||||
| 117 | =head2 _new | ||||||||||||
| 118 | |||||||||||||
| 119 | Gets information about a requested zone order. | ||||||||||||
| 120 | |||||||||||||
| 121 | =over | ||||||||||||
| 122 | |||||||||||||
| 123 | =item * Parameter: $zone_name - desired zone, $minimized - only mandatory record entries | ||||||||||||
| 124 | |||||||||||||
| 125 | =item * Return: L<Webservice::OVH::Me::Order> | ||||||||||||
| 126 | |||||||||||||
| 127 | =item * Synopsis: my $oder = $ovh->order->domain->zone->order('mydomain.de', 'true'); | ||||||||||||
| 128 | |||||||||||||
| 129 | =back | ||||||||||||
| 130 | |||||||||||||
| 131 | =cut | ||||||||||||
| 132 | |||||||||||||
| 133 | 0 | ▶ | sub order { | ||||||||||
|
Subroutine
order: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 134 | |||||||||||||
| 135 | 0 | my ( $self, $zone_name, $minimized ) = @_; | |||||||||||
| 136 | |||||||||||||
| 137 | 0 | ▶ | $minimized ||= 'false'; | ||||||||||
|
Condition0%0/2
$minimized ||= "false"
MC/DC0%0/1
$minimized ||= "false"
$minimized
Truth table0%0/2
A
A= $minimized
| |||||||||||||
| 138 | |||||||||||||
| 139 | 0 | my $api = $self->{_api_wrapper}; | |||||||||||
| 140 | 0 | my $module = $self->{_module}; | |||||||||||
| 141 | |||||||||||||
| 142 | 0 | my $response = $api->rawCall( method => 'post', path => "/order/domain/zone/new", body => { zoneName => $zone_name, minimized => $minimized }, noSignature => 0 ); | |||||||||||
| 143 | 0 | ▶ | croak $response->error if $response->error; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 144 | |||||||||||||
| 145 | 0 | my $order = $module->me->order( $response->content->{orderId} ); | |||||||||||
| 146 | |||||||||||||
| 147 | 0 | return $order; | |||||||||||
| 148 | } | ||||||||||||
| 149 | |||||||||||||
| 150 | =head2 _new | ||||||||||||
| 151 | |||||||||||||
| 152 | Gets available options for the desired zone order. | ||||||||||||
| 153 | |||||||||||||
| 154 | =over | ||||||||||||
| 155 | |||||||||||||
| 156 | =item * Parameter: $zone_name - desired zone | ||||||||||||
| 157 | |||||||||||||
| 158 | =item * Return: HASH | ||||||||||||
| 159 | |||||||||||||
| 160 | =item * Synopsis: my $options = $ovh->order->domain->zone->options('mydomain.de'); | ||||||||||||
| 161 | |||||||||||||
| 162 | =back | ||||||||||||
| 163 | |||||||||||||
| 164 | =cut | ||||||||||||
| 165 | |||||||||||||
| 166 | 0 | ▶ | sub options { | ||||||||||
|
Subroutine
options: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 167 | |||||||||||||
| 168 | 0 | my ( $self, $zone_name ) = @_; | |||||||||||
| 169 | |||||||||||||
| 170 | 0 | my $api = $self->{_api_wrapper}; | |||||||||||
| 171 | |||||||||||||
| 172 | 0 | my $response = $api->rawCall( method => 'get', path => "/order/domain/zone/$zone_name", noSignature => 0 ); | |||||||||||
| 173 | 0 | ▶ | croak $response->error if $response->error; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 174 | |||||||||||||
| 175 | 0 | return $response->content; | |||||||||||
| 176 | } | ||||||||||||
| 177 | |||||||||||||
| 178 | 36 | 1; | |||||||||||