Skip to content

Commit

Permalink
Update generated code (#1782)
Browse files Browse the repository at this point in the history
* Update generated code for v963

* Update generated code for v964

* Update generated code for v966

* Update generated code for v967

* Update generated code for v968

* Update generated code for v969

* Update generated code for v971

* Update generated code for v972

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] committed Apr 18, 2024
1 parent 4035727 commit b3b308d
Show file tree
Hide file tree
Showing 30 changed files with 22,799 additions and 104 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
@@ -1 +1 @@
v961
v972
149 changes: 149 additions & 0 deletions src/main/java/com/stripe/model/Invoice.java
Expand Up @@ -12,6 +12,7 @@
import com.stripe.net.RequestOptions;
import com.stripe.net.StripeResponseGetter;
import com.stripe.param.InvoiceCreateParams;
import com.stripe.param.InvoiceCreatePreviewParams;
import com.stripe.param.InvoiceFinalizeInvoiceParams;
import com.stripe.param.InvoiceListParams;
import com.stripe.param.InvoiceMarkUncollectibleParams;
Expand Down Expand Up @@ -954,6 +955,154 @@ public static Invoice create(InvoiceCreateParams params, RequestOptions options)
return getGlobalResponseGetter().request(request, Invoice.class);
}

/**
* At any time, you can preview the upcoming invoice for a customer. This will show you all the
* charges that are pending, including subscription renewal charges, invoice item charges, etc. It
* will also show you any discounts that are applicable to the invoice.
*
* <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
* invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
* listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
* amount that your customer will be billed, you can add, remove, or update pending invoice items,
* or update the customer’s discount.
*
* <p>You can preview the effects of updating a subscription, including a preview of what
* proration will take place. To ensure that the actual proration is calculated exactly the same
* as the previewed proration, you should pass the {@code subscription_details.proration_date}
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*/
public static Invoice createPreview() throws StripeException {
return createPreview((Map<String, Object>) null, (RequestOptions) null);
}

/**
* At any time, you can preview the upcoming invoice for a customer. This will show you all the
* charges that are pending, including subscription renewal charges, invoice item charges, etc. It
* will also show you any discounts that are applicable to the invoice.
*
* <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
* invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
* listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
* amount that your customer will be billed, you can add, remove, or update pending invoice items,
* or update the customer’s discount.
*
* <p>You can preview the effects of updating a subscription, including a preview of what
* proration will take place. To ensure that the actual proration is calculated exactly the same
* as the previewed proration, you should pass the {@code subscription_details.proration_date}
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*/
public static Invoice createPreview(RequestOptions options) throws StripeException {
return createPreview((Map<String, Object>) null, options);
}

/**
* At any time, you can preview the upcoming invoice for a customer. This will show you all the
* charges that are pending, including subscription renewal charges, invoice item charges, etc. It
* will also show you any discounts that are applicable to the invoice.
*
* <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
* invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
* listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
* amount that your customer will be billed, you can add, remove, or update pending invoice items,
* or update the customer’s discount.
*
* <p>You can preview the effects of updating a subscription, including a preview of what
* proration will take place. To ensure that the actual proration is calculated exactly the same
* as the previewed proration, you should pass the {@code subscription_details.proration_date}
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*/
public static Invoice createPreview(Map<String, Object> params) throws StripeException {
return createPreview(params, (RequestOptions) null);
}

/**
* At any time, you can preview the upcoming invoice for a customer. This will show you all the
* charges that are pending, including subscription renewal charges, invoice item charges, etc. It
* will also show you any discounts that are applicable to the invoice.
*
* <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
* invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
* listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
* amount that your customer will be billed, you can add, remove, or update pending invoice items,
* or update the customer’s discount.
*
* <p>You can preview the effects of updating a subscription, including a preview of what
* proration will take place. To ensure that the actual proration is calculated exactly the same
* as the previewed proration, you should pass the {@code subscription_details.proration_date}
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*/
public static Invoice createPreview(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = "/v1/invoices/create_preview";
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, Invoice.class);
}

/**
* At any time, you can preview the upcoming invoice for a customer. This will show you all the
* charges that are pending, including subscription renewal charges, invoice item charges, etc. It
* will also show you any discounts that are applicable to the invoice.
*
* <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
* invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
* listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
* amount that your customer will be billed, you can add, remove, or update pending invoice items,
* or update the customer’s discount.
*
* <p>You can preview the effects of updating a subscription, including a preview of what
* proration will take place. To ensure that the actual proration is calculated exactly the same
* as the previewed proration, you should pass the {@code subscription_details.proration_date}
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*/
public static Invoice createPreview(InvoiceCreatePreviewParams params) throws StripeException {
return createPreview(params, (RequestOptions) null);
}

/**
* At any time, you can preview the upcoming invoice for a customer. This will show you all the
* charges that are pending, including subscription renewal charges, invoice item charges, etc. It
* will also show you any discounts that are applicable to the invoice.
*
* <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
* invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
* listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
* amount that your customer will be billed, you can add, remove, or update pending invoice items,
* or update the customer’s discount.
*
* <p>You can preview the effects of updating a subscription, including a preview of what
* proration will take place. To ensure that the actual proration is calculated exactly the same
* as the previewed proration, you should pass the {@code subscription_details.proration_date}
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*/
public static Invoice createPreview(InvoiceCreatePreviewParams params, RequestOptions options)
throws StripeException {
String path = "/v1/invoices/create_preview";
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, Invoice.class);
}

/**
* Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices
* that are no longer in a draft state will fail; once an invoice has been finalized or if an
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/stripe/model/billing/Meter.java
Expand Up @@ -48,14 +48,14 @@ public class Meter extends ApiResource implements HasId {
String displayName;

/**
* The name of the usage event to record usage for. Corresponds with the {@code event_name} field
* on usage events.
* The name of the meter event to record usage for. Corresponds with the {@code event_name} field
* on meter events.
*/
@SerializedName("event_name")
String eventName;

/**
* The time window to pre-aggregate usage events for, if any.
* The time window to pre-aggregate meter events for, if any.
*
* <p>One of {@code day}, or {@code hour}.
*/
Expand Down Expand Up @@ -342,7 +342,7 @@ public Meter update(MeterUpdateParams params, RequestOptions options) throws Str
@Setter
@EqualsAndHashCode(callSuper = false)
public static class CustomerMapping extends StripeObject {
/** The key in the usage event payload to use for mapping the event to a customer. */
/** The key in the meter event payload to use for mapping the event to a customer. */
@SerializedName("event_payload_key")
String eventPayloadKey;

Expand Down Expand Up @@ -381,7 +381,7 @@ public static class StatusTransitions extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class ValueSettings extends StripeObject {
/** The key in the usage event payload to use as the value for this meter. */
/** The key in the meter event payload to use as the value for this meter. */
@SerializedName("event_payload_key")
String eventPayloadKey;
}
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/stripe/model/billing/MeterEvent.java
Expand Up @@ -51,7 +51,12 @@ public class MeterEvent extends ApiResource {
@SerializedName("object")
String object;

/** The payload of the event. */
/**
* The payload of the event. This contains the fields corresponding to a meter's {@code
* customer_mapping.event_payload_key} (default is {@code stripe_customer_id}) and {@code
* value_settings.event_payload_key} (default is {@code value}). Read more about the <a
* href="https://stripe.com/docs/billing/subscriptions/usage-based/recording-usage#payload-key-overrides">payload</a>.
*/
@SerializedName("payload")
Map<String, String> payload;

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/stripe/model/billing/MeterEventSummary.java
Expand Up @@ -27,13 +27,13 @@
@EqualsAndHashCode(callSuper = false)
public class MeterEventSummary extends ApiResource implements HasId {
/**
* Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The
* aggregation strategy is defined on meter via `default_aggregation``.
* Aggregated value of all the events within {@code start_time} (inclusive) and {@code end_time}
* (inclusive). The aggregation strategy is defined on meter via {@code default_aggregation}.
*/
@SerializedName("aggregated_value")
BigDecimal aggregatedValue;

/** End timestamp for this usage summary (inclusive). */
/** End timestamp for this event summary (inclusive). */
@SerializedName("end_time")
Long endTime;

Expand All @@ -49,7 +49,7 @@ public class MeterEventSummary extends ApiResource implements HasId {
@SerializedName("livemode")
Boolean livemode;

/** The meter associated with this usage summary. */
/** The meter associated with this event summary. */
@SerializedName("meter")
String meter;

Expand All @@ -61,7 +61,7 @@ public class MeterEventSummary extends ApiResource implements HasId {
@SerializedName("object")
String object;

/** Start timestamp for this usage summary (inclusive). */
/** Start timestamp for this event summary (inclusive). */
@SerializedName("start_time")
Long startTime;

Expand Down
56 changes: 56 additions & 0 deletions src/main/java/com/stripe/model/checkout/Session.java
Expand Up @@ -314,6 +314,13 @@ public class Session extends ApiResource implements HasId {
@SerializedName("return_url")
String returnUrl;

/**
* Controls saved payment method settings for the session. Only available in {@code payment} and
* {@code subscription} mode.
*/
@SerializedName("saved_payment_method_options")
SavedPaymentMethodOptions savedPaymentMethodOptions;

/** The ID of the SetupIntent for Checkout Sessions in {@code setup} mode. */
@SerializedName("setup_intent")
@Getter(lombok.AccessLevel.NONE)
Expand Down Expand Up @@ -1429,6 +1436,9 @@ public static class PaymentMethodOptions extends StripeObject {
@SerializedName("link")
Link link;

@SerializedName("mobilepay")
Mobilepay mobilepay;

@SerializedName("oxxo")
Oxxo oxxo;

Expand Down Expand Up @@ -2117,6 +2127,31 @@ public static class Link extends StripeObject {
String setupFutureUsage;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Mobilepay extends StripeObject {
/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
* <p>Providing this parameter will <a
* href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
* to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
* required actions from the user are complete. If no Customer was provided, the payment
* method can still be <a
* href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
* the transaction completes.
*
* <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
* dynamically optimize your payment flow and comply with regional legislation and network
* rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
*
* <p>Equal to {@code none}.
*/
@SerializedName("setup_future_usage")
String setupFutureUsage;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -2390,6 +2425,26 @@ public static class PhoneNumberCollection extends StripeObject {
Boolean enabled;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class SavedPaymentMethodOptions extends StripeObject {
/**
* Controls which payment methods are eligible to be redisplayed to returning customers.
* Corresponds to {@code allow_redisplay} on the payment method.
*/
@SerializedName("allow_redisplay_filters")
List<String> allowRedisplayFilters;

/**
* Enable customers to choose if they wish to save their payment method for future use.
*
* <p>One of {@code disabled}, or {@code enabled}.
*/
@SerializedName("payment_method_save")
String paymentMethodSave;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -2642,6 +2697,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
trySetResponseGetter(paymentMethodConfigurationDetails, responseGetter);
trySetResponseGetter(paymentMethodOptions, responseGetter);
trySetResponseGetter(phoneNumberCollection, responseGetter);
trySetResponseGetter(savedPaymentMethodOptions, responseGetter);
trySetResponseGetter(setupIntent, responseGetter);
trySetResponseGetter(shippingAddressCollection, responseGetter);
trySetResponseGetter(shippingCost, responseGetter);
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/stripe/model/issuing/Transaction.java
Expand Up @@ -618,7 +618,10 @@ public static class Fuel extends StripeObject {
@SerializedName("type")
String type;

/** The units for {@code volume_decimal}. One of {@code us_gallon} or {@code liter}. */
/**
* The units for {@code volume_decimal}. One of {@code liter}, {@code us_gallon}, or {@code
* other}.
*/
@SerializedName("unit")
String unit;

Expand Down

0 comments on commit b3b308d

Please sign in to comment.