line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::DigitalOcean::Role::DomainRecords; |
2
|
|
|
|
|
|
|
# ABSTRACT: Domain Records role for DigitalOcean WebService |
3
|
2
|
|
|
2
|
|
1091
|
use utf8; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
15
|
|
4
|
2
|
|
|
2
|
|
49
|
use Moo::Role; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
12
|
|
5
|
2
|
|
|
2
|
|
532
|
use feature 'state'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
150
|
|
6
|
2
|
|
|
2
|
|
7
|
use Types::Standard qw/Str Int Object Dict Optional/; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
12
|
|
7
|
2
|
|
|
2
|
|
1135
|
use Type::Utils; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
10
|
|
8
|
2
|
|
|
2
|
|
1687
|
use Type::Params qw/compile/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
9
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires 'make_request'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.025'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub domain_record_create { |
15
|
0
|
|
|
0
|
1
|
|
state $check = compile(Object, |
16
|
|
|
|
|
|
|
Dict[ |
17
|
|
|
|
|
|
|
domain => Str, |
18
|
|
|
|
|
|
|
type => Str, |
19
|
|
|
|
|
|
|
name => Optional[Str], |
20
|
|
|
|
|
|
|
data => Optional[Str], |
21
|
|
|
|
|
|
|
priority => Optional[Int], |
22
|
|
|
|
|
|
|
port => Optional[Int], |
23
|
|
|
|
|
|
|
weight => Optional[Int], |
24
|
|
|
|
|
|
|
], |
25
|
|
|
|
|
|
|
); |
26
|
0
|
|
|
|
|
|
my ($self, $opts) = $check->(@_); |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $domain = delete $opts->{domain}; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return $self->make_request(POST => "/domains/$domain/records", $opts); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub domain_record_list { |
34
|
0
|
|
|
0
|
1
|
|
state $check = compile(Object, Str); |
35
|
0
|
|
|
|
|
|
my ($self, $domain) = $check->(@_); |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
return $self->make_request(GET => "/domains/$domain/records"); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub domain_record_get { |
41
|
0
|
|
|
0
|
1
|
|
state $check = compile(Object, |
42
|
|
|
|
|
|
|
Dict[ |
43
|
|
|
|
|
|
|
domain => Str, |
44
|
|
|
|
|
|
|
id => Int, |
45
|
|
|
|
|
|
|
], |
46
|
|
|
|
|
|
|
); |
47
|
0
|
|
|
|
|
|
my ($self, $opts) = $check->(@_); |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
return $self->make_request(GET => "/domains/$opts->{domain}/records/$opts->{id}"); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub domain_record_delete { |
53
|
0
|
|
|
0
|
1
|
|
state $check = compile(Object, |
54
|
|
|
|
|
|
|
Dict[ |
55
|
|
|
|
|
|
|
domain => Str, |
56
|
|
|
|
|
|
|
id => Int, |
57
|
|
|
|
|
|
|
], |
58
|
|
|
|
|
|
|
); |
59
|
0
|
|
|
|
|
|
my ($self, $opts) = $check->(@_); |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
return $self->make_request(DELETE => "/domains/$opts->{domain}/records/$opts->{id}"); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# TODO: |
65
|
|
|
|
|
|
|
# domain_record_update |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=pod |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=encoding UTF-8 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 NAME |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
WebService::DigitalOcean::Role::DomainRecords - Domain Records role for DigitalOcean WebService |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 VERSION |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
version 0.025 |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 DESCRIPTION |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Implements the domain records methods. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 METHODS |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head2 domain_record_create |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 domain_record_delete |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 domain_record_get |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head2 domain_record_list |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
See main documentation in L<WebService::DigitalOcean>. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 AUTHOR |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
André Walker <andre@cpan.org> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
This software is Copyright (c) 2015 by André Walker. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
This is free software, licensed under: |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
The GNU General Public License, Version 2, June 1991 |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |