line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## Stripe API - ~/lib/Net/API/Stripe/File.pm |
3
|
|
|
|
|
|
|
## Version v0.100.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2019 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <@sitael.tokyo.deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2019/11/02 |
7
|
|
|
|
|
|
|
## Modified 2020/05/15 |
8
|
|
|
|
|
|
|
## |
9
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
## https://stripe.com/docs/api/files/object |
11
|
|
|
|
|
|
|
package Net::API::Stripe::File; |
12
|
|
|
|
|
|
|
BEGIN |
13
|
|
|
|
|
|
|
{ |
14
|
1
|
|
|
1
|
|
803
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
15
|
1
|
|
|
1
|
|
5
|
use parent qw( Net::API::Stripe::Generic ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
16
|
1
|
|
|
1
|
|
206
|
our( $VERSION ) = 'v0.100.0'; |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
0
|
1
|
|
sub id { shift->_set_get_scalar( 'id', @_ ); } |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
0
|
1
|
|
sub object { shift->_set_get_scalar( 'object', @_ ); } |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
1
|
|
sub created { shift->_set_get_datetime( 'created', @_ ); } |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
0
|
1
|
|
sub filename { shift->_set_get_scalar( 'filename', @_ ); } |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
0
|
1
|
|
sub links { shift->_set_get_object( 'links', 'Net::API::Stripe::File::Links', @_ ); } |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
1
|
|
sub purpose { shift->_set_get_scalar( 'purpose', @_ ); } |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
1
|
|
sub size { shift->_set_get_number( 'size', @_ ); } |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
1
|
|
sub title { shift->_set_get_scalar( 'title', @_ ); } |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
0
|
1
|
|
sub type { shift->_set_get_scalar( 'type', @_ ); } |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
1
|
|
sub url { shift->_set_get_uri( 'url', @_ ); } |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=encoding utf8 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 NAME |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Net::API::Stripe::File - A file in Stripe API |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 SYNOPSIS |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
my $file = $stripe->file({ |
52
|
|
|
|
|
|
|
filename => 'some_file.jpg', |
53
|
|
|
|
|
|
|
links => $file_links_object, |
54
|
|
|
|
|
|
|
purpose => 'business_logo', |
55
|
|
|
|
|
|
|
size => 40069, |
56
|
|
|
|
|
|
|
title => 'Big Corp, Inc Logo', |
57
|
|
|
|
|
|
|
type => 'jpg', |
58
|
|
|
|
|
|
|
url => 'https://files.stripe.com/v1/files/file_fake123456789/contents', |
59
|
|
|
|
|
|
|
}); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 VERSION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
v0.100.0 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 DESCRIPTION |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This is an object representing a file hosted on Stripe's servers. The file may have been uploaded by yourself using the create file request (for example, when uploading dispute evidence) or it may have been created by Stripe (for example, the results of a Sigma scheduled query L<https://stripe.com/docs/api/files#scheduled_queries>). |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=over 4 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item B<new>( %ARG ) |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Creates a new L<Net::API::Stripe::File> object. |
78
|
|
|
|
|
|
|
It may also take an hash like arguments, that also are method of the same name. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=back |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 METHODS |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=over 4 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item B<id> string |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Unique identifier for the object. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item B<object> string, value is "file" |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
String representing the objectâs type. Objects of the same type share the same value. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item B<created> timestamp |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Time at which the object was created. Measured in seconds since the Unix epoch. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item B<filename> string |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
A filename for the file, suitable for saving to a filesystem. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item B<links> list |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
This is a L<Net::API::Stripe::File::Links> object. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item B<purpose> string |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
The purpose of the file. Possible values are business_icon, business_logo, customer_signature, dispute_evidence, finance_report_run, identity_document, pci_document, sigma_scheduled_query, or tax_document_user_upload. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=item B<size> integer |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
The size in bytes of the file object. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=item B<title> string |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
A user friendly title for the document. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=item B<type> string |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
The type of the file returned (e.g., csv, pdf, jpg, or png). |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=item B<url> string |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
The URL from which the file can be downloaded using your live secret API key. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=back |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 API SAMPLE |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
{ |
131
|
|
|
|
|
|
|
"id": "file_fake123456789", |
132
|
|
|
|
|
|
|
"object": "file", |
133
|
|
|
|
|
|
|
"created": 1540111053, |
134
|
|
|
|
|
|
|
"filename": "file_fake123456789", |
135
|
|
|
|
|
|
|
"links": { |
136
|
|
|
|
|
|
|
"object": "list", |
137
|
|
|
|
|
|
|
"data": [ |
138
|
|
|
|
|
|
|
{ |
139
|
|
|
|
|
|
|
"id": "link_fake123456789", |
140
|
|
|
|
|
|
|
"object": "file_link", |
141
|
|
|
|
|
|
|
"created": 1571229407, |
142
|
|
|
|
|
|
|
"expired": false, |
143
|
|
|
|
|
|
|
"expires_at": null, |
144
|
|
|
|
|
|
|
"file": "file_fake123456789", |
145
|
|
|
|
|
|
|
"livemode": false, |
146
|
|
|
|
|
|
|
"metadata": {}, |
147
|
|
|
|
|
|
|
"url": "https://files.stripe.com/links/fl_test_fake123456789" |
148
|
|
|
|
|
|
|
}, |
149
|
|
|
|
|
|
|
{ |
150
|
|
|
|
|
|
|
"id": "link_fake123456789", |
151
|
|
|
|
|
|
|
"object": "file_link", |
152
|
|
|
|
|
|
|
"created": 1571225071, |
153
|
|
|
|
|
|
|
"expired": false, |
154
|
|
|
|
|
|
|
"expires_at": null, |
155
|
|
|
|
|
|
|
"file": "file_fake123456789", |
156
|
|
|
|
|
|
|
"livemode": false, |
157
|
|
|
|
|
|
|
"metadata": {}, |
158
|
|
|
|
|
|
|
"url": "https://files.stripe.com/links/fl_test_fake123456789" |
159
|
|
|
|
|
|
|
}, |
160
|
|
|
|
|
|
|
{ |
161
|
|
|
|
|
|
|
"id": "link_fake123456789", |
162
|
|
|
|
|
|
|
"object": "file_link", |
163
|
|
|
|
|
|
|
"created": 1571223490, |
164
|
|
|
|
|
|
|
"expired": false, |
165
|
|
|
|
|
|
|
"expires_at": null, |
166
|
|
|
|
|
|
|
"file": "file_fake123456789", |
167
|
|
|
|
|
|
|
"livemode": false, |
168
|
|
|
|
|
|
|
"metadata": {}, |
169
|
|
|
|
|
|
|
"url": "https://files.stripe.com/links/fl_test_fake123456789" |
170
|
|
|
|
|
|
|
}, |
171
|
|
|
|
|
|
|
{ |
172
|
|
|
|
|
|
|
"id": "link_1FUA14CeyNCl6fY2s3gFUjmP", |
173
|
|
|
|
|
|
|
"object": "file_link", |
174
|
|
|
|
|
|
|
"created": 1571222766, |
175
|
|
|
|
|
|
|
"expired": false, |
176
|
|
|
|
|
|
|
"expires_at": null, |
177
|
|
|
|
|
|
|
"file": "file_fake123456789", |
178
|
|
|
|
|
|
|
"livemode": false, |
179
|
|
|
|
|
|
|
"metadata": {}, |
180
|
|
|
|
|
|
|
"url": "https://files.stripe.com/links/fl_test_fake123456789" |
181
|
|
|
|
|
|
|
}, |
182
|
|
|
|
|
|
|
{ |
183
|
|
|
|
|
|
|
"id": "link_fake123456789", |
184
|
|
|
|
|
|
|
"object": "file_link", |
185
|
|
|
|
|
|
|
"created": 1571197169, |
186
|
|
|
|
|
|
|
"expired": false, |
187
|
|
|
|
|
|
|
"expires_at": null, |
188
|
|
|
|
|
|
|
"file": "file_fake123456789", |
189
|
|
|
|
|
|
|
"livemode": false, |
190
|
|
|
|
|
|
|
"metadata": {}, |
191
|
|
|
|
|
|
|
"url": "https://files.stripe.com/links/fl_test_fake123456789" |
192
|
|
|
|
|
|
|
}, |
193
|
|
|
|
|
|
|
{ |
194
|
|
|
|
|
|
|
"id": "link_fake123456789", |
195
|
|
|
|
|
|
|
"object": "file_link", |
196
|
|
|
|
|
|
|
"created": 1571176460, |
197
|
|
|
|
|
|
|
"expired": false, |
198
|
|
|
|
|
|
|
"expires_at": null, |
199
|
|
|
|
|
|
|
"file": "file_fake123456789", |
200
|
|
|
|
|
|
|
"livemode": false, |
201
|
|
|
|
|
|
|
"metadata": {}, |
202
|
|
|
|
|
|
|
"url": "https://files.stripe.com/links/fl_test_fake123456789" |
203
|
|
|
|
|
|
|
}, |
204
|
|
|
|
|
|
|
{ |
205
|
|
|
|
|
|
|
"id": "link_fake123456789", |
206
|
|
|
|
|
|
|
"object": "file_link", |
207
|
|
|
|
|
|
|
"created": 1571099998, |
208
|
|
|
|
|
|
|
"expired": false, |
209
|
|
|
|
|
|
|
"expires_at": null, |
210
|
|
|
|
|
|
|
"file": "file_fake123456789", |
211
|
|
|
|
|
|
|
"livemode": false, |
212
|
|
|
|
|
|
|
"metadata": {}, |
213
|
|
|
|
|
|
|
"url": "https://files.stripe.com/links/fl_test_fake123456789" |
214
|
|
|
|
|
|
|
}, |
215
|
|
|
|
|
|
|
{ |
216
|
|
|
|
|
|
|
"id": "link_fake123456789", |
217
|
|
|
|
|
|
|
"object": "file_link", |
218
|
|
|
|
|
|
|
"created": 1551509650, |
219
|
|
|
|
|
|
|
"expired": false, |
220
|
|
|
|
|
|
|
"expires_at": null, |
221
|
|
|
|
|
|
|
"file": "file_fake123456789", |
222
|
|
|
|
|
|
|
"livemode": false, |
223
|
|
|
|
|
|
|
"metadata": {}, |
224
|
|
|
|
|
|
|
"url": "https://files.stripe.com/links/fl_test_fake123456789" |
225
|
|
|
|
|
|
|
}, |
226
|
|
|
|
|
|
|
{ |
227
|
|
|
|
|
|
|
"id": "link_fake123456789", |
228
|
|
|
|
|
|
|
"object": "file_link", |
229
|
|
|
|
|
|
|
"created": 1551509211, |
230
|
|
|
|
|
|
|
"expired": false, |
231
|
|
|
|
|
|
|
"expires_at": null, |
232
|
|
|
|
|
|
|
"file": "file_fake123456789", |
233
|
|
|
|
|
|
|
"livemode": false, |
234
|
|
|
|
|
|
|
"metadata": {}, |
235
|
|
|
|
|
|
|
"url": "https://files.stripe.com/links/fl_test_fake123456789" |
236
|
|
|
|
|
|
|
}, |
237
|
|
|
|
|
|
|
{ |
238
|
|
|
|
|
|
|
"id": "link_fake123456789", |
239
|
|
|
|
|
|
|
"object": "file_link", |
240
|
|
|
|
|
|
|
"created": 1547559540, |
241
|
|
|
|
|
|
|
"expired": false, |
242
|
|
|
|
|
|
|
"expires_at": null, |
243
|
|
|
|
|
|
|
"file": "file_fake123456789", |
244
|
|
|
|
|
|
|
"livemode": false, |
245
|
|
|
|
|
|
|
"metadata": {}, |
246
|
|
|
|
|
|
|
"url": "https://files.stripe.com/links/fl_test_fake123456789" |
247
|
|
|
|
|
|
|
} |
248
|
|
|
|
|
|
|
], |
249
|
|
|
|
|
|
|
"has_more": true, |
250
|
|
|
|
|
|
|
"url": "/v1/file_links?file=file_fake123456789" |
251
|
|
|
|
|
|
|
}, |
252
|
|
|
|
|
|
|
"purpose": "dispute_evidence", |
253
|
|
|
|
|
|
|
"size": 9863, |
254
|
|
|
|
|
|
|
"title": null, |
255
|
|
|
|
|
|
|
"type": "png", |
256
|
|
|
|
|
|
|
"url": "https://files.stripe.com/v1/files/file_fake123456789/contents" |
257
|
|
|
|
|
|
|
} |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=head1 HISTORY |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
=head2 v0.1 |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
Initial version |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=head1 AUTHOR |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
=head1 SEE ALSO |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
Stripe API documentation: |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/files>, L<https://stripe.com/docs/file-upload> |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
Copyright (c) 2019-2020 DEGUEST Pte. Ltd. |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
280
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
=cut |