File Coverage

blib/lib/Net/DRI/Protocol/OVH/WS/Account.pm
Criterion Covered Total %
statement 9 25 36.0
branch 0 4 0.0
condition n/a
subroutine 3 6 50.0
pod 0 3 0.0
total 12 38 31.5


line stmt bran cond sub pod time code
1             ## Domain Registry Interface, OVH Web Services Account commands
2             ##
3             ## Copyright (c) 2008,2009,2013 Patrick Mevzek . All rights reserved.
4             ##
5             ## This file is part of Net::DRI
6             ##
7             ## Net::DRI is free software; you can redistribute it and/or modify
8             ## it under the terms of the GNU General Public License as published by
9             ## the Free Software Foundation; either version 2 of the License, or
10             ## (at your option) any later version.
11             ##
12             ## See the LICENSE file that comes with this distribution for more details.
13             #########################################################################################
14              
15             package Net::DRI::Protocol::OVH::WS::Account;
16              
17 1     1   1106 use strict;
  1         3  
  1         26  
18 1     1   12 use warnings;
  1         2  
  1         26  
19              
20 1     1   4 use Net::DRI::Exception;
  1         1  
  1         214  
21              
22             =pod
23              
24             =head1 NAME
25              
26             Net::DRI::Protocol::OVH::WS::Account - OVH Web Services Account commands for Net::DRI
27              
28             =head1 DESCRIPTION
29              
30             Please see the README file for details.
31              
32             =head1 SUPPORT
33              
34             For now, support questions should be sent to:
35              
36             Enetdri@dotandco.comE
37              
38             Please also see the SUPPORT file in the distribution.
39              
40             =head1 SEE ALSO
41              
42             Ehttp://www.dotandco.com/services/software/Net-DRI/E
43              
44             =head1 AUTHOR
45              
46             Patrick Mevzek, Enetdri@dotandco.comE
47              
48             =head1 COPYRIGHT
49              
50             Copyright (c) 2008,2009,2013 Patrick Mevzek .
51             All rights reserved.
52              
53             This program is free software; you can redistribute it and/or modify
54             it under the terms of the GNU General Public License as published by
55             the Free Software Foundation; either version 2 of the License, or
56             (at your option) any later version.
57              
58             See the LICENSE file that comes with this distribution for more details.
59              
60             =cut
61              
62             ####################################################################################################
63              
64             sub register_commands
65             {
66 0     0 0   my ($class,$version)=@_;
67 0           my %tmp=(
68             list_domains => [\&list_domains, \&list_domains_parse ],
69             );
70              
71 0           return { 'account' => \%tmp };
72             }
73              
74             sub list_domains
75             {
76 0     0 0   my ($po)=@_;
77 0           my $msg=$po->message();
78 0           $msg->method('domainList');
79 0           return;
80             }
81              
82             sub list_domains_parse
83             {
84 0     0 0   my ($po,$otype,$oaction,$oname,$rinfo)=@_;
85 0           my $mes=$po->message();
86 0 0         return unless $mes->is_success();
87              
88 0           my $r=$mes->result();
89 0 0         Net::DRI::Exception->die(1,'protocol/ovh/ws',1,'Unexpected reply for domainList: '.$r) unless (ref($r) eq 'MyArrayOfStringType');
90 0           my @r=@$r;
91 0           $rinfo->{account}->{domains}->{action}='list';
92 0           $rinfo->{account}->{domains}->{list}=\@r;
93 0           return;
94             }
95              
96             ####################################################################################################
97             1;