Skip to content

Commit

Permalink
Update generated code (#1774)
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Apr 4, 2024
1 parent c80df8b commit e53a8da
Show file tree
Hide file tree
Showing 59 changed files with 5,718 additions and 436 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
@@ -1 +1 @@
v911
v932
4 changes: 2 additions & 2 deletions src/main/java/com/stripe/model/Account.java
Expand Up @@ -757,7 +757,7 @@ public static class BusinessProfile extends StripeObject {
public static class AnnualRevenue extends StripeObject {
/**
* A non-negative integer representing the amount in the <a
* href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
* href="https://docs.stripe.com/currencies#zero-decimal">smallest currency unit</a>.
*/
@SerializedName("amount")
Long amount;
Expand All @@ -784,7 +784,7 @@ public static class AnnualRevenue extends StripeObject {
public static class MonthlyEstimatedRevenue extends StripeObject {
/**
* A non-negative integer representing how much to charge in the <a
* href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
* href="https://docs.stripe.com/currencies#zero-decimal">smallest currency unit</a>.
*/
@SerializedName("amount")
Long amount;
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/stripe/model/Discount.java
Expand Up @@ -104,6 +104,13 @@ public class Discount extends StripeObject implements HasId {
@SerializedName("subscription")
String subscription;

/**
* The subscription item that this coupon is applied to, if it is applied to a particular
* subscription item.
*/
@SerializedName("subscription_item")
String subscriptionItem;

/** Get ID of expandable {@code customer} object. */
public String getCustomer() {
return (this.customer != null) ? this.customer.getId() : null;
Expand Down
50 changes: 20 additions & 30 deletions src/main/java/com/stripe/model/Invoice.java
Expand Up @@ -1476,12 +1476,10 @@ public Invoice sendInvoice(InvoiceSendInvoiceParams params, RequestOptions optio
*
* <p>You can preview the effects of updating a subscription, including a preview of what
* proration will take place. To ensure that the actual proration is calculated exactly the same
* as the previewed proration, you should pass a {@code proration_date} parameter when doing the
* actual subscription update. The value passed in should be the same as the {@code
* subscription_proration_date} returned on the upcoming invoice resource. 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_proration_date} on the upcoming invoice
* resource.
* as the previewed proration, you should pass the {@code subscription_proration_date} 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_proration_date} value passed in the request.
*/
public static Invoice upcoming() throws StripeException {
return upcoming((Map<String, Object>) null, (RequestOptions) null);
Expand All @@ -1500,12 +1498,10 @@ public static Invoice upcoming() throws StripeException {
*
* <p>You can preview the effects of updating a subscription, including a preview of what
* proration will take place. To ensure that the actual proration is calculated exactly the same
* as the previewed proration, you should pass a {@code proration_date} parameter when doing the
* actual subscription update. The value passed in should be the same as the {@code
* subscription_proration_date} returned on the upcoming invoice resource. 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_proration_date} on the upcoming invoice
* resource.
* as the previewed proration, you should pass the {@code subscription_proration_date} 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_proration_date} value passed in the request.
*/
public static Invoice upcoming(Map<String, Object> params) throws StripeException {
return upcoming(params, (RequestOptions) null);
Expand All @@ -1524,12 +1520,10 @@ public static Invoice upcoming(Map<String, Object> params) throws StripeExceptio
*
* <p>You can preview the effects of updating a subscription, including a preview of what
* proration will take place. To ensure that the actual proration is calculated exactly the same
* as the previewed proration, you should pass a {@code proration_date} parameter when doing the
* actual subscription update. The value passed in should be the same as the {@code
* subscription_proration_date} returned on the upcoming invoice resource. 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_proration_date} on the upcoming invoice
* resource.
* as the previewed proration, you should pass the {@code subscription_proration_date} 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_proration_date} value passed in the request.
*/
public static Invoice upcoming(Map<String, Object> params, RequestOptions options)
throws StripeException {
Expand All @@ -1553,12 +1547,10 @@ public static Invoice upcoming(Map<String, Object> params, RequestOptions option
*
* <p>You can preview the effects of updating a subscription, including a preview of what
* proration will take place. To ensure that the actual proration is calculated exactly the same
* as the previewed proration, you should pass a {@code proration_date} parameter when doing the
* actual subscription update. The value passed in should be the same as the {@code
* subscription_proration_date} returned on the upcoming invoice resource. 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_proration_date} on the upcoming invoice
* resource.
* as the previewed proration, you should pass the {@code subscription_proration_date} 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_proration_date} value passed in the request.
*/
public static Invoice upcoming(InvoiceUpcomingParams params) throws StripeException {
return upcoming(params, (RequestOptions) null);
Expand All @@ -1577,12 +1569,10 @@ public static Invoice upcoming(InvoiceUpcomingParams params) throws StripeExcept
*
* <p>You can preview the effects of updating a subscription, including a preview of what
* proration will take place. To ensure that the actual proration is calculated exactly the same
* as the previewed proration, you should pass a {@code proration_date} parameter when doing the
* actual subscription update. The value passed in should be the same as the {@code
* subscription_proration_date} returned on the upcoming invoice resource. 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_proration_date} on the upcoming invoice
* resource.
* as the previewed proration, you should pass the {@code subscription_proration_date} 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_proration_date} value passed in the request.
*/
public static Invoice upcoming(InvoiceUpcomingParams params, RequestOptions options)
throws StripeException {
Expand Down
47 changes: 47 additions & 0 deletions src/main/java/com/stripe/model/PaymentMethodConfiguration.java
Expand Up @@ -210,6 +210,9 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId {
@SerializedName("wechat_pay")
WechatPay wechatPay;

@SerializedName("zip")
Zip zip;

/** Creates a payment method configuration. */
public static PaymentMethodConfiguration create(Map<String, Object> params)
throws StripeException {
Expand Down Expand Up @@ -2049,6 +2052,49 @@ public static class DisplayPreference extends StripeObject {
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Zip extends StripeObject {
/**
* Whether this payment method may be offered at checkout. True if {@code display_preference} is
* {@code on} and the payment method's capability is active.
*/
@SerializedName("available")
Boolean available;

@SerializedName("display_preference")
DisplayPreference displayPreference;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class DisplayPreference extends StripeObject {
/**
* For child configs, whether or not the account's preference will be observed. If {@code
* false}, the parent configuration's default is used.
*/
@SerializedName("overridable")
Boolean overridable;

/**
* The account's display preference.
*
* <p>One of {@code none}, {@code off}, or {@code on}.
*/
@SerializedName("preference")
String preference;

/**
* The effective display preference value.
*
* <p>One of {@code off}, or {@code on}.
*/
@SerializedName("value")
String value;
}
}

@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
Expand Down Expand Up @@ -2091,5 +2137,6 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
trySetResponseGetter(upi, responseGetter);
trySetResponseGetter(usBankAccount, responseGetter);
trySetResponseGetter(wechatPay, responseGetter);
trySetResponseGetter(zip, responseGetter);
}
}
13 changes: 13 additions & 0 deletions src/main/java/com/stripe/model/SetupAttempt.java
Expand Up @@ -646,6 +646,10 @@ public static class CardPresent extends StripeObject {
@Setter(lombok.AccessLevel.NONE)
ExpandableField<PaymentMethod> generatedCard;

/** Details about payments collected offline. */
@SerializedName("offline")
Offline offline;

/** Get ID of expandable {@code generatedCard} object. */
public String getGeneratedCard() {
return (this.generatedCard != null) ? this.generatedCard.getId() : null;
Expand All @@ -664,6 +668,15 @@ public void setGeneratedCardObject(PaymentMethod expandableObject) {
this.generatedCard =
new ExpandableField<PaymentMethod>(expandableObject.getId(), expandableObject);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Offline extends StripeObject {
/** Time at which the payment was collected while offline. */
@SerializedName("stored_at")
Long storedAt;
}
}

@Getter
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/stripe/model/SetupIntent.java
Expand Up @@ -970,6 +970,9 @@ public static class PaymentMethodOptions extends StripeObject {
@SerializedName("card")
Card card;

@SerializedName("card_present")
CardPresent cardPresent;

@SerializedName("link")
Link link;

Expand Down Expand Up @@ -1144,6 +1147,11 @@ public static class MandateOptions extends StripeObject {
}
}

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

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
53 changes: 52 additions & 1 deletion src/main/java/com/stripe/model/Subscription.java
Expand Up @@ -21,6 +21,7 @@
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
Expand Down Expand Up @@ -189,11 +190,20 @@ public class Subscription extends ApiResource implements HasId, MetadataStore<Su

/**
* Describes the current discount applied to this subscription, if there is one. When billing, a
* discount applied to a subscription overrides a discount applied on a customer-wide basis.
* discount applied to a subscription overrides a discount applied on a customer-wide basis. This
* field has been deprecated and will be removed in a future API version. Use {@code discounts}
* instead.
*/
@SerializedName("discount")
Discount discount;

/**
* The discounts applied to the subscription. Subscription item discounts are applied before
* subscription discounts. Use {@code expand[]=discounts} to expand each discount.
*/
@SerializedName("discounts")
List<ExpandableField<Discount>> discounts;

/** If the subscription has ended, the date the subscription ended. */
@SerializedName("ended_at")
Long endedAt;
Expand Down Expand Up @@ -538,6 +548,47 @@ public void setTestClockObject(TestClock expandableObject) {
this.testClock = new ExpandableField<TestClock>(expandableObject.getId(), expandableObject);
}

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

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

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

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

/**
* Cancels a customer’s subscription immediately. The customer will not be charged again for the
* subscription.
Expand Down
49 changes: 49 additions & 0 deletions src/main/java/com/stripe/model/SubscriptionItem.java
Expand Up @@ -18,6 +18,7 @@
import com.stripe.param.SubscriptionItemUsageRecordSummariesParams;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
Expand Down Expand Up @@ -46,6 +47,13 @@ public class SubscriptionItem extends ApiResource
@SerializedName("deleted")
Boolean deleted;

/**
* The discounts applied to the subscription item. Subscription item discounts are applied before
* subscription discounts. Use {@code expand[]=discounts} to expand each discount.
*/
@SerializedName("discounts")
List<ExpandableField<Discount>> discounts;

/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
Expand Down Expand Up @@ -128,6 +136,47 @@ public class SubscriptionItem extends ApiResource
@SerializedName("tax_rates")
List<TaxRate> taxRates;

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

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

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

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

/** Adds a new item to an existing subscription. No existing items will be changed or replaced. */
public static SubscriptionItem create(Map<String, Object> params) throws StripeException {
return create(params, (RequestOptions) null);
Expand Down

0 comments on commit e53a8da

Please sign in to comment.