Skip to content

Commit 8edb488

Browse files
Merge pull request #2056 from stripe/latest-codegen-private-preview
Update generated code for private-preview
2 parents d45628b + 5a900e0 commit 8edb488

File tree

621 files changed

+9894
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

621 files changed

+9894
-124
lines changed

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4776797593c966ebe1494340934edf45a6764bf2
1+
1bc3aceb31e76e2eb165647acb28d8801c4b6911

src/main/java/com/stripe/StripeClient.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.stripe.exception.SignatureVerificationException;
44
import com.stripe.exception.StripeException;
55
import com.stripe.model.StripeObject;
6-
import com.stripe.model.ThinEvent;
6+
import com.stripe.model.v2.EventNotification;
77
import com.stripe.net.*;
88
import com.stripe.net.Webhook.Signature;
99
import java.net.PasswordAuthentication;
@@ -52,9 +52,9 @@ protected StripeResponseGetter getResponseGetter() {
5252
* @return the StripeEvent instance
5353
* @throws SignatureVerificationException if the verification fails.
5454
*/
55-
public ThinEvent parseThinEvent(String payload, String sigHeader, String secret)
55+
public EventNotification parseEventNotification(String payload, String sigHeader, String secret)
5656
throws SignatureVerificationException {
57-
return parseThinEvent(payload, sigHeader, secret, Webhook.DEFAULT_TOLERANCE);
57+
return parseEventNotification(payload, sigHeader, secret, Webhook.DEFAULT_TOLERANCE);
5858
}
5959

6060
/**
@@ -70,11 +70,12 @@ public ThinEvent parseThinEvent(String payload, String sigHeader, String secret)
7070
* @return the StripeEvent instance
7171
* @throws SignatureVerificationException if the verification fails.
7272
*/
73-
public ThinEvent parseThinEvent(String payload, String sigHeader, String secret, long tolerance)
73+
public EventNotification parseEventNotification(
74+
String payload, String sigHeader, String secret, long tolerance)
7475
throws SignatureVerificationException {
7576
Signature.verifyHeader(payload, sigHeader, secret, tolerance);
7677

77-
return ApiResource.GSON.fromJson(payload, ThinEvent.class);
78+
return EventNotification.fromJson(payload, this);
7879
}
7980

8081
/**

src/main/java/com/stripe/events/V1AccountUpdatedEvent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.stripe.exception.StripeException;
66
import com.stripe.model.Account;
77
import com.stripe.model.v2.Event;
8+
import com.stripe.model.v2.Event.RelatedObject;
89
import lombok.Getter;
910

1011
@Getter
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.Account;
7+
import com.stripe.model.v2.Event.RelatedObject;
8+
import com.stripe.model.v2.EventNotification;
9+
import lombok.Getter;
10+
11+
@Getter
12+
public final class V1AccountUpdatedEventNotification 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 Account fetchRelatedObject() throws StripeException {
20+
return (Account) super.fetchRelatedObject(this.relatedObject);
21+
}
22+
/** Retrieve the corresponding full event from the Stripe API. */
23+
@Override
24+
public V1AccountUpdatedEvent fetchEvent() throws StripeException {
25+
return (V1AccountUpdatedEvent) super.fetchEvent();
26+
}
27+
}

src/main/java/com/stripe/events/V1ApplicationFeeCreatedEvent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.stripe.exception.StripeException;
66
import com.stripe.model.ApplicationFee;
77
import com.stripe.model.v2.Event;
8+
import com.stripe.model.v2.Event.RelatedObject;
89
import lombok.Getter;
910

1011
@Getter
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.ApplicationFee;
7+
import com.stripe.model.v2.Event.RelatedObject;
8+
import com.stripe.model.v2.EventNotification;
9+
import lombok.Getter;
10+
11+
@Getter
12+
public final class V1ApplicationFeeCreatedEventNotification 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 ApplicationFee fetchRelatedObject() throws StripeException {
20+
return (ApplicationFee) super.fetchRelatedObject(this.relatedObject);
21+
}
22+
/** Retrieve the corresponding full event from the Stripe API. */
23+
@Override
24+
public V1ApplicationFeeCreatedEvent fetchEvent() throws StripeException {
25+
return (V1ApplicationFeeCreatedEvent) super.fetchEvent();
26+
}
27+
}

src/main/java/com/stripe/events/V1ApplicationFeeRefundedEvent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.stripe.exception.StripeException;
66
import com.stripe.model.ApplicationFee;
77
import com.stripe.model.v2.Event;
8+
import com.stripe.model.v2.Event.RelatedObject;
89
import lombok.Getter;
910

1011
@Getter
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.ApplicationFee;
7+
import com.stripe.model.v2.Event.RelatedObject;
8+
import com.stripe.model.v2.EventNotification;
9+
import lombok.Getter;
10+
11+
@Getter
12+
public final class V1ApplicationFeeRefundedEventNotification 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 ApplicationFee fetchRelatedObject() throws StripeException {
20+
return (ApplicationFee) super.fetchRelatedObject(this.relatedObject);
21+
}
22+
/** Retrieve the corresponding full event from the Stripe API. */
23+
@Override
24+
public V1ApplicationFeeRefundedEvent fetchEvent() throws StripeException {
25+
return (V1ApplicationFeeRefundedEvent) super.fetchEvent();
26+
}
27+
}

src/main/java/com/stripe/events/V1BillingMeterErrorReportTriggeredEvent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.stripe.exception.StripeException;
66
import com.stripe.model.billing.Meter;
77
import com.stripe.model.v2.Event;
8+
import com.stripe.model.v2.Event.RelatedObject;
89
import java.time.Instant;
910
import java.util.List;
1011
import lombok.Getter;
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.billing.Meter;
7+
import com.stripe.model.v2.Event.RelatedObject;
8+
import com.stripe.model.v2.EventNotification;
9+
import lombok.Getter;
10+
11+
@Getter
12+
public final class V1BillingMeterErrorReportTriggeredEventNotification 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 Meter fetchRelatedObject() throws StripeException {
20+
return (Meter) super.fetchRelatedObject(this.relatedObject);
21+
}
22+
/** Retrieve the corresponding full event from the Stripe API. */
23+
@Override
24+
public V1BillingMeterErrorReportTriggeredEvent fetchEvent() throws StripeException {
25+
return (V1BillingMeterErrorReportTriggeredEvent) super.fetchEvent();
26+
}
27+
}

0 commit comments

Comments
 (0)