From 3502c7f3d7e7cb073aa4139e15e0e8dd32d511cc Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:53:32 -0700 Subject: [PATCH 1/5] Update generated code (#1864) * Update generated code for v1249 * Update generated code for v1250 * Update generated code for v1255 * Update generated code for v1257 * Update generated code for v1259 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/StripeClient.java | 4 + src/main/java/com/stripe/model/Customer.java | 8 + .../stripe/model/EventDataClassLookup.java | 1 + src/main/java/com/stripe/model/Invoice.java | 8 + .../model/InvoiceRenderingTemplate.java | 297 ++++++++++++++++++ .../InvoiceRenderingTemplateCollection.java | 5 + .../java/com/stripe/model/PaymentLink.java | 3 + .../com/stripe/model/checkout/Session.java | 8 + .../java/com/stripe/model/issuing/Card.java | 2 +- .../stripe/param/CustomerCreateParams.java | 19 +- .../stripe/param/CustomerUpdateParams.java | 25 +- .../com/stripe/param/InvoiceCreateParams.java | 41 ++- ...InvoiceRenderingTemplateArchiveParams.java | 99 ++++++ .../InvoiceRenderingTemplateListParams.java | 201 ++++++++++++ ...nvoiceRenderingTemplateRetrieveParams.java | 111 +++++++ ...voiceRenderingTemplateUnarchiveParams.java | 99 ++++++ .../com/stripe/param/InvoiceUpdateParams.java | 47 ++- .../stripe/param/PaymentLinkCreateParams.java | 33 +- .../stripe/param/PaymentLinkUpdateParams.java | 33 +- .../com/stripe/param/QuoteCreateParams.java | 6 +- .../com/stripe/param/QuoteUpdateParams.java | 6 +- .../stripe/param/SubscriptionListParams.java | 10 + .../param/checkout/SessionCreateParams.java | 33 +- .../param/terminal/LocationCreateParams.java | 4 +- .../InvoiceRenderingTemplateService.java | 187 +++++++++++ 26 files changed, 1268 insertions(+), 24 deletions(-) create mode 100644 src/main/java/com/stripe/model/InvoiceRenderingTemplate.java create mode 100644 src/main/java/com/stripe/model/InvoiceRenderingTemplateCollection.java create mode 100644 src/main/java/com/stripe/param/InvoiceRenderingTemplateArchiveParams.java create mode 100644 src/main/java/com/stripe/param/InvoiceRenderingTemplateListParams.java create mode 100644 src/main/java/com/stripe/param/InvoiceRenderingTemplateRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/InvoiceRenderingTemplateUnarchiveParams.java create mode 100644 src/main/java/com/stripe/service/InvoiceRenderingTemplateService.java diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 340c4578c3f..b39b96e3790 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1246 \ No newline at end of file +v1259 \ No newline at end of file diff --git a/src/main/java/com/stripe/StripeClient.java b/src/main/java/com/stripe/StripeClient.java index 34ab96be86d..d000e326d13 100644 --- a/src/main/java/com/stripe/StripeClient.java +++ b/src/main/java/com/stripe/StripeClient.java @@ -197,6 +197,10 @@ public com.stripe.service.InvoiceItemService invoiceItems() { return new com.stripe.service.InvoiceItemService(this.getResponseGetter()); } + public com.stripe.service.InvoiceRenderingTemplateService invoiceRenderingTemplates() { + return new com.stripe.service.InvoiceRenderingTemplateService(this.getResponseGetter()); + } + public com.stripe.service.InvoiceService invoices() { return new com.stripe.service.InvoiceService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/model/Customer.java b/src/main/java/com/stripe/model/Customer.java index 2b08f70c7fe..ee6edc8a467 100644 --- a/src/main/java/com/stripe/model/Customer.java +++ b/src/main/java/com/stripe/model/Customer.java @@ -916,6 +916,14 @@ public static class RenderingOptions extends StripeObject { /** How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. */ @SerializedName("amount_tax_display") String amountTaxDisplay; + + /** + * ID of the invoice rendering template to be used for this customer's invoices. If set, the + * template will be used on all invoices for this customer unless a template is set directly + * on the invoice. + */ + @SerializedName("template") + String template; } } diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index 1d62653f018..ef93e6eb9c5 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -45,6 +45,7 @@ final class EventDataClassLookup { classLookup.put("file_link", FileLink.class); classLookup.put("funding_instructions", FundingInstructions.class); classLookup.put("invoice", Invoice.class); + classLookup.put("invoice_rendering_template", InvoiceRenderingTemplate.class); classLookup.put("invoiceitem", InvoiceItem.class); classLookup.put("item", LineItem.class); classLookup.put("line_item", InvoiceLineItem.class); diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index d8d5c77d7d5..e18b7e949cc 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -2591,6 +2591,14 @@ public static class Rendering extends StripeObject { @SerializedName("pdf") Pdf pdf; + /** ID of the rendering template that the invoice is formatted by. */ + @SerializedName("template") + String template; + + /** Version of the rendering template that the invoice is using. */ + @SerializedName("template_version") + Long templateVersion; + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/InvoiceRenderingTemplate.java b/src/main/java/com/stripe/model/InvoiceRenderingTemplate.java new file mode 100644 index 00000000000..7963652d4ee --- /dev/null +++ b/src/main/java/com/stripe/model/InvoiceRenderingTemplate.java @@ -0,0 +1,297 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +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.param.InvoiceRenderingTemplateArchiveParams; +import com.stripe.param.InvoiceRenderingTemplateListParams; +import com.stripe.param.InvoiceRenderingTemplateRetrieveParams; +import com.stripe.param.InvoiceRenderingTemplateUnarchiveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class InvoiceRenderingTemplate extends ApiResource implements HasId { + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** A brief description of the template, hidden from customers. */ + @SerializedName("nickname") + String nickname; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code invoice_rendering_template}. + */ + @SerializedName("object") + String object; + + /** The status of the template, one of {@code active} or {@code archived}. */ + @SerializedName("status") + String status; + + /** + * Version of this template; version increases by one when an update on the template changes any + * field that controls invoice rendering. + */ + @SerializedName("version") + Long version; + + /** + * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects + * (customers, invoices, etc.) can reference it. The template can also no longer be updated. + * However, if the template is already set on a Stripe object, it will continue to be applied on + * invoices generated by it. + */ + public InvoiceRenderingTemplate archive() throws StripeException { + return archive((Map) null, (RequestOptions) null); + } + + /** + * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects + * (customers, invoices, etc.) can reference it. The template can also no longer be updated. + * However, if the template is already set on a Stripe object, it will continue to be applied on + * invoices generated by it. + */ + public InvoiceRenderingTemplate archive(RequestOptions options) throws StripeException { + return archive((Map) null, options); + } + + /** + * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects + * (customers, invoices, etc.) can reference it. The template can also no longer be updated. + * However, if the template is already set on a Stripe object, it will continue to be applied on + * invoices generated by it. + */ + public InvoiceRenderingTemplate archive(Map params) throws StripeException { + return archive(params, (RequestOptions) null); + } + + /** + * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects + * (customers, invoices, etc.) can reference it. The template can also no longer be updated. + * However, if the template is already set on a Stripe object, it will continue to be applied on + * invoices generated by it. + */ + public InvoiceRenderingTemplate archive(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/invoice_rendering_templates/%s/archive", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, InvoiceRenderingTemplate.class); + } + + /** + * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects + * (customers, invoices, etc.) can reference it. The template can also no longer be updated. + * However, if the template is already set on a Stripe object, it will continue to be applied on + * invoices generated by it. + */ + public InvoiceRenderingTemplate archive(InvoiceRenderingTemplateArchiveParams params) + throws StripeException { + return archive(params, (RequestOptions) null); + } + + /** + * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects + * (customers, invoices, etc.) can reference it. The template can also no longer be updated. + * However, if the template is already set on a Stripe object, it will continue to be applied on + * invoices generated by it. + */ + public InvoiceRenderingTemplate archive( + InvoiceRenderingTemplateArchiveParams params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/invoice_rendering_templates/%s/archive", ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, InvoiceRenderingTemplate.class); + } + + /** + * List all templates, ordered by creation date, with the most recently created template appearing + * first. + */ + public static InvoiceRenderingTemplateCollection list(Map params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * List all templates, ordered by creation date, with the most recently created template appearing + * first. + */ + public static InvoiceRenderingTemplateCollection list( + Map params, RequestOptions options) throws StripeException { + String path = "/v1/invoice_rendering_templates"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, InvoiceRenderingTemplateCollection.class); + } + + /** + * List all templates, ordered by creation date, with the most recently created template appearing + * first. + */ + public static InvoiceRenderingTemplateCollection list(InvoiceRenderingTemplateListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * List all templates, ordered by creation date, with the most recently created template appearing + * first. + */ + public static InvoiceRenderingTemplateCollection list( + InvoiceRenderingTemplateListParams params, RequestOptions options) throws StripeException { + String path = "/v1/invoice_rendering_templates"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, InvoiceRenderingTemplateCollection.class); + } + + /** + * Retrieves an invoice rendering template with the given ID. It by default returns the latest + * version of the template. Optionally, specify a version to see previous versions. + */ + public static InvoiceRenderingTemplate retrieve(String template) throws StripeException { + return retrieve(template, (Map) null, (RequestOptions) null); + } + + /** + * Retrieves an invoice rendering template with the given ID. It by default returns the latest + * version of the template. Optionally, specify a version to see previous versions. + */ + public static InvoiceRenderingTemplate retrieve(String template, RequestOptions options) + throws StripeException { + return retrieve(template, (Map) null, options); + } + + /** + * Retrieves an invoice rendering template with the given ID. It by default returns the latest + * version of the template. Optionally, specify a version to see previous versions. + */ + public static InvoiceRenderingTemplate retrieve( + String template, Map params, RequestOptions options) throws StripeException { + String path = + String.format("/v1/invoice_rendering_templates/%s", ApiResource.urlEncodeId(template)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, InvoiceRenderingTemplate.class); + } + + /** + * Retrieves an invoice rendering template with the given ID. It by default returns the latest + * version of the template. Optionally, specify a version to see previous versions. + */ + public static InvoiceRenderingTemplate retrieve( + String template, InvoiceRenderingTemplateRetrieveParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/invoice_rendering_templates/%s", ApiResource.urlEncodeId(template)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, InvoiceRenderingTemplate.class); + } + + /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */ + public InvoiceRenderingTemplate unarchive() throws StripeException { + return unarchive((Map) null, (RequestOptions) null); + } + + /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */ + public InvoiceRenderingTemplate unarchive(RequestOptions options) throws StripeException { + return unarchive((Map) null, options); + } + + /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */ + public InvoiceRenderingTemplate unarchive(Map params) throws StripeException { + return unarchive(params, (RequestOptions) null); + } + + /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */ + public InvoiceRenderingTemplate unarchive(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/invoice_rendering_templates/%s/unarchive", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, InvoiceRenderingTemplate.class); + } + + /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */ + public InvoiceRenderingTemplate unarchive(InvoiceRenderingTemplateUnarchiveParams params) + throws StripeException { + return unarchive(params, (RequestOptions) null); + } + + /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */ + public InvoiceRenderingTemplate unarchive( + InvoiceRenderingTemplateUnarchiveParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/invoice_rendering_templates/%s/unarchive", ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, InvoiceRenderingTemplate.class); + } +} diff --git a/src/main/java/com/stripe/model/InvoiceRenderingTemplateCollection.java b/src/main/java/com/stripe/model/InvoiceRenderingTemplateCollection.java new file mode 100644 index 00000000000..fc62f1e497e --- /dev/null +++ b/src/main/java/com/stripe/model/InvoiceRenderingTemplateCollection.java @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +public class InvoiceRenderingTemplateCollection + extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/PaymentLink.java b/src/main/java/com/stripe/model/PaymentLink.java index 64ea7c26664..1fb5c81132b 100644 --- a/src/main/java/com/stripe/model/PaymentLink.java +++ b/src/main/java/com/stripe/model/PaymentLink.java @@ -1180,6 +1180,9 @@ public static class TaxIdCollection extends StripeObject { /** Indicates whether tax ID collection is enabled for the session. */ @SerializedName("enabled") Boolean enabled; + + @SerializedName("required") + String required; } @Getter diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index 85dedddbb47..71734f50d4d 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -2849,6 +2849,14 @@ public static class TaxIdCollection extends StripeObject { /** Indicates whether tax ID collection is enabled for the session. */ @SerializedName("enabled") Boolean enabled; + + /** + * Indicates whether a tax ID is required on the payment page + * + *

One of {@code if_supported}, or {@code never}. + */ + @SerializedName("required") + String required; } @Getter diff --git a/src/main/java/com/stripe/model/issuing/Card.java b/src/main/java/com/stripe/model/issuing/Card.java index e5e764e3c56..f2d347c7c5c 100644 --- a/src/main/java/com/stripe/model/issuing/Card.java +++ b/src/main/java/com/stripe/model/issuing/Card.java @@ -466,7 +466,7 @@ public static class Shipping extends StripeObject { * The delivery status of the card. * *

One of {@code canceled}, {@code delivered}, {@code failure}, {@code pending}, {@code - * returned}, or {@code shipped}. + * returned}, {@code shipped}, or {@code submitted}. */ @SerializedName("status") String status; diff --git a/src/main/java/com/stripe/param/CustomerCreateParams.java b/src/main/java/com/stripe/param/CustomerCreateParams.java index f4d8e8bcab7..e574e140be8 100644 --- a/src/main/java/com/stripe/param/CustomerCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerCreateParams.java @@ -1180,10 +1180,17 @@ public static class RenderingOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** ID of the invoice rendering template to use for future invoices. */ + @SerializedName("template") + String template; + private RenderingOptions( - ApiRequestParams.EnumParam amountTaxDisplay, Map extraParams) { + ApiRequestParams.EnumParam amountTaxDisplay, + Map extraParams, + String template) { this.amountTaxDisplay = amountTaxDisplay; this.extraParams = extraParams; + this.template = template; } public static Builder builder() { @@ -1195,10 +1202,12 @@ public static class Builder { private Map extraParams; + private String template; + /** Finalize and obtain parameter instance from this builder. */ public CustomerCreateParams.InvoiceSettings.RenderingOptions build() { return new CustomerCreateParams.InvoiceSettings.RenderingOptions( - this.amountTaxDisplay, this.extraParams); + this.amountTaxDisplay, this.extraParams, this.template); } /** @@ -1254,6 +1263,12 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** ID of the invoice rendering template to use for future invoices. */ + public Builder setTemplate(String template) { + this.template = template; + return this; + } } public enum AmountTaxDisplay implements ApiRequestParams.EnumParam { diff --git a/src/main/java/com/stripe/param/CustomerUpdateParams.java b/src/main/java/com/stripe/param/CustomerUpdateParams.java index 61861ff491d..6fa3b29a242 100644 --- a/src/main/java/com/stripe/param/CustomerUpdateParams.java +++ b/src/main/java/com/stripe/param/CustomerUpdateParams.java @@ -1300,10 +1300,17 @@ public static class RenderingOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** ID of the invoice rendering template to use for future invoices. */ + @SerializedName("template") + Object template; + private RenderingOptions( - ApiRequestParams.EnumParam amountTaxDisplay, Map extraParams) { + ApiRequestParams.EnumParam amountTaxDisplay, + Map extraParams, + Object template) { this.amountTaxDisplay = amountTaxDisplay; this.extraParams = extraParams; + this.template = template; } public static Builder builder() { @@ -1315,10 +1322,12 @@ public static class Builder { private Map extraParams; + private Object template; + /** Finalize and obtain parameter instance from this builder. */ public CustomerUpdateParams.InvoiceSettings.RenderingOptions build() { return new CustomerUpdateParams.InvoiceSettings.RenderingOptions( - this.amountTaxDisplay, this.extraParams); + this.amountTaxDisplay, this.extraParams, this.template); } /** @@ -1374,6 +1383,18 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** ID of the invoice rendering template to use for future invoices. */ + public Builder setTemplate(String template) { + this.template = template; + return this; + } + + /** ID of the invoice rendering template to use for future invoices. */ + public Builder setTemplate(EmptyParam template) { + this.template = template; + return this; + } } public enum AmountTaxDisplay implements ApiRequestParams.EnumParam { diff --git a/src/main/java/com/stripe/param/InvoiceCreateParams.java b/src/main/java/com/stripe/param/InvoiceCreateParams.java index b1ee84f0fe9..956f936842f 100644 --- a/src/main/java/com/stripe/param/InvoiceCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreateParams.java @@ -3651,11 +3651,25 @@ public static class Rendering { @SerializedName("pdf") Pdf pdf; + /** ID of the invoice rendering template to use for this invoice. */ + @SerializedName("template") + String template; + + /** The specific version of invoice rendering template to use for this invoice. */ + @SerializedName("template_version") + Object templateVersion; + private Rendering( - ApiRequestParams.EnumParam amountTaxDisplay, Map extraParams, Pdf pdf) { + ApiRequestParams.EnumParam amountTaxDisplay, + Map extraParams, + Pdf pdf, + String template, + Object templateVersion) { this.amountTaxDisplay = amountTaxDisplay; this.extraParams = extraParams; this.pdf = pdf; + this.template = template; + this.templateVersion = templateVersion; } public static Builder builder() { @@ -3669,9 +3683,14 @@ public static class Builder { private Pdf pdf; + private String template; + + private Object templateVersion; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreateParams.Rendering build() { - return new InvoiceCreateParams.Rendering(this.amountTaxDisplay, this.extraParams, this.pdf); + return new InvoiceCreateParams.Rendering( + this.amountTaxDisplay, this.extraParams, this.pdf, this.template, this.templateVersion); } /** @@ -3728,6 +3747,24 @@ public Builder setPdf(InvoiceCreateParams.Rendering.Pdf pdf) { this.pdf = pdf; return this; } + + /** ID of the invoice rendering template to use for this invoice. */ + public Builder setTemplate(String template) { + this.template = template; + return this; + } + + /** The specific version of invoice rendering template to use for this invoice. */ + public Builder setTemplateVersion(Long templateVersion) { + this.templateVersion = templateVersion; + return this; + } + + /** The specific version of invoice rendering template to use for this invoice. */ + public Builder setTemplateVersion(EmptyParam templateVersion) { + this.templateVersion = templateVersion; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/InvoiceRenderingTemplateArchiveParams.java b/src/main/java/com/stripe/param/InvoiceRenderingTemplateArchiveParams.java new file mode 100644 index 00000000000..6f6475fabdf --- /dev/null +++ b/src/main/java/com/stripe/param/InvoiceRenderingTemplateArchiveParams.java @@ -0,0 +1,99 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class InvoiceRenderingTemplateArchiveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private InvoiceRenderingTemplateArchiveParams( + List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceRenderingTemplateArchiveParams build() { + return new InvoiceRenderingTemplateArchiveParams(this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceRenderingTemplateArchiveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceRenderingTemplateArchiveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * InvoiceRenderingTemplateArchiveParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link InvoiceRenderingTemplateArchiveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/InvoiceRenderingTemplateListParams.java b/src/main/java/com/stripe/param/InvoiceRenderingTemplateListParams.java new file mode 100644 index 00000000000..1219b1acba8 --- /dev/null +++ b/src/main/java/com/stripe/param/InvoiceRenderingTemplateListParams.java @@ -0,0 +1,201 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class InvoiceRenderingTemplateListParams extends ApiRequestParams { + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + @SerializedName("ending_before") + String endingBefore; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + @SerializedName("limit") + Long limit; + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, ending with + * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to + * fetch the next page of the list. + */ + @SerializedName("starting_after") + String startingAfter; + + @SerializedName("status") + Status status; + + private InvoiceRenderingTemplateListParams( + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter, + Status status) { + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.startingAfter = startingAfter; + this.status = status; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String endingBefore; + + private List expand; + + private Map extraParams; + + private Long limit; + + private String startingAfter; + + private Status status; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceRenderingTemplateListParams build() { + return new InvoiceRenderingTemplateListParams( + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter, + this.status); + } + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + public Builder setEndingBefore(String endingBefore) { + this.endingBefore = endingBefore; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceRenderingTemplateListParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceRenderingTemplateListParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * InvoiceRenderingTemplateListParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link InvoiceRenderingTemplateListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your + * place in the list. For instance, if you make a list request and receive 100 objects, ending + * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in + * order to fetch the next page of the list. + */ + public Builder setStartingAfter(String startingAfter) { + this.startingAfter = startingAfter; + return this; + } + + public Builder setStatus(InvoiceRenderingTemplateListParams.Status status) { + this.status = status; + return this; + } + } + + public enum Status implements ApiRequestParams.EnumParam { + @SerializedName("active") + ACTIVE("active"), + + @SerializedName("archived") + ARCHIVED("archived"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Status(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/InvoiceRenderingTemplateRetrieveParams.java b/src/main/java/com/stripe/param/InvoiceRenderingTemplateRetrieveParams.java new file mode 100644 index 00000000000..a87a3c667a7 --- /dev/null +++ b/src/main/java/com/stripe/param/InvoiceRenderingTemplateRetrieveParams.java @@ -0,0 +1,111 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class InvoiceRenderingTemplateRetrieveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + @SerializedName("version") + Long version; + + private InvoiceRenderingTemplateRetrieveParams( + List expand, Map extraParams, Long version) { + this.expand = expand; + this.extraParams = extraParams; + this.version = version; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private Long version; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceRenderingTemplateRetrieveParams build() { + return new InvoiceRenderingTemplateRetrieveParams( + this.expand, this.extraParams, this.version); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceRenderingTemplateRetrieveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceRenderingTemplateRetrieveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * InvoiceRenderingTemplateRetrieveParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link InvoiceRenderingTemplateRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + public Builder setVersion(Long version) { + this.version = version; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/InvoiceRenderingTemplateUnarchiveParams.java b/src/main/java/com/stripe/param/InvoiceRenderingTemplateUnarchiveParams.java new file mode 100644 index 00000000000..53d196f112d --- /dev/null +++ b/src/main/java/com/stripe/param/InvoiceRenderingTemplateUnarchiveParams.java @@ -0,0 +1,99 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class InvoiceRenderingTemplateUnarchiveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private InvoiceRenderingTemplateUnarchiveParams( + List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceRenderingTemplateUnarchiveParams build() { + return new InvoiceRenderingTemplateUnarchiveParams(this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceRenderingTemplateUnarchiveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceRenderingTemplateUnarchiveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * InvoiceRenderingTemplateUnarchiveParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link InvoiceRenderingTemplateUnarchiveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/InvoiceUpdateParams.java b/src/main/java/com/stripe/param/InvoiceUpdateParams.java index 223412314be..470a52d30b1 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateParams.java @@ -3659,11 +3659,25 @@ public static class Rendering { @SerializedName("pdf") Pdf pdf; + /** ID of the invoice rendering template to use for this invoice. */ + @SerializedName("template") + Object template; + + /** The specific version of invoice rendering template to use for this invoice. */ + @SerializedName("template_version") + Object templateVersion; + private Rendering( - ApiRequestParams.EnumParam amountTaxDisplay, Map extraParams, Pdf pdf) { + ApiRequestParams.EnumParam amountTaxDisplay, + Map extraParams, + Pdf pdf, + Object template, + Object templateVersion) { this.amountTaxDisplay = amountTaxDisplay; this.extraParams = extraParams; this.pdf = pdf; + this.template = template; + this.templateVersion = templateVersion; } public static Builder builder() { @@ -3677,9 +3691,14 @@ public static class Builder { private Pdf pdf; + private Object template; + + private Object templateVersion; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceUpdateParams.Rendering build() { - return new InvoiceUpdateParams.Rendering(this.amountTaxDisplay, this.extraParams, this.pdf); + return new InvoiceUpdateParams.Rendering( + this.amountTaxDisplay, this.extraParams, this.pdf, this.template, this.templateVersion); } /** @@ -3736,6 +3755,30 @@ public Builder setPdf(InvoiceUpdateParams.Rendering.Pdf pdf) { this.pdf = pdf; return this; } + + /** ID of the invoice rendering template to use for this invoice. */ + public Builder setTemplate(String template) { + this.template = template; + return this; + } + + /** ID of the invoice rendering template to use for this invoice. */ + public Builder setTemplate(EmptyParam template) { + this.template = template; + return this; + } + + /** The specific version of invoice rendering template to use for this invoice. */ + public Builder setTemplateVersion(Long templateVersion) { + this.templateVersion = templateVersion; + return this; + } + + /** The specific version of invoice rendering template to use for this invoice. */ + public Builder setTemplateVersion(EmptyParam templateVersion) { + this.templateVersion = templateVersion; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 98cbfb33c81..8e2388620e1 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -5454,9 +5454,14 @@ public static class TaxIdCollection { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private TaxIdCollection(Boolean enabled, Map extraParams) { + /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + @SerializedName("required") + Required required; + + private TaxIdCollection(Boolean enabled, Map extraParams, Required required) { this.enabled = enabled; this.extraParams = extraParams; + this.required = required; } public static Builder builder() { @@ -5468,9 +5473,12 @@ public static class Builder { private Map extraParams; + private Required required; + /** Finalize and obtain parameter instance from this builder. */ public PaymentLinkCreateParams.TaxIdCollection build() { - return new PaymentLinkCreateParams.TaxIdCollection(this.enabled, this.extraParams); + return new PaymentLinkCreateParams.TaxIdCollection( + this.enabled, this.extraParams, this.required); } /** @@ -5508,6 +5516,27 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + public Builder setRequired(PaymentLinkCreateParams.TaxIdCollection.Required required) { + this.required = required; + return this; + } + } + + public enum Required implements ApiRequestParams.EnumParam { + @SerializedName("if_supported") + IF_SUPPORTED("if_supported"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Required(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index ca38f13fd37..ac18c8ec871 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -4995,9 +4995,14 @@ public static class TaxIdCollection { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private TaxIdCollection(Boolean enabled, Map extraParams) { + /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + @SerializedName("required") + Required required; + + private TaxIdCollection(Boolean enabled, Map extraParams, Required required) { this.enabled = enabled; this.extraParams = extraParams; + this.required = required; } public static Builder builder() { @@ -5009,9 +5014,12 @@ public static class Builder { private Map extraParams; + private Required required; + /** Finalize and obtain parameter instance from this builder. */ public PaymentLinkUpdateParams.TaxIdCollection build() { - return new PaymentLinkUpdateParams.TaxIdCollection(this.enabled, this.extraParams); + return new PaymentLinkUpdateParams.TaxIdCollection( + this.enabled, this.extraParams, this.required); } /** @@ -5049,6 +5057,27 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + public Builder setRequired(PaymentLinkUpdateParams.TaxIdCollection.Required required) { + this.required = required; + return this; + } + } + + public enum Required implements ApiRequestParams.EnumParam { + @SerializedName("if_supported") + IF_SUPPORTED("if_supported"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Required(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/QuoteCreateParams.java b/src/main/java/com/stripe/param/QuoteCreateParams.java index 149cbf81a2c..1b0938344ea 100644 --- a/src/main/java/com/stripe/param/QuoteCreateParams.java +++ b/src/main/java/com/stripe/param/QuoteCreateParams.java @@ -64,7 +64,7 @@ public class QuoteCreateParams extends ApiRequestParams { @SerializedName("description") Object description; - /** The discounts applied to the quote. You can only set up to one discount. */ + /** The discounts applied to the quote. */ @SerializedName("discounts") Object discounts; @@ -434,13 +434,13 @@ public Builder addAllDiscount(List elements) { return this; } - /** The discounts applied to the quote. You can only set up to one discount. */ + /** The discounts applied to the quote. */ public Builder setDiscounts(EmptyParam discounts) { this.discounts = discounts; return this; } - /** The discounts applied to the quote. You can only set up to one discount. */ + /** The discounts applied to the quote. */ public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; diff --git a/src/main/java/com/stripe/param/QuoteUpdateParams.java b/src/main/java/com/stripe/param/QuoteUpdateParams.java index 334275622a2..07912b6afd1 100644 --- a/src/main/java/com/stripe/param/QuoteUpdateParams.java +++ b/src/main/java/com/stripe/param/QuoteUpdateParams.java @@ -59,7 +59,7 @@ public class QuoteUpdateParams extends ApiRequestParams { @SerializedName("description") Object description; - /** The discounts applied to the quote. You can only set up to one discount. */ + /** The discounts applied to the quote. */ @SerializedName("discounts") Object discounts; @@ -397,13 +397,13 @@ public Builder addAllDiscount(List elements) { return this; } - /** The discounts applied to the quote. You can only set up to one discount. */ + /** The discounts applied to the quote. */ public Builder setDiscounts(EmptyParam discounts) { this.discounts = discounts; return this; } - /** The discounts applied to the quote. You can only set up to one discount. */ + /** The discounts applied to the quote. */ public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; diff --git a/src/main/java/com/stripe/param/SubscriptionListParams.java b/src/main/java/com/stripe/param/SubscriptionListParams.java index 4ca32bde27e..d6a71e261e1 100644 --- a/src/main/java/com/stripe/param/SubscriptionListParams.java +++ b/src/main/java/com/stripe/param/SubscriptionListParams.java @@ -26,9 +26,11 @@ public class SubscriptionListParams extends ApiRequestParams { @SerializedName("created") Object created; + /** Only return subscriptions whose current_period_end falls within the given date interval. */ @SerializedName("current_period_end") Object currentPeriodEnd; + /** Only return subscriptions whose current_period_start falls within the given date interval. */ @SerializedName("current_period_start") Object currentPeriodStart; @@ -215,22 +217,30 @@ public Builder setCreated(Long created) { return this; } + /** Only return subscriptions whose current_period_end falls within the given date interval. */ public Builder setCurrentPeriodEnd(SubscriptionListParams.CurrentPeriodEnd currentPeriodEnd) { this.currentPeriodEnd = currentPeriodEnd; return this; } + /** Only return subscriptions whose current_period_end falls within the given date interval. */ public Builder setCurrentPeriodEnd(Long currentPeriodEnd) { this.currentPeriodEnd = currentPeriodEnd; return this; } + /** + * Only return subscriptions whose current_period_start falls within the given date interval. + */ public Builder setCurrentPeriodStart( SubscriptionListParams.CurrentPeriodStart currentPeriodStart) { this.currentPeriodStart = currentPeriodStart; return this; } + /** + * Only return subscriptions whose current_period_start falls within the given date interval. + */ public Builder setCurrentPeriodStart(Long currentPeriodStart) { this.currentPeriodStart = currentPeriodStart; return this; diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 0992ae1e50b..06cb2526d0c 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -14529,9 +14529,14 @@ public static class TaxIdCollection { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private TaxIdCollection(Boolean enabled, Map extraParams) { + /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + @SerializedName("required") + Required required; + + private TaxIdCollection(Boolean enabled, Map extraParams, Required required) { this.enabled = enabled; this.extraParams = extraParams; + this.required = required; } public static Builder builder() { @@ -14543,9 +14548,12 @@ public static class Builder { private Map extraParams; + private Required required; + /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.TaxIdCollection build() { - return new SessionCreateParams.TaxIdCollection(this.enabled, this.extraParams); + return new SessionCreateParams.TaxIdCollection( + this.enabled, this.extraParams, this.required); } /** @@ -14582,6 +14590,27 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + public Builder setRequired(SessionCreateParams.TaxIdCollection.Required required) { + this.required = required; + return this; + } + } + + public enum Required implements ApiRequestParams.EnumParam { + @SerializedName("if_supported") + IF_SUPPORTED("if_supported"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Required(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/terminal/LocationCreateParams.java b/src/main/java/com/stripe/param/terminal/LocationCreateParams.java index 6a1ccb51d03..21bfc6cd563 100644 --- a/src/main/java/com/stripe/param/terminal/LocationCreateParams.java +++ b/src/main/java/com/stripe/param/terminal/LocationCreateParams.java @@ -20,7 +20,7 @@ public class LocationCreateParams extends ApiRequestParams { @SerializedName("configuration_overrides") String configurationOverrides; - /** Required. A name for the location. */ + /** Required. A name for the location. Maximum length is 1000 characters. */ @SerializedName("display_name") String displayName; @@ -101,7 +101,7 @@ public Builder setConfigurationOverrides(String configurationOverrides) { return this; } - /** Required. A name for the location. */ + /** Required. A name for the location. Maximum length is 1000 characters. */ public Builder setDisplayName(String displayName) { this.displayName = displayName; return this; diff --git a/src/main/java/com/stripe/service/InvoiceRenderingTemplateService.java b/src/main/java/com/stripe/service/InvoiceRenderingTemplateService.java new file mode 100644 index 00000000000..33f6f455df8 --- /dev/null +++ b/src/main/java/com/stripe/service/InvoiceRenderingTemplateService.java @@ -0,0 +1,187 @@ +// File generated from our OpenAPI spec +package com.stripe.service; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.InvoiceRenderingTemplate; +import com.stripe.model.StripeCollection; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.ApiService; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.InvoiceRenderingTemplateArchiveParams; +import com.stripe.param.InvoiceRenderingTemplateListParams; +import com.stripe.param.InvoiceRenderingTemplateRetrieveParams; +import com.stripe.param.InvoiceRenderingTemplateUnarchiveParams; + +public final class InvoiceRenderingTemplateService extends ApiService { + public InvoiceRenderingTemplateService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** + * List all templates, ordered by creation date, with the most recently created template appearing + * first. + */ + public StripeCollection list(InvoiceRenderingTemplateListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + /** + * List all templates, ordered by creation date, with the most recently created template appearing + * first. + */ + public StripeCollection list(RequestOptions options) + throws StripeException { + return list((InvoiceRenderingTemplateListParams) null, options); + } + /** + * List all templates, ordered by creation date, with the most recently created template appearing + * first. + */ + public StripeCollection list() throws StripeException { + return list((InvoiceRenderingTemplateListParams) null, (RequestOptions) null); + } + /** + * List all templates, ordered by creation date, with the most recently created template appearing + * first. + */ + public StripeCollection list( + InvoiceRenderingTemplateListParams params, RequestOptions options) throws StripeException { + String path = "/v1/invoice_rendering_templates"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request( + request, new TypeToken>() {}.getType()); + } + /** + * Retrieves an invoice rendering template with the given ID. It by default returns the latest + * version of the template. Optionally, specify a version to see previous versions. + */ + public InvoiceRenderingTemplate retrieve( + String template, InvoiceRenderingTemplateRetrieveParams params) throws StripeException { + return retrieve(template, params, (RequestOptions) null); + } + /** + * Retrieves an invoice rendering template with the given ID. It by default returns the latest + * version of the template. Optionally, specify a version to see previous versions. + */ + public InvoiceRenderingTemplate retrieve(String template, RequestOptions options) + throws StripeException { + return retrieve(template, (InvoiceRenderingTemplateRetrieveParams) null, options); + } + /** + * Retrieves an invoice rendering template with the given ID. It by default returns the latest + * version of the template. Optionally, specify a version to see previous versions. + */ + public InvoiceRenderingTemplate retrieve(String template) throws StripeException { + return retrieve(template, (InvoiceRenderingTemplateRetrieveParams) null, (RequestOptions) null); + } + /** + * Retrieves an invoice rendering template with the given ID. It by default returns the latest + * version of the template. Optionally, specify a version to see previous versions. + */ + public InvoiceRenderingTemplate retrieve( + String template, InvoiceRenderingTemplateRetrieveParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/invoice_rendering_templates/%s", ApiResource.urlEncodeId(template)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, InvoiceRenderingTemplate.class); + } + /** + * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects + * (customers, invoices, etc.) can reference it. The template can also no longer be updated. + * However, if the template is already set on a Stripe object, it will continue to be applied on + * invoices generated by it. + */ + public InvoiceRenderingTemplate archive( + String template, InvoiceRenderingTemplateArchiveParams params) throws StripeException { + return archive(template, params, (RequestOptions) null); + } + /** + * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects + * (customers, invoices, etc.) can reference it. The template can also no longer be updated. + * However, if the template is already set on a Stripe object, it will continue to be applied on + * invoices generated by it. + */ + public InvoiceRenderingTemplate archive(String template, RequestOptions options) + throws StripeException { + return archive(template, (InvoiceRenderingTemplateArchiveParams) null, options); + } + /** + * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects + * (customers, invoices, etc.) can reference it. The template can also no longer be updated. + * However, if the template is already set on a Stripe object, it will continue to be applied on + * invoices generated by it. + */ + public InvoiceRenderingTemplate archive(String template) throws StripeException { + return archive(template, (InvoiceRenderingTemplateArchiveParams) null, (RequestOptions) null); + } + /** + * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects + * (customers, invoices, etc.) can reference it. The template can also no longer be updated. + * However, if the template is already set on a Stripe object, it will continue to be applied on + * invoices generated by it. + */ + public InvoiceRenderingTemplate archive( + String template, InvoiceRenderingTemplateArchiveParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/invoice_rendering_templates/%s/archive", ApiResource.urlEncodeId(template)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, InvoiceRenderingTemplate.class); + } + /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */ + public InvoiceRenderingTemplate unarchive( + String template, InvoiceRenderingTemplateUnarchiveParams params) throws StripeException { + return unarchive(template, params, (RequestOptions) null); + } + /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */ + public InvoiceRenderingTemplate unarchive(String template, RequestOptions options) + throws StripeException { + return unarchive(template, (InvoiceRenderingTemplateUnarchiveParams) null, options); + } + /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */ + public InvoiceRenderingTemplate unarchive(String template) throws StripeException { + return unarchive( + template, (InvoiceRenderingTemplateUnarchiveParams) null, (RequestOptions) null); + } + /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */ + public InvoiceRenderingTemplate unarchive( + String template, InvoiceRenderingTemplateUnarchiveParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/invoice_rendering_templates/%s/unarchive", ApiResource.urlEncodeId(template)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, InvoiceRenderingTemplate.class); + } +} From 6841d41850303ba3da9190df54b6057fc14b8a41 Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 12 Sep 2024 18:06:12 -0400 Subject: [PATCH 2/5] Bump version to 26.11.0 --- CHANGELOG.md | 8 ++++++++ README.md | 8 ++++---- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35be7eec1b4..1e874c15f1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 26.11.0 - 2024-09-12 +* [#1864](https://github.com/stripe/stripe-java/pull/1864) Update generated code + * Add support for new resource `InvoiceRenderingTemplate` + * Add support for `archive`, `list`, `retrieve`, and `unarchive` methods on resource `InvoiceRenderingTemplate` + * Add support for `required` on `Checkout.Session.tax_id_collection`, `PaymentLink.tax_id_collection`, `PaymentLinkCreateParams.tax_id_collection`, `PaymentLinkUpdateParams.tax_id_collection`, and `checkout.SessionCreateParams.tax_id_collection` + * Add support for `template` on `Customer.invoice_settings.rendering_options`, `CustomerCreateParams.invoice_settings.rendering_options`, `CustomerUpdateParams.invoice_settings.rendering_options`, `Invoice.rendering`, `InvoiceCreateParams.rendering`, and `InvoiceUpdateParams.rendering` + * Add support for `template_version` on `Invoice.rendering`, `InvoiceCreateParams.rendering`, and `InvoiceUpdateParams.rendering` + ## 26.10.0 - 2024-09-05 * [#1850](https://github.com/stripe/stripe-java/pull/1850) Update generated code * Add support for `subscription_item` and `subscription` on `billing.AlertCreateParams.filter` diff --git a/README.md b/README.md index 6d8536ec787..1c9152136a0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stripe Java client library -[![Maven Central](https://img.shields.io/badge/maven--central-v26.10.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) +[![Maven Central](https://img.shields.io/badge/maven--central-v26.11.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master) @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:26.10.0" +implementation "com.stripe:stripe-java:26.11.0" ``` ### Maven users @@ -29,7 +29,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 26.10.0 + 26.11.0 ``` @@ -37,7 +37,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/26.10.0/stripe-java-26.10.0.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/26.11.0/stripe-java-26.11.0.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index 8a94b991271..03a8c4fa8cb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -26.10.0 +26.11.0 diff --git a/gradle.properties b/gradle.properties index c5f17377942..06d9d3f49a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=26.10.0 +VERSION_NAME=26.11.0 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index 04b62ca2a04..e5ad1fdee35 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -13,7 +13,7 @@ public abstract class Stripe { public static final String CONNECT_API_BASE = "https://connect.stripe.com"; public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; - public static final String VERSION = "26.10.0"; + public static final String VERSION = "26.11.0"; public static volatile String apiKey; public static volatile String clientId; From 7f8b0e796757d8382e07c4517b2b5ebca2169fa6 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:10:00 -0700 Subject: [PATCH 3/5] Update generated code (#1866) * Update generated code for v1254 * Update generated code for v1261 * Update generated code for v1263 * Update generated code for v1266 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Account.java | 10 +- .../java/com/stripe/model/BankAccount.java | 10 +- .../java/com/stripe/model/Capability.java | 10 +- src/main/java/com/stripe/model/Charge.java | 32 ++- src/main/java/com/stripe/model/Dispute.java | 18 +- src/main/java/com/stripe/model/Invoice.java | 9 + .../model/InvoiceRenderingTemplate.java | 5 + src/main/java/com/stripe/model/Person.java | 10 +- .../java/com/stripe/model/StripeError.java | 1 + .../com/stripe/model/tax/Registration.java | 34 +++ .../param/tax/RegistrationCreateParams.java | 240 +++++++++++++++++- 12 files changed, 357 insertions(+), 24 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index b39b96e3790..1f205edf7b1 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1259 \ No newline at end of file +v1266 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/Account.java b/src/main/java/com/stripe/model/Account.java index 8602fba26ff..67ad20ce8ef 100644 --- a/src/main/java/com/stripe/model/Account.java +++ b/src/main/java/com/stripe/model/Account.java @@ -1772,8 +1772,9 @@ public static class Errors extends StripeObject { * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code verification_missing_directors}, {@code * verification_missing_executives}, {@code verification_missing_owners}, {@code - * verification_requires_additional_memorandum_of_associations}, or {@code - * verification_requires_additional_proof_of_registration}. + * verification_requires_additional_memorandum_of_associations}, {@code + * verification_requires_additional_proof_of_registration}, or {@code + * verification_supportability}. */ @SerializedName("code") String code; @@ -1940,8 +1941,9 @@ public static class Errors extends StripeObject { * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code verification_missing_directors}, {@code * verification_missing_executives}, {@code verification_missing_owners}, {@code - * verification_requires_additional_memorandum_of_associations}, or {@code - * verification_requires_additional_proof_of_registration}. + * verification_requires_additional_memorandum_of_associations}, {@code + * verification_requires_additional_proof_of_registration}, or {@code + * verification_supportability}. */ @SerializedName("code") String code; diff --git a/src/main/java/com/stripe/model/BankAccount.java b/src/main/java/com/stripe/model/BankAccount.java index a6b6e5a44ca..c0ee9156f8b 100644 --- a/src/main/java/com/stripe/model/BankAccount.java +++ b/src/main/java/com/stripe/model/BankAccount.java @@ -589,8 +589,9 @@ public static class Errors extends StripeObject { * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code verification_missing_directors}, {@code * verification_missing_executives}, {@code verification_missing_owners}, {@code - * verification_requires_additional_memorandum_of_associations}, or {@code - * verification_requires_additional_proof_of_registration}. + * verification_requires_additional_memorandum_of_associations}, {@code + * verification_requires_additional_proof_of_registration}, or {@code + * verification_supportability}. */ @SerializedName("code") String code; @@ -706,8 +707,9 @@ public static class Errors extends StripeObject { * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code verification_missing_directors}, {@code * verification_missing_executives}, {@code verification_missing_owners}, {@code - * verification_requires_additional_memorandum_of_associations}, or {@code - * verification_requires_additional_proof_of_registration}. + * verification_requires_additional_memorandum_of_associations}, {@code + * verification_requires_additional_proof_of_registration}, or {@code + * verification_supportability}. */ @SerializedName("code") String code; diff --git a/src/main/java/com/stripe/model/Capability.java b/src/main/java/com/stripe/model/Capability.java index 38866e2689a..3d62d9f46a8 100644 --- a/src/main/java/com/stripe/model/Capability.java +++ b/src/main/java/com/stripe/model/Capability.java @@ -285,8 +285,9 @@ public static class Errors extends StripeObject { * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code verification_missing_directors}, {@code * verification_missing_executives}, {@code verification_missing_owners}, {@code - * verification_requires_additional_memorandum_of_associations}, or {@code - * verification_requires_additional_proof_of_registration}. + * verification_requires_additional_memorandum_of_associations}, {@code + * verification_requires_additional_proof_of_registration}, or {@code + * verification_supportability}. */ @SerializedName("code") String code; @@ -454,8 +455,9 @@ public static class Errors extends StripeObject { * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code verification_missing_directors}, {@code * verification_missing_executives}, {@code verification_missing_owners}, {@code - * verification_requires_additional_memorandum_of_associations}, or {@code - * verification_requires_additional_proof_of_registration}. + * verification_requires_additional_memorandum_of_associations}, {@code + * verification_requires_additional_proof_of_registration}, or {@code + * verification_supportability}. */ @SerializedName("code") String code; diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 8037a22dae2..40cffbd08fc 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -927,7 +927,7 @@ public Charge update(ChargeUpdateParams params, RequestOptions options) throws S public static class BillingDetails extends StripeObject { /** Billing address. */ @SerializedName("address") - Address address; + com.stripe.model.Address address; /** Email address. */ @SerializedName("email") @@ -1962,7 +1962,7 @@ public static class Masterpass extends StripeObject { * or mutated. */ @SerializedName("billing_address") - Address billingAddress; + com.stripe.model.Address billingAddress; /** * Owner's verified email. Values are verified or provided by the wallet directly (if @@ -1984,7 +1984,7 @@ public static class Masterpass extends StripeObject { * or mutated. */ @SerializedName("shipping_address") - Address shippingAddress; + com.stripe.model.Address shippingAddress; } @Getter @@ -2002,7 +2002,7 @@ public static class VisaCheckout extends StripeObject { * or mutated. */ @SerializedName("billing_address") - Address billingAddress; + com.stripe.model.Address billingAddress; /** * Owner's verified email. Values are verified or provided by the wallet directly (if @@ -2024,7 +2024,7 @@ public static class VisaCheckout extends StripeObject { * or mutated. */ @SerializedName("shipping_address") - Address shippingAddress; + com.stripe.model.Address shippingAddress; } } } @@ -2661,6 +2661,10 @@ public static class Receipt extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Klarna extends StripeObject { + /** The payer details for this transaction. */ + @SerializedName("payer_details") + PayerDetails payerDetails; + /** * The Klarna payment method used for this transaction. Can be one of {@code pay_later}, * {@code pay_now}, {@code pay_with_financing}, or {@code pay_in_installments} @@ -2681,6 +2685,24 @@ public static class Klarna extends StripeObject { */ @SerializedName("preferred_locale") String preferredLocale; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PayerDetails extends StripeObject { + /** The payer's address. */ + @SerializedName("address") + com.stripe.model.Charge.PaymentMethodDetails.Klarna.PayerDetails.Address address; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** The payer address country. */ + @SerializedName("country") + String country; + } + } } @Getter diff --git a/src/main/java/com/stripe/model/Dispute.java b/src/main/java/com/stripe/model/Dispute.java index 1caa8abf901..b8448412e7e 100644 --- a/src/main/java/com/stripe/model/Dispute.java +++ b/src/main/java/com/stripe/model/Dispute.java @@ -795,6 +795,9 @@ public static class EvidenceDetails extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class PaymentMethodDetails extends StripeObject { + @SerializedName("amazon_pay") + AmazonPay amazonPay; + @SerializedName("card") Card card; @@ -807,11 +810,24 @@ public static class PaymentMethodDetails extends StripeObject { /** * Payment method type. * - *

One of {@code card}, {@code klarna}, or {@code paypal}. + *

One of {@code amazon_pay}, {@code card}, {@code klarna}, or {@code paypal}. */ @SerializedName("type") String type; + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmazonPay extends StripeObject { + /** + * The AmazonPay dispute type, chargeback or claim + * + *

One of {@code chargeback}, or {@code claim}. + */ + @SerializedName("dispute_type") + String disputeType; + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index e18b7e949cc..1e95ff9de66 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -156,6 +156,15 @@ public class Invoice extends ApiResource implements HasId, MetadataStore elections; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Election extends StripeObject { + /** + * A FIPS code + * representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + + /** + * The type of the election for the state sales tax registration. + * + *

One of {@code local_use_tax}, {@code simplified_sellers_use_tax}, or {@code + * single_local_use_tax}. + */ + @SerializedName("type") + String type; + } + } } @Getter diff --git a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java index e0d288d9d1a..4aa133fe8bc 100644 --- a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java @@ -8698,6 +8698,10 @@ public static class Us { @SerializedName("state") String state; + /** Options for the state sales tax registration. */ + @SerializedName("state_sales_tax") + StateSalesTax stateSalesTax; + /** Required. Type of registration to be created in the US. */ @SerializedName("type") Type type; @@ -8707,11 +8711,13 @@ private Us( LocalAmusementTax localAmusementTax, LocalLeaseTax localLeaseTax, String state, + StateSalesTax stateSalesTax, Type type) { this.extraParams = extraParams; this.localAmusementTax = localAmusementTax; this.localLeaseTax = localLeaseTax; this.state = state; + this.stateSalesTax = stateSalesTax; this.type = type; } @@ -8728,12 +8734,19 @@ public static class Builder { private String state; + private StateSalesTax stateSalesTax; + private Type type; /** Finalize and obtain parameter instance from this builder. */ public RegistrationCreateParams.CountryOptions.Us build() { return new RegistrationCreateParams.CountryOptions.Us( - this.extraParams, this.localAmusementTax, this.localLeaseTax, this.state, this.type); + this.extraParams, + this.localAmusementTax, + this.localLeaseTax, + this.state, + this.stateSalesTax, + this.type); } /** @@ -8787,6 +8800,13 @@ public Builder setState(String state) { return this; } + /** Options for the state sales tax registration. */ + public Builder setStateSalesTax( + RegistrationCreateParams.CountryOptions.Us.StateSalesTax stateSalesTax) { + this.stateSalesTax = stateSalesTax; + return this; + } + /** Required. Type of registration to be created in the US. */ public Builder setType(RegistrationCreateParams.CountryOptions.Us.Type type) { this.type = type; @@ -8960,6 +8980,224 @@ public Builder setJurisdiction(String jurisdiction) { } } + @Getter + public static class StateSalesTax { + /** Required. Elections for the state sales tax registration. */ + @SerializedName("elections") + List elections; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private StateSalesTax( + List elections, + Map extraParams) { + this.elections = elections; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List elections; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public RegistrationCreateParams.CountryOptions.Us.StateSalesTax build() { + return new RegistrationCreateParams.CountryOptions.Us.StateSalesTax( + this.elections, this.extraParams); + } + + /** + * Add an element to `elections` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RegistrationCreateParams.CountryOptions.Us.StateSalesTax#elections} for the field + * documentation. + */ + public Builder addElection( + RegistrationCreateParams.CountryOptions.Us.StateSalesTax.Election element) { + if (this.elections == null) { + this.elections = new ArrayList<>(); + } + this.elections.add(element); + return this; + } + + /** + * Add all elements to `elections` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RegistrationCreateParams.CountryOptions.Us.StateSalesTax#elections} for the field + * documentation. + */ + public Builder addAllElection( + List elements) { + if (this.elections == null) { + this.elections = new ArrayList<>(); + } + this.elections.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link RegistrationCreateParams.CountryOptions.Us.StateSalesTax#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link RegistrationCreateParams.CountryOptions.Us.StateSalesTax#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + public static class Election { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A FIPS code + * representing the local jurisdiction. Supported FIPS codes are: {@code 003} (Allegheny + * County) and {@code 60000} (Philadelphia City). + */ + @SerializedName("jurisdiction") + String jurisdiction; + + /** + * Required. The type of the election for the state sales tax + * registration. + */ + @SerializedName("type") + Type type; + + private Election(Map extraParams, String jurisdiction, Type type) { + this.extraParams = extraParams; + this.jurisdiction = jurisdiction; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String jurisdiction; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public RegistrationCreateParams.CountryOptions.Us.StateSalesTax.Election build() { + return new RegistrationCreateParams.CountryOptions.Us.StateSalesTax.Election( + this.extraParams, this.jurisdiction, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * RegistrationCreateParams.CountryOptions.Us.StateSalesTax.Election#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * RegistrationCreateParams.CountryOptions.Us.StateSalesTax.Election#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A FIPS + * code representing the local jurisdiction. Supported FIPS codes are: {@code 003} + * (Allegheny County) and {@code 60000} (Philadelphia City). + */ + public Builder setJurisdiction(String jurisdiction) { + this.jurisdiction = jurisdiction; + return this; + } + + /** + * Required. The type of the election for the state sales tax + * registration. + */ + public Builder setType( + RegistrationCreateParams.CountryOptions.Us.StateSalesTax.Election.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("local_use_tax") + LOCAL_USE_TAX("local_use_tax"), + + @SerializedName("simplified_sellers_use_tax") + SIMPLIFIED_SELLERS_USE_TAX("simplified_sellers_use_tax"), + + @SerializedName("single_local_use_tax") + SINGLE_LOCAL_USE_TAX("single_local_use_tax"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + public enum Type implements ApiRequestParams.EnumParam { @SerializedName("local_amusement_tax") LOCAL_AMUSEMENT_TAX("local_amusement_tax"), From 3c0c87d967c172b5e8ec42eec3b2d8dedbc9ddb3 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:29:40 -0700 Subject: [PATCH 4/5] Update generated code for v1267 (#1869) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/treasury/ReceivedDebit.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 1f205edf7b1..5f5b311191b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1266 \ No newline at end of file +v1267 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java index 06a973084cf..38b80881d4b 100644 --- a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java +++ b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java @@ -53,8 +53,8 @@ public class ReceivedDebit extends ApiResource implements HasId { * Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have * sufficient funds, is closed, or is frozen. * - *

One of {@code account_closed}, {@code account_frozen}, {@code insufficient_funds}, or {@code - * other}. + *

One of {@code account_closed}, {@code account_frozen}, {@code insufficient_funds}, {@code + * international_transaction}, or {@code other}. */ @SerializedName("failure_code") String failureCode; From fd2e2e37a133a39249c76f1bf10d3f031f1d8f1f Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Wed, 18 Sep 2024 11:39:26 -0700 Subject: [PATCH 5/5] Bump version to 26.12.0 --- CHANGELOG.md | 7 +++++++ README.md | 8 ++++---- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e874c15f1b..ac969411169 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 26.12.0 - 2024-09-18 +* [#1866](https://github.com/stripe/stripe-java/pull/1866) Update generated code + * Add support for `payer_details` on `Charge.payment_method_details.klarna` + * Add support for `amazon_pay` on `Dispute.payment_method_details` + * Add support for `automatically_finalizes_at` on `Invoice` + * Add support for `state_sales_tax` on `Tax.Registration.country_options.us` and `tax.RegistrationCreateParams.country_options.us` + ## 26.11.0 - 2024-09-12 * [#1864](https://github.com/stripe/stripe-java/pull/1864) Update generated code * Add support for new resource `InvoiceRenderingTemplate` diff --git a/README.md b/README.md index 1c9152136a0..d6a5993561d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stripe Java client library -[![Maven Central](https://img.shields.io/badge/maven--central-v26.11.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) +[![Maven Central](https://img.shields.io/badge/maven--central-v26.12.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master) @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:26.11.0" +implementation "com.stripe:stripe-java:26.12.0" ``` ### Maven users @@ -29,7 +29,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 26.11.0 + 26.12.0 ``` @@ -37,7 +37,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/26.11.0/stripe-java-26.11.0.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/26.12.0/stripe-java-26.12.0.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index 03a8c4fa8cb..2b42e392df0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -26.11.0 +26.12.0 diff --git a/gradle.properties b/gradle.properties index 06d9d3f49a9..e705dcba05f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=26.11.0 +VERSION_NAME=26.12.0 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index e5ad1fdee35..8ad8117d230 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -13,7 +13,7 @@ public abstract class Stripe { public static final String CONNECT_API_BASE = "https://connect.stripe.com"; public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; - public static final String VERSION = "26.11.0"; + public static final String VERSION = "26.12.0"; public static volatile String apiKey; public static volatile String clientId;