Skip to content

Commit

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

* Update generated code for v412

* Update generated code for v413

* Update generated code for v415

* Update generated code for v416

* Update generated code for v417

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] authored Jul 13, 2023
1 parent fa747b6 commit 7951d69
Show file tree
Hide file tree
Showing 18 changed files with 1,096 additions and 23 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v408
v417
4 changes: 4 additions & 0 deletions src/main/java/com/stripe/model/Charge.java
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,10 @@ public static class Affirm extends StripeObject {}
@Setter
@EqualsAndHashCode(callSuper = false)
public static class AfterpayClearpay extends StripeObject {
/** The Afterpay order ID associated with this payment intent. */
@SerializedName("order_id")
String orderId;

/** Order identifier shown to the merchant in Afterpay’s online portal. */
@SerializedName("reference")
String reference;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ final class EventDataClassLookup {

classLookup.put("tax.calculation", com.stripe.model.tax.Calculation.class);
classLookup.put("tax.calculation_line_item", com.stripe.model.tax.CalculationLineItem.class);
classLookup.put("tax.settings", com.stripe.model.tax.Settings.class);
classLookup.put("tax.transaction", com.stripe.model.tax.Transaction.class);
classLookup.put("tax.transaction_line_item", com.stripe.model.tax.TransactionLineItem.class);

Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,20 @@ public static class Tip extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class AutomaticPaymentMethods extends StripeObject {
/**
* Controls whether this PaymentIntent will accept redirect-based payment methods.
*
* <p>Redirect-based payment methods may require your customer to be redirected to a payment
* method's app or site for authentication or additional steps. To <a
* href="https://stripe.com/docs/api/payment_intents/confirm">confirm</a> this PaymentIntent,
* you may be required to provide a {@code return_url} to redirect customers back to your site
* after they authenticate or complete the payment.
*
* <p>One of {@code always}, or {@code never}.
*/
@SerializedName("allow_redirects")
String allowRedirects;

/** Automatically calculates compatible payment methods. */
@SerializedName("enabled")
Boolean enabled;
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/stripe/model/SetupIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,20 @@ public SetupIntent verifyMicrodeposits(
@Setter
@EqualsAndHashCode(callSuper = false)
public static class AutomaticPaymentMethods extends StripeObject {
/**
* Controls whether this SetupIntent will accept redirect-based payment methods.
*
* <p>Redirect-based payment methods may require your customer to be redirected to a payment
* method's app or site for authentication or additional steps. To <a
* href="https://stripe.com/docs/api/setup_intents/confirm">confirm</a> this SetupIntent, you
* may be required to provide a {@code return_url} to redirect customers back to your site after
* they authenticate or complete the setup.
*
* <p>One of {@code always}, or {@code never}.
*/
@SerializedName("allow_redirects")
String allowRedirects;

/** Automatically calculates compatible payment methods. */
@SerializedName("enabled")
Boolean enabled;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/stripe/model/StripeError.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public class StripeError extends StripeObject {
* insufficient_funds}, {@code intent_invalid_state}, {@code intent_verification_method_missing},
* {@code invalid_card_type}, {@code invalid_characters}, {@code invalid_charge_amount}, {@code
* invalid_cvc}, {@code invalid_expiry_month}, {@code invalid_expiry_year}, {@code
* invalid_number}, {@code invalid_source_usage}, {@code invoice_no_customer_line_items}, {@code
* invoice_no_payment_method_types}, {@code invoice_no_subscription_line_items}, {@code
* invoice_not_editable}, {@code invoice_on_behalf_of_not_editable}, {@code
* invoice_payment_intent_requires_action}, {@code invoice_upcoming_none}, {@code
* livemode_mismatch}, {@code lock_timeout}, {@code missing}, {@code no_account}, {@code
* not_allowed_on_standard_account}, {@code out_of_inventory}, {@code
* invalid_number}, {@code invalid_source_usage}, {@code invalid_tax_location}, {@code
* invoice_no_customer_line_items}, {@code invoice_no_payment_method_types}, {@code
* invoice_no_subscription_line_items}, {@code invoice_not_editable}, {@code
* invoice_on_behalf_of_not_editable}, {@code invoice_payment_intent_requires_action}, {@code
* invoice_upcoming_none}, {@code livemode_mismatch}, {@code lock_timeout}, {@code missing},
* {@code no_account}, {@code not_allowed_on_standard_account}, {@code out_of_inventory}, {@code
* ownership_declaration_not_allowed}, {@code parameter_invalid_empty}, {@code
* parameter_invalid_integer}, {@code parameter_invalid_string_blank}, {@code
* parameter_invalid_string_empty}, {@code parameter_missing}, {@code parameter_unknown}, {@code
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/com/stripe/model/tax/Calculation.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public static class ShippingCost extends StripeObject {

/**
* The ID of an existing <a
* href="https://stripe.com/docs/api/shipping_rates/object">ShippingRate.</a>
* href="https://stripe.com/docs/api/shipping_rates/object">ShippingRate</a>.
*/
@SerializedName("shipping_rate")
String shippingRate;
Expand Down Expand Up @@ -395,8 +395,9 @@ public static class TaxRateDetails extends StripeObject {
/**
* The tax type, such as {@code vat} or {@code sales_tax}.
*
* <p>One of {@code gst}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code
* pst}, {@code qst}, {@code rst}, {@code sales_tax}, or {@code vat}.
* <p>One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst},
* {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code rst},
* {@code sales_tax}, or {@code vat}.
*/
@SerializedName("tax_type")
String taxType;
Expand Down Expand Up @@ -458,8 +459,9 @@ public static class TaxRateDetails extends StripeObject {
/**
* The tax type, such as {@code vat} or {@code sales_tax}.
*
* <p>One of {@code gst}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code
* pst}, {@code qst}, {@code rst}, {@code sales_tax}, or {@code vat}.
* <p>One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst},
* {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code rst}, {@code
* sales_tax}, or {@code vat}.
*/
@SerializedName("tax_type")
String taxType;
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/stripe/model/tax/CalculationLineItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class CalculationLineItem extends StripeObject implements HasId {
@SerializedName("object")
String object;

/** A Product ID. */
/** The ID of an existing <a href="https://stripe.com/docs/api/products/object">Product</a>. */
@SerializedName("product")
String product;

Expand Down Expand Up @@ -175,8 +175,9 @@ public static class TaxRateDetails extends StripeObject {
/**
* The tax type, such as {@code vat} or {@code sales_tax}.
*
* <p>One of {@code gst}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code
* pst}, {@code qst}, {@code rst}, {@code sales_tax}, or {@code vat}.
* <p>One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst},
* {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code rst}, {@code
* sales_tax}, or {@code vat}.
*/
@SerializedName("tax_type")
String taxType;
Expand Down
185 changes: 185 additions & 0 deletions src/main/java/com/stripe/model/tax/Settings.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
// File generated from our OpenAPI spec
package com.stripe.model.tax;

import com.google.gson.annotations.SerializedName;
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.model.Address;
import com.stripe.model.StripeObject;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.tax.SettingsRetrieveParams;
import com.stripe.param.tax.SettingsUpdateParams;
import java.util.List;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
* You can use Tax {@code Settings} to manage configurations used by Stripe Tax calculations.
*
* <p>Related guide: <a href="https://stripe.com/docs/tax/settings-api">Using the Settings API</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class Settings extends ApiResource {
@SerializedName("defaults")
Defaults defaults;

/** The place where your business is located. */
@SerializedName("head_office")
HeadOffice headOffice;

/**
* 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;

/**
* String representing the object's type. Objects of the same type share the same value.
*
* <p>Equal to {@code tax.settings}.
*/
@SerializedName("object")
String object;

/**
* The {@code active} status indicates you have all required settings to calculate tax. A status
* can transition out of {@code active} when new required settings are introduced.
*
* <p>One of {@code active}, or {@code pending}.
*/
@SerializedName("status")
String status;

@SerializedName("status_details")
StatusDetails statusDetails;

/** Retrieves Tax {@code Settings} for a merchant. */
public static Settings retrieve() throws StripeException {
return retrieve((Map<String, Object>) null, (RequestOptions) null);
}

/** Retrieves Tax {@code Settings} for a merchant. */
public static Settings retrieve(RequestOptions options) throws StripeException {
return retrieve((Map<String, Object>) null, options);
}

/** Retrieves Tax {@code Settings} for a merchant. */
public static Settings retrieve(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings");
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Settings.class, options);
}

/** Retrieves Tax {@code Settings} for a merchant. */
public static Settings retrieve(SettingsRetrieveParams params, RequestOptions options)
throws StripeException {
String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings");
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Settings.class, options);
}

/**
* Updates Tax {@code Settings} parameters used in tax calculations. All parameters are editable
* but none can be removed once set.
*/
public static Settings update(Map<String, Object> params) throws StripeException {
return update(params, (RequestOptions) null);
}

/**
* Updates Tax {@code Settings} parameters used in tax calculations. All parameters are editable
* but none can be removed once set.
*/
public static Settings update(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings");
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, Settings.class, options);
}

/**
* Updates Tax {@code Settings} parameters used in tax calculations. All parameters are editable
* but none can be removed once set.
*/
public static Settings update(SettingsUpdateParams params) throws StripeException {
return update(params, (RequestOptions) null);
}

/**
* Updates Tax {@code Settings} parameters used in tax calculations. All parameters are editable
* but none can be removed once set.
*/
public static Settings update(SettingsUpdateParams params, RequestOptions options)
throws StripeException {
String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings");
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, Settings.class, options);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Defaults extends StripeObject {
/**
* Default <a
* href="https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior">tax
* behavior</a> used to specify whether the price is considered inclusive of taxes or exclusive
* of taxes. If the item's price has a tax behavior set, it will take precedence over the
* default tax behavior.
*
* <p>One of {@code exclusive}, {@code inclusive}, or {@code inferred_by_currency}.
*/
@SerializedName("tax_behavior")
String taxBehavior;

/**
* Default <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> used to classify
* your products and prices.
*/
@SerializedName("tax_code")
String taxCode;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class HeadOffice extends StripeObject {
@SerializedName("address")
Address address;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class StatusDetails extends StripeObject {
@SerializedName("active")
Active active;

@SerializedName("pending")
Pending pending;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Active extends StripeObject {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Pending extends StripeObject {
/**
* The list of missing fields that are required to perform calculations. It includes the entry
* {@code head_office} when the status is {@code pending}. It is recommended to set the
* optional values even if they aren't listed as required for calculating taxes. Calculations
* can fail if missing fields aren't explicitly provided on every call.
*/
@SerializedName("missing_fields")
List<String> missingFields;
}
}
}
8 changes: 4 additions & 4 deletions src/main/java/com/stripe/model/tax/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,7 @@ public static class ShippingCost extends StripeObject {

/**
* The ID of an existing <a
* href="https://stripe.com/docs/api/shipping_rates/object">ShippingRate</a>. (It is not
* populated for the transaction resource object and will be removed in the next API version.)
* href="https://stripe.com/docs/api/shipping_rates/object">ShippingRate</a>.
*/
@SerializedName("shipping_rate")
String shippingRate;
Expand Down Expand Up @@ -491,8 +490,9 @@ public static class TaxRateDetails extends StripeObject {
/**
* The tax type, such as {@code vat} or {@code sales_tax}.
*
* <p>One of {@code gst}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code
* pst}, {@code qst}, {@code rst}, {@code sales_tax}, or {@code vat}.
* <p>One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst},
* {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code rst},
* {@code sales_tax}, or {@code vat}.
*/
@SerializedName("tax_type")
String taxType;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/stripe/model/tax/TransactionLineItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public class TransactionLineItem extends StripeObject implements HasId {
@SerializedName("object")
String object;

/** The ID of an existing <a href="https://stripe.com/docs/api/products/object">Product</a>. */
@SerializedName("product")
String product;

/**
* The number of units of the item being purchased. For reversals, this is the quantity reversed.
*/
Expand Down
Loading

0 comments on commit 7951d69

Please sign in to comment.