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
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2022
v2023
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// 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.billing.BillSetting;
import java.time.Instant;
import lombok.Getter;
import lombok.Setter;

@Getter
public final class V2BillingBillSettingUpdatedEvent extends Event {
/** Data for the v2.billing.bill_setting.updated event. */
@SerializedName("data")
V2BillingBillSettingUpdatedEvent.EventData data;

@Getter
@Setter
public static final class EventData {
/** Timestamp of when the object was updated. */
@SerializedName("updated")
Instant updated;
}

@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 BillSetting fetchRelatedObject() throws StripeException {
return (BillSetting) super.fetchRelatedObject(this.relatedObject);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ 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}.
* <p>One of {@code financial_addressses.bank_accounts}, {@code
* financial_addressses.crypto_wallets}, {@code holds_currencies.eur}, {@code
* holds_currencies.gbp}, {@code holds_currencies.usd}, {@code holds_currencies.usdc}, {@code
* inbound_transfers.bank_accounts}, {@code outbound_payments.bank_accounts}, {@code
* outbound_payments.cards}, {@code outbound_payments.crypto_wallets}, {@code
* outbound_payments.financial_accounts}, {@code outbound_transfers.bank_accounts}, {@code
* outbound_transfers.crypto_wallets}, or {@code outbound_transfers.financial_accounts}.
*/
@SerializedName("updated_capability")
String updatedCapability;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/stripe/exception/StripeException.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ public static StripeException parseV2Exception(
case "quota_exceeded":
return com.stripe.exception.QuotaExceededException.parse(
body, statusCode, requestId, responseGetter);
case "rate_limit":
return com.stripe.exception.RateLimitException.parse(
body, statusCode, requestId, responseGetter);
case "recipient_not_notifiable":
return com.stripe.exception.RecipientNotNotifiableException.parse(
body, statusCode, requestId, responseGetter);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/stripe/model/Dispute.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ public class Dispute extends ApiResource
* warning_under_review}, {@code warning_closed}, {@code needs_response}, {@code under_review},
* {@code won}, {@code lost}, or {@code prevented}.
*
* <p>One of {@code lost}, {@code needs_response}, {@code under_review}, {@code warning_closed},
* {@code warning_needs_response}, {@code warning_under_review}, or {@code won}.
* <p>One of {@code lost}, {@code needs_response}, {@code prevented}, {@code under_review}, {@code
* warning_closed}, {@code warning_needs_response}, {@code warning_under_review}, or {@code won}.
*/
@SerializedName("status")
String status;
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/stripe/model/v2/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,22 @@ public final class EventDataClassLookup {
classLookup.put("v2.core.event", com.stripe.model.v2.Event.class);
classLookup.put("v2.core.event_destination", com.stripe.model.v2.EventDestination.class);

classLookup.put("v2.billing.bill_setting", com.stripe.model.v2.billing.BillSetting.class);
classLookup.put(
"v2.billing.bill_setting_version", com.stripe.model.v2.billing.BillSettingVersion.class);
classLookup.put("v2.billing.cadence", com.stripe.model.v2.billing.Cadence.class);
classLookup.put(
"v2.billing.collection_setting", com.stripe.model.v2.billing.CollectionSetting.class);
classLookup.put(
"v2.billing.collection_setting_version",
com.stripe.model.v2.billing.CollectionSettingVersion.class);
classLookup.put("v2.billing.meter_event", com.stripe.model.v2.billing.MeterEvent.class);
classLookup.put(
"v2.billing.meter_event_adjustment",
com.stripe.model.v2.billing.MeterEventAdjustment.class);
classLookup.put(
"v2.billing.meter_event_session", com.stripe.model.v2.billing.MeterEventSession.class);
classLookup.put("v2.billing.profile", com.stripe.model.v2.billing.Profile.class);

classLookup.put("v2.core.account", com.stripe.model.v2.core.Account.class);
classLookup.put("v2.core.account_link", com.stripe.model.v2.core.AccountLink.class);
Expand Down Expand Up @@ -92,6 +102,9 @@ public final class EventDataClassLookup {
com.stripe.events.V1BillingMeterErrorReportTriggeredEvent.class);
eventClassLookup.put(
"v1.billing.meter.no_meter_found", com.stripe.events.V1BillingMeterNoMeterFoundEvent.class);
eventClassLookup.put(
"v2.billing.bill_setting.updated",
com.stripe.events.V2BillingBillSettingUpdatedEvent.class);
eventClassLookup.put(
"v2.core.account.closed", com.stripe.events.V2CoreAccountClosedEvent.class);
eventClassLookup.put(
Expand Down
138 changes: 138 additions & 0 deletions src/main/java/com/stripe/model/v2/billing/BillSetting.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
// File generated from our OpenAPI spec
package com.stripe.model.v2.billing;

import com.google.gson.annotations.SerializedName;
import com.stripe.model.HasId;
import com.stripe.model.StripeObject;
import java.time.Instant;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
* BillSetting is responsible for settings which dictate generating bills, which include settings
* for calculating totals on bills, tax on bill items, as well as how to generate and present
* invoices.
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class BillSetting extends StripeObject implements HasId {
/** Settings related to calculating a bill. */
@SerializedName("calculation")
Calculation calculation;

/** Timestamp of when the object was created. */
@SerializedName("created")
Instant created;

/** An optional field for adding a display name for the BillSetting object. */
@SerializedName("display_name")
String displayName;

/** The ID of the BillSetting object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;

/** Settings related to invoice behavior. */
@SerializedName("invoice")
Invoice invoice;

/** The ID of the invoice rendering template to be used when generating invoices. */
@SerializedName("invoice_rendering_template")
String invoiceRenderingTemplate;

/**
* The latest version of the current settings object. This will be Updated every time an attribute
* of the settings is updated.
*/
@SerializedName("latest_version")
String latestVersion;

/**
* The current live version of the settings object. This can be different from latest_version if
* settings are updated without setting live_version='latest'.
*/
@SerializedName("live_version")
String liveVersion;

/**
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
* object exists in test mode.
*/
@SerializedName("livemode")
Boolean livemode;

/**
* A lookup key used to retrieve settings dynamically from a static string. This may be up to 200
* characters.
*/
@SerializedName("lookup_key")
String lookupKey;

/**
* String representing the object's type. Objects of the same type share the same value of the
* object field.
*
* <p>Equal to {@code v2.billing.bill_setting}.
*/
@SerializedName("object")
String object;

/** Settings related to calculating a bill. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Calculation extends StripeObject {
/** Settings for calculating tax. */
@SerializedName("tax")
Tax tax;

/** Settings for calculating tax. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Tax extends StripeObject {
/**
* Determines if tax will be calculated automatically based on a PTC or manually based on
* rules defined by the merchant. Defaults to &quot;manual&quot;.
*
* <p>One of {@code automatic}, or {@code manual}.
*/
@SerializedName("type")
String type;
}
}

/** Settings related to invoice behavior. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Invoice extends StripeObject {
/** The amount of time until the invoice will be overdue for payment. */
@SerializedName("time_until_due")
TimeUntilDue timeUntilDue;

/** The amount of time until the invoice will be overdue for payment. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class TimeUntilDue extends StripeObject {
/**
* The interval unit for the time until due.
*
* <p>One of {@code day}, {@code month}, {@code week}, or {@code year}.
*/
@SerializedName("interval")
String interval;

/**
* The number of interval units. For example, if interval=day and interval_count=30, the
* invoice will be due in 30 days.
*/
@SerializedName("interval_count")
Long intervalCount;
}
}
}
108 changes: 108 additions & 0 deletions src/main/java/com/stripe/model/v2/billing/BillSettingVersion.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// File generated from our OpenAPI spec
package com.stripe.model.v2.billing;

import com.google.gson.annotations.SerializedName;
import com.stripe.model.HasId;
import com.stripe.model.StripeObject;
import java.time.Instant;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class BillSettingVersion extends StripeObject implements HasId {
/** Settings related to calculating a bill. */
@SerializedName("calculation")
Calculation calculation;

/** Timestamp of when the object was created. */
@SerializedName("created")
Instant created;

/** The ID of the BillSettingVersion object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;

/** Settings related to invoice behavior. */
@SerializedName("invoice")
Invoice invoice;

/** The ID of the invoice rendering template to be used when generating invoices. */
@SerializedName("invoice_rendering_template")
String invoiceRenderingTemplate;

/**
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
* object exists in test mode.
*/
@SerializedName("livemode")
Boolean livemode;

/**
* String representing the object's type. Objects of the same type share the same value of the
* object field.
*
* <p>Equal to {@code v2.billing.bill_setting_version}.
*/
@SerializedName("object")
String object;

/** Settings related to calculating a bill. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Calculation extends StripeObject {
/** Settings for calculating tax. */
@SerializedName("tax")
Tax tax;

/** Settings for calculating tax. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Tax extends StripeObject {
/**
* Determines if tax will be calculated automatically based on a PTC or manually based on
* rules defined by the merchant. Defaults to &quot;manual&quot;.
*
* <p>One of {@code automatic}, or {@code manual}.
*/
@SerializedName("type")
String type;
}
}

/** Settings related to invoice behavior. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Invoice extends StripeObject {
/** The amount of time until the invoice will be overdue for payment. */
@SerializedName("time_until_due")
TimeUntilDue timeUntilDue;

/** The amount of time until the invoice will be overdue for payment. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class TimeUntilDue extends StripeObject {
/**
* The interval unit for the time until due.
*
* <p>One of {@code day}, {@code month}, {@code week}, or {@code year}.
*/
@SerializedName("interval")
String interval;

/**
* The number of interval units. For example, if interval=day and interval_count=30, the
* invoice will be due in 30 days.
*/
@SerializedName("interval_count")
Long intervalCount;
}
}
}
Loading
Loading