DRI/Protocol/EPP/Extensions/AT/Contact.pm

filter: Statementstmt 22.7% 10 / 44 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 37.5% 3 / 8 Podpod 0.0% 0 / 5 totaltotal 17.1% 13 / 76 CC 9 SCAR 32.7
CC
9
Cov
16%
parse_info
56.0
create
6.0
update
6.0
CRAP 26.4
« DRI/Protocol/EPP/Extensions/VeriSign/NameStore.pm ↑ Summary DRI/Protocol/EPP/Extensions/SIDN/Host.pm »
1 ## Domain Registry Interface, NIC.AT Contact extension
2 ## Contributed by Michael Braunoeder from NIC.AT <mib@nic.at>
3 ##
4 ## Copyright (c) 2006-2008,2010,2013,2016,2018 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
5 ##
6 ## This file is part of Net::DRI
7 ##
8 ## Net::DRI is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 2 of the License, or
11 ## (at your option) any later version.
12 ##
13 ## See the LICENSE file that comes with this distribution for more details.
14 ####################################################################################################
15  
16 package Net::DRI::Protocol::EPP::Extensions::AT::Contact;
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use feature 'state';
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 =pod
23  
24 =head1 NAME
25  
26 Net::DRI::Protocol::EPP::Extensions::AT::Contact - NIC.AT Contact Extensions 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 E<lt>netdri@dotandco.comE<gt>
37  
38 Please also see the SUPPORT file in the distribution.
39  
40 =head1 SEE ALSO
41  
42 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
43  
44 =head1 AUTHOR
45  
46 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
47  
48 =head1 COPYRIGHT
49  
50 Copyright (c) 2006-2008,2010,2013,2016,2018 Patrick Mevzek <netdri@dotandco.com>.
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 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
67 0 state $contact = {
68 info => [ undef, \&parse_info ],
69 update => [ \&update, undef ],
70 create => [ \&create, undef ],
71 };
72 0 state $commands = { 'contact' => $contact };
73  
74 0 return $commands;
75 }
76  
77 sub setup
78 {
79 0 ▶ my ($class,$po,$version)=@_;
Subroutine setup: not called CC=1 SCAR=6.9
Pod undocumented
80 0 $po->ns({ 'at-ext-contact' => 'http://www.nic.at/xsd/at-ext-contact-1.0' });
81 0 return;
82 }
83  
84 sub parse_info
85 {
86 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine parse_info: not called CC=7 SCAR=40.3
Pod undocumented
87 0 my $mes=$po->message();
88  
89 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
90  
91 0 my $c=$rinfo->{contact}->{$oname}->{self};
92 0 ▶ $c->email(undef) if ($c->email() eq 'n/a');
Branch: 1 branch
BranchTrueFalseTotal
if $c->email eq "n/a" 0 0 0
93  
94 0 my $condata=$mes->get_extension('at-ext-contact', 'infData');
95 0 ▶ return unless $condata;
Branch: 1 branch
BranchTrueFalseTotal
unless $condata 0 0 0
96  
97 0 my @options;
98  
99 0 my $el=$condata->getElementsByTagNameNS($mes->ns('at-ext-contact'), 'type');
100 0 ▶ my $type=$el? $el->get_node(1)->getFirstChild()->getData() : undef;
Branch: 1 branch
BranchTrueFalseTotal
$el ? : 0 0 0
101  
102 0 ▶ $c->type($type) if (defined($type) && $type);
Branch: 1 branch
BranchTrueFalseTotal
if defined $type and $type 0 0 0
Condition0%0/3
defined $type and $type
!ll&&!rl&&r
000
MC/DC0%0/2
defined $type and $type
defined $type $type
Truth table0%0/3
A and B
A= defined $typeB= $type
ABresult
0X0
100
111
103 # $rinfo->{contact}->{$oname}->{type}=$type if $type;
104 0 return;
105 }
106  
107 sub create
108 {
109 0 ▶ my ($epp,$contact,$rd)=@_;
Subroutine create: not called CC=2 SCAR=17.9
Pod undocumented
110 0 my $mes=$epp->message();
111  
112 0 my $type=$contact->type();
113 0 ▶ return unless (defined($type));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $type 0 0 0
114  
115 0 my $eid=$mes->command_extension_register('at-ext-contact', 'create');
116 0 $mes->command_extension($eid,['at-ext-contact:type',$type]);
117 0 return;
118 }
119  
120 sub update
121 {
122 0 ▶ my ($epp,$contact,$todo)=@_;
Subroutine update: not called CC=2 SCAR=17.9
Pod undocumented
123  
124 0 my $mes=$epp->message();
125 0 my $newc=$todo->set('info');
126  
127 0 my $type=$newc->type();
128 0 ▶ return unless (defined($type));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $type 0 0 0
129  
130 0 my $eid=$mes->command_extension_register('at-ext-contact', 'update');
131 0 $mes->command_extension($eid,['at-ext-contact:chg',['at-ext-contact:type',$type]]);
132 0 return;
133 }
134  
135 ####################################################################################################
136 1 1;
« DRI/Protocol/EPP/Extensions/VeriSign/NameStore.pm ↑ Summary DRI/Protocol/EPP/Extensions/SIDN/Host.pm »