blib/lib/Net/Cisco/ISE/InternalUser.pm

filter: Statementstmt 56.9% 33 / 58 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 26 MC/DCmcdc 0.0% 0 / 13 Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 2 totaltotal 34.5% 38 / 110 CC 16 SCAR 47.1
CC
16
Cov
38%
toXML
182.0
header
20.0
BEGIN
1.0
CRAP 111.4
« blib/lib/Net/Cisco/ISE.pm ↑ Summary blib/lib/Net/Cisco/ISE/IdentityGroup.pm »
1 package Net::Cisco::ISE::InternalUser;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 BEGIN {
6 1 ▶ use Exporter ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS %actions);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶ $VERSION = '0.02';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 @ISA = qw(Exporter);
10 1 @EXPORT = qw();
11 1 @EXPORT_OK = qw();
12 1 %EXPORT_TAGS = ();
13 };
14  
15 1 %actions = ( "query" => "/ers/config/internaluser/",
16 "create" => "/ers/config/internaluser/",
17 "update" => "/ers/config/internaluser/",
18 "getById" => "/ers/config/internaluser/",
19 );
20  
21 # MOOSE!
22
23 1 has 'email' => (
24 is => 'rw',
25 isa => 'Any',
26 );
27  
28 1 has 'firstName' => (
29 is => 'rw',
30 isa => 'Str',
31 );
32  
33 1 has 'lastName' => (
34 is => 'rw',
35 isa => 'Str',
36 );
37  
38 1 has 'id' => (
39 is => 'rw',
40 isa => 'Str',
41 );
42  
43 1 has 'identityGroups' => (
44 is => 'rw',
45 isa => 'Str',
46 );
47  
48 1 has 'name' => (
49 is => 'rw',
50 isa => 'Str',
51 );
52  
53 1 has 'changePassword' => (
54 is => 'ro',
55 isa => 'Str',
56 );
57  
58 #has 'customAttributes' => (
59 # is => 'ro',
60 # isa => 'ArrayRef',
61 # auto_deref => '1',
62 # );
63  
64 1 has 'expiryDateEnabled' => (
65 is => 'rw',
66 isa => 'Str',
67 );
68  
69 1 has 'expiryDate' => (
70 is => 'rw',
71 isa => 'Str',
72 );
73  
74 1 has 'enablePassword' => (
75 is => 'rw',
76 isa => 'Str',
77 );
78  
79 1 has 'enabled' => (
80 is => 'rw',
81 isa => 'Str',
82 );
83  
84 1 has 'password' => (
85 is => 'rw',
86 isa => 'Str',
87 );
88  
89 1 has 'passwordIDStore' => (
90 is => 'rw',
91 isa => 'Str',
92 );
93  
94 # No Moose
95
96 sub toXML
97 0 ▶{ my $self = shift;
Subroutine toXML: not called CC=13 SCAR=52.0
Pod undocumented
98 0 my $id = $self->id;
99 0 ▶ my $identitygroups = $self->identityGroups || "";
Condition0%0/2
$self->identityGroups || ''
l!l
00
MC/DC0%0/1
$self->identityGroups || ''
$self->identityGroups
Truth table0%0/2
A
A= $self->identityGroups
Aresult
11
00
100 0 ▶ my $name = $self->name || "";
Condition0%0/2
$self->name || ''
l!l
00
MC/DC0%0/1
$self->name || ''
$self->name
Truth table0%0/2
A
A= $self->name
Aresult
11
00
101 0 ▶ my $changepassword = $self->changePassword || "false";
Condition0%0/2
$self->changePassword || 'false'
l!l
00
MC/DC0%0/1
$self->changePassword || 'false'
$self->changePassword
Truth table0%0/2
A
A= $self->changePassword
Aresult
11
00
102 0 ▶ my $enabled = $self->enabled || "true";
Condition0%0/2
$self->enabled || 'true'
l!l
00
MC/DC0%0/1
$self->enabled || 'true'
$self->enabled
Truth table0%0/2
A
A= $self->enabled
Aresult
11
00
103 0 ▶ my $password = $self->password || "";
Condition0%0/2
$self->password || ''
l!l
00
MC/DC0%0/1
$self->password || ''
$self->password
Truth table0%0/2
A
A= $self->password
Aresult
11
00
104 0 ▶ my $passwordidstore = $self->passwordIDStore || "Internal Users";
Condition0%0/2
$self->passwordIDStore || 'Internal Users'
l!l
00
MC/DC0%0/1
$self->passwordIDStore || 'Internal Users'
$self->passwordIDStore
Truth table0%0/2
A
A= $self->passwordIDStore
Aresult
11
00
105 0 ▶ my $enablepassword = $self->enablePassword || "";
Condition0%0/2
$self->enablePassword || ''
l!l
00
MC/DC0%0/1
$self->enablePassword || ''
$self->enablePassword
Truth table0%0/2
A
A= $self->enablePassword
Aresult
11
00
106 0 ▶ my $expirydate = $self->expiryDate || "";
Condition0%0/2
$self->expiryDate || ''
l!l
00
MC/DC0%0/1
$self->expiryDate || ''
$self->expiryDate
Truth table0%0/2
A
A= $self->expiryDate
Aresult
11
00
107 0 ▶ my $expirydateenabled = $self->expiryDateEnabled || "false";
Condition0%0/2
$self->expiryDateEnabled || 'false'
l!l
00
MC/DC0%0/1
$self->expiryDateEnabled || 'false'
$self->expiryDateEnabled
Truth table0%0/2
A
A= $self->expiryDateEnabled
Aresult
11
00
108 0 ▶ my $lastname = $self->lastName || "";
Condition0%0/2
$self->lastName || ''
l!l
00
MC/DC0%0/1
$self->lastName || ''
$self->lastName
Truth table0%0/2
A
A= $self->lastName
Aresult
11
00
109 0 ▶ my $firstname = $self->firstName || "";
Condition0%0/2
$self->firstName || ''
l!l
00
MC/DC0%0/1
$self->firstName || ''
$self->firstName
Truth table0%0/2
A
A= $self->firstName
Aresult
11
00
110 0 ▶ my $email = $self->email || "";
Condition0%0/2
$self->email || ''
l!l
00
MC/DC0%0/1
$self->email || ''
$self->email
Truth table0%0/2
A
A= $self->email
Aresult
11
00
111 0 my $result = "";
112  
113 # <expiryDateEnabled>$expirydateenabled</expiryDateEnabled>
114 # <expiryDate>$expirydate</expiryDate>
115 # <passwordIDStore>$passwordidstore</passwordIDStore>
116  
117 #<name>$name</name>
118
119 #if ($id) { $result = " <id>$id</id>\n"; }
120 0 $result .= <<XML;
121 <changePassword>$changepassword</changePassword>
122 <customAttributes/>
123 <email>$email</email>
124 <enabled>$enabled</enabled>
125 <firstName>$firstname</firstName>
126 <identityGroups>$identitygroups</identityGroups>
127 <lastName>$lastname</lastName>
128 <password>$password</password>
129 XML
130  
131 0 return $result;
132 }
133  
134 sub header
135 0 ▶{ my $self = shift;
Subroutine header: not called CC=4 SCAR=30.0
Pod undocumented
136 0 my $data = shift;
137 0 my $record = shift;
138 0 ▶ my $name = " name=\"".$record->name."\"" if $record->name;
Branch: 1 branch
BranchTrueFalseTotal
if $record->name 0 0 0
139 0 ▶ my $id = " id=\"".$record->id."\"" if $record->id;
Branch: 1 branch
BranchTrueFalseTotal
if $record->id 0 0 0
140 0 ▶ $id ||= "";
Condition0%0/2
$id ||= ""
l!l
00
MC/DC0%0/1
$id ||= ""
$id
Truth table0%0/2
A
A= $id
Aresult
11
00
141 0 my $description = " description=\"".$record->firstName." ".$record->lastName."\"";
142
143 0 return qq{<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns3:internaluser$description$name$id xmlns:ns2="ers.ise.cisco.com" xmlns:ns3="identity.ers.ise.cisco.com">$data</ns3:internaluser>};
144  
145 }
146  
147 #################### main pod documentation end ###################
148 1 __PACKAGE__->meta->make_immutable();
149  
150 1 1;
151 # The preceding line will help the module return a true value
152  
« blib/lib/Net/Cisco/ISE.pm ↑ Summary blib/lib/Net/Cisco/ISE/IdentityGroup.pm »