Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.core.Account;
import lombok.Getter;
import lombok.Setter;

@Getter
public final class V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEvent
extends Event {
/** Data for the v2.core.account[configuration.storer].capability_status_updated event. */
@SerializedName("data")
V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEvent.EventData data;

@Getter
@Setter
public static final class EventData {
/**
* Open Enum. The capability which had its status updated.
*
* <p>One of {@code financial_addressses.bank_accounts}, {@code holds_currencies.eur}, {@code
* holds_currencies.gbp}, {@code holds_currencies.usd}, {@code inbound_transfers.bank_accounts},
* {@code outbound_payments.bank_accounts}, {@code outbound_payments.cards}, {@code
* outbound_payments.financial_accounts}, {@code outbound_transfers.bank_accounts}, or {@code
* outbound_transfers.financial_accounts}.
*/
@SerializedName("updated_capability")
String updatedCapability;
}

@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Account fetchRelatedObject() throws StripeException {
return (Account) super.fetchRelatedObject(this.relatedObject);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.core.Account;
import lombok.Getter;

@Getter
public final class V2CoreAccountIncludingConfigurationStorerUpdatedEvent extends Event {
@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Account fetchRelatedObject() throws StripeException {
return (Account) super.fetchRelatedObject(this.relatedObject);
}
}
32 changes: 32 additions & 0 deletions src/main/java/com/stripe/exception/AlreadyExistsException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// File generated from our OpenAPI spec
package com.stripe.exception;

import com.google.gson.JsonObject;
import com.stripe.model.StripeError;
import com.stripe.model.StripeObject;
import com.stripe.net.StripeResponseGetter;

/** The resource already exists. */
public final class AlreadyExistsException extends ApiException {
private static final long serialVersionUID = 2L;

private AlreadyExistsException(
String message, String requestId, String code, Integer statusCode, Throwable e) {
super(message, requestId, code, statusCode, e);
}

static AlreadyExistsException parse(
JsonObject body, int statusCode, String requestId, StripeResponseGetter responseGetter) {
AlreadyExistsException.AlreadyExistsError error =
(AlreadyExistsException.AlreadyExistsError)
StripeObject.deserializeStripeObject(
body, AlreadyExistsException.AlreadyExistsError.class, responseGetter);
AlreadyExistsException exception =
new AlreadyExistsException(
error.getMessage(), requestId, error.getCode(), statusCode, null);
exception.setStripeError(error);
return exception;
}

public static class AlreadyExistsError extends StripeError {}
}
32 changes: 32 additions & 0 deletions src/main/java/com/stripe/exception/NonZeroBalanceException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// File generated from our OpenAPI spec
package com.stripe.exception;

import com.google.gson.JsonObject;
import com.stripe.model.StripeError;
import com.stripe.model.StripeObject;
import com.stripe.net.StripeResponseGetter;

/** Error thrown if a user tries to close an account that has non-zero balances. */
public final class NonZeroBalanceException extends ApiException {
private static final long serialVersionUID = 2L;

private NonZeroBalanceException(
String message, String requestId, String code, Integer statusCode, Throwable e) {
super(message, requestId, code, statusCode, e);
}

static NonZeroBalanceException parse(
JsonObject body, int statusCode, String requestId, StripeResponseGetter responseGetter) {
NonZeroBalanceException.NonZeroBalanceError error =
(NonZeroBalanceException.NonZeroBalanceError)
StripeObject.deserializeStripeObject(
body, NonZeroBalanceException.NonZeroBalanceError.class, responseGetter);
NonZeroBalanceException exception =
new NonZeroBalanceException(
error.getMessage(), requestId, error.getCode(), statusCode, null);
exception.setStripeError(error);
return exception;
}

public static class NonZeroBalanceError extends StripeError {}
}
10 changes: 8 additions & 2 deletions src/main/java/com/stripe/exception/StripeException.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,18 @@ public static StripeException parseV2Exception(
case "temporary_session_expired":
return com.stripe.exception.TemporarySessionExpiredException.parse(
body, statusCode, requestId, responseGetter);
case "financial_account_not_open":
return com.stripe.exception.FinancialAccountNotOpenException.parse(
case "non_zero_balance":
return com.stripe.exception.NonZeroBalanceException.parse(
body, statusCode, requestId, responseGetter);
case "already_exists":
return com.stripe.exception.AlreadyExistsException.parse(
body, statusCode, requestId, responseGetter);
case "feature_not_enabled":
return com.stripe.exception.FeatureNotEnabledException.parse(
body, statusCode, requestId, responseGetter);
case "financial_account_not_open":
return com.stripe.exception.FinancialAccountNotOpenException.parse(
body, statusCode, requestId, responseGetter);
case "blocked_by_stripe":
return com.stripe.exception.BlockedByStripeException.parse(
body, statusCode, requestId, responseGetter);
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/stripe/model/v2/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ public final class EventDataClassLookup {
eventClassLookup.put(
"v2.core.account[configuration.recipient].updated",
com.stripe.events.V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.class);
eventClassLookup.put(
"v2.core.account[configuration.storer].capability_status_updated",
com.stripe.events.V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEvent
.class);
eventClassLookup.put(
"v2.core.account[configuration.storer].updated",
com.stripe.events.V2CoreAccountIncludingConfigurationStorerUpdatedEvent.class);
eventClassLookup.put(
"v2.money_management.adjustment.created",
com.stripe.events.V2MoneyManagementAdjustmentCreatedEvent.class);
Expand Down
Loading