Skip to content

Commit de630ec

Browse files
Update generated code for v2254 and
1 parent e065f77 commit de630ec

29 files changed

Lines changed: 1288 additions & 111 deletions

CODEGEN_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5214632d48fa0ade071cbbe4412e43790abd4438
1+
3ac0dc357d86c95bbba40ca9818f5eacf4d0a405
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// File generated from our OpenAPI spec
2+
package com.stripe.events;
3+
4+
import com.google.gson.annotations.SerializedName;
5+
import com.stripe.exception.StripeException;
6+
import com.stripe.model.v2.core.ApprovalRequest;
7+
import com.stripe.model.v2.core.Event;
8+
import com.stripe.model.v2.core.Event.RelatedObject;
9+
import lombok.Getter;
10+
11+
@Getter
12+
public final class V2CoreApprovalRequestCreatedEvent extends Event {
13+
@SerializedName("related_object")
14+
15+
/** Object containing the reference to API resource relevant to the event. */
16+
RelatedObject relatedObject;
17+
18+
/** Retrieves the related object from the API. Make an API request on every call. */
19+
public ApprovalRequest fetchRelatedObject() throws StripeException {
20+
return (ApprovalRequest) super.fetchRelatedObject(this.relatedObject);
21+
}
22+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// File generated from our OpenAPI spec
2+
package com.stripe.events;
3+
4+
import com.google.gson.annotations.SerializedName;
5+
import com.stripe.exception.StripeException;
6+
import com.stripe.model.v2.core.ApprovalRequest;
7+
import com.stripe.model.v2.core.Event.RelatedObject;
8+
import com.stripe.model.v2.core.EventNotification;
9+
import lombok.Getter;
10+
11+
@Getter
12+
public final class V2CoreApprovalRequestCreatedEventNotification extends EventNotification {
13+
@SerializedName("related_object")
14+
15+
/** Object containing the reference to API resource relevant to the event. */
16+
RelatedObject relatedObject;
17+
18+
/** Retrieves the related object from the API. Make an API request on every call. */
19+
public ApprovalRequest fetchRelatedObject() throws StripeException {
20+
return (ApprovalRequest) super.fetchRelatedObject(this.relatedObject);
21+
}
22+
/** Retrieve the corresponding full event from the Stripe API. */
23+
@Override
24+
public V2CoreApprovalRequestCreatedEvent fetchEvent() throws StripeException {
25+
return (V2CoreApprovalRequestCreatedEvent) super.fetchEvent();
26+
}
27+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// File generated from our OpenAPI spec
2+
package com.stripe.events;
3+
4+
import com.google.gson.annotations.SerializedName;
5+
import com.stripe.exception.StripeException;
6+
import com.stripe.model.v2.core.ApprovalRequest;
7+
import com.stripe.model.v2.core.Event;
8+
import com.stripe.model.v2.core.Event.RelatedObject;
9+
import lombok.Getter;
10+
11+
@Getter
12+
public final class V2CoreApprovalRequestExpiredEvent extends Event {
13+
@SerializedName("related_object")
14+
15+
/** Object containing the reference to API resource relevant to the event. */
16+
RelatedObject relatedObject;
17+
18+
/** Retrieves the related object from the API. Make an API request on every call. */
19+
public ApprovalRequest fetchRelatedObject() throws StripeException {
20+
return (ApprovalRequest) super.fetchRelatedObject(this.relatedObject);
21+
}
22+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// File generated from our OpenAPI spec
2+
package com.stripe.events;
3+
4+
import com.google.gson.annotations.SerializedName;
5+
import com.stripe.exception.StripeException;
6+
import com.stripe.model.v2.core.ApprovalRequest;
7+
import com.stripe.model.v2.core.Event.RelatedObject;
8+
import com.stripe.model.v2.core.EventNotification;
9+
import lombok.Getter;
10+
11+
@Getter
12+
public final class V2CoreApprovalRequestExpiredEventNotification extends EventNotification {
13+
@SerializedName("related_object")
14+
15+
/** Object containing the reference to API resource relevant to the event. */
16+
RelatedObject relatedObject;
17+
18+
/** Retrieves the related object from the API. Make an API request on every call. */
19+
public ApprovalRequest fetchRelatedObject() throws StripeException {
20+
return (ApprovalRequest) super.fetchRelatedObject(this.relatedObject);
21+
}
22+
/** Retrieve the corresponding full event from the Stripe API. */
23+
@Override
24+
public V2CoreApprovalRequestExpiredEvent fetchEvent() throws StripeException {
25+
return (V2CoreApprovalRequestExpiredEvent) super.fetchEvent();
26+
}
27+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// File generated from our OpenAPI spec
2+
package com.stripe.events;
3+
4+
import com.google.gson.annotations.SerializedName;
5+
import com.stripe.model.v2.core.Event;
6+
import lombok.Getter;
7+
import lombok.Setter;
8+
9+
@Getter
10+
public final class V2ExtendExtensionRunFailedEvent extends Event {
11+
/** Data for the v2.extend.extension_run.failed event. */
12+
@SerializedName("data")
13+
V2ExtendExtensionRunFailedEvent.EventData data;
14+
15+
@Getter
16+
@Setter
17+
public static final class EventData {
18+
/** Details about the error that occurred. */
19+
@SerializedName("error")
20+
Errors error;
21+
/** Details about the extension that failed. */
22+
@SerializedName("extension")
23+
Extension extension;
24+
/** The ID of the extension run that failed. */
25+
@SerializedName("extension_run_id")
26+
String extensionRunId;
27+
28+
public static final class Errors {
29+
/** URL to the extension run in Workbench for deeper debugging. */
30+
@SerializedName("debug_url")
31+
String debugUrl;
32+
/** Detailed error message. */
33+
@SerializedName("message")
34+
String message;
35+
}
36+
37+
public static final class Extension {
38+
/** The extension's unique identifier. */
39+
@SerializedName("id")
40+
String id;
41+
/** The extension method called where the failure occurred. */
42+
@SerializedName("method")
43+
String method;
44+
/** Human-readable name of the extension. */
45+
@SerializedName("name")
46+
String name;
47+
/** Version of the extension that failed. */
48+
@SerializedName("version")
49+
String version;
50+
}
51+
}
52+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// File generated from our OpenAPI spec
2+
package com.stripe.events;
3+
4+
import com.stripe.exception.StripeException;
5+
import com.stripe.model.v2.core.EventNotification;
6+
7+
public final class V2ExtendExtensionRunFailedEventNotification extends EventNotification {
8+
/** Retrieve the corresponding full event from the Stripe API. */
9+
@Override
10+
public V2ExtendExtensionRunFailedEvent fetchEvent() throws StripeException {
11+
return (V2ExtendExtensionRunFailedEvent) super.fetchEvent();
12+
}
13+
}

src/main/java/com/stripe/model/v2/EventDataClassLookup.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ public final class EventDataClassLookup {
172172
classLookup.put(
173173
"v2.core.vault.us_bank_account", com.stripe.model.v2.core.vault.UsBankAccount.class);
174174

175+
classLookup.put(
176+
"v2.data.analytics.metric_query_result",
177+
com.stripe.model.v2.data.analytics.MetricQueryResult.class);
178+
175179
classLookup.put(
176180
"v2.data.reporting.query_run", com.stripe.model.v2.data.reporting.QueryRun.class);
177181

@@ -853,6 +857,12 @@ public final class EventDataClassLookup {
853857
eventClassLookup.put(
854858
"v2.core.approval_request.canceled",
855859
com.stripe.events.V2CoreApprovalRequestCanceledEvent.class);
860+
eventClassLookup.put(
861+
"v2.core.approval_request.created",
862+
com.stripe.events.V2CoreApprovalRequestCreatedEvent.class);
863+
eventClassLookup.put(
864+
"v2.core.approval_request.expired",
865+
com.stripe.events.V2CoreApprovalRequestExpiredEvent.class);
856866
eventClassLookup.put(
857867
"v2.core.approval_request.failed",
858868
com.stripe.events.V2CoreApprovalRequestFailedEvent.class);
@@ -979,6 +989,8 @@ public final class EventDataClassLookup {
979989
eventClassLookup.put(
980990
"v2.data.reporting.query_run.updated",
981991
com.stripe.events.V2DataReportingQueryRunUpdatedEvent.class);
992+
eventClassLookup.put(
993+
"v2.extend.extension_run.failed", com.stripe.events.V2ExtendExtensionRunFailedEvent.class);
982994
eventClassLookup.put(
983995
"v2.extend.workflow_run.failed", com.stripe.events.V2ExtendWorkflowRunFailedEvent.class);
984996
eventClassLookup.put(

src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,12 @@ public final class EventNotificationClassLookup {
743743
eventClassLookup.put(
744744
"v2.core.approval_request.canceled",
745745
com.stripe.events.V2CoreApprovalRequestCanceledEventNotification.class);
746+
eventClassLookup.put(
747+
"v2.core.approval_request.created",
748+
com.stripe.events.V2CoreApprovalRequestCreatedEventNotification.class);
749+
eventClassLookup.put(
750+
"v2.core.approval_request.expired",
751+
com.stripe.events.V2CoreApprovalRequestExpiredEventNotification.class);
746752
eventClassLookup.put(
747753
"v2.core.approval_request.failed",
748754
com.stripe.events.V2CoreApprovalRequestFailedEventNotification.class);
@@ -882,6 +888,9 @@ public final class EventNotificationClassLookup {
882888
eventClassLookup.put(
883889
"v2.data.reporting.query_run.updated",
884890
com.stripe.events.V2DataReportingQueryRunUpdatedEventNotification.class);
891+
eventClassLookup.put(
892+
"v2.extend.extension_run.failed",
893+
com.stripe.events.V2ExtendExtensionRunFailedEventNotification.class);
885894
eventClassLookup.put(
886895
"v2.extend.workflow_run.failed",
887896
com.stripe.events.V2ExtendWorkflowRunFailedEventNotification.class);

src/main/java/com/stripe/model/v2/core/Account.java

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@
1313
import lombok.Setter;
1414

1515
/**
16-
* An Account v2 object represents a company, individual, or other entity that interacts with a
17-
* platform on Stripe. It contains both identifying information and properties that control its
18-
* behavior and functionality. An Account can have one or more configurations that enable sets of
19-
* related features, such as allowing it to act as a merchant or customer. The Accounts v2 API
20-
* supports both the Global Payouts preview feature and the Connect-Billing integration preview
21-
* feature. However, a particular Account can only access one of them. The Connect-Billing
22-
* integration preview feature allows an Account v2 to pay subscription fees to a platform. An
23-
* Account v1 required a separate Customer object to pay subscription fees.
16+
* An Account v2 object represents a company, individual, or other entity that your Stripe
17+
* integration interacts with. It contains both identifying information and properties that control
18+
* its behavior and functionality. An Account can have one or more configurations that enable sets
19+
* of related features, such as allowing it to act as a merchant or customer. The Accounts v2 API is
20+
* broadly available to Connect platforms, and to other users in preview. The Accounts v2 API also
21+
* supports the Global Payouts preview feature.
2422
*/
2523
@Getter
2624
@Setter
@@ -42,10 +40,7 @@ public class Account extends StripeObject implements HasId {
4240
@SerializedName("configuration")
4341
Configuration configuration;
4442

45-
/**
46-
* The default contact email address for the Account. Required when configuring the account as a
47-
* merchant or recipient.
48-
*/
43+
/** The primary contact email address for the Account. */
4944
@SerializedName("contact_email")
5045
String contactEmail;
5146

@@ -139,7 +134,10 @@ public static class Configuration extends StripeObject {
139134
@SerializedName("card_creator")
140135
CardCreator cardCreator;
141136

142-
/** The Customer Configuration allows the Account to be used in inbound payment flows. */
137+
/**
138+
* The Customer Configuration allows the Account to be used in inbound payment flows (i.e.
139+
* customer-facing payment and billing flows).
140+
*/
143141
@SerializedName("customer")
144142
Customer customer;
145143

@@ -995,7 +993,10 @@ public static class StatusDetail extends StripeObject {
995993
}
996994
}
997995

998-
/** The Customer Configuration allows the Account to be used in inbound payment flows. */
996+
/**
997+
* The Customer Configuration allows the Account to be used in inbound payment flows (i.e.
998+
* customer-facing payment and billing flows).
999+
*/
9991000
@Getter
10001001
@Setter
10011002
@EqualsAndHashCode(callSuper = false)
@@ -1104,8 +1105,8 @@ public static class Location extends StripeObject {
11041105
@EqualsAndHashCode(callSuper = false)
11051106
public static class Billing extends StripeObject {
11061107
/**
1107-
* ID of a PaymentMethod attached to the customer account to use as the default for invoices
1108-
* and subscriptions.
1108+
* The ID of a {@code PaymentMethod} attached to this Account's {@code customer}
1109+
* configuration, used as the default payment method for invoices and subscriptions.
11091110
*/
11101111
@SerializedName("default_payment_method")
11111112
String defaultPaymentMethod;
@@ -6380,7 +6381,9 @@ public static class Identity extends StripeObject {
63806381
String country;
63816382

63826383
/**
6383-
* The entity type.
6384+
* The entity type represented by the Account. Ensure this field is accurate before adding
6385+
* configurations that rely on identity information, as it determines which identity fields
6386+
* apply and how the Account is validated.
63846387
*
63856388
* <p>One of {@code company}, {@code government_entity}, {@code individual}, or {@code
63866389
* non_profit}.
@@ -9103,7 +9106,11 @@ public static class Individual extends StripeObject implements HasId {
91039106
@SerializedName("documents")
91049107
Documents documents;
91059108

9106-
/** The individual's email address. */
9109+
/**
9110+
* The individual's email address. You can only set this field when the Account is configured
9111+
* as a {@code merchant} or {@code recipient}. Use {@code contact_email} as the primary
9112+
* contact email for this Account.
9113+
*/
91079114
@SerializedName("email")
91089115
String email;
91099116

0 commit comments

Comments
 (0)