Skip to content

Commit

Permalink
Merge pull request #1675 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 Oct 26, 2023
2 parents 825100f + a1fbf39 commit 00ec92d
Show file tree
Hide file tree
Showing 57 changed files with 3,459 additions and 282 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v605
v627
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/ApiVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

final class ApiVersion {
public static final String CURRENT = "2023-10-16";
public static final String PREVIEW_CURRENT = "2023-09-15.preview-v2";
public static final String PREVIEW_CURRENT = "2023-10-26.preview-v2";
}
4 changes: 4 additions & 0 deletions src/main/java/com/stripe/StripeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ public com.stripe.service.MandateService mandates() {
return new com.stripe.service.MandateService(this.getResponseGetter());
}

public com.stripe.service.MarginService margins() {
return new com.stripe.service.MarginService(this.getResponseGetter());
}

public com.stripe.service.OrderService orders() {
return new com.stripe.service.OrderService(this.getResponseGetter());
}
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -1515,11 +1515,7 @@ public static class FutureRequirements extends StripeObject {
@SerializedName("currently_due")
List<String> currentlyDue;

/**
* This is typed as a string for consistency with {@code requirements.disabled_reason}, but it
* safe to assume {@code future_requirements.disabled_reason} is empty because fields in {@code
* future_requirements} will never disable the account.
*/
/** This is typed as a string for consistency with {@code requirements.disabled_reason}. */
@SerializedName("disabled_reason")
String disabledReason;

Expand Down Expand Up @@ -1677,10 +1673,13 @@ public static class Requirements extends StripeObject {
List<String> currentlyDue;

/**
* If the account is disabled, this string describes why. Can be {@code requirements.past_due},
* {@code requirements.pending_verification}, {@code listed}, {@code platform_paused}, {@code
* rejected.fraud}, {@code rejected.listed}, {@code rejected.terms_of_service}, {@code
* rejected.other}, {@code under_review}, or {@code other}.
* If the account is disabled, this string describes why. <a
* href="https://stripe.com/docs/connect/handling-api-verification">Learn more about handling
* verification issues</a>. Can be {@code action_required.requested_capabilities}, {@code
* requirements.past_due}, {@code requirements.pending_verification}, {@code listed}, {@code
* platform_paused}, {@code rejected.fraud}, {@code rejected.incomplete_verification}, {@code
* rejected.listed}, {@code rejected.other}, {@code rejected.terms_of_service}, {@code
* under_review}, or {@code other}.
*/
@SerializedName("disabled_reason")
String disabledReason;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ final class EventDataClassLookup {
classLookup.put("line_item", InvoiceLineItem.class);
classLookup.put("login_link", LoginLink.class);
classLookup.put("mandate", Mandate.class);
classLookup.put("margin", Margin.class);
classLookup.put("order", Order.class);
classLookup.put("payment_intent", PaymentIntent.class);
classLookup.put("payment_link", PaymentLink.class);
Expand Down
47 changes: 46 additions & 1 deletion src/main/java/com/stripe/model/FundingInstructions.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public static class BankTransfer extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class FinancialAddress extends StripeObject {
/** ABA Records contain U.S. bank account details per the ABA format. */
@SerializedName("aba")
Aba aba;

/** Iban Records contain E.U. bank account details per the SEPA format. */
@SerializedName("iban")
Iban iban;
Expand All @@ -94,10 +98,15 @@ public static class FinancialAddress extends StripeObject {
@SerializedName("supported_networks")
List<String> supportedNetworks;

/** SWIFT Records contain U.S. bank account details per the SWIFT format. */
@SerializedName("swift")
Swift swift;

/**
* The type of financial address
*
* <p>One of {@code iban}, {@code sort_code}, {@code spei}, or {@code zengin}.
* <p>One of {@code aba}, {@code iban}, {@code sort_code}, {@code spei}, {@code swift}, or
* {@code zengin}.
*/
@SerializedName("type")
String type;
Expand All @@ -106,6 +115,24 @@ public static class FinancialAddress extends StripeObject {
@SerializedName("zengin")
Zengin zengin;

/** ABA Records contain U.S. bank account details per the ABA format. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Aba extends StripeObject {
/** The ABA account number. */
@SerializedName("account_number")
String accountNumber;

/** The bank name. */
@SerializedName("bank_name")
String bankName;

/** The ABA routing number. */
@SerializedName("routing_number")
String routingNumber;
}

/** Iban Records contain E.U. bank account details per the SEPA format. */
@Getter
@Setter
Expand Down Expand Up @@ -167,6 +194,24 @@ public static class Spei extends StripeObject {
String clabe;
}

/** SWIFT Records contain U.S. bank account details per the SWIFT format. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Swift extends StripeObject {
/** The account number. */
@SerializedName("account_number")
String accountNumber;

/** The bank name. */
@SerializedName("bank_name")
String bankName;

/** The SWIFT code. */
@SerializedName("swift_code")
String swiftCode;
}

/** Zengin Records contain Japan bank account details per the Zengin format. */
@Getter
@Setter
Expand Down
88 changes: 88 additions & 0 deletions src/main/java/com/stripe/model/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("customer_tax_ids")
List<Invoice.CustomerTaxId> customerTaxIds;

/**
* The margins applied to the invoice. Can be overridden by line item {@code margins}. Use {@code
* expand[]=default_margins} to expand each margin.
*/
@SerializedName("default_margins")
List<ExpandableField<Margin>> defaultMargins;

/**
* ID of the default payment method for the invoice. It must belong to the customer associated
* with the invoice. If not set, defaults to the subscription's default payment method, if any, or
Expand Down Expand Up @@ -600,6 +607,10 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("total_excluding_tax")
Long totalExcludingTax;

/** The aggregate amounts calculated per margin across all line items. */
@SerializedName("total_margin_amounts")
List<Invoice.TotalMarginAmount> totalMarginAmounts;

/** The aggregate amounts calculated per tax rate for all line items. */
@SerializedName("total_tax_amounts")
List<Invoice.TotalTaxAmount> totalTaxAmounts;
Expand Down Expand Up @@ -867,6 +878,50 @@ public void setAccountTaxIdObjects(List<TaxId> objs) {
: null;
}

/** Get IDs of expandable {@code defaultMargins} object list. */
public List<String> getDefaultMargins() {
return (this.defaultMargins != null)
? this.defaultMargins.stream().map(x -> x.getId()).collect(Collectors.toList())
: null;
}

public void setDefaultMargins(List<String> ids) {
if (ids == null) {
this.defaultMargins = null;
return;
}
if (this.defaultMargins != null
&& this.defaultMargins.stream()
.map(x -> x.getId())
.collect(Collectors.toList())
.equals(ids)) {
// noop if the ids are equal to what are already present
return;
}
this.defaultMargins =
(ids != null)
? ids.stream()
.map(id -> new ExpandableField<Margin>(id, null))
.collect(Collectors.toList())
: null;
}

/** Get expanded {@code defaultMargins}. */
public List<Margin> getDefaultMarginObjects() {
return (this.defaultMargins != null)
? this.defaultMargins.stream().map(x -> x.getExpanded()).collect(Collectors.toList())
: null;
}

public void setDefaultMarginObjects(List<Margin> objs) {
this.defaultMargins =
objs != null
? objs.stream()
.map(x -> new ExpandableField<Margin>(x.getId(), x))
.collect(Collectors.toList())
: null;
}

/** Get IDs of expandable {@code discounts} object list. */
public List<String> getDiscounts() {
return (this.discounts != null)
Expand Down Expand Up @@ -2518,6 +2573,39 @@ public void setDiscountObject(Discount expandableObject) {
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class TotalMarginAmount extends StripeObject {
/** The amount, in cents (or local equivalent), of the reduction in line item amount. */
@SerializedName("amount")
Long amount;

/** The margin that was applied to get this margin amount. */
@SerializedName("margin")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Margin> margin;

/** Get ID of expandable {@code margin} object. */
public String getMargin() {
return (this.margin != null) ? this.margin.getId() : null;
}

public void setMargin(String id) {
this.margin = ApiResource.setExpandableFieldId(id, this.margin);
}

/** Get expanded {@code margin}. */
public Margin getMarginObject() {
return (this.margin != null) ? this.margin.getExpanded() : null;
}

public void setMarginObject(Margin expandableObject) {
this.margin = new ExpandableField<Margin>(expandableObject.getId(), expandableObject);
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
48 changes: 48 additions & 0 deletions src/main/java/com/stripe/model/InvoiceItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ public class InvoiceItem extends ApiResource implements HasId, MetadataStore<Inv
@SerializedName("livemode")
Boolean livemode;

/**
* The margins which apply to the invoice item. When set, the {@code default_margins} on the
* invoice do not apply to this invoice item.
*/
@SerializedName("margins")
List<ExpandableField<Margin>> margins;

/**
* Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
* to an object. This can be useful for storing additional information about the object in a
Expand Down Expand Up @@ -296,6 +303,47 @@ public void setDiscountObjects(List<Discount> objs) {
: null;
}

/** Get IDs of expandable {@code margins} object list. */
public List<String> getMargins() {
return (this.margins != null)
? this.margins.stream().map(x -> x.getId()).collect(Collectors.toList())
: null;
}

public void setMargins(List<String> ids) {
if (ids == null) {
this.margins = null;
return;
}
if (this.margins != null
&& this.margins.stream().map(x -> x.getId()).collect(Collectors.toList()).equals(ids)) {
// noop if the ids are equal to what are already present
return;
}
this.margins =
(ids != null)
? ids.stream()
.map(id -> new ExpandableField<Margin>(id, null))
.collect(Collectors.toList())
: null;
}

/** Get expanded {@code margins}. */
public List<Margin> getMarginObjects() {
return (this.margins != null)
? this.margins.stream().map(x -> x.getExpanded()).collect(Collectors.toList())
: null;
}

public void setMarginObjects(List<Margin> objs) {
this.margins =
objs != null
? objs.stream()
.map(x -> new ExpandableField<Margin>(x.getId(), x))
.collect(Collectors.toList())
: null;
}

/**
* Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is
* specified, the item will be on the next invoice created for the customer specified.
Expand Down

0 comments on commit 00ec92d

Please sign in to comment.