File Coverage

blib/lib/Net/Amazon/Route53/Change.pm
Criterion Covered Total %
statement 15 21 71.4
branch 0 2 0.0
condition n/a
subroutine 5 6 83.3
pod 1 1 100.0
total 21 30 70.0


line stmt bran cond sub pod time code
1 2     2   10 use strict;
  2         2  
  2         55  
2 2     2   9 use warnings;
  2         3  
  2         88  
3              
4             package Net::Amazon::Route53::Change;
5             {
6             $Net::Amazon::Route53::Change::VERSION = '0.123250';
7             }
8 2     2   8 use Mouse;
  2         3  
  2         8  
9 2     2   827 use HTML::Entities;
  2         4  
  2         408  
10              
11             =head2 SYNOPSIS
12              
13             my $change = Net::Amazon::Route53::Change->new(...);
14             # use methods on $change
15              
16             =cut
17              
18             =head2 ATTRIBUTES
19              
20             =cut
21              
22             =head3 route53
23              
24             A L object, needed and used to perform requests
25             to Amazon's Route 53 service
26              
27             =cut
28              
29             has 'route53' => (is => 'rw', isa => 'Net::Amazon::Route53', required => 1,);
30              
31             =head3 id
32              
33             The change request's id
34              
35             =head3 status
36              
37             The change request's status; usually C or C.
38              
39             =head3 submittedat
40              
41             The date/time the change was submitted at, in the format:
42             C
43              
44             =head3 comment
45              
46             Any Comment given when the zone is created
47              
48             =cut
49              
50             has 'id' => (is => 'rw', isa => 'Str', required => 1, default => '');
51             has 'status' => (is => 'rw', isa => 'Str', required => 1, default => '');
52             has 'submittedat' => (is => 'rw', isa => 'Str', required => 1, default => '');
53              
54             =head2 METHODS
55              
56             =cut
57              
58             =head3 refresh
59              
60             Refresh the details of the change. When performed, the object's status is current.
61              
62             =cut
63              
64             sub refresh {
65 0     0 1   my $self = shift;
66 0 0         die "Cannot refresh without an id\n" unless length $self->id;
67 0           my $resp =
68             $self->route53->request('get',
69             'https://route53.amazonaws.com/2010-10-01/' . $self->id,
70             );
71 0           for (qw/Id Status SubmittedAt/) {
72 0           my $method = lc $_;
73 0           $self->$method(decode_entities($resp->{ChangeInfo}{$_}));
74             }
75             }
76              
77 2     2   9 no Mouse;
  2         4  
  2         9  
78              
79             =head1 AUTHOR
80              
81             Marco FONTANI
82              
83             =head1 COPYRIGHT AND LICENSE
84              
85             This software is copyright (c) 2011 by Marco FONTANI.
86              
87             This is free software; you can redistribute it and/or modify it under
88             the same terms as the Perl 5 programming language system itself.
89              
90             =cut
91              
92             1;