RestApi/DriveApi3/Revision.pm

filter: Statementstmt 55.2% 21 / 38 Branchbran 0.0% 0 / 20 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 6 / 10 Podpod 83.3% 5 / 6 totaltotal 43.2% 32 / 74 CC 11 SCAR 33.3
CC
11
Cov
36%
update
59.1
get
5.7
_uri_base
2.0
CRAP 28.0
↑ Summary RestApi/SheetsApi4/Request.pm »
1 package Google::RestApi::DriveApi3::Revision;
2  
3 2 our $VERSION = '1.1.0';
4  
5 2 ▶use Google::RestApi::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use parent 'Google::RestApi::SubResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
10 4 my $class = shift;
11 4 state $check = signature(
12 bless => !!0,
13 named => [
14 file => HasApi,
15 id => Str, { optional => 1 },
16 ],
17 );
18 4 return bless $check->(@_), $class;
19 }
20  
21 0 ▶sub _uri_base { 'revisions' }
Subroutine _uri_base: not called CC=1 SCAR=6.9
22 0 ▶sub _parent_accessor { 'file' }
Subroutine _parent_accessor: not called CC=1 SCAR=6.9
23  
24 1 ▶sub get {
Subroutine get: called CC=3 SCAR=17.3
Pod documented
25 1 my $self = shift;
26 1 state $check = signature(
27 bless => !!0,
28 named => [
29 fields => Str, { optional => 1 },
30 acknowledge_abuse => Bool, { default => 0 },
31 ],
32 );
33 1 my $p = $check->(@_);
34  
35 1 $self->require_id('get');
36  
37 0 my %params;
38 0 ▶ $params{fields} = $p->{fields} if defined $p->{fields};
Branch: 1 branch
BranchTrueFalseTotal
if defined $$p{"fields"} 0 0 0
39 0 ▶ $params{acknowledgeAbuse} = 'true' if $p->{acknowledge_abuse};
Branch: 1 branch
BranchTrueFalseTotal
if $$p{"acknowledge_abuse"} 0 0 0
40  
41 0 return $self->api(params => \%params);
42 }
43  
44 1 ▶sub update {
Subroutine update: called CC=9 SCAR=40.8
Pod documented
45 1 my $self = shift;
46 1 state $check = signature(
47 bless => !!0,
48 named => [
49 keep_forever => Bool, { optional => 1 },
50 publish_auto => Bool, { optional => 1 },
51 published => Bool, { optional => 1 },
52 published_outside_domain => Bool, { optional => 1 },
53 _extra_ => slurpy HashRef,
54 ],
55 );
56 1 my $p = named_extra($check->(@_));
57  
58 1 $self->require_id('update');
59  
60 0 my %content;
61 0 ▶ $content{keepForever} = $p->{keep_forever} ? \1 : \0 if defined $p->{keep_forever};
Branch: 2 branches
BranchTrueFalseTotal
if defined $$p{"keep_forever"} 0 0 0
$$p{'keep_forever'} ? : 0 0 0
62 0 ▶ $content{publishAuto} = $p->{publish_auto} ? \1 : \0 if defined $p->{publish_auto};
Branch: 2 branches
BranchTrueFalseTotal
if defined $$p{"publish_auto"} 0 0 0
$$p{'publish_auto'} ? : 0 0 0
63 0 ▶ $content{published} = $p->{published} ? \1 : \0 if defined $p->{published};
Branch: 2 branches
BranchTrueFalseTotal
if defined $$p{"published"} 0 0 0
$$p{'published'} ? : 0 0 0
64 $content{publishedOutsideDomain} = $p->{published_outside_domain} ? \1 : \0
65 0 ▶ if defined $p->{published_outside_domain};
Branch: 2 branches
BranchTrueFalseTotal
if defined $$p{"published_outside_domain"} 0 0 0
$$p{'published_outside_domain'} ? : 0 0 0
66  
67 0 DEBUG(sprintf("Updating revision '%s' on file '%s'", $self->{id}, $self->file()->file_id()));
68 0 return $self->api(
69 method => 'patch',
70 content => \%content,
71 );
72 }
73  
74 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=1.2
Pod documented
75 1 my $self = shift;
76  
77 1 $self->require_id('delete');
78  
79 0 DEBUG(sprintf("Deleting revision '%s' from file '%s'", $self->{id}, $self->file()->file_id()));
80 0 return $self->api(method => 'delete');
81 }
82  
83 0 ▶sub revision_id { shift->{id}; }
Subroutine revision_id: not called CC=1 SCAR=6.9
Pod documented
84 0 ▶sub file { shift->{file}; }
Subroutine file: not called CC=1 SCAR=6.9
Pod documented
85  
86 2 1;
87  
88 __END__
↑ Summary RestApi/SheetsApi4/Request.pm »