line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
our $VERSION = '1.0.2'; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use Google::RestApi::Setup; |
5
|
1
|
|
|
1
|
|
476
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
use aliased 'Google::RestApi::DriveApi3'; |
7
|
1
|
|
|
1
|
|
18834
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
8
|
|
|
|
|
|
|
my $class = shift; |
9
|
|
|
|
|
|
|
my $qr_id = DriveApi3->Drive_File_Id; |
10
|
17
|
|
|
17
|
0
|
33
|
state $check = compile_named( |
11
|
17
|
|
|
|
|
59
|
drive => HasApi, |
12
|
17
|
|
|
|
|
33
|
id => StrMatch[qr/$qr_id/], |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
return bless $check->(@_), $class; |
15
|
|
|
|
|
|
|
} |
16
|
17
|
|
|
|
|
1893
|
|
17
|
|
|
|
|
|
|
my $self = shift; |
18
|
|
|
|
|
|
|
my %p = @_; |
19
|
|
|
|
|
|
|
my $uri = "files"; |
20
|
11
|
|
|
11
|
0
|
22
|
$uri .= "/$p{uri}" if $p{uri}; |
21
|
11
|
|
|
|
|
44
|
return $self->drive()->api(%p, uri => $uri); |
22
|
11
|
|
|
|
|
22
|
} |
23
|
11
|
50
|
|
|
|
52
|
|
24
|
11
|
|
|
|
|
28
|
my $self = shift; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
state $check = compile_named( |
27
|
|
|
|
|
|
|
name => Str, { optional => 1 }, |
28
|
6
|
|
|
6
|
0
|
14
|
title => Str, { optional => 1 }, |
29
|
|
|
|
|
|
|
_extra_ => slurpy Any, |
30
|
6
|
|
|
|
|
17
|
); |
31
|
|
|
|
|
|
|
my $p = named_extra($check->(@_)); |
32
|
|
|
|
|
|
|
$p->{name} //= $p->{title}; |
33
|
|
|
|
|
|
|
$p->{content}->{name} = $p->{name} if defined $p->{name}; |
34
|
|
|
|
|
|
|
delete @$p{qw(name title)}; |
35
|
6
|
|
|
|
|
993
|
|
36
|
6
|
|
100
|
|
|
43
|
my $file_id = $self->file_id(); |
37
|
6
|
100
|
|
|
|
37
|
$p->{uri} = "$file_id/copy"; |
38
|
6
|
|
|
|
|
23
|
$p->{method} = 'post'; |
39
|
|
|
|
|
|
|
|
40
|
6
|
|
|
|
|
19
|
my $copy = $self->api(%$p); |
41
|
6
|
|
|
|
|
24
|
DEBUG(sprintf("Copied file '%s' to '$copy->{id}'", $self->file_id())); |
42
|
6
|
|
|
|
|
15
|
return ref($self)->new( |
43
|
|
|
|
|
|
|
drive => $self->drive(), |
44
|
6
|
|
|
|
|
22
|
id => $copy->{id}, |
45
|
6
|
|
|
|
|
46
|
); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $self = shift; |
49
|
6
|
|
|
|
|
60
|
DEBUG(sprintf("Deleting file '%s'", $self->file_id())); |
50
|
|
|
|
|
|
|
return $self->api( |
51
|
|
|
|
|
|
|
method => 'delete', |
52
|
|
|
|
|
|
|
uri => $self->file_id(), |
53
|
5
|
|
|
5
|
0
|
170
|
); |
54
|
5
|
|
|
|
|
11
|
} |
55
|
5
|
|
|
|
|
41
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 NAME |
61
|
28
|
|
|
28
|
0
|
143
|
|
62
|
17
|
|
|
17
|
0
|
80
|
Google::RestApi::DriveApi3::File - File object for Google Drive. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 DESCRIPTION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Represents a Drive file. You may currently copy and delete the file. |
67
|
|
|
|
|
|
|
This needs further filling out. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 AUTHORS |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=over |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Robin Murray mvsjes@cpan.org |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=back |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 COPYRIGHT |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Copyright (c) 2021, Robin Murray. All rights reserved. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. |