|
6 | 6 | import com.stripe.exception.StripeException;
|
7 | 7 | import com.stripe.net.ApiResource;
|
8 | 8 | import com.stripe.net.RequestOptions;
|
| 9 | +import com.stripe.param.FileCreateParams; |
| 10 | +import com.stripe.param.FileListParams; |
9 | 11 |
|
10 | 12 | import java.util.Map;
|
11 | 13 |
|
@@ -74,6 +76,26 @@ public static File create(Map<String, Object> params) throws StripeException {
|
74 | 76 | return create(params, (RequestOptions) null);
|
75 | 77 | }
|
76 | 78 |
|
| 79 | + /** |
| 80 | + * To upload a file to Stripe, you’ll need to send a request of type {@code multipart/form-data}. |
| 81 | + * The request should contain the file you would like to upload, as well as the parameters for |
| 82 | + * creating a file. |
| 83 | + */ |
| 84 | + public static File create(FileCreateParams params) throws StripeException { |
| 85 | + return create(params, (RequestOptions) null); |
| 86 | + } |
| 87 | + |
| 88 | + /** |
| 89 | + * To upload a file to Stripe, you’ll need to send a request of type {@code multipart/form-data}. |
| 90 | + * The request should contain the file you would like to upload, as well as the parameters for |
| 91 | + * creating a file. |
| 92 | + */ |
| 93 | + public static File create(FileCreateParams params, RequestOptions options) |
| 94 | + throws StripeException { |
| 95 | + checkNullTypedParams(classUrl(File.class, Stripe.getUploadBase()), params); |
| 96 | + return create(params.toMap(), options); |
| 97 | + } |
| 98 | + |
77 | 99 | /**
|
78 | 100 | * To upload a file to Stripe, you’ll need to send a request of type {@code multipart/form-data}.
|
79 | 101 | * The request should contain the file you would like to upload, as well as the parameters for
|
@@ -102,6 +124,23 @@ public static FileCollection list(Map<String, Object> params, RequestOptions opt
|
102 | 124 | return requestCollection(classUrl(File.class), params, FileCollection.class, options);
|
103 | 125 | }
|
104 | 126 |
|
| 127 | + /** |
| 128 | + * Returns a list of the files that your account has access to. The files are returned sorted by |
| 129 | + * creation date, with the most recently created files appearing first. |
| 130 | + */ |
| 131 | + public static FileCollection list(FileListParams params) throws StripeException { |
| 132 | + return list(params, (RequestOptions) null); |
| 133 | + } |
| 134 | + |
| 135 | + /** |
| 136 | + * Returns a list of the files that your account has access to. The files are returned sorted by |
| 137 | + * creation date, with the most recently created files appearing first. |
| 138 | + */ |
| 139 | + public static FileCollection list(FileListParams params, RequestOptions options) |
| 140 | + throws StripeException { |
| 141 | + return requestCollection(classUrl(File.class), params, FileCollection.class, options); |
| 142 | + } |
| 143 | + |
105 | 144 | /**
|
106 | 145 | * Retrieves the details of an existing file object. Supply the unique file ID from a file, and
|
107 | 146 | * Stripe will return the corresponding file object.
|
|
0 commit comments