Skip to content

Commit

Permalink
Merge pull request #1749 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 Feb 22, 2024
2 parents b0e1a3d + 8d43a4f commit 39e938b
Show file tree
Hide file tree
Showing 56 changed files with 3,813 additions and 101 deletions.
18 changes: 13 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 24.17.0 - 2024-02-22
* [#1748](https://github.com/stripe/stripe-java/pull/1748) Update generated code
* Add support for `client_reference_id` on `Identity.VerificationReport`, `Identity.VerificationSession`, `identity.VerificationReportListParams`, `identity.VerificationSessionCreateParams`, and `identity.VerificationSessionListParams`
* Remove support for value `include_and_require` from enum `InvoiceCreateParams.pending_invoice_items_behavior`
* Remove support for value `service_tax` from enums `TaxRateCreateParams.tax_type` and `TaxRateUpdateParams.tax_type`
* Add support for `created` on `treasury.OutboundPaymentListParams`
* Add `InvoiceLineItem.update` method.

## 24.17.0-beta.1 - 2024-02-16
* [#1746](https://github.com/stripe/stripe-java/pull/1746) Update generated code for beta
* Add support for `payto` and `twint` payment methods across the API
Expand All @@ -22,11 +30,11 @@

## 24.15.0 - 2024-02-08
* [#1742](https://github.com/stripe/stripe-java/pull/1742) Update generated code
* Add support for `invoices` on `Account.settings` and `AccountUpdateParams.settings`
* Add support for new value `velobank` on enums `PaymentIntentConfirmParams.payment_method_data.p24.bank`, `PaymentIntentCreateParams.payment_method_data.p24.bank`, `PaymentIntentUpdateParams.payment_method_data.p24.bank`, `PaymentMethodCreateParams.p24.bank`, `SetupIntentConfirmParams.payment_method_data.p24.bank`, `SetupIntentCreateParams.payment_method_data.p24.bank`, and `SetupIntentUpdateParams.payment_method_data.p24.bank`
* Add support for `setup_future_usage` on `PaymentIntent.payment_method_options.blik`, `PaymentIntentConfirmParams.payment_method_options.blik`, `PaymentIntentCreateParams.payment_method_options.blik`, and `PaymentIntentUpdateParams.payment_method_options.blik`
* Add support for `require_cvc_recollection` on `PaymentIntent.payment_method_options.card`, `PaymentIntentConfirmParams.payment_method_options.card`, `PaymentIntentCreateParams.payment_method_options.card`, and `PaymentIntentUpdateParams.payment_method_options.card`
* Add support for `account_tax_ids` on `SubscriptionCreateParams.invoice_settings`, `SubscriptionSchedule.default_settings.invoice_settings`, `SubscriptionSchedule.phases[].invoice_settings`, `SubscriptionScheduleCreateParams.default_settings.invoice_settings`, `SubscriptionScheduleCreateParams.phases[].invoice_settings`, `SubscriptionScheduleUpdateParams.default_settings.invoice_settings`, `SubscriptionScheduleUpdateParams.phases[].invoice_settings`, and `SubscriptionUpdateParams.invoice_settings`
* Add support for `invoices` on `Account.settings` and `AccountUpdateParams.settings`
* Add support for new value `velobank` on enums `PaymentIntentConfirmParams.payment_method_data.p24.bank`, `PaymentIntentCreateParams.payment_method_data.p24.bank`, `PaymentIntentUpdateParams.payment_method_data.p24.bank`, `PaymentMethodCreateParams.p24.bank`, `SetupIntentConfirmParams.payment_method_data.p24.bank`, `SetupIntentCreateParams.payment_method_data.p24.bank`, and `SetupIntentUpdateParams.payment_method_data.p24.bank`
* Add support for `setup_future_usage` on `PaymentIntent.payment_method_options.blik`, `PaymentIntentConfirmParams.payment_method_options.blik`, `PaymentIntentCreateParams.payment_method_options.blik`, and `PaymentIntentUpdateParams.payment_method_options.blik`
* Add support for `require_cvc_recollection` on `PaymentIntent.payment_method_options.card`, `PaymentIntentConfirmParams.payment_method_options.card`, `PaymentIntentCreateParams.payment_method_options.card`, and `PaymentIntentUpdateParams.payment_method_options.card`
* Add support for `account_tax_ids` on `SubscriptionCreateParams.invoice_settings`, `SubscriptionSchedule.default_settings.invoice_settings`, `SubscriptionSchedule.phases[].invoice_settings`, `SubscriptionScheduleCreateParams.default_settings.invoice_settings`, `SubscriptionScheduleCreateParams.phases[].invoice_settings`, `SubscriptionScheduleUpdateParams.default_settings.invoice_settings`, `SubscriptionScheduleUpdateParams.phases[].invoice_settings`, and `SubscriptionUpdateParams.invoice_settings`
* [#1744](https://github.com/stripe/stripe-java/pull/1744) Define StripeClient "usage" in a single place

## 24.15.0-beta.1 - 2024-02-01
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v831
v840
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-12-11.preview-v2";
public static final String PREVIEW_CURRENT = "2024-02-15.preview-v2";
}
5 changes: 4 additions & 1 deletion src/main/java/com/stripe/model/BalanceTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,10 @@ public static class FeeDetail extends StripeObject {
@SerializedName("description")
String description;

/** Type of the fee, one of: {@code application_fee}, {@code stripe_fee} or {@code tax}. */
/**
* Type of the fee, one of: {@code application_fee}, {@code payment_method_passthrough_fee},
* {@code stripe_fee} or {@code tax}.
*/
@SerializedName("type")
String type;
}
Expand Down
91 changes: 90 additions & 1 deletion src/main/java/com/stripe/model/InvoiceLineItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiMode;
import com.stripe.net.ApiRequest;
import com.stripe.net.ApiRequestParams;
import com.stripe.net.ApiResource;
import com.stripe.net.BaseAddress;
import com.stripe.net.RequestOptions;
import com.stripe.net.StripeResponseGetter;
import com.stripe.param.InvoiceLineItemUpdateParams;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
Expand All @@ -14,7 +22,7 @@
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class InvoiceLineItem extends StripeObject implements HasId {
public class InvoiceLineItem extends ApiResource implements HasId, MetadataStore<InvoiceLineItem> {
/** The amount, in cents (or local equivalent). */
@SerializedName("amount")
Long amount;
Expand Down Expand Up @@ -94,6 +102,7 @@ public class InvoiceLineItem extends StripeObject implements HasId {
* structured format. Note that for line items with {@code type=subscription} this will reflect
* the metadata of the subscription that caused the line item to be created.
*/
@Getter(onMethod_ = {@Override})
@SerializedName("metadata")
Map<String, String> metadata;

Expand Down Expand Up @@ -305,6 +314,74 @@ public void setMarginObjects(List<Margin> objs) {
: null;
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
@Override
public InvoiceLineItem update(Map<String, Object> params) throws StripeException {
return update(params, (RequestOptions) null);
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
@Override
public InvoiceLineItem update(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/invoices/%s/lines/%s",
ApiResource.urlEncodeId(this.getInvoice()), ApiResource.urlEncodeId(this.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return getResponseGetter().request(request, InvoiceLineItem.class);
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
public InvoiceLineItem update(InvoiceLineItemUpdateParams params) throws StripeException {
return update(params, (RequestOptions) null);
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
public InvoiceLineItem update(InvoiceLineItemUpdateParams params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/invoices/%s/lines/%s",
ApiResource.urlEncodeId(this.getInvoice()), ApiResource.urlEncodeId(this.getId()));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getResponseGetter().request(request, InvoiceLineItem.class);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -465,4 +542,16 @@ public void setTaxRateObject(TaxRate expandableObject) {
this.taxRate = new ExpandableField<TaxRate>(expandableObject.getId(), expandableObject);
}
}

@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(invoiceItem, responseGetter);
trySetResponseGetter(period, responseGetter);
trySetResponseGetter(plan, responseGetter);
trySetResponseGetter(price, responseGetter);
trySetResponseGetter(prorationDetails, responseGetter);
trySetResponseGetter(subscription, responseGetter);
trySetResponseGetter(subscriptionItem, responseGetter);
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/model/TaxRate.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public class TaxRate extends ApiResource implements HasId, MetadataStore<TaxRate
*
* <p>One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, {@code
* igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code rst}, {@code
* sales_tax}, {@code service_tax}, or {@code vat}.
* sales_tax}, {@code vat}, or {@code service_tax}.
*/
@SerializedName("tax_type")
String taxType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ public static class SubscriptionUpdate extends StripeObject {

/**
* Determines how to handle prorations resulting from subscription updates. Valid values are
* {@code none}, {@code create_prorations}, and {@code always_invoice}.
* {@code none}, {@code create_prorations}, and {@code always_invoice}. Defaults to a value of
* {@code none} if you don't set it during creation.
*
* <p>One of {@code always_invoice}, {@code create_prorations}, or {@code none}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
@Setter
@EqualsAndHashCode(callSuper = false)
public class VerificationReport extends ApiResource implements HasId {
/**
* A string to reference this user. This can be a customer ID, a session ID, or similar, and can
* be used to reconcile this verification with your internal systems.
*/
@SerializedName("client_reference_id")
String clientReferenceId;

/** Time at which the object was created. Measured in seconds since the Unix epoch. */
@SerializedName("created")
Long created;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
@EqualsAndHashCode(callSuper = false)
public class VerificationSession extends ApiResource
implements HasId, MetadataStore<VerificationSession> {
/**
* A string to reference this user. This can be a customer ID, a session ID, or similar, and can
* be used to reconcile this verification with your internal systems.
*/
@SerializedName("client_reference_id")
String clientReferenceId;

/**
* The short-lived client secret used by Stripe.js to <a
* href="https://stripe.com/docs/js/identity/modal">show a verification modal</a> inside your app.
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/stripe/param/AccountListParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@Getter
public class AccountListParams extends ApiRequestParams {
/** Only return connected accounts that were created during the given date interval. */
@SerializedName("created")
Object created;

Expand Down Expand Up @@ -95,11 +96,13 @@ public AccountListParams build() {
this.startingAfter);
}

/** Only return connected accounts that were created during the given date interval. */
public Builder setCreated(AccountListParams.Created created) {
this.created = created;
return this;
}

/** Only return connected accounts that were created during the given date interval. */
public Builder setCreated(Long created) {
this.created = created;
return this;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/stripe/param/ApplicationFeeListParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class ApplicationFeeListParams extends ApiRequestParams {
@SerializedName("charge")
String charge;

/** Only return applications fees that were created during the given date interval. */
@SerializedName("created")
Object created;

Expand Down Expand Up @@ -110,11 +111,13 @@ public Builder setCharge(String charge) {
return this;
}

/** Only return applications fees that were created during the given date interval. */
public Builder setCreated(ApplicationFeeListParams.Created created) {
this.created = created;
return this;
}

/** Only return applications fees that were created during the given date interval. */
public Builder setCreated(Long created) {
this.created = created;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@Getter
public class BalanceTransactionListParams extends ApiRequestParams {
/** Only return transactions that were created during the given date interval. */
@SerializedName("created")
Object created;

Expand Down Expand Up @@ -152,11 +153,13 @@ public BalanceTransactionListParams build() {
this.type);
}

/** Only return transactions that were created during the given date interval. */
public Builder setCreated(BalanceTransactionListParams.Created created) {
this.created = created;
return this;
}

/** Only return transactions that were created during the given date interval. */
public Builder setCreated(Long created) {
this.created = created;
return this;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/stripe/param/ChargeListParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@Getter
public class ChargeListParams extends ApiRequestParams {
/** Only return charges that were created during the given date interval. */
@SerializedName("created")
Object created;

Expand Down Expand Up @@ -124,11 +125,13 @@ public ChargeListParams build() {
this.transferGroup);
}

/** Only return charges that were created during the given date interval. */
public Builder setCreated(ChargeListParams.Created created) {
this.created = created;
return this;
}

/** Only return charges that were created during the given date interval. */
public Builder setCreated(Long created) {
this.created = created;
return this;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/stripe/param/CustomerListParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@Getter
public class CustomerListParams extends ApiRequestParams {
/** Only return customers that were created during the given date interval. */
@SerializedName("created")
Object created;

Expand Down Expand Up @@ -119,11 +120,13 @@ public CustomerListParams build() {
this.testClock);
}

/** Only return customers that were created during the given date interval. */
public Builder setCreated(CustomerListParams.Created created) {
this.created = created;
return this;
}

/** Only return customers that were created during the given date interval. */
public Builder setCreated(Long created) {
this.created = created;
return this;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/stripe/param/EventListParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@Getter
public class EventListParams extends ApiRequestParams {
/** Only return events that were created during the given date interval. */
@SerializedName("created")
Object created;

Expand Down Expand Up @@ -132,11 +133,13 @@ public EventListParams build() {
this.types);
}

/** Only return events that were created during the given date interval. */
public Builder setCreated(EventListParams.Created created) {
this.created = created;
return this;
}

/** Only return events that were created during the given date interval. */
public Builder setCreated(Long created) {
this.created = created;
return this;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/stripe/param/FileLinkListParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@Getter
public class FileLinkListParams extends ApiRequestParams {
/** Only return links that were created during the given date interval. */
@SerializedName("created")
Object created;

Expand Down Expand Up @@ -113,11 +114,13 @@ public FileLinkListParams build() {
this.startingAfter);
}

/** Only return links that were created during the given date interval. */
public Builder setCreated(FileLinkListParams.Created created) {
this.created = created;
return this;
}

/** Only return links that were created during the given date interval. */
public Builder setCreated(Long created) {
this.created = created;
return this;
Expand Down

0 comments on commit 39e938b

Please sign in to comment.