File Coverage

blib/lib/Net/EPP/Frame/Command/Transfer/Domain.pm
Criterion Covered Total %
statement 9 31 29.0
branch n/a
condition n/a
subroutine 3 7 42.8
pod 1 4 25.0
total 13 42 30.9


line stmt bran cond sub pod time code
1             package Net::EPP::Frame::Command::Transfer::Domain;
2 1     1   7 use base qw(Net::EPP::Frame::Command::Transfer);
  1         4  
  1         139  
3 1     1   8 use Net::EPP::Frame::ObjectSpec;
  1         1  
  1         29  
4 1     1   6 use strict;
  1         2  
  1         532  
5              
6             =pod
7              
8             =head1 NAME
9              
10             Net::EPP::Frame::Command::Transfer::Domain - an instance of L
11             for domain objects.
12              
13             =head1 SYNOPSIS
14              
15             use Net::EPP::Frame::Command::Transfer::Domain;
16             use strict;
17              
18             my $info = Net::EPP::Frame::Command::Transfer::Domain->new;
19             $info->setOp('query');
20             $info->setDomain('example.tld');
21              
22             print $info->toString(1);
23              
24             This results in an XML document like this:
25              
26            
27            
28             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
29             xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
30             epp-1.0.xsd">
31            
32            
33            
34             xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
35             xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0
36             domain-1.0.xsd">
37             example.tldE/domain:name>
38            
39            
40             0cf1b8f7e14547d26f03b7641660c641d9e79f45
41            
42            
43              
44             =head1 OBJECT HIERARCHY
45              
46             L
47             +----L
48             +----L
49             +----L
50             +----L
51             +----L
52              
53             =cut
54              
55             sub new {
56 0     0 1   my $package = shift;
57 0           my $self = bless($package->SUPER::new('transfer'), $package);
58              
59 0           my $domain = $self->addObject(Net::EPP::Frame::ObjectSpec->spec('domain'));
60              
61 0           return $self;
62             }
63              
64             =pod
65              
66             =head1 METHODS
67              
68             $frame->setDomain('example.tld');
69              
70             This method specifies the domain name for the transfer.
71              
72             =cut
73              
74             sub setDomain {
75 0     0 0   my ($self, $domain) = @_;
76              
77 0           my $name = $self->createElement('domain:name');
78 0           $name->appendText($domain);
79              
80 0           $self->getNode('transfer')->getChildNodes->shift->appendChild($name);
81              
82 0           return 1;
83             }
84              
85             =pod
86              
87             $frame->period($years);
88              
89             This sets the optional renewal period for the transfer.
90              
91             =cut
92              
93             sub setPeriod {
94 0     0 0   my ($self, $years) = @_;
95              
96 0           my $period = $self->createElement('domain:period');
97 0           $period->setAttribute('unit', 'y');
98 0           $period->appendText($years);
99              
100 0           $self->getNode('transfer')->getChildNodes->shift->appendChild($period);
101              
102 0           return 1;
103             }
104              
105             =pod
106              
107             $frame->setAuthInfo($pw);
108              
109             This sets the authInfo code for the transfer.
110              
111             =cut
112              
113             sub setAuthInfo {
114 0     0 0   my ($self, $code) = @_;
115              
116 0           my $pw = $self->createElement('domain:pw');
117 0           $pw->appendText($code);
118              
119 0           my $authInfo = $self->createElement('domain:authInfo');
120 0           $authInfo->appendChild($pw);
121              
122 0           $self->getNode('transfer')->getChildNodes->shift->appendChild($authInfo);
123              
124 0           return 1;
125             }
126              
127             1;