From f2554c83afcd03cb52c9f81909382bad1070fba5 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 01:03:35 +0000 Subject: [PATCH 1/7] Update generated code for v682 --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/StripeClient.java | 4 + .../stripe/model/EventDataClassLookup.java | 4 + .../java/com/stripe/model/climate/Order.java | 518 ++++++++++++++++++ .../stripe/model/climate/OrderCollection.java | 6 + .../com/stripe/model/climate/Product.java | 182 ++++++ .../model/climate/ProductCollection.java | 6 + .../com/stripe/model/climate/Supplier.java | 175 ++++++ .../model/climate/SupplierCollection.java | 6 + .../param/climate/OrderCancelParams.java | 98 ++++ .../param/climate/OrderCreateParams.java | 313 +++++++++++ .../stripe/param/climate/OrderListParams.java | 169 ++++++ .../param/climate/OrderRetrieveParams.java | 98 ++++ .../param/climate/OrderUpdateParams.java | 252 +++++++++ .../param/climate/ProductListParams.java | 169 ++++++ .../param/climate/ProductRetrieveParams.java | 98 ++++ .../param/climate/SupplierListParams.java | 169 ++++++ .../param/climate/SupplierRetrieveParams.java | 98 ++++ .../com/stripe/service/ClimateService.java | 23 + .../stripe/service/climate/OrderService.java | 189 +++++++ .../service/climate/ProductService.java | 75 +++ .../service/climate/SupplierService.java | 75 +++ 22 files changed, 2728 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/stripe/model/climate/Order.java create mode 100644 src/main/java/com/stripe/model/climate/OrderCollection.java create mode 100644 src/main/java/com/stripe/model/climate/Product.java create mode 100644 src/main/java/com/stripe/model/climate/ProductCollection.java create mode 100644 src/main/java/com/stripe/model/climate/Supplier.java create mode 100644 src/main/java/com/stripe/model/climate/SupplierCollection.java create mode 100644 src/main/java/com/stripe/param/climate/OrderCancelParams.java create mode 100644 src/main/java/com/stripe/param/climate/OrderCreateParams.java create mode 100644 src/main/java/com/stripe/param/climate/OrderListParams.java create mode 100644 src/main/java/com/stripe/param/climate/OrderRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/climate/OrderUpdateParams.java create mode 100644 src/main/java/com/stripe/param/climate/ProductListParams.java create mode 100644 src/main/java/com/stripe/param/climate/ProductRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/climate/SupplierListParams.java create mode 100644 src/main/java/com/stripe/param/climate/SupplierRetrieveParams.java create mode 100644 src/main/java/com/stripe/service/ClimateService.java create mode 100644 src/main/java/com/stripe/service/climate/OrderService.java create mode 100644 src/main/java/com/stripe/service/climate/ProductService.java create mode 100644 src/main/java/com/stripe/service/climate/SupplierService.java diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 5528f1cf80b..c523b898421 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v681 \ No newline at end of file +v682 \ 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 f2f8551485b..9a4c6a5d5b7 100644 --- a/src/main/java/com/stripe/StripeClient.java +++ b/src/main/java/com/stripe/StripeClient.java @@ -93,6 +93,10 @@ public com.stripe.service.CheckoutService checkout() { return new com.stripe.service.CheckoutService(this.getResponseGetter()); } + public com.stripe.service.ClimateService climate() { + return new com.stripe.service.ClimateService(this.getResponseGetter()); + } + public com.stripe.service.ConfirmationTokenService confirmationTokens() { return new com.stripe.service.ConfirmationTokenService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index baf7e06c53b..c00381aad26 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -108,6 +108,10 @@ final class EventDataClassLookup { classLookup.put("checkout.session", com.stripe.model.checkout.Session.class); + classLookup.put("climate.order", com.stripe.model.climate.Order.class); + classLookup.put("climate.product", com.stripe.model.climate.Product.class); + classLookup.put("climate.supplier", com.stripe.model.climate.Supplier.class); + classLookup.put( "financial_connections.account", com.stripe.model.financialconnections.Account.class); classLookup.put( diff --git a/src/main/java/com/stripe/model/climate/Order.java b/src/main/java/com/stripe/model/climate/Order.java new file mode 100644 index 00000000000..2370d29651a --- /dev/null +++ b/src/main/java/com/stripe/model/climate/Order.java @@ -0,0 +1,518 @@ +// File generated from our OpenAPI spec +package com.stripe.model.climate; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.ExpandableField; +import com.stripe.model.HasId; +import com.stripe.model.MetadataStore; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiMode; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.climate.OrderCancelParams; +import com.stripe.param.climate.OrderCreateParams; +import com.stripe.param.climate.OrderListParams; +import com.stripe.param.climate.OrderRetrieveParams; +import com.stripe.param.climate.OrderUpdateParams; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * Orders represent your intent to purchase a particular Climate product. When you create an order, + * the payment is deducted from your merchant balance. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Order extends ApiResource implements HasId, MetadataStore { + /** + * Total amount of Frontier's service fees in the + * currency's smallest unit. + */ + @SerializedName("amount_fees") + Long amountFees; + + /** Total amount of the carbon removal in the currency's smallest unit. */ + @SerializedName("amount_subtotal") + Long amountSubtotal; + + /** Total amount of the order including fees in the currency's smallest unit. */ + @SerializedName("amount_total") + Long amountTotal; + + @SerializedName("beneficiary") + Beneficiary beneficiary; + + /** Time at which the order was canceled. Measured in seconds since the Unix epoch. */ + @SerializedName("canceled_at") + Long canceledAt; + + /** + * Reason for the cancellation of this order. + * + *

One of {@code expired}, {@code product_unavailable}, or {@code requested}. + */ + @SerializedName("cancellation_reason") + String cancellationReason; + + /** For delivered orders, a URL to a delivery certificate for the order. */ + @SerializedName("certificate") + String certificate; + + /** Time at which the order was confirmed. Measured in seconds since the Unix epoch. */ + @SerializedName("confirmed_at") + Long confirmedAt; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** + * Three-letter ISO currency code, + * in lowercase, representing the currency for this order. + */ + @SerializedName("currency") + String currency; + + /** + * Time at which the order's expected_delivery_year was delayed. Measured in seconds since the + * Unix epoch. + */ + @SerializedName("delayed_at") + Long delayedAt; + + /** Time at which the order was delivered. Measured in seconds since the Unix epoch. */ + @SerializedName("delivered_at") + Long deliveredAt; + + /** Details about the delivery of carbon removal for this order. */ + @SerializedName("delivery_details") + List deliveryDetails; + + /** The year this order is expected to be delivered. */ + @SerializedName("expected_delivery_year") + Long expectedDeliveryYear; + + /** 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. + */ + @Getter(onMethod_ = {@Override}) + @SerializedName("metadata") + Map metadata; + + /** Quantity of carbon removal that is included in this order. */ + @SerializedName("metric_tons") + BigDecimal metricTons; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code climate.order}. + */ + @SerializedName("object") + String object; + + /** Unique ID for the Climate {@code Product} this order is purchasing. */ + @SerializedName("product") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField product; + + /** + * Time at which the order's product was substituted for a different product. Measured in seconds + * since the Unix epoch. + */ + @SerializedName("product_substituted_at") + Long productSubstitutedAt; + + /** + * The current status of this order. + * + *

One of {@code awaiting_funds}, {@code canceled}, {@code confirmed}, {@code delivered}, or + * {@code open}. + */ + @SerializedName("status") + String status; + + /** Get ID of expandable {@code product} object. */ + public String getProduct() { + return (this.product != null) ? this.product.getId() : null; + } + + public void setProduct(String id) { + this.product = ApiResource.setExpandableFieldId(id, this.product); + } + + /** Get expanded {@code product}. */ + public Product getProductObject() { + return (this.product != null) ? this.product.getExpanded() : null; + } + + public void setProductObject(Product expandableObject) { + this.product = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** + * Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + * reservation {@code amount_subtotal}, but not the {@code amount_fees} for user-triggered + * cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier + * cancels the reservation, Stripe provides 90 days advance notice and refunds the {@code + * amount_total}. + */ + public Order cancel() throws StripeException { + return cancel((Map) null, (RequestOptions) null); + } + + /** + * Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + * reservation {@code amount_subtotal}, but not the {@code amount_fees} for user-triggered + * cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier + * cancels the reservation, Stripe provides 90 days advance notice and refunds the {@code + * amount_total}. + */ + public Order cancel(RequestOptions options) throws StripeException { + return cancel((Map) null, options); + } + + /** + * Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + * reservation {@code amount_subtotal}, but not the {@code amount_fees} for user-triggered + * cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier + * cancels the reservation, Stripe provides 90 days advance notice and refunds the {@code + * amount_total}. + */ + public Order cancel(Map params) throws StripeException { + return cancel(params, (RequestOptions) null); + } + + /** + * Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + * reservation {@code amount_subtotal}, but not the {@code amount_fees} for user-triggered + * cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier + * cancels the reservation, Stripe provides 90 days advance notice and refunds the {@code + * amount_total}. + */ + public Order cancel(Map params, RequestOptions options) throws StripeException { + String path = + String.format("/v1/climate/orders/%s/cancel", ApiResource.urlEncodeId(this.getId())); + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + params, + Order.class, + options, + ApiMode.V1); + } + + /** + * Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + * reservation {@code amount_subtotal}, but not the {@code amount_fees} for user-triggered + * cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier + * cancels the reservation, Stripe provides 90 days advance notice and refunds the {@code + * amount_total}. + */ + public Order cancel(OrderCancelParams params) throws StripeException { + return cancel(params, (RequestOptions) null); + } + + /** + * Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + * reservation {@code amount_subtotal}, but not the {@code amount_fees} for user-triggered + * cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier + * cancels the reservation, Stripe provides 90 days advance notice and refunds the {@code + * amount_total}. + */ + public Order cancel(OrderCancelParams params, RequestOptions options) throws StripeException { + String path = + String.format("/v1/climate/orders/%s/cancel", ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + Order.class, + options, + ApiMode.V1); + } + + /** + * Creates a Climate order object for a given Climate product. The order will be processed + * immediately after creation and payment will be deducted your Stripe balance. + */ + public static Order create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Creates a Climate order object for a given Climate product. The order will be processed + * immediately after creation and payment will be deducted your Stripe balance. + */ + public static Order create(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/climate/orders"; + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + params, + Order.class, + options, + ApiMode.V1); + } + + /** + * Creates a Climate order object for a given Climate product. The order will be processed + * immediately after creation and payment will be deducted your Stripe balance. + */ + public static Order create(OrderCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Creates a Climate order object for a given Climate product. The order will be processed + * immediately after creation and payment will be deducted your Stripe balance. + */ + public static Order create(OrderCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/climate/orders"; + ApiResource.checkNullTypedParams(path, params); + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + Order.class, + options, + ApiMode.V1); + } + + /** + * Lists all Climate order objects. The orders are returned sorted by creation date, with the most + * recently created orders appearing first. + */ + public static OrderCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Lists all Climate order objects. The orders are returned sorted by creation date, with the most + * recently created orders appearing first. + */ + public static OrderCollection list(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/climate/orders"; + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + params, + OrderCollection.class, + options, + ApiMode.V1); + } + + /** + * Lists all Climate order objects. The orders are returned sorted by creation date, with the most + * recently created orders appearing first. + */ + public static OrderCollection list(OrderListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Lists all Climate order objects. The orders are returned sorted by creation date, with the most + * recently created orders appearing first. + */ + public static OrderCollection list(OrderListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/climate/orders"; + ApiResource.checkNullTypedParams(path, params); + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + OrderCollection.class, + options, + ApiMode.V1); + } + + /** Retrieves the details of a Climate order object with the given ID. */ + public static Order retrieve(String order) throws StripeException { + return retrieve(order, (Map) null, (RequestOptions) null); + } + + /** Retrieves the details of a Climate order object with the given ID. */ + public static Order retrieve(String order, RequestOptions options) throws StripeException { + return retrieve(order, (Map) null, options); + } + + /** Retrieves the details of a Climate order object with the given ID. */ + public static Order retrieve(String order, Map params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/climate/orders/%s", ApiResource.urlEncodeId(order)); + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + params, + Order.class, + options, + ApiMode.V1); + } + + /** Retrieves the details of a Climate order object with the given ID. */ + public static Order retrieve(String order, OrderRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/climate/orders/%s", ApiResource.urlEncodeId(order)); + ApiResource.checkNullTypedParams(path, params); + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + Order.class, + options, + ApiMode.V1); + } + + /** Updates the specified order by setting the values of the parameters passed. */ + @Override + public Order update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates the specified order by setting the values of the parameters passed. */ + @Override + public Order update(Map params, RequestOptions options) throws StripeException { + String path = String.format("/v1/climate/orders/%s", ApiResource.urlEncodeId(this.getId())); + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + params, + Order.class, + options, + ApiMode.V1); + } + + /** Updates the specified order by setting the values of the parameters passed. */ + public Order update(OrderUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates the specified order by setting the values of the parameters passed. */ + public Order update(OrderUpdateParams params, RequestOptions options) throws StripeException { + String path = String.format("/v1/climate/orders/%s", ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + Order.class, + options, + ApiMode.V1); + } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Beneficiary extends StripeObject { + /** Publicly displayable name for the end beneficiary of carbon removal. */ + @SerializedName("public_name") + String publicName; + } + + /** The delivery of a specified quantity of carbon for an order. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DeliveryDetail extends StripeObject { + /** Time at which the delivery occurred. Measured in seconds since the Unix epoch. */ + @SerializedName("delivered_at") + Long deliveredAt; + + /** Specific location of this delivery. */ + @SerializedName("location") + Location location; + + /** Quantity of carbon removal supplied by this delivery. */ + @SerializedName("metric_tons") + String metricTons; + + /** Once retired, a URL to the registry entry for the tons from this delivery. */ + @SerializedName("registry_url") + String registryUrl; + + /** A supplier of carbon removal. */ + @SerializedName("supplier") + Supplier supplier; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Location extends StripeObject { + /** The city where the supplier is located. */ + @SerializedName("city") + String city; + + /** Two-letter ISO code representing the country where the supplier is located. */ + @SerializedName("country") + String country; + + /** The geographic latitude where the supplier is located. */ + @SerializedName("latitude") + BigDecimal latitude; + + /** The geographic longitude where the supplier is located. */ + @SerializedName("longitude") + BigDecimal longitude; + + /** The state/county/province/region where the supplier is located. */ + @SerializedName("region") + String region; + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(beneficiary, responseGetter); + trySetResponseGetter(product, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/climate/OrderCollection.java b/src/main/java/com/stripe/model/climate/OrderCollection.java new file mode 100644 index 00000000000..609d0d48c74 --- /dev/null +++ b/src/main/java/com/stripe/model/climate/OrderCollection.java @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec +package com.stripe.model.climate; + +import com.stripe.model.StripeCollection; + +public class OrderCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/climate/Product.java b/src/main/java/com/stripe/model/climate/Product.java new file mode 100644 index 00000000000..8e4f039554a --- /dev/null +++ b/src/main/java/com/stripe/model/climate/Product.java @@ -0,0 +1,182 @@ +// File generated from our OpenAPI spec +package com.stripe.model.climate; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiMode; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.param.climate.ProductListParams; +import com.stripe.param.climate.ProductRetrieveParams; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * A Climate product represents a type of carbon removal unit available for reservation. You can + * retrieve it to see the current price and availability. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Product extends ApiResource implements HasId { + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** Current prices for a metric ton of carbon removal in a currency's smallest unit. */ + @SerializedName("current_prices_per_metric_ton") + Map currentPricesPerMetricTon; + + /** The year in which the carbon removal is expected to be delivered. */ + @SerializedName("delivery_year") + Long deliveryYear; + + /** + * Unique identifier for the object. For convenience, Climate product IDs are human-readable + * strings that start with {@code climsku_}. See carbon removal + * inventory for a list of available carbon removal products. + */ + @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; + + /** The quantity of metric tons available for reservation. */ + @SerializedName("metric_tons_available") + BigDecimal metricTonsAvailable; + + /** The Climate product's name. */ + @SerializedName("name") + String name; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code climate.product}. + */ + @SerializedName("object") + String object; + + /** The carbon removal suppliers that fulfill orders for this Climate product. */ + @SerializedName("suppliers") + List suppliers; + + /** Lists all available Climate product objects. */ + public static ProductCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Lists all available Climate product objects. */ + public static ProductCollection list(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/climate/products"; + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + params, + ProductCollection.class, + options, + ApiMode.V1); + } + + /** Lists all available Climate product objects. */ + public static ProductCollection list(ProductListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Lists all available Climate product objects. */ + public static ProductCollection list(ProductListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/climate/products"; + ApiResource.checkNullTypedParams(path, params); + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + ProductCollection.class, + options, + ApiMode.V1); + } + + /** Retrieves the details of a Climate product with the given ID. */ + public static Product retrieve(String product) throws StripeException { + return retrieve(product, (Map) null, (RequestOptions) null); + } + + /** Retrieves the details of a Climate product with the given ID. */ + public static Product retrieve(String product, RequestOptions options) throws StripeException { + return retrieve(product, (Map) null, options); + } + + /** Retrieves the details of a Climate product with the given ID. */ + public static Product retrieve(String product, Map params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/climate/products/%s", ApiResource.urlEncodeId(product)); + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + params, + Product.class, + options, + ApiMode.V1); + } + + /** Retrieves the details of a Climate product with the given ID. */ + public static Product retrieve( + String product, ProductRetrieveParams params, RequestOptions options) throws StripeException { + String path = String.format("/v1/climate/products/%s", ApiResource.urlEncodeId(product)); + ApiResource.checkNullTypedParams(path, params); + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + Product.class, + options, + ApiMode.V1); + } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CurrentPricesPerMetricTon extends StripeObject { + /** Fees for one metric ton of carbon removal in the currency's smallest unit. */ + @SerializedName("amount_fees") + Long amountFees; + + /** + * Subtotal for one metric ton of carbon removal (excluding fees) in the currency's smallest + * unit. + */ + @SerializedName("amount_subtotal") + Long amountSubtotal; + + /** + * Total for one metric ton of carbon removal (including fees) in the currency's smallest unit. + */ + @SerializedName("amount_total") + Long amountTotal; + } +} diff --git a/src/main/java/com/stripe/model/climate/ProductCollection.java b/src/main/java/com/stripe/model/climate/ProductCollection.java new file mode 100644 index 00000000000..cc035a14930 --- /dev/null +++ b/src/main/java/com/stripe/model/climate/ProductCollection.java @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec +package com.stripe.model.climate; + +import com.stripe.model.StripeCollection; + +public class ProductCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/climate/Supplier.java b/src/main/java/com/stripe/model/climate/Supplier.java new file mode 100644 index 00000000000..a9c1ffc7dcc --- /dev/null +++ b/src/main/java/com/stripe/model/climate/Supplier.java @@ -0,0 +1,175 @@ +// File generated from our OpenAPI spec +package com.stripe.model.climate; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiMode; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.param.climate.SupplierListParams; +import com.stripe.param.climate.SupplierRetrieveParams; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** A supplier of carbon removal. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Supplier extends ApiResource implements HasId { + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** Link to a webpage to learn more about the supplier. */ + @SerializedName("info_url") + String infoUrl; + + /** + * 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; + + /** The locations in which this supplier operates. */ + @SerializedName("locations") + List locations; + + /** Name of this carbon removal supplier. */ + @SerializedName("name") + String name; + + /** + * String representing the object’s type. Objects of the same type share the same value. + * + *

Equal to {@code climate.supplier}. + */ + @SerializedName("object") + String object; + + /** + * The scientific pathway used for carbon removal. + * + *

One of {@code biomass_carbon_removal_and_storage}, {@code direct_air_capture}, or {@code + * various}. + */ + @SerializedName("removal_pathway") + String removalPathway; + + /** Lists all available Climate supplier objects. */ + public static SupplierCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Lists all available Climate supplier objects. */ + public static SupplierCollection list(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/climate/suppliers"; + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + params, + SupplierCollection.class, + options, + ApiMode.V1); + } + + /** Lists all available Climate supplier objects. */ + public static SupplierCollection list(SupplierListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Lists all available Climate supplier objects. */ + public static SupplierCollection list(SupplierListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/climate/suppliers"; + ApiResource.checkNullTypedParams(path, params); + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + SupplierCollection.class, + options, + ApiMode.V1); + } + + /** Retrieves a Climate supplier object. */ + public static Supplier retrieve(String supplier) throws StripeException { + return retrieve(supplier, (Map) null, (RequestOptions) null); + } + + /** Retrieves a Climate supplier object. */ + public static Supplier retrieve(String supplier, RequestOptions options) throws StripeException { + return retrieve(supplier, (Map) null, options); + } + + /** Retrieves a Climate supplier object. */ + public static Supplier retrieve( + String supplier, Map params, RequestOptions options) throws StripeException { + String path = String.format("/v1/climate/suppliers/%s", ApiResource.urlEncodeId(supplier)); + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + params, + Supplier.class, + options, + ApiMode.V1); + } + + /** Retrieves a Climate supplier object. */ + public static Supplier retrieve( + String supplier, SupplierRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/climate/suppliers/%s", ApiResource.urlEncodeId(supplier)); + ApiResource.checkNullTypedParams(path, params); + return getGlobalResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + Supplier.class, + options, + ApiMode.V1); + } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Location extends StripeObject { + /** The city where the supplier is located. */ + @SerializedName("city") + String city; + + /** Two-letter ISO code representing the country where the supplier is located. */ + @SerializedName("country") + String country; + + /** The geographic latitude where the supplier is located. */ + @SerializedName("latitude") + BigDecimal latitude; + + /** The geographic longitude where the supplier is located. */ + @SerializedName("longitude") + BigDecimal longitude; + + /** The state/county/province/region where the supplier is located. */ + @SerializedName("region") + String region; + } +} diff --git a/src/main/java/com/stripe/model/climate/SupplierCollection.java b/src/main/java/com/stripe/model/climate/SupplierCollection.java new file mode 100644 index 00000000000..5c490853419 --- /dev/null +++ b/src/main/java/com/stripe/model/climate/SupplierCollection.java @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec +package com.stripe.model.climate; + +import com.stripe.model.StripeCollection; + +public class SupplierCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/param/climate/OrderCancelParams.java b/src/main/java/com/stripe/param/climate/OrderCancelParams.java new file mode 100644 index 00000000000..faf05637a47 --- /dev/null +++ b/src/main/java/com/stripe/param/climate/OrderCancelParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.climate; + +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 OrderCancelParams 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 OrderCancelParams(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 OrderCancelParams build() { + return new OrderCancelParams(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 + * OrderCancelParams#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 + * OrderCancelParams#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 + * OrderCancelParams#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 OrderCancelParams#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/climate/OrderCreateParams.java b/src/main/java/com/stripe/param/climate/OrderCreateParams.java new file mode 100644 index 00000000000..09c65ba4837 --- /dev/null +++ b/src/main/java/com/stripe/param/climate/OrderCreateParams.java @@ -0,0 +1,313 @@ +// File generated from our OpenAPI spec +package com.stripe.param.climate; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class OrderCreateParams extends ApiRequestParams { + /** + * Requested amount of carbon removal units. Either this or {@code metric_tons} must be specified. + */ + @SerializedName("amount") + Long amount; + + /** + * Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe + * account if not set. + */ + @SerializedName("beneficiary") + Beneficiary beneficiary; + + /** + * Request currency for the order as a three-letter ISO currency code, in lowercase. + * Must be a supported settlement currency for your + * account. If omitted, the account's default currency will be used. + */ + @SerializedName("currency") + String currency; + + /** 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; + + /** + * 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. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + + /** Requested number of tons for the order. Either this or {@code amount} must be specified. */ + @SerializedName("metric_tons") + BigDecimal metricTons; + + /** Required. Unique identifier of the Climate product. */ + @SerializedName("product") + String product; + + private OrderCreateParams( + Long amount, + Beneficiary beneficiary, + String currency, + List expand, + Map extraParams, + Map metadata, + BigDecimal metricTons, + String product) { + this.amount = amount; + this.beneficiary = beneficiary; + this.currency = currency; + this.expand = expand; + this.extraParams = extraParams; + this.metadata = metadata; + this.metricTons = metricTons; + this.product = product; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private Beneficiary beneficiary; + + private String currency; + + private List expand; + + private Map extraParams; + + private Map metadata; + + private BigDecimal metricTons; + + private String product; + + /** Finalize and obtain parameter instance from this builder. */ + public OrderCreateParams build() { + return new OrderCreateParams( + this.amount, + this.beneficiary, + this.currency, + this.expand, + this.extraParams, + this.metadata, + this.metricTons, + this.product); + } + + /** + * Requested amount of carbon removal units. Either this or {@code metric_tons} must be + * specified. + */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the + * Stripe account if not set. + */ + public Builder setBeneficiary(OrderCreateParams.Beneficiary beneficiary) { + this.beneficiary = beneficiary; + return this; + } + + /** + * Request currency for the order as a three-letter ISO currency code, in lowercase. + * Must be a supported settlement currency for your + * account. If omitted, the account's default currency will be used. + */ + public Builder setCurrency(String currency) { + this.currency = currency; + 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 + * OrderCreateParams#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 + * OrderCreateParams#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 + * OrderCreateParams#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 OrderCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add a key/value pair to `metadata` 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 + * OrderCreateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` 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 OrderCreateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** Requested number of tons for the order. Either this or {@code amount} must be specified. */ + public Builder setMetricTons(BigDecimal metricTons) { + this.metricTons = metricTons; + return this; + } + + /** Required. Unique identifier of the Climate product. */ + public Builder setProduct(String product) { + this.product = product; + return this; + } + } + + @Getter + public static class Beneficiary { + /** + * 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; + + /** + * Required. Publicly displayable name for the end beneficiary of carbon + * removal. + */ + @SerializedName("public_name") + String publicName; + + private Beneficiary(Map extraParams, String publicName) { + this.extraParams = extraParams; + this.publicName = publicName; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String publicName; + + /** Finalize and obtain parameter instance from this builder. */ + public OrderCreateParams.Beneficiary build() { + return new OrderCreateParams.Beneficiary(this.extraParams, this.publicName); + } + + /** + * 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 + * OrderCreateParams.Beneficiary#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 OrderCreateParams.Beneficiary#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Publicly displayable name for the end beneficiary of carbon + * removal. + */ + public Builder setPublicName(String publicName) { + this.publicName = publicName; + return this; + } + } + } +} diff --git a/src/main/java/com/stripe/param/climate/OrderListParams.java b/src/main/java/com/stripe/param/climate/OrderListParams.java new file mode 100644 index 00000000000..6fb446f88db --- /dev/null +++ b/src/main/java/com/stripe/param/climate/OrderListParams.java @@ -0,0 +1,169 @@ +// File generated from our OpenAPI spec +package com.stripe.param.climate; + +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 OrderListParams 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; + + private OrderListParams( + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.startingAfter = startingAfter; + } + + 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; + + /** Finalize and obtain parameter instance from this builder. */ + public OrderListParams build() { + return new OrderListParams( + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); + } + + /** + * 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 + * OrderListParams#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 + * OrderListParams#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 + * OrderListParams#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 OrderListParams#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; + } + } +} diff --git a/src/main/java/com/stripe/param/climate/OrderRetrieveParams.java b/src/main/java/com/stripe/param/climate/OrderRetrieveParams.java new file mode 100644 index 00000000000..44e29481fc2 --- /dev/null +++ b/src/main/java/com/stripe/param/climate/OrderRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.climate; + +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 OrderRetrieveParams 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 OrderRetrieveParams(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 OrderRetrieveParams build() { + return new OrderRetrieveParams(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 + * OrderRetrieveParams#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 + * OrderRetrieveParams#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 + * OrderRetrieveParams#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 OrderRetrieveParams#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/climate/OrderUpdateParams.java b/src/main/java/com/stripe/param/climate/OrderUpdateParams.java new file mode 100644 index 00000000000..07ccadd11a2 --- /dev/null +++ b/src/main/java/com/stripe/param/climate/OrderUpdateParams.java @@ -0,0 +1,252 @@ +// File generated from our OpenAPI spec +package com.stripe.param.climate; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class OrderUpdateParams extends ApiRequestParams { + /** + * Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe + * account if not set. + */ + @SerializedName("beneficiary") + Object beneficiary; + + /** 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; + + /** + * 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. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + + private OrderUpdateParams( + Object beneficiary, + List expand, + Map extraParams, + Map metadata) { + this.beneficiary = beneficiary; + this.expand = expand; + this.extraParams = extraParams; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object beneficiary; + + private List expand; + + private Map extraParams; + + private Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public OrderUpdateParams build() { + return new OrderUpdateParams(this.beneficiary, this.expand, this.extraParams, this.metadata); + } + + /** + * Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the + * Stripe account if not set. + */ + public Builder setBeneficiary(OrderUpdateParams.Beneficiary beneficiary) { + this.beneficiary = beneficiary; + return this; + } + + /** + * Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the + * Stripe account if not set. + */ + public Builder setBeneficiary(EmptyParam beneficiary) { + this.beneficiary = beneficiary; + 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 + * OrderUpdateParams#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 + * OrderUpdateParams#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 + * OrderUpdateParams#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 OrderUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add a key/value pair to `metadata` 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 + * OrderUpdateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` 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 OrderUpdateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + } + + @Getter + public static class Beneficiary { + /** + * 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; + + /** + * Required. Publicly displayable name for the end beneficiary of carbon + * removal. + */ + @SerializedName("public_name") + Object publicName; + + private Beneficiary(Map extraParams, Object publicName) { + this.extraParams = extraParams; + this.publicName = publicName; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object publicName; + + /** Finalize and obtain parameter instance from this builder. */ + public OrderUpdateParams.Beneficiary build() { + return new OrderUpdateParams.Beneficiary(this.extraParams, this.publicName); + } + + /** + * 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 + * OrderUpdateParams.Beneficiary#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 OrderUpdateParams.Beneficiary#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Publicly displayable name for the end beneficiary of carbon + * removal. + */ + public Builder setPublicName(String publicName) { + this.publicName = publicName; + return this; + } + + /** + * Required. Publicly displayable name for the end beneficiary of carbon + * removal. + */ + public Builder setPublicName(EmptyParam publicName) { + this.publicName = publicName; + return this; + } + } + } +} diff --git a/src/main/java/com/stripe/param/climate/ProductListParams.java b/src/main/java/com/stripe/param/climate/ProductListParams.java new file mode 100644 index 00000000000..1817c2f1f51 --- /dev/null +++ b/src/main/java/com/stripe/param/climate/ProductListParams.java @@ -0,0 +1,169 @@ +// File generated from our OpenAPI spec +package com.stripe.param.climate; + +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 ProductListParams 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; + + private ProductListParams( + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.startingAfter = startingAfter; + } + + 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; + + /** Finalize and obtain parameter instance from this builder. */ + public ProductListParams build() { + return new ProductListParams( + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); + } + + /** + * 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 + * ProductListParams#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 + * ProductListParams#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 + * ProductListParams#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 ProductListParams#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; + } + } +} diff --git a/src/main/java/com/stripe/param/climate/ProductRetrieveParams.java b/src/main/java/com/stripe/param/climate/ProductRetrieveParams.java new file mode 100644 index 00000000000..5fb0f3c2612 --- /dev/null +++ b/src/main/java/com/stripe/param/climate/ProductRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.climate; + +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 ProductRetrieveParams 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 ProductRetrieveParams(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 ProductRetrieveParams build() { + return new ProductRetrieveParams(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 + * ProductRetrieveParams#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 + * ProductRetrieveParams#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 + * ProductRetrieveParams#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 ProductRetrieveParams#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/climate/SupplierListParams.java b/src/main/java/com/stripe/param/climate/SupplierListParams.java new file mode 100644 index 00000000000..64f39dd357c --- /dev/null +++ b/src/main/java/com/stripe/param/climate/SupplierListParams.java @@ -0,0 +1,169 @@ +// File generated from our OpenAPI spec +package com.stripe.param.climate; + +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 SupplierListParams 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; + + private SupplierListParams( + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.startingAfter = startingAfter; + } + + 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; + + /** Finalize and obtain parameter instance from this builder. */ + public SupplierListParams build() { + return new SupplierListParams( + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); + } + + /** + * 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 + * SupplierListParams#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 + * SupplierListParams#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 + * SupplierListParams#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 SupplierListParams#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; + } + } +} diff --git a/src/main/java/com/stripe/param/climate/SupplierRetrieveParams.java b/src/main/java/com/stripe/param/climate/SupplierRetrieveParams.java new file mode 100644 index 00000000000..c6d8005adf2 --- /dev/null +++ b/src/main/java/com/stripe/param/climate/SupplierRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.climate; + +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 SupplierRetrieveParams 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 SupplierRetrieveParams(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 SupplierRetrieveParams build() { + return new SupplierRetrieveParams(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 + * SupplierRetrieveParams#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 + * SupplierRetrieveParams#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 + * SupplierRetrieveParams#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 SupplierRetrieveParams#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/service/ClimateService.java b/src/main/java/com/stripe/service/ClimateService.java new file mode 100644 index 00000000000..fca4966f612 --- /dev/null +++ b/src/main/java/com/stripe/service/ClimateService.java @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec +package com.stripe.service; + +import com.stripe.net.ApiService; +import com.stripe.net.StripeResponseGetter; + +public final class ClimateService extends ApiService { + public ClimateService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + public com.stripe.service.climate.OrderService orders() { + return new com.stripe.service.climate.OrderService(this.getResponseGetter()); + } + + public com.stripe.service.climate.ProductService products() { + return new com.stripe.service.climate.ProductService(this.getResponseGetter()); + } + + public com.stripe.service.climate.SupplierService suppliers() { + return new com.stripe.service.climate.SupplierService(this.getResponseGetter()); + } +} diff --git a/src/main/java/com/stripe/service/climate/OrderService.java b/src/main/java/com/stripe/service/climate/OrderService.java new file mode 100644 index 00000000000..4617e2e32bf --- /dev/null +++ b/src/main/java/com/stripe/service/climate/OrderService.java @@ -0,0 +1,189 @@ +// File generated from our OpenAPI spec +package com.stripe.service.climate; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.StripeCollection; +import com.stripe.model.climate.Order; +import com.stripe.net.ApiMode; +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.climate.OrderCancelParams; +import com.stripe.param.climate.OrderCreateParams; +import com.stripe.param.climate.OrderListParams; +import com.stripe.param.climate.OrderRetrieveParams; +import com.stripe.param.climate.OrderUpdateParams; + +public final class OrderService extends ApiService { + public OrderService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Retrieves the details of a Climate order object with the given ID. */ + public Order retrieve(String order, OrderRetrieveParams params) throws StripeException { + return retrieve(order, params, (RequestOptions) null); + } + /** Retrieves the details of a Climate order object with the given ID. */ + public Order retrieve(String order, RequestOptions options) throws StripeException { + return retrieve(order, (OrderRetrieveParams) null, options); + } + /** Retrieves the details of a Climate order object with the given ID. */ + public Order retrieve(String order) throws StripeException { + return retrieve(order, (OrderRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves the details of a Climate order object with the given ID. */ + public Order retrieve(String order, OrderRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/climate/orders/%s", ApiResource.urlEncodeId(order)); + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + Order.class, + options, + ApiMode.V1); + } + /** Updates the specified order by setting the values of the parameters passed. */ + public Order update(String order, OrderUpdateParams params) throws StripeException { + return update(order, params, (RequestOptions) null); + } + /** Updates the specified order by setting the values of the parameters passed. */ + public Order update(String order, RequestOptions options) throws StripeException { + return update(order, (OrderUpdateParams) null, options); + } + /** Updates the specified order by setting the values of the parameters passed. */ + public Order update(String order) throws StripeException { + return update(order, (OrderUpdateParams) null, (RequestOptions) null); + } + /** Updates the specified order by setting the values of the parameters passed. */ + public Order update(String order, OrderUpdateParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/climate/orders/%s", ApiResource.urlEncodeId(order)); + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + Order.class, + options, + ApiMode.V1); + } + /** + * Lists all Climate order objects. The orders are returned sorted by creation date, with the most + * recently created orders appearing first. + */ + public StripeCollection list(OrderListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + /** + * Lists all Climate order objects. The orders are returned sorted by creation date, with the most + * recently created orders appearing first. + */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((OrderListParams) null, options); + } + /** + * Lists all Climate order objects. The orders are returned sorted by creation date, with the most + * recently created orders appearing first. + */ + public StripeCollection list() throws StripeException { + return list((OrderListParams) null, (RequestOptions) null); + } + /** + * Lists all Climate order objects. The orders are returned sorted by creation date, with the most + * recently created orders appearing first. + */ + public StripeCollection list(OrderListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/climate/orders"; + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + new TypeToken>() {}.getType(), + options, + ApiMode.V1); + } + /** + * Creates a Climate order object for a given Climate product. The order will be processed + * immediately after creation and payment will be deducted your Stripe balance. + */ + public Order create(OrderCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** + * Creates a Climate order object for a given Climate product. The order will be processed + * immediately after creation and payment will be deducted your Stripe balance. + */ + public Order create(OrderCreateParams params, RequestOptions options) throws StripeException { + String path = "/v1/climate/orders"; + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + Order.class, + options, + ApiMode.V1); + } + /** + * Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + * reservation {@code amount_subtotal}, but not the {@code amount_fees} for user-triggered + * cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier + * cancels the reservation, Stripe provides 90 days advance notice and refunds the {@code + * amount_total}. + */ + public Order cancel(String order, OrderCancelParams params) throws StripeException { + return cancel(order, params, (RequestOptions) null); + } + /** + * Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + * reservation {@code amount_subtotal}, but not the {@code amount_fees} for user-triggered + * cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier + * cancels the reservation, Stripe provides 90 days advance notice and refunds the {@code + * amount_total}. + */ + public Order cancel(String order, RequestOptions options) throws StripeException { + return cancel(order, (OrderCancelParams) null, options); + } + /** + * Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + * reservation {@code amount_subtotal}, but not the {@code amount_fees} for user-triggered + * cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier + * cancels the reservation, Stripe provides 90 days advance notice and refunds the {@code + * amount_total}. + */ + public Order cancel(String order) throws StripeException { + return cancel(order, (OrderCancelParams) null, (RequestOptions) null); + } + /** + * Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + * reservation {@code amount_subtotal}, but not the {@code amount_fees} for user-triggered + * cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier + * cancels the reservation, Stripe provides 90 days advance notice and refunds the {@code + * amount_total}. + */ + public Order cancel(String order, OrderCancelParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/climate/orders/%s/cancel", ApiResource.urlEncodeId(order)); + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + Order.class, + options, + ApiMode.V1); + } +} diff --git a/src/main/java/com/stripe/service/climate/ProductService.java b/src/main/java/com/stripe/service/climate/ProductService.java new file mode 100644 index 00000000000..ecb89348b8b --- /dev/null +++ b/src/main/java/com/stripe/service/climate/ProductService.java @@ -0,0 +1,75 @@ +// File generated from our OpenAPI spec +package com.stripe.service.climate; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.StripeCollection; +import com.stripe.model.climate.Product; +import com.stripe.net.ApiMode; +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.climate.ProductListParams; +import com.stripe.param.climate.ProductRetrieveParams; + +public final class ProductService extends ApiService { + public ProductService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Retrieves the details of a Climate product with the given ID. */ + public Product retrieve(String product, ProductRetrieveParams params) throws StripeException { + return retrieve(product, params, (RequestOptions) null); + } + /** Retrieves the details of a Climate product with the given ID. */ + public Product retrieve(String product, RequestOptions options) throws StripeException { + return retrieve(product, (ProductRetrieveParams) null, options); + } + /** Retrieves the details of a Climate product with the given ID. */ + public Product retrieve(String product) throws StripeException { + return retrieve(product, (ProductRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves the details of a Climate product with the given ID. */ + public Product retrieve(String product, ProductRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/climate/products/%s", ApiResource.urlEncodeId(product)); + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + Product.class, + options, + ApiMode.V1); + } + /** Lists all available Climate product objects. */ + public StripeCollection list(ProductListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + /** Lists all available Climate product objects. */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((ProductListParams) null, options); + } + /** Lists all available Climate product objects. */ + public StripeCollection list() throws StripeException { + return list((ProductListParams) null, (RequestOptions) null); + } + /** Lists all available Climate product objects. */ + public StripeCollection list(ProductListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/climate/products"; + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + new TypeToken>() {}.getType(), + options, + ApiMode.V1); + } +} diff --git a/src/main/java/com/stripe/service/climate/SupplierService.java b/src/main/java/com/stripe/service/climate/SupplierService.java new file mode 100644 index 00000000000..81b67773601 --- /dev/null +++ b/src/main/java/com/stripe/service/climate/SupplierService.java @@ -0,0 +1,75 @@ +// File generated from our OpenAPI spec +package com.stripe.service.climate; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.StripeCollection; +import com.stripe.model.climate.Supplier; +import com.stripe.net.ApiMode; +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.climate.SupplierListParams; +import com.stripe.param.climate.SupplierRetrieveParams; + +public final class SupplierService extends ApiService { + public SupplierService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Retrieves a Climate supplier object. */ + public Supplier retrieve(String supplier, SupplierRetrieveParams params) throws StripeException { + return retrieve(supplier, params, (RequestOptions) null); + } + /** Retrieves a Climate supplier object. */ + public Supplier retrieve(String supplier, RequestOptions options) throws StripeException { + return retrieve(supplier, (SupplierRetrieveParams) null, options); + } + /** Retrieves a Climate supplier object. */ + public Supplier retrieve(String supplier) throws StripeException { + return retrieve(supplier, (SupplierRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves a Climate supplier object. */ + public Supplier retrieve(String supplier, SupplierRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/climate/suppliers/%s", ApiResource.urlEncodeId(supplier)); + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + Supplier.class, + options, + ApiMode.V1); + } + /** Lists all available Climate supplier objects. */ + public StripeCollection list(SupplierListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + /** Lists all available Climate supplier objects. */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((SupplierListParams) null, options); + } + /** Lists all available Climate supplier objects. */ + public StripeCollection list() throws StripeException { + return list((SupplierListParams) null, (RequestOptions) null); + } + /** Lists all available Climate supplier objects. */ + public StripeCollection list(SupplierListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/climate/suppliers"; + return getResponseGetter() + .request( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + new TypeToken>() {}.getType(), + options, + ApiMode.V1); + } +} From aea5612477e79fc21b7d273379b3117c678005fc Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 11:45:45 +0000 Subject: [PATCH 2/7] Update generated code for v683 --- OPENAPI_VERSION | 2 +- .../stripe/param/CustomerCreateParams.java | 35 +++++++++++++++++-- .../stripe/param/CustomerUpdateParams.java | 35 +++++++++++++++++-- 3 files changed, 67 insertions(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c523b898421..88cba600871 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v682 \ No newline at end of file +v683 \ No newline at end of file diff --git a/src/main/java/com/stripe/param/CustomerCreateParams.java b/src/main/java/com/stripe/param/CustomerCreateParams.java index f190a9cf5d3..1cee1c831fb 100644 --- a/src/main/java/com/stripe/param/CustomerCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerCreateParams.java @@ -1544,9 +1544,15 @@ public static class Tax { @SerializedName("ip_address") Object ipAddress; - private Tax(Map extraParams, Object ipAddress) { + /** A flag that indicates whether Stripe should validate the customer tax location. */ + @SerializedName("validate_location") + ValidateLocation validateLocation; + + private Tax( + Map extraParams, Object ipAddress, ValidateLocation validateLocation) { this.extraParams = extraParams; this.ipAddress = ipAddress; + this.validateLocation = validateLocation; } public static Builder builder() { @@ -1558,9 +1564,12 @@ public static class Builder { private Object ipAddress; + private ValidateLocation validateLocation; + /** Finalize and obtain parameter instance from this builder. */ public CustomerCreateParams.Tax build() { - return new CustomerCreateParams.Tax(this.extraParams, this.ipAddress); + return new CustomerCreateParams.Tax( + this.extraParams, this.ipAddress, this.validateLocation); } /** @@ -1610,6 +1619,28 @@ public Builder setIpAddress(EmptyParam ipAddress) { this.ipAddress = ipAddress; return this; } + + /** A flag that indicates whether Stripe should validate the customer tax location. */ + public Builder setValidateLocation( + CustomerCreateParams.Tax.ValidateLocation validateLocation) { + this.validateLocation = validateLocation; + return this; + } + } + + public enum ValidateLocation implements ApiRequestParams.EnumParam { + @SerializedName("deferred") + DEFERRED("deferred"), + + @SerializedName("immediately") + IMMEDIATELY("immediately"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + ValidateLocation(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/CustomerUpdateParams.java b/src/main/java/com/stripe/param/CustomerUpdateParams.java index 5a621981326..117184a5f8e 100644 --- a/src/main/java/com/stripe/param/CustomerUpdateParams.java +++ b/src/main/java/com/stripe/param/CustomerUpdateParams.java @@ -1715,9 +1715,15 @@ public static class Tax { @SerializedName("ip_address") Object ipAddress; - private Tax(Map extraParams, Object ipAddress) { + /** A flag that indicates whether Stripe should validate the customer tax location. */ + @SerializedName("validate_location") + ValidateLocation validateLocation; + + private Tax( + Map extraParams, Object ipAddress, ValidateLocation validateLocation) { this.extraParams = extraParams; this.ipAddress = ipAddress; + this.validateLocation = validateLocation; } public static Builder builder() { @@ -1729,9 +1735,12 @@ public static class Builder { private Object ipAddress; + private ValidateLocation validateLocation; + /** Finalize and obtain parameter instance from this builder. */ public CustomerUpdateParams.Tax build() { - return new CustomerUpdateParams.Tax(this.extraParams, this.ipAddress); + return new CustomerUpdateParams.Tax( + this.extraParams, this.ipAddress, this.validateLocation); } /** @@ -1781,6 +1790,28 @@ public Builder setIpAddress(EmptyParam ipAddress) { this.ipAddress = ipAddress; return this; } + + /** A flag that indicates whether Stripe should validate the customer tax location. */ + public Builder setValidateLocation( + CustomerUpdateParams.Tax.ValidateLocation validateLocation) { + this.validateLocation = validateLocation; + return this; + } + } + + public enum ValidateLocation implements ApiRequestParams.EnumParam { + @SerializedName("deferred") + DEFERRED("deferred"), + + @SerializedName("immediately") + IMMEDIATELY("immediately"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + ValidateLocation(String value) { + this.value = value; + } } } From 72a7ba6bb39dbed733c6611e0f8fc20c4632dbed Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 21:55:15 +0000 Subject: [PATCH 3/7] Update generated code for v684 --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Event.java | 5 ++++- .../param/WebhookEndpointCreateParams.java | 21 +++++++++++++++++++ .../param/WebhookEndpointUpdateParams.java | 21 +++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 88cba600871..01af7187fb6 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v683 \ No newline at end of file +v684 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/Event.java b/src/main/java/com/stripe/model/Event.java index 93448d9a886..2ff6283ae21 100644 --- a/src/main/java/com/stripe/model/Event.java +++ b/src/main/java/com/stripe/model/Event.java @@ -128,7 +128,10 @@ public class Event extends ApiResource implements HasId { * {@code charge.refund.updated}, {@code charge.refunded}, {@code charge.succeeded}, {@code * charge.updated}, {@code checkout.session.async_payment_failed}, {@code * checkout.session.async_payment_succeeded}, {@code checkout.session.completed}, {@code - * checkout.session.expired}, {@code coupon.created}, {@code coupon.deleted}, {@code + * checkout.session.expired}, {@code climate.order.canceled}, {@code climate.order.created}, + * {@code climate.order.delayed}, {@code climate.order.delivered}, {@code + * climate.order.product_substituted}, {@code climate.product.created}, {@code + * climate.product.pricing_updated}, {@code coupon.created}, {@code coupon.deleted}, {@code * coupon.updated}, {@code credit_note.created}, {@code credit_note.updated}, {@code * credit_note.voided}, {@code customer.created}, {@code customer.deleted}, {@code * customer.discount.created}, {@code customer.discount.deleted}, {@code diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index c9900edaf7a..2652377cc1b 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -723,6 +723,27 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("checkout.session.expired") CHECKOUT__SESSION__EXPIRED("checkout.session.expired"), + @SerializedName("climate.order.canceled") + CLIMATE__ORDER__CANCELED("climate.order.canceled"), + + @SerializedName("climate.order.created") + CLIMATE__ORDER__CREATED("climate.order.created"), + + @SerializedName("climate.order.delayed") + CLIMATE__ORDER__DELAYED("climate.order.delayed"), + + @SerializedName("climate.order.delivered") + CLIMATE__ORDER__DELIVERED("climate.order.delivered"), + + @SerializedName("climate.order.product_substituted") + CLIMATE__ORDER__PRODUCT_SUBSTITUTED("climate.order.product_substituted"), + + @SerializedName("climate.product.created") + CLIMATE__PRODUCT__CREATED("climate.product.created"), + + @SerializedName("climate.product.pricing_updated") + CLIMATE__PRODUCT__PRICING_UPDATED("climate.product.pricing_updated"), + @SerializedName("coupon.created") COUPON__CREATED("coupon.created"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index e4f06fe7001..6c242afd720 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -393,6 +393,27 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("checkout.session.expired") CHECKOUT__SESSION__EXPIRED("checkout.session.expired"), + @SerializedName("climate.order.canceled") + CLIMATE__ORDER__CANCELED("climate.order.canceled"), + + @SerializedName("climate.order.created") + CLIMATE__ORDER__CREATED("climate.order.created"), + + @SerializedName("climate.order.delayed") + CLIMATE__ORDER__DELAYED("climate.order.delayed"), + + @SerializedName("climate.order.delivered") + CLIMATE__ORDER__DELIVERED("climate.order.delivered"), + + @SerializedName("climate.order.product_substituted") + CLIMATE__ORDER__PRODUCT_SUBSTITUTED("climate.order.product_substituted"), + + @SerializedName("climate.product.created") + CLIMATE__PRODUCT__CREATED("climate.product.created"), + + @SerializedName("climate.product.pricing_updated") + CLIMATE__PRODUCT__PRICING_UPDATED("climate.product.pricing_updated"), + @SerializedName("coupon.created") COUPON__CREATED("coupon.created"), From cbbcd5b420b37441d83f5f4f52c95de89598ca0f Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 23:00:25 +0000 Subject: [PATCH 4/7] Update generated code for v685 --- OPENAPI_VERSION | 2 +- .../com/stripe/model/BalanceTransaction.java | 32 ++++++------- .../param/BalanceTransactionListParams.java | 45 ++++++++++--------- .../reporting/ReportRunCreateParams.java | 6 +++ 4 files changed, 47 insertions(+), 38 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 01af7187fb6..0eff07fd6c2 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v684 \ No newline at end of file +v685 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/BalanceTransaction.java b/src/main/java/com/stripe/model/BalanceTransaction.java index be7982ac140..6cb9c27e8a1 100644 --- a/src/main/java/com/stripe/model/BalanceTransaction.java +++ b/src/main/java/com/stripe/model/BalanceTransaction.java @@ -121,27 +121,29 @@ public class BalanceTransaction extends ApiResource implements HasId { /** * Transaction type: {@code adjustment}, {@code advance}, {@code advance_funding}, {@code * anticipation_repayment}, {@code application_fee}, {@code application_fee_refund}, {@code - * charge}, {@code connect_collection_transfer}, {@code contribution}, {@code - * issuing_authorization_hold}, {@code issuing_authorization_release}, {@code issuing_dispute}, - * {@code issuing_transaction}, {@code obligation_inbound}, {@code obligation_outbound}, {@code - * obligation_reversal_inbound}, {@code obligation_reversal_outbound}, {@code obligation_payout}, - * {@code obligation_payout_failure}, {@code payment}, {@code payment_failure_refund}, {@code - * payment_refund}, {@code payment_reversal}, {@code payment_unreconciled}, {@code payout}, {@code - * payout_cancel}, {@code payout_failure}, {@code refund}, {@code refund_failure}, {@code - * reserve_transaction}, {@code reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code - * tax_fee}, {@code topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, - * {@code transfer_failure}, or {@code transfer_refund}. Learn more about balance transaction types and * what they represent. To classify transactions for accounting purposes, consider {@code * reporting_category} instead. * *

One of {@code adjustment}, {@code advance}, {@code advance_funding}, {@code * anticipation_repayment}, {@code application_fee}, {@code application_fee_refund}, {@code - * charge}, {@code connect_collection_transfer}, {@code contribution}, {@code - * issuing_authorization_hold}, {@code issuing_authorization_release}, {@code issuing_dispute}, - * {@code issuing_transaction}, {@code obligation_inbound}, {@code obligation_outbound}, {@code - * obligation_payout}, {@code obligation_payout_failure}, {@code obligation_reversal_inbound}, - * {@code obligation_reversal_outbound}, {@code payment}, {@code payment_failure_refund}, {@code + * charge}, {@code climate_order_purchase}, {@code climate_order_refund}, {@code + * connect_collection_transfer}, {@code contribution}, {@code issuing_authorization_hold}, {@code + * issuing_authorization_release}, {@code issuing_dispute}, {@code issuing_transaction}, {@code + * obligation_inbound}, {@code obligation_outbound}, {@code obligation_payout}, {@code + * obligation_payout_failure}, {@code obligation_reversal_inbound}, {@code + * obligation_reversal_outbound}, {@code payment}, {@code payment_failure_refund}, {@code * payment_refund}, {@code payment_reversal}, {@code payment_unreconciled}, {@code payout}, {@code * payout_cancel}, {@code payout_failure}, {@code refund}, {@code refund_failure}, {@code * reserve_transaction}, {@code reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code diff --git a/src/main/java/com/stripe/param/BalanceTransactionListParams.java b/src/main/java/com/stripe/param/BalanceTransactionListParams.java index 60f2cb01bcf..ae524b30a2d 100644 --- a/src/main/java/com/stripe/param/BalanceTransactionListParams.java +++ b/src/main/java/com/stripe/param/BalanceTransactionListParams.java @@ -74,17 +74,17 @@ public class BalanceTransactionListParams extends ApiRequestParams { /** * Only returns transactions of the given type. One of: {@code adjustment}, {@code advance}, * {@code advance_funding}, {@code anticipation_repayment}, {@code application_fee}, {@code - * application_fee_refund}, {@code charge}, {@code connect_collection_transfer}, {@code - * contribution}, {@code issuing_authorization_hold}, {@code issuing_authorization_release}, - * {@code issuing_dispute}, {@code issuing_transaction}, {@code obligation_inbound}, {@code - * obligation_outbound}, {@code obligation_reversal_inbound}, {@code - * obligation_reversal_outbound}, {@code obligation_payout}, {@code obligation_payout_failure}, - * {@code payment}, {@code payment_failure_refund}, {@code payment_refund}, {@code - * payment_reversal}, {@code payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code - * payout_failure}, {@code refund}, {@code refund_failure}, {@code reserve_transaction}, {@code - * reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code topup}, - * {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or - * {@code transfer_refund}. + * application_fee_refund}, {@code charge}, {@code climate_order_purchase}, {@code + * climate_order_refund}, {@code connect_collection_transfer}, {@code contribution}, {@code + * issuing_authorization_hold}, {@code issuing_authorization_release}, {@code issuing_dispute}, + * {@code issuing_transaction}, {@code obligation_inbound}, {@code obligation_outbound}, {@code + * obligation_reversal_inbound}, {@code obligation_reversal_outbound}, {@code obligation_payout}, + * {@code obligation_payout_failure}, {@code payment}, {@code payment_failure_refund}, {@code + * payment_refund}, {@code payment_reversal}, {@code payment_unreconciled}, {@code payout}, {@code + * payout_cancel}, {@code payout_failure}, {@code refund}, {@code refund_failure}, {@code + * reserve_transaction}, {@code reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code + * tax_fee}, {@code topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, + * {@code transfer_failure}, or {@code transfer_refund}. */ @SerializedName("type") String type; @@ -273,17 +273,18 @@ public Builder setStartingAfter(String startingAfter) { /** * Only returns transactions of the given type. One of: {@code adjustment}, {@code advance}, * {@code advance_funding}, {@code anticipation_repayment}, {@code application_fee}, {@code - * application_fee_refund}, {@code charge}, {@code connect_collection_transfer}, {@code - * contribution}, {@code issuing_authorization_hold}, {@code issuing_authorization_release}, - * {@code issuing_dispute}, {@code issuing_transaction}, {@code obligation_inbound}, {@code - * obligation_outbound}, {@code obligation_reversal_inbound}, {@code - * obligation_reversal_outbound}, {@code obligation_payout}, {@code obligation_payout_failure}, - * {@code payment}, {@code payment_failure_refund}, {@code payment_refund}, {@code - * payment_reversal}, {@code payment_unreconciled}, {@code payout}, {@code payout_cancel}, - * {@code payout_failure}, {@code refund}, {@code refund_failure}, {@code reserve_transaction}, - * {@code reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code - * topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, {@code - * transfer_failure}, or {@code transfer_refund}. + * application_fee_refund}, {@code charge}, {@code climate_order_purchase}, {@code + * climate_order_refund}, {@code connect_collection_transfer}, {@code contribution}, {@code + * issuing_authorization_hold}, {@code issuing_authorization_release}, {@code issuing_dispute}, + * {@code issuing_transaction}, {@code obligation_inbound}, {@code obligation_outbound}, {@code + * obligation_reversal_inbound}, {@code obligation_reversal_outbound}, {@code + * obligation_payout}, {@code obligation_payout_failure}, {@code payment}, {@code + * payment_failure_refund}, {@code payment_refund}, {@code payment_reversal}, {@code + * payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code + * refund}, {@code refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code + * stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code topup}, {@code topup_reversal}, + * {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or {@code + * transfer_refund}. */ public Builder setType(String type) { this.type = type; diff --git a/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java b/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java index 08fed7aee28..0cdee8152d8 100644 --- a/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java +++ b/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java @@ -370,6 +370,12 @@ public enum ReportingCategory implements ApiRequestParams.EnumParam { @SerializedName("charge_failure") CHARGE_FAILURE("charge_failure"), + @SerializedName("climate_order_purchase") + CLIMATE_ORDER_PURCHASE("climate_order_purchase"), + + @SerializedName("climate_order_refund") + CLIMATE_ORDER_REFUND("climate_order_refund"), + @SerializedName("connect_collection_transfer") CONNECT_COLLECTION_TRANSFER("connect_collection_transfer"), From 000ebdc3008d61e2794625f3fcd25a521f3076c5 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 00:10:50 +0000 Subject: [PATCH 5/7] Update generated code for v686 --- OPENAPI_VERSION | 2 +- .../java/com/stripe/model/PaymentIntent.java | 6 ++++-- .../param/PaymentIntentCaptureParams.java | 12 ++++++++---- .../param/PaymentIntentCreateParams.java | 12 ++++++++---- ...mentIntentIncrementAuthorizationParams.java | 12 ++++++++---- .../param/PaymentIntentUpdateParams.java | 18 ++++++++++++------ 6 files changed, 41 insertions(+), 21 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 0eff07fd6c2..66c5b1a0706 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v685 \ No newline at end of file +v686 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 65e9e7cabeb..cff5c4bb419 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -312,8 +312,10 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore

source; /** - * For non-card charges, you can use this value as the complete description that appears on your - * customers’ statements. Must contain at least one letter, maximum 22 characters. + * For card charges, use statement_descriptor_suffix. + * Otherwise, you can use this value as the complete description of a charge on your customers' + * statements. It must contain at least one letter and be 1–22 characters long. */ @SerializedName("statement_descriptor") String statementDescriptor; diff --git a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java index 19f289ba08d..433ad77af36 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java @@ -67,8 +67,10 @@ public class PaymentIntentCaptureParams extends ApiRequestParams { Object paymentDetails; /** - * For non-card charges, you can use this value as the complete description that appears on your - * customers’ statements. Must contain at least one letter, maximum 22 characters. + * For card charges, use statement_descriptor_suffix. + * Otherwise, you can use this value as the complete description of a charge on your customers' + * statements. It must contain at least one letter and be 1–22 characters long. */ @SerializedName("statement_descriptor") String statementDescriptor; @@ -302,8 +304,10 @@ public Builder setPaymentDetails(EmptyParam paymentDetails) { } /** - * For non-card charges, you can use this value as the complete description that appears on your - * customers’ statements. Must contain at least one letter, maximum 22 characters. + * For card charges, use statement_descriptor_suffix. + * Otherwise, you can use this value as the complete description of a charge on your customers' + * statements. It must contain at least one letter and be 1–22 characters long. */ public Builder setStatementDescriptor(String statementDescriptor) { this.statementDescriptor = statementDescriptor; diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index a59ec0d6262..3f9cb9f6617 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -258,8 +258,10 @@ public class PaymentIntentCreateParams extends ApiRequestParams { Shipping shipping; /** - * For non-card charges, you can use this value as the complete description that appears on your - * customers’ statements. It must contain at least one letter and be 1–22 characters long. + * For card charges, use statement_descriptor_suffix. + * Otherwise, you can use this value as the complete description of a charge on your customers' + * statements. It must contain at least one letter and be 1–22 characters long. */ @SerializedName("statement_descriptor") String statementDescriptor; @@ -887,8 +889,10 @@ public Builder setShipping(PaymentIntentCreateParams.Shipping shipping) { } /** - * For non-card charges, you can use this value as the complete description that appears on your - * customers’ statements. It must contain at least one letter and be 1–22 characters long. + * For card charges, use statement_descriptor_suffix. + * Otherwise, you can use this value as the complete description of a charge on your customers' + * statements. It must contain at least one letter and be 1–22 characters long. */ public Builder setStatementDescriptor(String statementDescriptor) { this.statementDescriptor = statementDescriptor; diff --git a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java index 8bb9d4a4372..449fd14698d 100644 --- a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java @@ -55,8 +55,10 @@ public class PaymentIntentIncrementAuthorizationParams extends ApiRequestParams Map metadata; /** - * For non-card charges, you can use this value as the complete description that appears on your - * customers’ statements. Must contain at least one letter, maximum 22 characters. + * For card charges, use statement_descriptor_suffix. + * Otherwise, you can use this value as the complete description of a charge on your customers' + * statements. It must contain at least one letter and be 1–22 characters long. */ @SerializedName("statement_descriptor") String statementDescriptor; @@ -229,8 +231,10 @@ public Builder putAllMetadata(Map map) { } /** - * For non-card charges, you can use this value as the complete description that appears on your - * customers’ statements. Must contain at least one letter, maximum 22 characters. + * For card charges, use statement_descriptor_suffix. + * Otherwise, you can use this value as the complete description of a charge on your customers' + * statements. It must contain at least one letter and be 1–22 characters long. */ public Builder setStatementDescriptor(String statementDescriptor) { this.statementDescriptor = statementDescriptor; diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index ca58403c422..9697e2da3f7 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -158,8 +158,10 @@ public class PaymentIntentUpdateParams extends ApiRequestParams { Object shipping; /** - * For non-card charges, you can use this value as the complete description that appears on your - * customers’ statements. Must contain at least one letter, maximum 22 characters. + * For card charges, use statement_descriptor_suffix. + * Otherwise, you can use this value as the complete description of a charge on your customers' + * statements. It must contain at least one letter and be 1–22 characters long. */ @SerializedName("statement_descriptor") Object statementDescriptor; @@ -699,8 +701,10 @@ public Builder setShipping(EmptyParam shipping) { } /** - * For non-card charges, you can use this value as the complete description that appears on your - * customers’ statements. Must contain at least one letter, maximum 22 characters. + * For card charges, use statement_descriptor_suffix. + * Otherwise, you can use this value as the complete description of a charge on your customers' + * statements. It must contain at least one letter and be 1–22 characters long. */ public Builder setStatementDescriptor(String statementDescriptor) { this.statementDescriptor = statementDescriptor; @@ -708,8 +712,10 @@ public Builder setStatementDescriptor(String statementDescriptor) { } /** - * For non-card charges, you can use this value as the complete description that appears on your - * customers’ statements. Must contain at least one letter, maximum 22 characters. + * For card charges, use statement_descriptor_suffix. + * Otherwise, you can use this value as the complete description of a charge on your customers' + * statements. It must contain at least one letter and be 1–22 characters long. */ public Builder setStatementDescriptor(EmptyParam statementDescriptor) { this.statementDescriptor = statementDescriptor; From f9fe894aa6107655ebda5451b58eaebcc3a901eb Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 08:52:42 +0000 Subject: [PATCH 6/7] Update generated code for v689 --- OPENAPI_VERSION | 2 +- .../com/stripe/model/climate/Supplier.java | 4 +- .../stripe/param/CustomerCreateParams.java | 10 +- .../stripe/param/CustomerUpdateParams.java | 10 +- .../param/checkout/SessionListParams.java | 129 ++++++++++++++++++ 5 files changed, 148 insertions(+), 7 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 66c5b1a0706..23c765cb2aa 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v686 \ No newline at end of file +v689 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/climate/Supplier.java b/src/main/java/com/stripe/model/climate/Supplier.java index a9c1ffc7dcc..4d889b519af 100644 --- a/src/main/java/com/stripe/model/climate/Supplier.java +++ b/src/main/java/com/stripe/model/climate/Supplier.java @@ -59,8 +59,8 @@ public class Supplier extends ApiResource implements HasId { /** * The scientific pathway used for carbon removal. * - *

One of {@code biomass_carbon_removal_and_storage}, {@code direct_air_capture}, or {@code - * various}. + *

One of {@code biomass_carbon_removal_and_storage}, {@code direct_air_capture}, {@code + * enhanced_weathering}, or {@code various}. */ @SerializedName("removal_pathway") String removalPathway; diff --git a/src/main/java/com/stripe/param/CustomerCreateParams.java b/src/main/java/com/stripe/param/CustomerCreateParams.java index 1cee1c831fb..60d758b8ee5 100644 --- a/src/main/java/com/stripe/param/CustomerCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerCreateParams.java @@ -1544,7 +1544,10 @@ public static class Tax { @SerializedName("ip_address") Object ipAddress; - /** A flag that indicates whether Stripe should validate the customer tax location. */ + /** + * A flag that indicates when Stripe should validate the customer tax location. Defaults to + * {@code deferred}. + */ @SerializedName("validate_location") ValidateLocation validateLocation; @@ -1620,7 +1623,10 @@ public Builder setIpAddress(EmptyParam ipAddress) { return this; } - /** A flag that indicates whether Stripe should validate the customer tax location. */ + /** + * A flag that indicates when Stripe should validate the customer tax location. Defaults to + * {@code deferred}. + */ public Builder setValidateLocation( CustomerCreateParams.Tax.ValidateLocation validateLocation) { this.validateLocation = validateLocation; diff --git a/src/main/java/com/stripe/param/CustomerUpdateParams.java b/src/main/java/com/stripe/param/CustomerUpdateParams.java index 117184a5f8e..c585d07bfe0 100644 --- a/src/main/java/com/stripe/param/CustomerUpdateParams.java +++ b/src/main/java/com/stripe/param/CustomerUpdateParams.java @@ -1715,7 +1715,10 @@ public static class Tax { @SerializedName("ip_address") Object ipAddress; - /** A flag that indicates whether Stripe should validate the customer tax location. */ + /** + * A flag that indicates when Stripe should validate the customer tax location. Defaults to + * {@code deferred}. + */ @SerializedName("validate_location") ValidateLocation validateLocation; @@ -1791,7 +1794,10 @@ public Builder setIpAddress(EmptyParam ipAddress) { return this; } - /** A flag that indicates whether Stripe should validate the customer tax location. */ + /** + * A flag that indicates when Stripe should validate the customer tax location. Defaults to + * {@code deferred}. + */ public Builder setValidateLocation( CustomerUpdateParams.Tax.ValidateLocation validateLocation) { this.validateLocation = validateLocation; diff --git a/src/main/java/com/stripe/param/checkout/SessionListParams.java b/src/main/java/com/stripe/param/checkout/SessionListParams.java index 647c993ede1..c63f3e7e286 100644 --- a/src/main/java/com/stripe/param/checkout/SessionListParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionListParams.java @@ -11,6 +11,10 @@ @Getter public class SessionListParams extends ApiRequestParams { + /** Only return the Checkout Sessions that were created during the given date interval. */ + @SerializedName("created") + Object created; + /** Only return the Checkout Sessions for the Customer specified. */ @SerializedName("customer") String customer; @@ -74,6 +78,7 @@ public class SessionListParams extends ApiRequestParams { String subscription; private SessionListParams( + Object created, String customer, CustomerDetails customerDetails, String endingBefore, @@ -85,6 +90,7 @@ private SessionListParams( String startingAfter, Status status, String subscription) { + this.created = created; this.customer = customer; this.customerDetails = customerDetails; this.endingBefore = endingBefore; @@ -103,6 +109,8 @@ public static Builder builder() { } public static class Builder { + private Object created; + private String customer; private CustomerDetails customerDetails; @@ -128,6 +136,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SessionListParams build() { return new SessionListParams( + this.created, this.customer, this.customerDetails, this.endingBefore, @@ -141,6 +150,18 @@ public SessionListParams build() { this.subscription); } + /** Only return the Checkout Sessions that were created during the given date interval. */ + public Builder setCreated(SessionListParams.Created created) { + this.created = created; + return this; + } + + /** Only return the Checkout Sessions that were created during the given date interval. */ + public Builder setCreated(Long created) { + this.created = created; + return this; + } + /** Only return the Checkout Sessions for the Customer specified. */ public Builder setCustomer(String customer) { this.customer = customer; @@ -261,6 +282,114 @@ public Builder setSubscription(String subscription) { } } + @Getter + public static class Created { + /** + * 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; + + /** Minimum value to filter by (exclusive). */ + @SerializedName("gt") + Long gt; + + /** Minimum value to filter by (inclusive). */ + @SerializedName("gte") + Long gte; + + /** Maximum value to filter by (exclusive). */ + @SerializedName("lt") + Long lt; + + /** Maximum value to filter by (inclusive). */ + @SerializedName("lte") + Long lte; + + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; + this.gt = gt; + this.gte = gte; + this.lt = lt; + this.lte = lte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long gt; + + private Long gte; + + private Long lt; + + private Long lte; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionListParams.Created build() { + return new SessionListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * SessionListParams.Created#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 SessionListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Minimum value to filter by (exclusive). */ + public Builder setGt(Long gt) { + this.gt = gt; + return this; + } + + /** Minimum value to filter by (inclusive). */ + public Builder setGte(Long gte) { + this.gte = gte; + return this; + } + + /** Maximum value to filter by (exclusive). */ + public Builder setLt(Long lt) { + this.lt = lt; + return this; + } + + /** Maximum value to filter by (inclusive). */ + public Builder setLte(Long lte) { + this.lte = lte; + return this; + } + } + } + @Getter public static class CustomerDetails { /** Required. Customer's email address. */ From 76af9e49ef4a0aa4b19b680542fe9259e5db256c Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:01:34 +0000 Subject: [PATCH 7/7] Update generated code for v691 --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/PaymentIntent.java | 2 +- src/main/java/com/stripe/model/SetupIntent.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 23c765cb2aa..794622303c3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v689 \ No newline at end of file +v691 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index cff5c4bb419..0ce023c790b 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -3066,7 +3066,7 @@ public static class Card extends StripeObject { * Secure for more information on how this configuration interacts with Radar and our SCA * Engine. * - *

One of {@code any}, {@code automatic}, or {@code challenge_only}. + *

One of {@code any}, {@code automatic}, {@code challenge}, or {@code challenge_only}. */ @SerializedName("request_three_d_secure") String requestThreeDSecure; diff --git a/src/main/java/com/stripe/model/SetupIntent.java b/src/main/java/com/stripe/model/SetupIntent.java index 583779e3f22..986ad5a10d6 100644 --- a/src/main/java/com/stripe/model/SetupIntent.java +++ b/src/main/java/com/stripe/model/SetupIntent.java @@ -1102,7 +1102,7 @@ public static class Card extends StripeObject { * Secure for more information on how this configuration interacts with Radar and our SCA * Engine. * - *

One of {@code any}, {@code automatic}, or {@code challenge_only}. + *

One of {@code any}, {@code automatic}, {@code challenge}, or {@code challenge_only}. */ @SerializedName("request_three_d_secure") String requestThreeDSecure;