File Coverage

lib/Net/API/Stripe/Reporting/ReportRun.pm
Criterion Covered Total %
statement 19 29 65.5
branch n/a
condition n/a
subroutine 7 17 41.1
pod 10 10 100.0
total 36 56 64.2


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/usr/local/src/perl/Net-API-Stripe/lib/Net/API/Stripe/Reporting/ReportRun.pm
3             ## Version v0.101.0
4             ## Copyright(c) 2020 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2020/01/19
7             ## Modified 2020/11/28
8             ## All rights reserved
9             ##
10             ## This program is free software; you can redistribute it and/or modify it
11             ## under the same terms as Perl itself.
12             ##----------------------------------------------------------------------------
13             package Net::API::Stripe::Reporting::ReportRun;
14             BEGIN
15             {
16 2     2   21263017 use strict;
  2         14  
  2         65  
17 2     2   12 use warnings;
  2         4  
  2         62  
18 2     2   11 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         11  
19 2     2   144 use vars qw( $VERSION );
  2         5  
  2         134  
20 2     2   45 our( $VERSION ) = 'v0.101.0';
21             };
22              
23 2     2   12 use strict;
  2         5  
  2         61  
24 2     2   11 use warnings;
  2         4  
  2         727  
25              
26 0     0 1   sub id { return( shift->_set_get_scalar( 'id', @_ ) ); }
27              
28 0     0 1   sub object { return( shift->_set_get_scalar( 'object', @_ ) ); }
29              
30 0     0 1   sub created { return( shift->_set_get_datetime( 'created', @_ ) ); }
31              
32 0     0 1   sub error { return( shift->_set_get_scalar( 'error', @_ ) ); }
33              
34 0     0 1   sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
35              
36             sub parameters
37             {
38 0     0 1   return( shift->_set_get_class( 'parameters',
39             {
40             columns => { type => 'array_as_object' },
41             connected_account => { type => 'scalar_as_object' },
42             currency => { type => 'scalar_as_object' },
43             interval_end => { type => 'datetime' },
44             interval_start => { type => 'datetime' },
45             payout => { type => 'scalar_as_object' },
46             reporting_category => { type => 'scalar_as_object' },
47             timezone => { type => 'scalar' },
48             }, @_ ) );
49             }
50              
51 0     0 1   sub report_type { return( shift->_set_get_scalar( 'report_type', @_ ) ); }
52              
53 0     0 1   sub result { return( shift->_set_get_object( 'result', 'Net::APi::Stripe::File', @_ ) ); }
54              
55 0     0 1   sub status { return( shift->_set_get_scalar( 'status', @_ ) ); }
56              
57 0     0 1   sub succeeded_at { return( shift->_set_get_datetime( 'succeeded_at', @_ ) ); }
58              
59             1;
60              
61             =encoding utf8
62              
63             =head1 NAME
64              
65             Net::API::Stripe::Reporting::ReportRun - Stripe API Reporting Run Object
66              
67             =head1 SYNOPSIS
68              
69             my $report = $stripe->report_run({
70             livemode => $stripe->false,
71             report_type => 'balance.summary.1',
72             result => $file_object,
73             status => 'pending',
74             succeeded_at => undef,
75             });
76              
77             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
78              
79             =head1 VERSION
80              
81             v0.101.0
82              
83             =head1 DESCRIPTION
84              
85             The Report Run object represents an instance of a report type generated with specific run parameters. Once the object is created, Stripe begins processing the report. When the report has finished running, it will give you a reference to a file where you can retrieve your results. For an overview, see API Access to Reports (L<https://stripe.com/docs/reporting/statements/api>).
86              
87             Note that reports can only be run based on your live-mode data (not test-mode data), and thus related requests must be made with a live-mode API key (L<https://stripe.com/docs/keys#test-live-modes>).
88              
89             =head1 CONSTRUCTOR
90              
91             =head2 new( %arg )
92              
93             Creates a new L<Net::API::Stripe::Reporting::ReportRun> object.
94             It may also take an hash like arguments, that also are method of the same name.
95              
96             =head1 METHODS
97              
98             =head2 id string
99              
100             Unique identifier for the object.
101              
102             =head2 object string, value is "reporting.report_run"
103              
104             String representing the object’s type. Objects of the same type share the same value.
105              
106             =head2 created timestamp
107              
108             Time at which the object was created. Measured in seconds since the Unix epoch.
109              
110             =head2 errorstring
111              
112             If something should go wrong during the run, a message about the failure (populated when status=failed).
113              
114             =head2 livemode boolean
115              
116             Always true: reports can only be run on live-mode data.
117              
118             =head2 parameters hash
119              
120             Parameters of this report run.
121              
122             =over 4
123              
124             =item I<columns> array containing strings
125              
126             The set of output columns requested for inclusion in the report run.
127              
128             =item I<connected>_account string
129              
130             Connected account ID by which to filter the report run.
131              
132             =item I<urrency> currency
133              
134             Currency of objects to be included in the report run.
135              
136             =item I<interval_end> timestamp
137              
138             Ending timestamp of data to be included in the report run (exclusive).
139              
140             =item I<interval_start> timestamp
141              
142             Starting timestamp of data to be included in the report run.
143              
144             =item I<payout> string
145              
146             Payout ID by which to filter the report run.
147              
148             =item I<reporting_category> string
149              
150             Category of balance transactions to be included in the report run.
151              
152             =item I<timezone> string
153              
154             Defaults to C<Etc/UTC>. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the L<IANA Time Zone Database|http://www.iana.org/time-zones>. Has no effect on C<interval_start> or C<interval_end>.
155              
156             =back
157              
158             =head2 report_type string
159              
160             The ID of the report type to run, such as "balance.summary.1".
161              
162             =head2 result hash
163              
164             The file object (L<Net::APi::Stripe::File>) representing the result of the report run (populated when status=succeeded).
165              
166             =head2 status string
167              
168             Status of this report run. This will be pending when the run is initially created. When the run finishes, this will be set to succeeded and the result field will be populated. Rarely, Stripe may encounter an error, at which point this will be set to failed and the error field will be populated.
169              
170             =head2 succeeded_at timestamp
171              
172             Timestamp at which this run successfully finished (populated when status=succeeded). Measured in seconds since the Unix epoch.
173              
174             =head1 API SAMPLE
175              
176             {
177             "id": "frr_fake123456789",
178             "object": "reporting.report_run",
179             "created": 1579440566,
180             "error": null,
181             "livemode": true,
182             "parameters": {
183             "interval_end": 1525132800,
184             "interval_start": 1522540800
185             },
186             "report_type": "balance.summary.1",
187             "result": {
188             "id": "file_fake123456789",
189             "object": "file",
190             "created": 1535589144,
191             "filename": "file_fake123456789",
192             "links": {
193             "object": "list",
194             "data": [],
195             "has_more": false,
196             "url": "/v1/file_links?file=file_fake123456789"
197             },
198             "purpose": "finance_report_run",
199             "size": 9863,
200             "title": null,
201             "type": "csv",
202             "url": "https://files.stripe.com/v1/files/file_fake123456789/contents"
203             },
204             "status": "succeeded",
205             "succeeded_at": 1525192811
206             }
207              
208             =head1 HISTORY
209              
210             =head2 v0.1
211              
212             Initial version
213              
214             =head1 AUTHOR
215              
216             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
217              
218             =head1 SEE ALSO
219              
220             L<perl>
221              
222             =head1 COPYRIGHT & LICENSE
223              
224             Copyright (c) 2020-2020 DEGUEST Pte. Ltd.
225              
226             All rights reserved
227              
228             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
229              
230             =cut