Skip to content

Commit

Permalink
Merge pull request #1656 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] committed Sep 29, 2023
2 parents dc8a738 + 00a5de3 commit 3849ac7
Show file tree
Hide file tree
Showing 69 changed files with 3,730 additions and 2,113 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@
* Add support for new value `quote.accept_failed` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
* [#1633](https://github.com/stripe/stripe-java/pull/1633) Merge master

## 23.7.0 - 2023-09-28
* [#1657](https://github.com/stripe/stripe-java/pull/1657) Update generated code
* Add support for `rendering` on `InvoiceCreateParams`, `InvoiceUpdateParams`, and `Invoice`

## 23.6.0 - 2023-09-21
* [#1654](https://github.com/stripe/stripe-java/pull/1654) Update generated code
* Add support for `terms_of_service_acceptance` on `Checkout.Session.custom_text`, `PaymentLink.custom_text`, `PaymentLinkCreateParams.custom_text`, `PaymentLinkUpdateParams.custom_text`, and `checkout.SessionCreateParams.custom_text`
* [#1655](https://github.com/stripe/stripe-java/pull/1655) CI: Drop testing for 9, 10, 12-16

## 23.5.0 - 2023-09-14
* [#1647](https://github.com/stripe/stripe-java/pull/1647) Update generated code
* Add support for new resource `PaymentMethodConfiguration`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v545
v569
60 changes: 60 additions & 0 deletions src/main/java/com/stripe/model/AccountSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,32 @@ public static class PaymentDetails extends StripeObject {
/** Whether the embedded component is enabled. */
@SerializedName("enabled")
Boolean enabled;

@SerializedName("features")
Features features;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Features extends StripeObject {
/**
* Whether to allow capturing and cancelling payment intents. This is {@code true} by
* default.
*/
@SerializedName("capture_payments")
Boolean capturePayments;

/**
* Whether to allow responding to disputes, including submitting evidence and accepting
* disputes. This is {@code true} by default.
*/
@SerializedName("dispute_management")
Boolean disputeManagement;

/** Whether to allow sending refunds. This is {@code true} by default. */
@SerializedName("refund_management")
Boolean refundManagement;
}
}

@Getter
Expand All @@ -166,6 +192,32 @@ public static class Payments extends StripeObject {
/** Whether the embedded component is enabled. */
@SerializedName("enabled")
Boolean enabled;

@SerializedName("features")
Features features;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Features extends StripeObject {
/**
* Whether to allow capturing and cancelling payment intents. This is {@code true} by
* default.
*/
@SerializedName("capture_payments")
Boolean capturePayments;

/**
* Whether to allow responding to disputes, including submitting evidence and accepting
* disputes. This is {@code true} by default.
*/
@SerializedName("dispute_management")
Boolean disputeManagement;

/** Whether to allow sending refunds. This is {@code true} by default. */
@SerializedName("refund_management")
Boolean refundManagement;
}
}

@Getter
Expand All @@ -175,6 +227,14 @@ public static class Payouts extends StripeObject {
/** Whether the embedded component is enabled. */
@SerializedName("enabled")
Boolean enabled;

@SerializedName("features")
Features features;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Features extends StripeObject {}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public void setCustomerObject(Customer expandableObject) {
@EqualsAndHashCode(callSuper = false)
public static class AdjustedForOverdraft extends StripeObject {
/**
* The <a href="docs/api/balance_transactions/object">Balance Transaction</a> that corresponds
* to funds taken out of your Stripe balance.
* The <a href="https://stripe.com/docs/api/balance_transactions/object">Balance Transaction</a>
* that corresponds to funds taken out of your Stripe balance.
*/
@SerializedName("balance_transaction")
@Getter(lombok.AccessLevel.NONE)
Expand Down
111 changes: 97 additions & 14 deletions src/main/java/com/stripe/model/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ public class Event extends ApiResource implements HasId {
@SerializedName("pending_webhooks")
Long pendingWebhooks;

/**
* Information about the action that causes the event. Only present when the event is triggered by
* an API request or an <a
* href="https://stripe.com/docs/billing/revenue-recovery/automations">Automation</a> action.
*/
@SerializedName("reason")
Reason reason;

/** Information on the API request that triggers the event. */
@SerializedName("request")
Request request;
Expand Down Expand Up @@ -125,8 +133,9 @@ public class Event extends ApiResource implements HasId {
* customer.discount.updated}, {@code customer.source.created}, {@code customer.source.deleted},
* {@code customer.source.expiring}, {@code customer.source.updated}, {@code
* customer.subscription.collection_paused}, {@code customer.subscription.collection_resumed},
* {@code customer.subscription.created}, {@code customer.subscription.deleted}, {@code
* customer.subscription.paused}, {@code customer.subscription.pending_update_applied}, {@code
* {@code customer.subscription.created}, {@code customer.subscription.custom_event}, {@code
* customer.subscription.deleted}, {@code customer.subscription.paused}, {@code
* customer.subscription.pending_update_applied}, {@code
* customer.subscription.pending_update_expired}, {@code customer.subscription.resumed}, {@code
* customer.subscription.trial_will_end}, {@code customer.subscription.updated}, {@code
* customer.tax_id.created}, {@code customer.tax_id.deleted}, {@code customer.tax_id.updated},
Expand All @@ -149,13 +158,13 @@ public class Event extends ApiResource implements HasId {
* invoice.updated}, {@code invoice.voided}, {@code invoiceitem.created}, {@code
* invoiceitem.deleted}, {@code issuing_authorization.created}, {@code
* issuing_authorization.request}, {@code issuing_authorization.updated}, {@code
* issuing_card.created}, {@code issuing_card.updated}, {@code issuing_card_design.activated},
* {@code issuing_card_design.deactivated}, {@code issuing_card_design.rejected}, {@code
* issuing_card_design.updated}, {@code issuing_cardholder.created}, {@code
* issuing_card.created}, {@code issuing_card.updated}, {@code issuing_cardholder.created}, {@code
* issuing_cardholder.updated}, {@code issuing_dispute.closed}, {@code issuing_dispute.created},
* {@code issuing_dispute.funds_reinstated}, {@code issuing_dispute.submitted}, {@code
* issuing_dispute.updated}, {@code issuing_transaction.created}, {@code
* issuing_transaction.updated}, {@code mandate.updated}, {@code order.created}, {@code
* issuing_dispute.updated}, {@code issuing_personalization_design.activated}, {@code
* issuing_personalization_design.deactivated}, {@code issuing_personalization_design.rejected},
* {@code issuing_personalization_design.updated}, {@code issuing_transaction.created}, {@code
* issuing_transaction.updated}, {@code mandate.updated}, {@code
* payment_intent.amount_capturable_updated}, {@code payment_intent.canceled}, {@code
* payment_intent.created}, {@code payment_intent.partially_funded}, {@code
* payment_intent.payment_failed}, {@code payment_intent.processing}, {@code
Expand All @@ -171,16 +180,14 @@ public class Event extends ApiResource implements HasId {
* quote.accept_failed}, {@code quote.accepted}, {@code quote.accepting}, {@code quote.canceled},
* {@code quote.created}, {@code quote.draft}, {@code quote.finalized}, {@code quote.reestimated},
* {@code quote.stale}, {@code radar.early_fraud_warning.created}, {@code
* radar.early_fraud_warning.updated}, {@code recipient.created}, {@code recipient.deleted},
* {@code recipient.updated}, {@code refund.created}, {@code refund.updated}, {@code
* radar.early_fraud_warning.updated}, {@code refund.created}, {@code refund.updated}, {@code
* reporting.report_run.failed}, {@code reporting.report_run.succeeded}, {@code
* reporting.report_type.updated}, {@code review.closed}, {@code review.opened}, {@code
* setup_intent.canceled}, {@code setup_intent.created}, {@code setup_intent.requires_action},
* {@code setup_intent.setup_failed}, {@code setup_intent.succeeded}, {@code
* sigma.scheduled_query_run.created}, {@code sku.created}, {@code sku.deleted}, {@code
* sku.updated}, {@code source.canceled}, {@code source.chargeable}, {@code source.failed}, {@code
* source.mandate_notification}, {@code source.refund_attributes_required}, {@code
* source.transaction.created}, {@code source.transaction.updated}, {@code
* sigma.scheduled_query_run.created}, {@code source.canceled}, {@code source.chargeable}, {@code
* source.failed}, {@code source.mandate_notification}, {@code source.refund_attributes_required},
* {@code source.transaction.created}, {@code source.transaction.updated}, {@code
* subscription_schedule.aborted}, {@code subscription_schedule.canceled}, {@code
* subscription_schedule.completed}, {@code subscription_schedule.created}, {@code
* subscription_schedule.expiring}, {@code subscription_schedule.released}, {@code
Expand All @@ -207,7 +214,9 @@ public class Event extends ApiResource implements HasId {
* treasury.outbound_transfer.failed}, {@code treasury.outbound_transfer.posted}, {@code
* treasury.outbound_transfer.returned}, {@code treasury.received_credit.created}, {@code
* treasury.received_credit.failed}, {@code treasury.received_credit.succeeded}, {@code
* treasury.received_debit.created}, or {@code invoiceitem.updated}.
* treasury.received_debit.created}, {@code invoiceitem.updated}, {@code order.created}, {@code
* recipient.created}, {@code recipient.deleted}, {@code recipient.updated}, {@code sku.created},
* {@code sku.deleted}, or {@code sku.updated}.
*/
@SerializedName("type")
String type;
Expand Down Expand Up @@ -387,6 +396,79 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Reason extends StripeObject {
@SerializedName("automation_action")
AutomationAction automationAction;

@SerializedName("request")
Request request;

/**
* The type of the reason for the event.
*
* <p>One of {@code automation_action}, or {@code request}.
*/
@SerializedName("type")
String type;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class AutomationAction extends StripeObject {
@SerializedName("stripe_send_webhook_custom_event")
StripeSendWebhookCustomEvent stripeSendWebhookCustomEvent;

/**
* The trigger name of the automation that triggered this action. Please visit <a
* href="https://stripe.com/docs/billing/revenue-recovery/automations#choose-a-trigger">Revenue
* and retention automations</a> for all possible trigger names.
*/
@SerializedName("trigger")
String trigger;

/**
* The type of the {@code automation_action}.
*
* <p>Equal to {@code stripe_send_webhook_custom_event}.
*/
@SerializedName("type")
String type;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class StripeSendWebhookCustomEvent extends StripeObject {
/** Set of key-value pairs attached to the action when creating an Automation. */
@SerializedName("custom_data")
Map<String, String> customData;
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Request extends StripeObject implements HasId {
/**
* ID of the API request that caused the event. If null, the event was automatic (e.g.,
* Stripe's automatic subscription handling). Request logs are available in the <a
* href="https://dashboard.stripe.com/logs">dashboard</a>, but currently not in the API.
*/
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;

/**
* The idempotency key transmitted during the request, if any. <em>Note: This property is
* populated only for events on or after May 23, 2017</em>.
*/
@SerializedName("idempotency_key")
String idempotencyKey;
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand All @@ -412,6 +494,7 @@ public static class Request extends StripeObject implements HasId {
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(data, responseGetter);
trySetResponseGetter(reason, responseGetter);
trySetResponseGetter(request, responseGetter);
}
}
5 changes: 3 additions & 2 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ final class EventDataClassLookup {

classLookup.put("issuing.authorization", com.stripe.model.issuing.Authorization.class);
classLookup.put("issuing.card", com.stripe.model.issuing.Card.class);
classLookup.put("issuing.card_bundle", com.stripe.model.issuing.CardBundle.class);
classLookup.put("issuing.card_design", com.stripe.model.issuing.CardDesign.class);
classLookup.put("issuing.cardholder", com.stripe.model.issuing.Cardholder.class);
classLookup.put("issuing.dispute", com.stripe.model.issuing.Dispute.class);
classLookup.put(
"issuing.personalization_design", com.stripe.model.issuing.PersonalizationDesign.class);
classLookup.put("issuing.physical_bundle", com.stripe.model.issuing.PhysicalBundle.class);
classLookup.put("issuing.transaction", com.stripe.model.issuing.Transaction.class);

classLookup.put("radar.early_fraud_warning", com.stripe.model.radar.EarlyFraudWarning.class);
Expand Down
46 changes: 42 additions & 4 deletions src/main/java/com/stripe/model/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,17 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("receipt_number")
String receiptNumber;

/** Options for invoice PDF rendering. */
/**
* The rendering-related settings that control how the invoice is displayed on customer-facing
* surfaces such as PDF and Hosted Invoice Page.
*/
@SerializedName("rendering")
Rendering rendering;

/**
* This is a legacy field that will be removed soon. For details about {@code rendering_options},
* refer to {@code rendering} instead. Options for invoice PDF rendering.
*/
@SerializedName("rendering_options")
RenderingOptions renderingOptions;

Expand Down Expand Up @@ -1876,9 +1886,9 @@ public static class AutomaticTax extends StripeObject {
Boolean enabled;

/**
* The connected account that's liable for tax. If set, the business address and tax
* registrations required to perform the tax calculation are loaded from this account. The tax
* transaction is returned in the report of the connected account.
* The account that's liable for tax. If set, the business address and tax registrations
* required to perform the tax calculation are loaded from this account. The tax transaction is
* returned in the report of the connected account.
*/
@SerializedName("liability")
Liability liability;
Expand Down Expand Up @@ -2271,6 +2281,33 @@ public static class FinancialConnections extends StripeObject {
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Rendering extends StripeObject {
/** How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. */
@SerializedName("amount_tax_display")
String amountTaxDisplay;

/** Invoice pdf rendering options. */
@SerializedName("pdf")
Pdf pdf;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Pdf extends StripeObject {
/**
* Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size
* will be switched to a4 or letter based on customer locale.
*
* <p>One of {@code a4}, {@code auto}, or {@code letter}.
*/
@SerializedName("page_size")
String pageSize;
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -2592,6 +2629,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
trySetResponseGetter(paymentIntent, responseGetter);
trySetResponseGetter(paymentSettings, responseGetter);
trySetResponseGetter(quote, responseGetter);
trySetResponseGetter(rendering, responseGetter);
trySetResponseGetter(renderingOptions, responseGetter);
trySetResponseGetter(shippingCost, responseGetter);
trySetResponseGetter(shippingDetails, responseGetter);
Expand Down
Loading

0 comments on commit 3849ac7

Please sign in to comment.