Skip to content

Commit

Permalink
Update generated code (#1864)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
stripe-openapi[bot] authored Sep 12, 2024
1 parent 4b536df commit 3502c7f
Show file tree
Hide file tree
Showing 26 changed files with 1,268 additions and 24 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1246
v1259
4 changes: 4 additions & 0 deletions src/main/java/com/stripe/StripeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/stripe/model/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/stripe/model/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
297 changes: 297 additions & 0 deletions src/main/java/com/stripe/model/InvoiceRenderingTemplate.java
Original file line number Diff line number Diff line change
@@ -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 <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> 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<String, String> 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.
*
* <p>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<String, Object>) 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<String, Object>) 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object>) 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<String, Object>) 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<String, Object> 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<String, Object>) 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<String, Object>) null, options);
}

/** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */
public InvoiceRenderingTemplate unarchive(Map<String, Object> 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<String, Object> 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);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// File generated from our OpenAPI spec
package com.stripe.model;

public class InvoiceRenderingTemplateCollection
extends StripeCollection<InvoiceRenderingTemplate> {}
3 changes: 3 additions & 0 deletions src/main/java/com/stripe/model/PaymentLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/stripe/model/checkout/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
* <p>One of {@code if_supported}, or {@code never}.
*/
@SerializedName("required")
String required;
}

@Getter
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/model/issuing/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ public static class Shipping extends StripeObject {
* The delivery status of the card.
*
* <p>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;
Expand Down
Loading

0 comments on commit 3502c7f

Please sign in to comment.