line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::EPP::Frame::Command::Create::Contact; |
2
|
1
|
|
|
1
|
|
7
|
use base qw(Net::EPP::Frame::Command::Create); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
94
|
|
3
|
1
|
|
|
1
|
|
7
|
use Net::EPP::Frame::ObjectSpec; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
577
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=pod |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Net::EPP::Frame::Command::Create::Contact - an instance of L |
11
|
|
|
|
|
|
|
for contact objects. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Net::EPP::Frame::Command::Create::Contact; |
16
|
|
|
|
|
|
|
use strict; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $create = Net::EPP::Frame::Command::Create::Contact->new; |
19
|
|
|
|
|
|
|
$create->setContact('contact-id); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
print $create->toString(1); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
This results in an XML document like this: |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
28
|
|
|
|
|
|
|
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 |
29
|
|
|
|
|
|
|
epp-1.0.xsd"> |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" |
34
|
|
|
|
|
|
|
xsi:schemaLocation="urn:ietf:params:xml:ns:contact-1.0 |
35
|
|
|
|
|
|
|
contact-1.0.xsd"> |
36
|
|
|
|
|
|
|
example-1.tldE/contact:id> |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
0cf1b8f7e14547d26f03b7641660c641d9e79f45 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 OBJECT HIERARCHY |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
L |
46
|
|
|
|
|
|
|
+----L |
47
|
|
|
|
|
|
|
+----L |
48
|
|
|
|
|
|
|
+----L |
49
|
|
|
|
|
|
|
+----L |
50
|
|
|
|
|
|
|
+----L |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub new { |
55
|
0
|
|
|
0
|
1
|
|
my $package = shift; |
56
|
0
|
|
|
|
|
|
my $self = bless($package->SUPER::new('create'), $package); |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
$self->addObject(Net::EPP::Frame::ObjectSpec->spec('contact')); |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
return $self; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=pod |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 METHODS |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
my $element = $frame->setContact($contact_id); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This sets the contact ID of the object to be created. Returns the |
70
|
|
|
|
|
|
|
Ccontact:nameE> element. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub setContact { |
75
|
0
|
|
|
0
|
0
|
|
my ($self, $id) = @_; |
76
|
0
|
|
|
|
|
|
return $self->addEl('id', $id); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub setVoice { |
80
|
0
|
|
|
0
|
0
|
|
my ($self, $voice) = @_; |
81
|
0
|
|
|
|
|
|
return $self->addEl('voice', $voice); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub setFax { |
85
|
0
|
|
|
0
|
0
|
|
my ($self, $fax) = @_; |
86
|
0
|
|
|
|
|
|
return $self->addEl('fax', $fax); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub setEmail { |
90
|
0
|
|
|
0
|
0
|
|
my ($self, $email) = @_; |
91
|
0
|
|
|
|
|
|
return $self->addEl('email', $email); |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub setAuthInfo { |
95
|
0
|
|
|
0
|
0
|
|
my ($self, $authInfo) = @_; |
96
|
0
|
|
|
|
|
|
my $el = $self->addEl('authInfo'); |
97
|
0
|
|
|
|
|
|
my $pw = $self->createElement('contact:pw'); |
98
|
0
|
|
|
|
|
|
$pw->appendText($authInfo); |
99
|
0
|
|
|
|
|
|
$el->appendChild($pw); |
100
|
0
|
|
|
|
|
|
return $el; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub addPostalInfo { |
104
|
0
|
|
|
0
|
0
|
|
my ($self, $type, $name, $org, $addr) = @_; |
105
|
0
|
|
|
|
|
|
my $el = $self->addEl('postalInfo'); |
106
|
0
|
|
|
|
|
|
$el->setAttribute('type', $type); |
107
|
|
|
|
|
|
|
|
108
|
0
|
|
|
|
|
|
my $nel = $self->createElement('contact:name'); |
109
|
0
|
|
|
|
|
|
$nel->appendText($name); |
110
|
|
|
|
|
|
|
|
111
|
0
|
|
|
|
|
|
my $oel = $self->createElement('contact:org'); |
112
|
0
|
|
|
|
|
|
$oel->appendText($org); |
113
|
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
my $ael = $self->createElement('contact:addr'); |
115
|
|
|
|
|
|
|
|
116
|
0
|
0
|
|
|
|
|
if (ref($addr->{street}) eq 'ARRAY') { |
117
|
0
|
|
|
|
|
|
foreach my $street (@{$addr->{street}}) { |
|
0
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
my $sel = $self->createElement('contact:street'); |
119
|
0
|
|
|
|
|
|
$sel->appendText($street); |
120
|
0
|
|
|
|
|
|
$ael->appendChild($sel); |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
0
|
|
|
|
|
|
foreach my $name (qw(city sp pc cc)) { |
125
|
0
|
|
|
|
|
|
my $vel = $self->createElement('contact:'.$name); |
126
|
0
|
|
|
|
|
|
$vel->appendText($addr->{$name}); |
127
|
0
|
|
|
|
|
|
$ael->appendChild($vel); |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
|
$el->appendChild($nel); |
131
|
0
|
0
|
|
|
|
|
$el->appendChild($oel) if $org; |
132
|
0
|
|
|
|
|
|
$el->appendChild($ael); |
133
|
|
|
|
|
|
|
|
134
|
0
|
|
|
|
|
|
return $el; |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
sub appendStatus { |
138
|
0
|
|
|
0
|
0
|
|
my ($self, $status) = @_; |
139
|
0
|
|
|
|
|
|
return $self->addEl('status', $status); |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub addEl { |
143
|
0
|
|
|
0
|
0
|
|
my ($self, $name, $value) = @_; |
144
|
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
|
my $el = $self->createElement('contact:'.$name); |
146
|
0
|
0
|
|
|
|
|
$el->appendText($value) if defined($value); |
147
|
|
|
|
|
|
|
|
148
|
0
|
|
|
|
|
|
$self->getNode('create')->getChildNodes->shift->appendChild($el); |
149
|
|
|
|
|
|
|
|
150
|
0
|
|
|
|
|
|
return $el; |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
1; |