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 0 4 0.0
total 12 42 28.5


line stmt bran cond sub pod time code
1             # Copyright (c) 2016 CentralNic Ltd. All rights reserved. This program is
2             # free software; you can redistribute it and/or modify it under the same
3             # terms as Perl itself.
4             #
5             # $Id: Domain.pm,v 1.1 2011/12/03 11:44:52 gavin Exp $
6             package Net::EPP::Frame::Command::Transfer::Domain;
7 1     1   3 use base qw(Net::EPP::Frame::Command::Transfer);
  1         1  
  1         57  
8 1     1   3 use Net::EPP::Frame::ObjectSpec;
  1         1  
  1         13  
9 1     1   3 use strict;
  1         1  
  1         202  
10              
11              
12             =pod
13              
14             =head1 NAME
15              
16             Net::EPP::Frame::Command::Transfer::Domain - an instance of L
17             for domain objects.
18              
19             =head1 SYNOPSIS
20              
21             use Net::EPP::Frame::Command::Transfer::Domain;
22             use strict;
23              
24             my $info = Net::EPP::Frame::Command::Transfer::Domain->new;
25             $info->setOp('query');
26             $info->setDomain('example.tld');
27              
28             print $info->toString(1);
29              
30             This results in an XML document like this:
31              
32            
33            
34             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
35             xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
36             epp-1.0.xsd">
37            
38            
39            
40             xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
41             xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0
42             domain-1.0.xsd">
43             example.tldE/domain:name>
44            
45            
46             0cf1b8f7e14547d26f03b7641660c641d9e79f45
47            
48            
49              
50             =head1 OBJECT HIERARCHY
51              
52             L
53             +----L
54             +----L
55             +----L
56             +----L
57             +----L
58              
59             =cut
60              
61             sub new {
62 0     0 0   my $package = shift;
63 0           my $self = bless($package->SUPER::new('transfer'), $package);
64              
65 0           my $domain = $self->addObject(Net::EPP::Frame::ObjectSpec->spec('domain'));
66              
67 0           return $self;
68             }
69              
70             =pod
71              
72             =head1 METHODS
73              
74             $frame->setDomain('example.tld');
75              
76             This method specifies the domain name for the transfer.
77              
78             =cut
79              
80             sub setDomain {
81 0     0 0   my ($self, $domain) = @_;
82              
83 0           my $name = $self->createElement('domain:name');
84 0           $name->appendText($domain);
85              
86 0           $self->getNode('transfer')->getChildNodes->shift->appendChild($name);
87              
88 0           return 1;
89             }
90              
91              
92             =pod
93              
94             $frame->period($years);
95              
96             This sets the optional renewal period for the transfer.
97              
98             =cut
99              
100             sub setPeriod {
101 0     0 0   my ($self, $years) = @_;
102              
103 0           my $period = $self->createElement('domain:period');
104 0           $period->setAttribute('unit', 'y');
105 0           $period->appendText($years);
106              
107 0           $self->getNode('transfer')->getChildNodes->shift->appendChild($period);
108              
109 0           return 1;
110             }
111              
112             =pod
113              
114             $frame->setAuthInfo($pw);
115              
116             This sets the authInfo code for the transfer.
117              
118             =cut
119              
120             sub setAuthInfo {
121 0     0 0   my ($self, $code) = @_;
122              
123 0           my $pw = $self->createElement('domain:pw');
124 0           $pw->appendText($code);
125              
126 0           my $authInfo = $self->createElement('domain:authInfo');
127 0           $authInfo->appendChild($pw);
128              
129 0           $self->getNode('transfer')->getChildNodes->shift->appendChild($authInfo);
130              
131 0           return 1;
132             }
133              
134              
135             =pod
136              
137             =head1 AUTHOR
138              
139             CentralNic Ltd (http://www.centralnic.com/).
140              
141             =head1 COPYRIGHT
142              
143             This module is (c) 2016 CentralNic Ltd. This module is free software; you can
144             redistribute it and/or modify it under the same terms as Perl itself.
145              
146             =head1 SEE ALSO
147              
148             =over
149              
150             =item * L
151              
152             =back
153              
154             =cut
155              
156             1;