|
1 | 1 | package com.stripe.model;
|
2 | 2 |
|
| 3 | +import com.google.gson.annotations.SerializedName; |
| 4 | + |
3 | 5 | import com.stripe.Stripe;
|
4 | 6 | import com.stripe.exception.StripeException;
|
5 | 7 | import com.stripe.net.ApiResource;
|
|
15 | 17 | @Setter
|
16 | 18 | @EqualsAndHashCode(callSuper = false)
|
17 | 19 | public class File extends ApiResource implements HasId {
|
18 |
| - @Getter(onMethod = @__({@Override})) String id; |
19 |
| - String object; |
| 20 | + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ |
| 21 | + @SerializedName("created") |
20 | 22 | Long created;
|
| 23 | + |
| 24 | + /** A filename for the file, suitable for saving to a filesystem. */ |
| 25 | + @SerializedName("filename") |
21 | 26 | String filename;
|
| 27 | + |
| 28 | + /** Unique identifier for the object. */ |
| 29 | + @Getter(onMethod = @__({@Override})) |
| 30 | + @SerializedName("id") |
| 31 | + String id; |
| 32 | + |
| 33 | + @SerializedName("links") |
22 | 34 | FileLinkCollection links;
|
| 35 | + |
| 36 | + /** String representing the object's type. Objects of the same type share the same value. */ |
| 37 | + @SerializedName("object") |
| 38 | + String object; |
| 39 | + |
| 40 | + /** |
| 41 | + * The purpose of the file. Possible values are {@code business_icon}, {@code business_logo}, |
| 42 | + * {@code customer_signature}, {@code dispute_evidence}, {@code finance_report_run}, |
| 43 | + * {@code identity_document}, {@code pci_document}, {@code sigma_scheduled_query}, or |
| 44 | + * {@code tax_document_user_upload}. |
| 45 | + */ |
| 46 | + @SerializedName("purpose") |
23 | 47 | String purpose;
|
| 48 | + |
| 49 | + /** The size in bytes of the file object. */ |
| 50 | + @SerializedName("size") |
24 | 51 | Long size;
|
| 52 | + |
| 53 | + /** A user friendly title for the document. */ |
| 54 | + @SerializedName("title") |
25 | 55 | String title;
|
| 56 | + |
| 57 | + /** |
| 58 | + * The type of the file returned (e.g., {@code csv}, {@code pdf}, {@code jpg}, or |
| 59 | + * {@code png}). |
| 60 | + */ |
| 61 | + @SerializedName("type") |
26 | 62 | String type;
|
| 63 | + |
| 64 | + /** The URL from which the file can be downloaded using your live secret API key. */ |
| 65 | + @SerializedName("url") |
27 | 66 | String url;
|
28 | 67 |
|
29 |
| - // <editor-fold desc="create"> |
30 | 68 | /**
|
31 |
| - * Create a file. |
| 69 | + * To upload a file to Stripe, you’ll need to send a request of type {@code multipart/form-data}. |
| 70 | + * The request should contain the file you would like to upload, as well as the parameters for |
| 71 | + * creating a file. |
32 | 72 | */
|
33 | 73 | public static File create(Map<String, Object> params) throws StripeException {
|
34 | 74 | return create(params, (RequestOptions) null);
|
35 | 75 | }
|
36 | 76 |
|
37 | 77 | /**
|
38 |
| - * Create a file. |
| 78 | + * To upload a file to Stripe, you’ll need to send a request of type {@code multipart/form-data}. |
| 79 | + * The request should contain the file you would like to upload, as well as the parameters for |
| 80 | + * creating a file. |
39 | 81 | */
|
40 | 82 | public static File create(Map<String, Object> params, RequestOptions options)
|
41 | 83 | throws StripeException {
|
42 | 84 | return multipartRequest(RequestMethod.POST, classUrl(File.class, Stripe.getUploadBase()),
|
43 | 85 | params, File.class, options);
|
44 | 86 | }
|
45 |
| - // </editor-fold> |
46 | 87 |
|
47 |
| - // <editor-fold desc="list"> |
48 | 88 | /**
|
49 |
| - * List all files. |
| 89 | + * Returns a list of the files that your account has access to. The files are returned sorted by |
| 90 | + * creation date, with the most recently created files appearing first. |
50 | 91 | */
|
51 | 92 | public static FileCollection list(Map<String, Object> params) throws StripeException {
|
52 | 93 | return list(params, null);
|
53 | 94 | }
|
54 | 95 |
|
55 | 96 | /**
|
56 |
| - * List all files. |
| 97 | + * Returns a list of the files that your account has access to. The files are returned sorted by |
| 98 | + * creation date, with the most recently created files appearing first. |
57 | 99 | */
|
58 | 100 | public static FileCollection list(Map<String, Object> params, RequestOptions options)
|
59 | 101 | throws StripeException {
|
60 | 102 | return requestCollection(classUrl(File.class), params, FileCollection.class, options);
|
61 | 103 | }
|
62 |
| - // </editor-fold> |
63 | 104 |
|
64 |
| - // <editor-fold desc="retrieve"> |
65 | 105 | /**
|
66 |
| - * Retrieve a file. |
| 106 | + * Retrieves the details of an existing file object. Supply the unique file ID from a file, and |
| 107 | + * Stripe will return the corresponding file object. |
67 | 108 | */
|
68 | 109 | public static File retrieve(String id) throws StripeException {
|
69 | 110 | return retrieve(id, (RequestOptions) null);
|
70 | 111 | }
|
71 | 112 |
|
72 | 113 | /**
|
73 |
| - * Retrieve a file. |
| 114 | + * Retrieves the details of an existing file object. Supply the unique file ID from a file, and |
| 115 | + * Stripe will return the corresponding file object. |
74 | 116 | */
|
75 | 117 | public static File retrieve(String id, RequestOptions options) throws StripeException {
|
76 | 118 | return retrieve(id, null, options);
|
77 | 119 | }
|
78 | 120 |
|
79 | 121 | /**
|
80 |
| - * Retrieve a file. |
| 122 | + * Retrieves the details of an existing file object. Supply the unique file ID from a file, and |
| 123 | + * Stripe will return the corresponding file object. |
81 | 124 | */
|
82 | 125 | public static File retrieve(String id, Map<String, Object> params, RequestOptions options)
|
83 | 126 | throws StripeException {
|
84 | 127 | return request(RequestMethod.GET, instanceUrl(File.class, id), params, File.class, options);
|
85 | 128 | }
|
86 |
| - // </editor-fold> |
87 | 129 | }
|
0 commit comments