Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code #1785

Merged
merged 12 commits into from
May 2, 2024
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v992
v1008
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/Charge.java
Original file line number Diff line number Diff line change
Expand Up @@ -2658,6 +2658,7 @@ public static class Link extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Mobilepay extends StripeObject {
/** Internal card details. */
@SerializedName("card")
Card card;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/ConfirmationToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,7 @@ public static class Link extends StripeObject {

/** [Deprecated] This is a legacy parameter that no longer has any function. */
@SerializedName("persistent_token")
@Deprecated
String persistentToken;
}

Expand Down
18 changes: 17 additions & 1 deletion src/main/java/com/stripe/model/Dispute.java
Original file line number Diff line number Diff line change
Expand Up @@ -807,10 +807,13 @@ public static class PaymentMethodDetails extends StripeObject {
@SerializedName("card")
Card card;

@SerializedName("paypal")
Paypal paypal;

/**
* Payment method type.
*
* <p>Equal to {@code card}.
* <p>One of {@code card}, or {@code paypal}.
*/
@SerializedName("type")
String type;
Expand All @@ -835,6 +838,19 @@ public static class Card extends StripeObject {
@SerializedName("network_reason_code")
String networkReasonCode;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Paypal extends StripeObject {
/** The ID of the dispute in PayPal. */
@SerializedName("case_id")
String caseId;

/** The reason for the dispute as defined by PayPal. */
@SerializedName("reason_code")
String reasonCode;
}
}

@Override
Expand Down
58 changes: 56 additions & 2 deletions src/main/java/com/stripe/model/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -466,11 +466,21 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("payment_settings")
PaymentSettings paymentSettings;

/** End of the usage period during which invoice items were added to this invoice. */
/**
* End of the usage period during which invoice items were added to this invoice. This looks back
* one period for a subscription invoice. Use the <a
* href="https://stripe.com/api/invoices/line_item#invoice_line_item_object-period">line item
* period</a> to get the service period for each price.
*/
@SerializedName("period_end")
Long periodEnd;

/** Start of the usage period during which invoice items were added to this invoice. */
/**
* Start of the usage period during which invoice items were added to this invoice. This looks
* back one period for a subscription invoice. Use the <a
* href="https://stripe.com/api/invoices/line_item#invoice_line_item_object-period">line item
* period</a> to get the service period for each price.
*/
@SerializedName("period_start")
Long periodStart;

Expand Down Expand Up @@ -972,6 +982,10 @@ public static Invoice create(InvoiceCreateParams params, RequestOptions options)
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview() throws StripeException {
return createPreview((Map<String, Object>) null, (RequestOptions) null);
Expand All @@ -994,6 +1008,10 @@ public static Invoice createPreview() throws StripeException {
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview(RequestOptions options) throws StripeException {
return createPreview((Map<String, Object>) null, options);
Expand All @@ -1016,6 +1034,10 @@ public static Invoice createPreview(RequestOptions options) throws StripeExcepti
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview(Map<String, Object> params) throws StripeException {
return createPreview(params, (RequestOptions) null);
Expand All @@ -1038,6 +1060,10 @@ public static Invoice createPreview(Map<String, Object> params) throws StripeExc
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview(Map<String, Object> params, RequestOptions options)
throws StripeException {
Expand Down Expand Up @@ -1065,6 +1091,10 @@ public static Invoice createPreview(Map<String, Object> params, RequestOptions o
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview(InvoiceCreatePreviewParams params) throws StripeException {
return createPreview(params, (RequestOptions) null);
Expand All @@ -1087,6 +1117,10 @@ public static Invoice createPreview(InvoiceCreatePreviewParams params) throws St
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview(InvoiceCreatePreviewParams params, RequestOptions options)
throws StripeException {
Expand Down Expand Up @@ -1622,6 +1656,10 @@ public Invoice sendInvoice(InvoiceSendInvoiceParams params, RequestOptions optio
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice upcoming() throws StripeException {
return upcoming((Map<String, Object>) null, (RequestOptions) null);
Expand All @@ -1644,6 +1682,10 @@ public static Invoice upcoming() throws StripeException {
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice upcoming(Map<String, Object> params) throws StripeException {
return upcoming(params, (RequestOptions) null);
Expand All @@ -1666,6 +1708,10 @@ public static Invoice upcoming(Map<String, Object> params) throws StripeExceptio
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice upcoming(Map<String, Object> params, RequestOptions options)
throws StripeException {
Expand Down Expand Up @@ -1693,6 +1739,10 @@ public static Invoice upcoming(Map<String, Object> params, RequestOptions option
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice upcoming(InvoiceUpcomingParams params) throws StripeException {
return upcoming(params, (RequestOptions) null);
Expand All @@ -1715,6 +1765,10 @@ public static Invoice upcoming(InvoiceUpcomingParams params) throws StripeExcept
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice upcoming(InvoiceUpcomingParams params, RequestOptions options)
throws StripeException {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -3365,6 +3365,7 @@ public static class Link extends StripeObject {

/** [Deprecated] This is a legacy parameter that no longer has any function. */
@SerializedName("persistent_token")
@Deprecated
String persistentToken;

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/PaymentMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,7 @@ public static class Link extends StripeObject {

/** [Deprecated] This is a legacy parameter that no longer has any function. */
@SerializedName("persistent_token")
@Deprecated
String persistentToken;
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/SetupIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,7 @@ public static class CardPresent extends StripeObject {}
public static class Link extends StripeObject {
/** [Deprecated] This is a legacy parameter that no longer has any function. */
@SerializedName("persistent_token")
@Deprecated
String persistentToken;
}

Expand Down
18 changes: 9 additions & 9 deletions src/main/java/com/stripe/model/StripeError.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ public class StripeError extends StripeObject {
* {@code secret_key_required}, {@code sepa_unsupported_account}, {@code setup_attempt_failed},
* {@code setup_intent_authentication_failure}, {@code setup_intent_invalid_parameter}, {@code
* setup_intent_mandate_invalid}, {@code setup_intent_setup_attempt_expired}, {@code
* setup_intent_unexpected_state}, {@code shipping_calculation_failed}, {@code sku_inactive},
* {@code state_unsupported}, {@code status_transition_invalid}, {@code stripe_tax_inactive},
* {@code tax_id_invalid}, {@code taxes_calculation_failed}, {@code
* terminal_location_country_unsupported}, {@code terminal_reader_busy}, {@code
* terminal_reader_hardware_fault}, {@code terminal_reader_offline}, {@code
* terminal_reader_timeout}, {@code testmode_charges_only}, {@code tls_version_unsupported},
* {@code token_already_used}, {@code token_card_network_invalid}, {@code token_in_use}, {@code
* transfer_source_balance_parameters_mismatch}, {@code transfers_not_allowed}, or {@code
* url_invalid}.
* setup_intent_unexpected_state}, {@code shipping_address_invalid}, {@code
* shipping_calculation_failed}, {@code sku_inactive}, {@code state_unsupported}, {@code
* status_transition_invalid}, {@code stripe_tax_inactive}, {@code tax_id_invalid}, {@code
* taxes_calculation_failed}, {@code terminal_location_country_unsupported}, {@code
* terminal_reader_busy}, {@code terminal_reader_hardware_fault}, {@code terminal_reader_offline},
* {@code terminal_reader_timeout}, {@code testmode_charges_only}, {@code
* tls_version_unsupported}, {@code token_already_used}, {@code token_card_network_invalid},
* {@code token_in_use}, {@code transfer_source_balance_parameters_mismatch}, {@code
* transfers_not_allowed}, or {@code url_invalid}.
*/
@SerializedName("code")
String code;
Expand Down
48 changes: 48 additions & 0 deletions src/main/java/com/stripe/model/tax/Calculation.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ public class Calculation extends ApiResource implements HasId {
@SerializedName("object")
String object;

/** The details of the ship from location, such as the address. */
@SerializedName("ship_from_details")
ShipFromDetails shipFromDetails;

/** The shipping cost details for the calculation. */
@SerializedName("shipping_cost")
ShippingCost shippingCost;
Expand Down Expand Up @@ -276,6 +280,49 @@ public static class TaxId extends StripeObject {
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class ShipFromDetails extends StripeObject {
@SerializedName("address")
Address address;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Address extends StripeObject {
/** City, district, suburb, town, or village. */
@SerializedName("city")
String city;

/**
* Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
* 3166-1 alpha-2</a>).
*/
@SerializedName("country")
String country;

/** Address line 1 (e.g., street, PO Box, or company name). */
@SerializedName("line1")
String line1;

/** Address line 2 (e.g., apartment, suite, unit, or building). */
@SerializedName("line2")
String line2;

/** ZIP or postal code. */
@SerializedName("postal_code")
String postalCode;

/**
* State/province as an <a href="https://en.wikipedia.org/wiki/ISO_3166-2">ISO 3166-2</a>
* subdivision code, without country prefix. Example: &quot;NY&quot; or &quot;TX&quot;.
*/
@SerializedName("state")
String state;
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -508,6 +555,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(customerDetails, responseGetter);
trySetResponseGetter(lineItems, responseGetter);
trySetResponseGetter(shipFromDetails, responseGetter);
trySetResponseGetter(shippingCost, responseGetter);
}
}