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