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); + } +}