File Coverage

blib/lib/Net/API/Stripe/Reporting/ReportRun.pm
Criterion Covered Total %
statement 7 17 41.1
branch n/a
condition n/a
subroutine 3 13 23.0
pod 10 10 100.0
total 20 40 50.0


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