Skip to content

Commit

Permalink
Update generated code (#1876)
Browse files Browse the repository at this point in the history
* Update generated code for v1268

* Update generated code for v1268

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] authored Sep 26, 2024
1 parent fd2e2e3 commit 265dcb5
Show file tree
Hide file tree
Showing 43 changed files with 4,162 additions and 351 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1267
v1268
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 @@ -2,5 +2,5 @@
package com.stripe;

final class ApiVersion {
public static final String CURRENT = "2024-06-20";
public static final String CURRENT = "2024-09-30.acacia";
}
6 changes: 4 additions & 2 deletions src/main/java/com/stripe/model/Capability.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ public class Capability extends ApiResource implements HasId {
Requirements requirements;

/**
* The status of the capability. Can be {@code active}, {@code inactive}, {@code pending}, or
* {@code unrequested}.
* The status of the capability.
*
* <p>One of {@code active}, {@code disabled}, {@code inactive}, {@code pending}, or {@code
* unrequested}.
*/
@SerializedName("status")
String status;
Expand Down
73 changes: 73 additions & 0 deletions src/main/java/com/stripe/model/CreditNote.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.billing.CreditBalanceTransaction;
import com.stripe.net.ApiRequest;
import com.stripe.net.ApiRequestParams;
import com.stripe.net.ApiResource;
Expand Down Expand Up @@ -142,6 +143,9 @@ public class CreditNote extends ApiResource implements HasId, MetadataStore<Cred
@SerializedName("pdf")
String pdf;

@SerializedName("pretax_credit_amounts")
List<CreditNote.PretaxCreditAmount> pretaxCreditAmounts;

/**
* Reason for issuing this credit note, one of {@code duplicate}, {@code fraudulent}, {@code
* order_change}, or {@code product_unsatisfactory}.
Expand Down Expand Up @@ -647,6 +651,75 @@ public void setDiscountObject(Discount expandableObject) {
}
}

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

/** The credit balance transaction that was applied to get this pretax credit amount. */
@SerializedName("credit_balance_transaction")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<CreditBalanceTransaction> creditBalanceTransaction;

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

/**
* Type of the pretax credit amount referenced.
*
* <p>One of {@code credit_balance_transaction}, or {@code discount}.
*/
@SerializedName("type")
String type;

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

public void setCreditBalanceTransaction(String id) {
this.creditBalanceTransaction =
ApiResource.setExpandableFieldId(id, this.creditBalanceTransaction);
}

/** Get expanded {@code creditBalanceTransaction}. */
public CreditBalanceTransaction getCreditBalanceTransactionObject() {
return (this.creditBalanceTransaction != null)
? this.creditBalanceTransaction.getExpanded()
: null;
}

public void setCreditBalanceTransactionObject(CreditBalanceTransaction expandableObject) {
this.creditBalanceTransaction =
new ExpandableField<CreditBalanceTransaction>(expandableObject.getId(), expandableObject);
}

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

public void setDiscount(String id) {
this.discount = ApiResource.setExpandableFieldId(id, this.discount);
}

/** Get expanded {@code discount}. */
public Discount getDiscountObject() {
return (this.discount != null) ? this.discount.getExpanded() : null;
}

public void setDiscountObject(Discount expandableObject) {
this.discount = new ExpandableField<Discount>(expandableObject.getId(), expandableObject);
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
73 changes: 73 additions & 0 deletions src/main/java/com/stripe/model/CreditNoteLineItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import com.stripe.model.billing.CreditBalanceTransaction;
import com.stripe.net.ApiResource;
import java.math.BigDecimal;
import java.util.List;
Expand Down Expand Up @@ -67,6 +68,9 @@ public class CreditNoteLineItem extends StripeObject implements HasId {
@SerializedName("object")
String object;

@SerializedName("pretax_credit_amounts")
List<CreditNoteLineItem.PretaxCreditAmount> pretaxCreditAmounts;

/** The number of units of product being credited. */
@SerializedName("quantity")
Long quantity;
Expand Down Expand Up @@ -136,6 +140,75 @@ public void setDiscountObject(Discount expandableObject) {
}
}

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

/** The credit balance transaction that was applied to get this pretax credit amount. */
@SerializedName("credit_balance_transaction")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<CreditBalanceTransaction> creditBalanceTransaction;

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

/**
* Type of the pretax credit amount referenced.
*
* <p>One of {@code credit_balance_transaction}, or {@code discount}.
*/
@SerializedName("type")
String type;

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

public void setCreditBalanceTransaction(String id) {
this.creditBalanceTransaction =
ApiResource.setExpandableFieldId(id, this.creditBalanceTransaction);
}

/** Get expanded {@code creditBalanceTransaction}. */
public CreditBalanceTransaction getCreditBalanceTransactionObject() {
return (this.creditBalanceTransaction != null)
? this.creditBalanceTransaction.getExpanded()
: null;
}

public void setCreditBalanceTransactionObject(CreditBalanceTransaction expandableObject) {
this.creditBalanceTransaction =
new ExpandableField<CreditBalanceTransaction>(expandableObject.getId(), expandableObject);
}

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

public void setDiscount(String id) {
this.discount = ApiResource.setExpandableFieldId(id, this.discount);
}

/** Get expanded {@code discount}. */
public Discount getDiscountObject() {
return (this.discount != null) ? this.discount.getExpanded() : null;
}

public void setDiscountObject(Discount expandableObject) {
this.discount = new ExpandableField<Discount>(expandableObject.getId(), expandableObject);
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/com/stripe/model/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
import lombok.Setter;

/**
* This object represents a customer of your business. Use it to create recurring charges and track
* payments that belong to the same customer.
*
* <p>Related guide: <a href="https://stripe.com/docs/payments/save-during-payment">Save a card
* during payment</a>
* This object represents a customer of your business. Use it to <a
* href="https://stripe.com/docs/invoicing/customer">create recurring charges</a>, <a
* href="https://stripe.com/docs/payments/save-during-payment">save payment</a> and contact
* information, and track payments that belong to the same customer.
*/
@Getter
@Setter
Expand Down
7 changes: 7 additions & 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("payment_intent", PaymentIntent.class);
classLookup.put("payment_link", PaymentLink.class);
classLookup.put("payment_method", PaymentMethod.class);
Expand Down Expand Up @@ -92,6 +93,12 @@ final class EventDataClassLookup {

classLookup.put("billing.alert", com.stripe.model.billing.Alert.class);
classLookup.put("billing.alert_triggered", com.stripe.model.billing.AlertTriggered.class);
classLookup.put(
"billing.credit_balance_summary", com.stripe.model.billing.CreditBalanceSummary.class);
classLookup.put(
"billing.credit_balance_transaction",
com.stripe.model.billing.CreditBalanceTransaction.class);
classLookup.put("billing.credit_grant", com.stripe.model.billing.CreditGrant.class);
classLookup.put("billing.meter", com.stripe.model.billing.Meter.class);
classLookup.put("billing.meter_event", com.stripe.model.billing.MeterEvent.class);
classLookup.put(
Expand Down
97 changes: 97 additions & 0 deletions src/main/java/com/stripe/model/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.billing.CreditBalanceTransaction;
import com.stripe.model.testhelpers.TestClock;
import com.stripe.net.ApiRequest;
import com.stripe.net.ApiRequestParams;
Expand Down Expand Up @@ -615,6 +616,9 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("total_excluding_tax")
Long totalExcludingTax;

@SerializedName("total_pretax_credit_amounts")
List<Invoice.TotalPretaxCreditAmount> totalPretaxCreditAmounts;

/** The aggregate amounts calculated per tax rate for all line items. */
@SerializedName("total_tax_amounts")
List<Invoice.TotalTaxAmount> totalTaxAmounts;
Expand Down Expand Up @@ -2801,6 +2805,99 @@ public void setDiscountObject(Discount expandableObject) {
}
}

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

/** The credit balance transaction that was applied to get this pretax credit amount. */
@SerializedName("credit_balance_transaction")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<CreditBalanceTransaction> creditBalanceTransaction;

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

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

/**
* Type of the pretax credit amount referenced.
*
* <p>One of {@code credit_balance_transaction}, or {@code discount}.
*/
@SerializedName("type")
String type;

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

public void setCreditBalanceTransaction(String id) {
this.creditBalanceTransaction =
ApiResource.setExpandableFieldId(id, this.creditBalanceTransaction);
}

/** Get expanded {@code creditBalanceTransaction}. */
public CreditBalanceTransaction getCreditBalanceTransactionObject() {
return (this.creditBalanceTransaction != null)
? this.creditBalanceTransaction.getExpanded()
: null;
}

public void setCreditBalanceTransactionObject(CreditBalanceTransaction expandableObject) {
this.creditBalanceTransaction =
new ExpandableField<CreditBalanceTransaction>(expandableObject.getId(), expandableObject);
}

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

public void setDiscount(String id) {
this.discount = ApiResource.setExpandableFieldId(id, this.discount);
}

/** Get expanded {@code discount}. */
public Discount getDiscountObject() {
return (this.discount != null) ? this.discount.getExpanded() : null;
}

public void setDiscountObject(Discount expandableObject) {
this.discount = new ExpandableField<Discount>(expandableObject.getId(), expandableObject);
}

/** 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
Loading

0 comments on commit 265dcb5

Please sign in to comment.