DRI/Protocol/EPP/Extensions/NeuLevel/UIN.pm

filter: Statementstmt 28.8% 13 / 45 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 4 / 8 Podpod 0.0% 0 / 4 totaltotal 25.0% 17 / 68 CC 5 SCAR 21.2
CC
5
Cov
24%
renew
20.0
add_uin
6.0
register_commands
2.0
CRAP 8.3
« DRI/Protocol/IRIS/Message.pm ↑ Summary DRI/Protocol/Whois/Domain/CAT.pm »
1 ## Domain Registry Interface, EPP Extension for .travel UIN
2 ## (ICANN Sponsored TLD Registry Agreement, Part IV)
3 ##
4 ## Copyright (c) 2008,2013 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>.
5 ## All rights reserved.
6 ## Copyright (c) 2016,2018 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
7 ##
8 ## This file is part of Net::DRI
9 ##
10 ## Net::DRI is free software; you can redistribute it and/or modify
11 ## it under the terms of the GNU General Public License as published by
12 ## the Free Software Foundation; either version 2 of the License, or
13 ## (at your option) any later version.
14 ##
15 ## See the LICENSE file that comes with this distribution for more details.
16 ####################################################################################################
17  
18 package Net::DRI::Protocol::EPP::Extensions::NeuLevel::UIN;
19  
20 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use feature 'state';
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 =pod
27  
28 =head1 NAME
29  
30 Net::DRI::Protocol::EPP::Extensions::NeuLevel::UIN - EPP Extension for .TRAVEL UIN for Net::DRI
31  
32 =head1 DESCRIPTION
33  
34 Please see the README file for details.
35  
36 =head1 SUPPORT
37  
38 For now, support questions should be sent to:
39  
40 E<lt>tonnerre.lombard@sygroup.chE<gt>
41  
42 Please also see the SUPPORT file in the distribution.
43  
44 =head1 SEE ALSO
45  
46 E<lt>http://oss.bsdprojects.net/projects/netdri/E<gt>
47  
48 =head1 AUTHOR
49  
50 Tonnerre Lombard, E<lt>tonnerre.lombard@sygroup.chE<gt>
51  
52 =head1 COPYRIGHT
53  
54 Copyright (c) 2008,2013 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>.
55 Copyright (c) 2016,2018 Patrick Mevzek <netdri@dotandco.com>.
56 All rights reserved.
57  
58 This program is free software; you can redistribute it and/or modify
59 it under the terms of the GNU General Public License as published by
60 the Free Software Foundation; either version 2 of the License, or
61 (at your option) any later version.
62  
63 See the LICENSE file that comes with this distribution for more details.
64  
65 =cut
66  
67  
68 ####################################################################################################
69  
70 sub register_commands
71 {
72 0 ▶ my ($class, $version) = @_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
73 0 state $domain = {
74 create => [ \&add_uin, undef ],
75 transfer_request => [ \&add_uin, undef ],
76 renew => [ \&renew, undef ],
77 };
78 0 state $commands = { domain => $domain };
79 0 return $commands;
80 }
81  
82 sub setup
83 {
84 0 ▶ my ($class,$po,$version)=@_;
Subroutine setup: not called CC=1 SCAR=6.9
Pod undocumented
85 0 $po->ns({ 'neulevel' => 'urn:ietf:params:xml:ns:neulevel-1.0' });
86 0 return;
87 }
88  
89 ####################################################################################################
90  
91 ############ Transform commands
92  
93 sub add_uin
94 {
95 0 ▶ my ($epp, $domain, $rd) = @_;
Subroutine add_uin: not called CC=2 SCAR=17.9
Pod undocumented
96 0 my $mes = $epp->message();
97  
98 0 ▶ return unless Net::DRI::Util::has_key($rd,'uin');
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::has_key($rd, "uin") 0 0 0
99  
100 0 my $eid = $mes->command_extension_register('neulevel', 'extension');
101 0 $mes->command_extension($eid, ['neulevel:unspec', 'UIN=' . $rd->{uin}]);
102 0 return;
103 }
104  
105 sub renew
106 {
107 0 ▶ my ($epp, $domain, $rd) = @_;
Subroutine renew: not called CC=4 SCAR=30.0
Pod undocumented
108 0 my $mes = $epp->message();
109 0 my @vals = qw(RestoreReasonCode RestoreComment TrueData ValidUse UIN);
110 0 my %info;
111 my $comment;
112  
113 0 ▶ if (defined($rd->{rgp}) && ref($rd->{rgp}) eq 'HASH')
Branch: 1 branch
BranchTrueFalseTotal
if (defined $rd->{"rgp"} and ref $rd->{"rgp"} eq "HASH") 0 0 0
Condition0%0/3
defined $rd->{"rgp"} and ref $rd->{"rgp"} eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $rd->{"rgp"} and ref $rd->{"rgp"} eq "HASH"
defined $rd->{"rgp"} ref $rd->{"rgp"} eq "HASH"
Truth table0%0/3
A and B
A= defined $rd->{"rgp"}B= ref $rd->{"rgp"} eq "HASH"
ABresult
0X0
100
111
114 {
115 0 $info{TrueData} = 'Y';
116 0 $info{ValidUse} = 'Y';
117 0 $info{RestoreReasonCode} = $rd->{rgp}->{code};
118 0 $comment = $rd->{rgp}->{comment};
119 0 $comment = join('', map { ucfirst($_) } split(/\s+/, $comment));
120 0 $info{RestoreComment} = $comment;
121 }
122  
123 0 ▶ if (Net::DRI::Util::has_key($rd,'uin'))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::has_key($rd, "uin")) 0 0 0
124 {
125 0 $info{UIN} = $rd->{uin};
126 }
127  
128 0 my $eid = $mes->command_extension_register('neulevel', 'extension');
129 0 $mes->command_extension($eid, ['neulevel:unspec', join(' ', map { $_ . '=' . $info{$_} } grep { defined($info{$_}) } @vals)]);
130 0 return;
131 }
132  
133 ####################################################################################################
134 1 1;
« DRI/Protocol/IRIS/Message.pm ↑ Summary DRI/Protocol/Whois/Domain/CAT.pm »