Skip to content

Commit 0cf1766

Browse files
Update generated code for v2256 and
1 parent c059cf9 commit 0cf1766

7 files changed

Lines changed: 762 additions & 2 deletions

File tree

CODEGEN_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f02038df5433a605fce164b9af1b8b445252ee4f
1+
6b817716b60b32636770d4c1bd7863bbdb6f5f7a

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2255
1+
v2256

src/main/java/com/stripe/model/PaymentLocation.java

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import com.stripe.net.RequestOptions;
1111
import com.stripe.net.StripeResponseGetter;
1212
import com.stripe.param.PaymentLocationCreateParams;
13+
import com.stripe.param.PaymentLocationRetrieveParams;
14+
import com.stripe.param.PaymentLocationUpdateParams;
1315
import java.util.List;
1416
import java.util.Map;
1517
import lombok.EqualsAndHashCode;
@@ -35,6 +37,10 @@ public class PaymentLocation extends ApiResource implements HasId {
3537
@SerializedName("capability_settings")
3638
CapabilitySettings capabilitySettings;
3739

40+
/** Always true for a deleted object. */
41+
@SerializedName("deleted")
42+
Boolean deleted;
43+
3844
/** The display name of the location. */
3945
@SerializedName("display_name")
4046
String displayName;
@@ -93,6 +99,99 @@ public static PaymentLocation create(PaymentLocationCreateParams params, Request
9399
return getGlobalResponseGetter().request(request, PaymentLocation.class);
94100
}
95101

102+
/** Delete a Payment Location. */
103+
public PaymentLocation delete() throws StripeException {
104+
return delete((Map<String, Object>) null, (RequestOptions) null);
105+
}
106+
107+
/** Delete a Payment Location. */
108+
public PaymentLocation delete(RequestOptions options) throws StripeException {
109+
return delete((Map<String, Object>) null, options);
110+
}
111+
112+
/** Delete a Payment Location. */
113+
public PaymentLocation delete(Map<String, Object> params) throws StripeException {
114+
return delete(params, (RequestOptions) null);
115+
}
116+
117+
/** Delete a Payment Location. */
118+
public PaymentLocation delete(Map<String, Object> params, RequestOptions options)
119+
throws StripeException {
120+
String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(this.getId()));
121+
ApiRequest request =
122+
new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.DELETE, path, params, options);
123+
return getResponseGetter().request(request, PaymentLocation.class);
124+
}
125+
126+
/** Retrieve a Payment Location. */
127+
public static PaymentLocation retrieve(String id) throws StripeException {
128+
return retrieve(id, (Map<String, Object>) null, (RequestOptions) null);
129+
}
130+
131+
/** Retrieve a Payment Location. */
132+
public static PaymentLocation retrieve(String id, RequestOptions options) throws StripeException {
133+
return retrieve(id, (Map<String, Object>) null, options);
134+
}
135+
136+
/** Retrieve a Payment Location. */
137+
public static PaymentLocation retrieve(
138+
String id, Map<String, Object> params, RequestOptions options) throws StripeException {
139+
String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(id));
140+
ApiRequest request =
141+
new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
142+
return getGlobalResponseGetter().request(request, PaymentLocation.class);
143+
}
144+
145+
/** Retrieve a Payment Location. */
146+
public static PaymentLocation retrieve(
147+
String id, PaymentLocationRetrieveParams params, RequestOptions options)
148+
throws StripeException {
149+
String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(id));
150+
ApiResource.checkNullTypedParams(path, params);
151+
ApiRequest request =
152+
new ApiRequest(
153+
BaseAddress.API,
154+
ApiResource.RequestMethod.GET,
155+
path,
156+
ApiRequestParams.paramsToMap(params),
157+
options);
158+
return getGlobalResponseGetter().request(request, PaymentLocation.class);
159+
}
160+
161+
/** Update a Payment Location. */
162+
public PaymentLocation update(Map<String, Object> params) throws StripeException {
163+
return update(params, (RequestOptions) null);
164+
}
165+
166+
/** Update a Payment Location. */
167+
public PaymentLocation update(Map<String, Object> params, RequestOptions options)
168+
throws StripeException {
169+
String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(this.getId()));
170+
ApiRequest request =
171+
new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
172+
return getResponseGetter().request(request, PaymentLocation.class);
173+
}
174+
175+
/** Update a Payment Location. */
176+
public PaymentLocation update(PaymentLocationUpdateParams params) throws StripeException {
177+
return update(params, (RequestOptions) null);
178+
}
179+
180+
/** Update a Payment Location. */
181+
public PaymentLocation update(PaymentLocationUpdateParams params, RequestOptions options)
182+
throws StripeException {
183+
String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(this.getId()));
184+
ApiResource.checkNullTypedParams(path, params);
185+
ApiRequest request =
186+
new ApiRequest(
187+
BaseAddress.API,
188+
ApiResource.RequestMethod.POST,
189+
path,
190+
ApiRequestParams.paramsToMap(params),
191+
options);
192+
return getResponseGetter().request(request, PaymentLocation.class);
193+
}
194+
96195
/**
97196
* For more details about BusinessRegistration, please refer to the <a
98197
* href="https://docs.stripe.com/api">API Reference.</a>

src/main/java/com/stripe/model/Subscription.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@ public class Subscription extends ApiResource implements HasId, MetadataStore<Su
386386
@SerializedName("status")
387387
String status;
388388

389+
/** Describes changes to the subscription's status. */
390+
@SerializedName("status_details")
391+
StatusDetails statusDetails;
392+
389393
/** ID of the test clock this subscription belongs to. */
390394
@SerializedName("test_clock")
391395
@Getter(lombok.AccessLevel.NONE)
@@ -2717,6 +2721,55 @@ public static class PresentmentDetails extends StripeObject {
27172721
String presentmentCurrency;
27182722
}
27192723

2724+
/** Describes changes to the subscription's status. */
2725+
@Getter
2726+
@Setter
2727+
@EqualsAndHashCode(callSuper = false)
2728+
public static class StatusDetails extends StripeObject {
2729+
/** Indicates when and why the subscription transitioned to the paused status. */
2730+
@SerializedName("paused")
2731+
Paused paused;
2732+
2733+
/** Indicates when and why the subscription transitioned to the paused status. */
2734+
@Getter
2735+
@Setter
2736+
@EqualsAndHashCode(callSuper = false)
2737+
public static class Paused extends StripeObject {
2738+
/** Information on the {@code type=subscription} pause. */
2739+
@SerializedName("subscription")
2740+
InnerSubscription subscription;
2741+
2742+
/**
2743+
* Unix timestamp in seconds of when the subscription status transitioned to {@code paused}.
2744+
*/
2745+
@SerializedName("transitioned_at")
2746+
Long transitionedAt;
2747+
2748+
/**
2749+
* The type of pause.
2750+
*
2751+
* <p>Equal to {@code subscription}.
2752+
*/
2753+
@SerializedName("type")
2754+
String type;
2755+
2756+
/** Information on the {@code type=subscription} pause. */
2757+
@Getter
2758+
@Setter
2759+
@EqualsAndHashCode(callSuper = false)
2760+
public static class InnerSubscription extends StripeObject {
2761+
/**
2762+
* The reason that the subscription was paused.
2763+
*
2764+
* <p>One of {@code pause_requested}, {@code system}, or {@code
2765+
* trial_end_without_payment_method}.
2766+
*/
2767+
@SerializedName("type")
2768+
String type;
2769+
}
2770+
}
2771+
}
2772+
27202773
/**
27212774
* For more details about TransferData, please refer to the <a
27222775
* href="https://docs.stripe.com/api">API Reference.</a>
@@ -2818,6 +2871,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
28182871
trySetResponseGetter(prebilling, responseGetter);
28192872
trySetResponseGetter(presentmentDetails, responseGetter);
28202873
trySetResponseGetter(schedule, responseGetter);
2874+
trySetResponseGetter(statusDetails, responseGetter);
28212875
trySetResponseGetter(testClock, responseGetter);
28222876
trySetResponseGetter(transferData, responseGetter);
28232877
trySetResponseGetter(trialSettings, responseGetter);
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// File generated from our OpenAPI spec
2+
package com.stripe.param;
3+
4+
import com.google.gson.annotations.SerializedName;
5+
import com.stripe.net.ApiRequestParams;
6+
import java.util.ArrayList;
7+
import java.util.HashMap;
8+
import java.util.List;
9+
import java.util.Map;
10+
import lombok.EqualsAndHashCode;
11+
import lombok.Getter;
12+
13+
@Getter
14+
@EqualsAndHashCode(callSuper = false)
15+
public class PaymentLocationRetrieveParams extends ApiRequestParams {
16+
/** Specifies which fields in the response should be expanded. */
17+
@SerializedName("expand")
18+
List<String> expand;
19+
20+
/**
21+
* Map of extra parameters for custom features not available in this client library. The content
22+
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
23+
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
24+
* param object. Effectively, this map is flattened to its parent instance.
25+
*/
26+
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
27+
Map<String, Object> extraParams;
28+
29+
private PaymentLocationRetrieveParams(List<String> expand, Map<String, Object> extraParams) {
30+
this.expand = expand;
31+
this.extraParams = extraParams;
32+
}
33+
34+
public static Builder builder() {
35+
return new Builder();
36+
}
37+
38+
public static class Builder {
39+
private List<String> expand;
40+
41+
private Map<String, Object> extraParams;
42+
43+
/** Finalize and obtain parameter instance from this builder. */
44+
public PaymentLocationRetrieveParams build() {
45+
return new PaymentLocationRetrieveParams(this.expand, this.extraParams);
46+
}
47+
48+
/**
49+
* Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
50+
* subsequent calls adds additional elements to the original list. See {@link
51+
* PaymentLocationRetrieveParams#expand} for the field documentation.
52+
*/
53+
public Builder addExpand(String element) {
54+
if (this.expand == null) {
55+
this.expand = new ArrayList<>();
56+
}
57+
this.expand.add(element);
58+
return this;
59+
}
60+
61+
/**
62+
* Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
63+
* subsequent calls adds additional elements to the original list. See {@link
64+
* PaymentLocationRetrieveParams#expand} for the field documentation.
65+
*/
66+
public Builder addAllExpand(List<String> elements) {
67+
if (this.expand == null) {
68+
this.expand = new ArrayList<>();
69+
}
70+
this.expand.addAll(elements);
71+
return this;
72+
}
73+
74+
/**
75+
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
76+
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
77+
* PaymentLocationRetrieveParams#extraParams} for the field documentation.
78+
*/
79+
public Builder putExtraParam(String key, Object value) {
80+
if (this.extraParams == null) {
81+
this.extraParams = new HashMap<>();
82+
}
83+
this.extraParams.put(key, value);
84+
return this;
85+
}
86+
87+
/**
88+
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
89+
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
90+
* See {@link PaymentLocationRetrieveParams#extraParams} for the field documentation.
91+
*/
92+
public Builder putAllExtraParam(Map<String, Object> map) {
93+
if (this.extraParams == null) {
94+
this.extraParams = new HashMap<>();
95+
}
96+
this.extraParams.putAll(map);
97+
return this;
98+
}
99+
}
100+
}

0 commit comments

Comments
 (0)