Skip to content

Commit 7c91caf

Browse files
Update generated code for v2146 and
1 parent 6527b50 commit 7c91caf

File tree

6 files changed

+98
-48
lines changed

6 files changed

+98
-48
lines changed

API_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bd43cbb47f556744f4727eeea7cddebc9b1cc05f
1+
62f4f6bb7256abf1d83d35d2fb79a309954b19c9

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2144
1+
v2146

src/main/java/com/stripe/model/sharedpayment/GrantedToken.java

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import com.stripe.net.StripeResponseGetter;
1414
import com.stripe.param.sharedpayment.GrantedTokenCreateParams;
1515
import com.stripe.param.sharedpayment.GrantedTokenRetrieveParams;
16-
import com.stripe.param.sharedpayment.GrantedTokenUpdateParams;
16+
import com.stripe.param.sharedpayment.GrantedTokenRevokeParams;
1717
import java.util.Map;
1818
import lombok.EqualsAndHashCode;
1919
import lombok.Getter;
@@ -237,15 +237,31 @@ public static GrantedToken create(GrantedTokenCreateParams params, RequestOption
237237
* Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode
238238
* and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
239239
*/
240-
public GrantedToken update(Map<String, Object> params) throws StripeException {
241-
return update(params, (RequestOptions) null);
240+
public GrantedToken revoke() throws StripeException {
241+
return revoke((Map<String, Object>) null, (RequestOptions) null);
242242
}
243243

244244
/**
245245
* Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode
246246
* and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
247247
*/
248-
public GrantedToken update(Map<String, Object> params, RequestOptions options)
248+
public GrantedToken revoke(RequestOptions options) throws StripeException {
249+
return revoke((Map<String, Object>) null, options);
250+
}
251+
252+
/**
253+
* Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode
254+
* and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
255+
*/
256+
public GrantedToken revoke(Map<String, Object> params) throws StripeException {
257+
return revoke(params, (RequestOptions) null);
258+
}
259+
260+
/**
261+
* Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode
262+
* and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
263+
*/
264+
public GrantedToken revoke(Map<String, Object> params, RequestOptions options)
249265
throws StripeException {
250266
String path =
251267
String.format(
@@ -260,15 +276,15 @@ public GrantedToken update(Map<String, Object> params, RequestOptions options)
260276
* Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode
261277
* and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
262278
*/
263-
public GrantedToken update(GrantedTokenUpdateParams params) throws StripeException {
264-
return update(params, (RequestOptions) null);
279+
public GrantedToken revoke(GrantedTokenRevokeParams params) throws StripeException {
280+
return revoke(params, (RequestOptions) null);
265281
}
266282

267283
/**
268284
* Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode
269285
* and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
270286
*/
271-
public GrantedToken update(GrantedTokenUpdateParams params, RequestOptions options)
287+
public GrantedToken revoke(GrantedTokenRevokeParams params, RequestOptions options)
272288
throws StripeException {
273289
String path =
274290
String.format(

src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,29 @@ public class RequestedSessionUpdateParams extends ApiRequestParams {
3737

3838
/** The metadata for this requested session. */
3939
@SerializedName("metadata")
40-
Map<String, String> metadata;
40+
Object metadata;
4141

4242
/** The payment method for this requested session. */
4343
@SerializedName("payment_method")
4444
Object paymentMethod;
4545

4646
/** The payment method data for this requested session. */
4747
@SerializedName("payment_method_data")
48-
PaymentMethodData paymentMethodData;
48+
Object paymentMethodData;
4949

5050
/** The shared metadata for this requested session. */
5151
@SerializedName("shared_metadata")
52-
Map<String, String> sharedMetadata;
52+
Object sharedMetadata;
5353

5454
private RequestedSessionUpdateParams(
5555
List<String> expand,
5656
Map<String, Object> extraParams,
5757
FulfillmentDetails fulfillmentDetails,
5858
List<RequestedSessionUpdateParams.LineItemDetail> lineItemDetails,
59-
Map<String, String> metadata,
59+
Object metadata,
6060
Object paymentMethod,
61-
PaymentMethodData paymentMethodData,
62-
Map<String, String> sharedMetadata) {
61+
Object paymentMethodData,
62+
Object sharedMetadata) {
6363
this.expand = expand;
6464
this.extraParams = extraParams;
6565
this.fulfillmentDetails = fulfillmentDetails;
@@ -83,13 +83,13 @@ public static class Builder {
8383

8484
private List<RequestedSessionUpdateParams.LineItemDetail> lineItemDetails;
8585

86-
private Map<String, String> metadata;
86+
private Object metadata;
8787

8888
private Object paymentMethod;
8989

90-
private PaymentMethodData paymentMethodData;
90+
private Object paymentMethodData;
9191

92-
private Map<String, String> sharedMetadata;
92+
private Object sharedMetadata;
9393

9494
/** Finalize and obtain parameter instance from this builder. */
9595
public RequestedSessionUpdateParams build() {
@@ -195,11 +195,12 @@ public Builder addAllLineItemDetail(
195195
* and subsequent calls add additional key/value pairs to the original map. See {@link
196196
* RequestedSessionUpdateParams#metadata} for the field documentation.
197197
*/
198+
@SuppressWarnings("unchecked")
198199
public Builder putMetadata(String key, String value) {
199-
if (this.metadata == null) {
200-
this.metadata = new HashMap<>();
200+
if (this.metadata == null || this.metadata instanceof EmptyParam) {
201+
this.metadata = new HashMap<String, String>();
201202
}
202-
this.metadata.put(key, value);
203+
((Map<String, String>) this.metadata).put(key, value);
203204
return this;
204205
}
205206

@@ -208,11 +209,24 @@ public Builder putMetadata(String key, String value) {
208209
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
209210
* See {@link RequestedSessionUpdateParams#metadata} for the field documentation.
210211
*/
212+
@SuppressWarnings("unchecked")
211213
public Builder putAllMetadata(Map<String, String> map) {
212-
if (this.metadata == null) {
213-
this.metadata = new HashMap<>();
214+
if (this.metadata == null || this.metadata instanceof EmptyParam) {
215+
this.metadata = new HashMap<String, String>();
214216
}
215-
this.metadata.putAll(map);
217+
((Map<String, String>) this.metadata).putAll(map);
218+
return this;
219+
}
220+
221+
/** The metadata for this requested session. */
222+
public Builder setMetadata(EmptyParam metadata) {
223+
this.metadata = metadata;
224+
return this;
225+
}
226+
227+
/** The metadata for this requested session. */
228+
public Builder setMetadata(Map<String, String> metadata) {
229+
this.metadata = metadata;
216230
return this;
217231
}
218232

@@ -235,16 +249,23 @@ public Builder setPaymentMethodData(
235249
return this;
236250
}
237251

252+
/** The payment method data for this requested session. */
253+
public Builder setPaymentMethodData(EmptyParam paymentMethodData) {
254+
this.paymentMethodData = paymentMethodData;
255+
return this;
256+
}
257+
238258
/**
239259
* Add a key/value pair to `sharedMetadata` map. A map is initialized for the first `put/putAll`
240260
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
241261
* RequestedSessionUpdateParams#sharedMetadata} for the field documentation.
242262
*/
263+
@SuppressWarnings("unchecked")
243264
public Builder putSharedMetadata(String key, String value) {
244-
if (this.sharedMetadata == null) {
245-
this.sharedMetadata = new HashMap<>();
265+
if (this.sharedMetadata == null || this.sharedMetadata instanceof EmptyParam) {
266+
this.sharedMetadata = new HashMap<String, String>();
246267
}
247-
this.sharedMetadata.put(key, value);
268+
((Map<String, String>) this.sharedMetadata).put(key, value);
248269
return this;
249270
}
250271

@@ -253,11 +274,24 @@ public Builder putSharedMetadata(String key, String value) {
253274
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
254275
* See {@link RequestedSessionUpdateParams#sharedMetadata} for the field documentation.
255276
*/
277+
@SuppressWarnings("unchecked")
256278
public Builder putAllSharedMetadata(Map<String, String> map) {
257-
if (this.sharedMetadata == null) {
258-
this.sharedMetadata = new HashMap<>();
279+
if (this.sharedMetadata == null || this.sharedMetadata instanceof EmptyParam) {
280+
this.sharedMetadata = new HashMap<String, String>();
259281
}
260-
this.sharedMetadata.putAll(map);
282+
((Map<String, String>) this.sharedMetadata).putAll(map);
283+
return this;
284+
}
285+
286+
/** The shared metadata for this requested session. */
287+
public Builder setSharedMetadata(EmptyParam sharedMetadata) {
288+
this.sharedMetadata = sharedMetadata;
289+
return this;
290+
}
291+
292+
/** The shared metadata for this requested session. */
293+
public Builder setSharedMetadata(Map<String, String> sharedMetadata) {
294+
this.sharedMetadata = sharedMetadata;
261295
return this;
262296
}
263297
}

src/main/java/com/stripe/param/sharedpayment/GrantedTokenUpdateParams.java renamed to src/main/java/com/stripe/param/sharedpayment/GrantedTokenRevokeParams.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
@Getter
1414
@EqualsAndHashCode(callSuper = false)
15-
public class GrantedTokenUpdateParams extends ApiRequestParams {
15+
public class GrantedTokenRevokeParams extends ApiRequestParams {
1616
/** Specifies which fields in the response should be expanded. */
1717
@SerializedName("expand")
1818
List<String> expand;
@@ -26,7 +26,7 @@ public class GrantedTokenUpdateParams extends ApiRequestParams {
2626
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2727
Map<String, Object> extraParams;
2828

29-
private GrantedTokenUpdateParams(List<String> expand, Map<String, Object> extraParams) {
29+
private GrantedTokenRevokeParams(List<String> expand, Map<String, Object> extraParams) {
3030
this.expand = expand;
3131
this.extraParams = extraParams;
3232
}
@@ -41,14 +41,14 @@ public static class Builder {
4141
private Map<String, Object> extraParams;
4242

4343
/** Finalize and obtain parameter instance from this builder. */
44-
public GrantedTokenUpdateParams build() {
45-
return new GrantedTokenUpdateParams(this.expand, this.extraParams);
44+
public GrantedTokenRevokeParams build() {
45+
return new GrantedTokenRevokeParams(this.expand, this.extraParams);
4646
}
4747

4848
/**
4949
* Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
5050
* subsequent calls adds additional elements to the original list. See {@link
51-
* GrantedTokenUpdateParams#expand} for the field documentation.
51+
* GrantedTokenRevokeParams#expand} for the field documentation.
5252
*/
5353
public Builder addExpand(String element) {
5454
if (this.expand == null) {
@@ -61,7 +61,7 @@ public Builder addExpand(String element) {
6161
/**
6262
* Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
6363
* subsequent calls adds additional elements to the original list. See {@link
64-
* GrantedTokenUpdateParams#expand} for the field documentation.
64+
* GrantedTokenRevokeParams#expand} for the field documentation.
6565
*/
6666
public Builder addAllExpand(List<String> elements) {
6767
if (this.expand == null) {
@@ -74,7 +74,7 @@ public Builder addAllExpand(List<String> elements) {
7474
/**
7575
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
7676
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
77-
* GrantedTokenUpdateParams#extraParams} for the field documentation.
77+
* GrantedTokenRevokeParams#extraParams} for the field documentation.
7878
*/
7979
public Builder putExtraParam(String key, Object value) {
8080
if (this.extraParams == null) {
@@ -87,7 +87,7 @@ public Builder putExtraParam(String key, Object value) {
8787
/**
8888
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
8989
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
90-
* See {@link GrantedTokenUpdateParams#extraParams} for the field documentation.
90+
* See {@link GrantedTokenRevokeParams#extraParams} for the field documentation.
9191
*/
9292
public Builder putAllExtraParam(Map<String, Object> map) {
9393
if (this.extraParams == null) {

src/main/java/com/stripe/service/testhelpers/sharedpayment/GrantedTokenService.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import com.stripe.net.RequestOptions;
1212
import com.stripe.net.StripeResponseGetter;
1313
import com.stripe.param.sharedpayment.GrantedTokenCreateParams;
14-
import com.stripe.param.sharedpayment.GrantedTokenUpdateParams;
14+
import com.stripe.param.sharedpayment.GrantedTokenRevokeParams;
1515

1616
public final class GrantedTokenService extends ApiService {
1717
public GrantedTokenService(StripeResponseGetter responseGetter) {
@@ -45,32 +45,32 @@ public GrantedToken create(GrantedTokenCreateParams params, RequestOptions optio
4545
* Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode
4646
* and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
4747
*/
48-
public GrantedToken update(String sharedPaymentGrantedToken, GrantedTokenUpdateParams params)
48+
public GrantedToken revoke(String sharedPaymentGrantedToken, GrantedTokenRevokeParams params)
4949
throws StripeException {
50-
return update(sharedPaymentGrantedToken, params, (RequestOptions) null);
50+
return revoke(sharedPaymentGrantedToken, params, (RequestOptions) null);
5151
}
5252
/**
5353
* Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode
5454
* and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
5555
*/
56-
public GrantedToken update(String sharedPaymentGrantedToken, RequestOptions options)
56+
public GrantedToken revoke(String sharedPaymentGrantedToken, RequestOptions options)
5757
throws StripeException {
58-
return update(sharedPaymentGrantedToken, (GrantedTokenUpdateParams) null, options);
58+
return revoke(sharedPaymentGrantedToken, (GrantedTokenRevokeParams) null, options);
5959
}
6060
/**
6161
* Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode
6262
* and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
6363
*/
64-
public GrantedToken update(String sharedPaymentGrantedToken) throws StripeException {
65-
return update(
66-
sharedPaymentGrantedToken, (GrantedTokenUpdateParams) null, (RequestOptions) null);
64+
public GrantedToken revoke(String sharedPaymentGrantedToken) throws StripeException {
65+
return revoke(
66+
sharedPaymentGrantedToken, (GrantedTokenRevokeParams) null, (RequestOptions) null);
6767
}
6868
/**
6969
* Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode
7070
* and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
7171
*/
72-
public GrantedToken update(
73-
String sharedPaymentGrantedToken, GrantedTokenUpdateParams params, RequestOptions options)
72+
public GrantedToken revoke(
73+
String sharedPaymentGrantedToken, GrantedTokenRevokeParams params, RequestOptions options)
7474
throws StripeException {
7575
String path =
7676
String.format(

0 commit comments

Comments
 (0)