line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CanvasCloud::API::Account::OutcomeImport; |
2
|
|
|
|
|
|
|
$CanvasCloud::API::Account::OutcomeImport::VERSION = '0.007'; |
3
|
|
|
|
|
|
|
# ABSTRACT: extends L<CanvasCloud::API::Account> |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1210
|
use Moose; |
|
1
|
|
|
|
|
457774
|
|
|
1
|
|
|
|
|
6
|
|
6
|
1
|
|
|
1
|
|
8204
|
use namespace::autoclean; |
|
1
|
|
|
|
|
8121
|
|
|
1
|
|
|
|
|
4
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends 'CanvasCloud::API::Account'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
augment 'uri' => sub { return '/outcome_imports'; }; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub sendcsv { |
15
|
1
|
|
|
1
|
1
|
4
|
my ( $self, $file_or_string ) = @_; |
16
|
1
|
|
|
|
|
2
|
my $text; |
17
|
1
|
50
|
|
|
|
46
|
if ( -f $file_or_string ) { |
18
|
0
|
0
|
|
|
|
0
|
open( my $ZF, '<', $file_or_string ) or die sprintf( 'cannot open input file {%s} error {%s}', $file_or_string, $! ); |
19
|
0
|
|
|
|
|
0
|
binmode $ZF; |
20
|
0
|
|
|
|
|
0
|
while (<$ZF>) { $text .= $_; } |
|
0
|
|
|
|
|
0
|
|
21
|
0
|
|
|
|
|
0
|
close $ZF; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
else { |
24
|
1
|
|
|
|
|
4
|
$text = $file_or_string; |
25
|
|
|
|
|
|
|
} |
26
|
1
|
|
|
|
|
11
|
my $r = $self->request( 'POST', $self->uri . '?import_type=instructure_csv&extension=csv' ); |
27
|
1
|
|
|
|
|
11
|
$r->content_type( 'text/csv' ); |
28
|
1
|
|
|
|
|
44
|
$r->content("$text"); |
29
|
1
|
|
|
|
|
34
|
return $self->send( $r ); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub status { |
34
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
35
|
1
|
|
50
|
|
|
4
|
my $id = shift || die 'id must be given!'; |
36
|
1
|
|
|
|
|
5
|
return $self->send( $self->request( 'GET', $self->uri . '/' . $id ) ); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=pod |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=encoding UTF-8 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
CanvasCloud::API::Account::OutcomeImport - extends L<CanvasCloud::API::Account> |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 VERSION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
version 0.007 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 uri |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
augments base uri to append '/outcome_imports' |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 METHODS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 sendcsv( $csvfile ) |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
return data object response from POST ->uri / $csvfile |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 csvstatus |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
get sendfile status as GET ->uri/$id.json |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 AUTHOR |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Ted Katseres |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This software is copyright (c) 2019 by Ted Katseres. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
82
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |