ACME2/Order.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 40 CC 1 SCAR 6.9
CC
1
Cov
0%
authorizations
2.0
identifiers
2.0
update
2.0
CRAP 2.0
1 package Net::ACME2::Order;
2  
3 use strict;
4 use warnings;
5  
6 =encoding utf-8
7  
8 =head1 NAME
9  
10 Net::ACME2::Order
11  
12 =head1 DESCRIPTION
13  
14 The ACME Order object.
15  
16 =cut
17  
18 use parent qw( Net::ACME2::AccessorBase );
19  
20 use Call::Context ();
21  
22 use constant _ACCESSORS => (
23 'id',
24 'status',
25 'expires',
26 'notBefore',
27 'notAfter',
28 'certificate',
29 'finalize',
30 );
31  
32 =head1 ACCESSORS
33  
34 These provide text strings as defined in the ACME specification.
35  
36 =over
37  
38 =item * B<id()>
39  
40 =item * B<status()>
41  
42 =item * B<expires()>
43  
44 =item * B<notBefore()>
45  
46 =item * B<notAfter()>
47  
48 =item * B<certificate()>
49  
50 =item * B<finalize()>
51  
52 =back
53  
54 =head2 I<OBJ>->authorizations()
55  
56 The URLs for the order’s authorizations.
57  
58 =cut
59  
60 sub authorizations {
61 my ($self) = @_;
62  
63 Call::Context::must_be_list();
64  
65 return @{ $self->{'_authorizations'} };
66 }
67  
68 =head2 I<OBJ>->identifiers()
69  
70 The order’s identifiers, as a list of hash references.
71 The content matches the ACME specification.
72  
73 =cut
74  
75 sub identifiers {
76 my ($self) = @_;
77  
78 Call::Context::must_be_list();
79  
80 return map { { %$_ } } @{ $self->{'_identifiers'} };
81 }
82  
83 #Only to be called from ACME2.pm?
84  
85 sub update {
86 my ($self, $new_hr) = @_;
87  
88 for my $name ( 'status', 'certificate' ) {
89 $self->{"_$name"} = $new_hr->{$name};
90 }
91  
92 return $self;
93 }
94  
95 1;