diff --git a/API_VERSION b/API_VERSION index e48768f4a01..4b12d797adf 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -3602014a6583f6c0fbfdde3c575839ac7d0b4e9c \ No newline at end of file +5abe0e44caedb3474ee672265284096ec89e0fa3 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f548180094b..e763e2652cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,74 @@ * Add support for event notifications `V2PaymentsSettlementAllocationIntentCanceledEvent`, `V2PaymentsSettlementAllocationIntentCreatedEvent`, `V2PaymentsSettlementAllocationIntentErroredEvent`, `V2PaymentsSettlementAllocationIntentFundsNotReceivedEvent`, `V2PaymentsSettlementAllocationIntentMatchedEvent`, `V2PaymentsSettlementAllocationIntentSettledEvent`, and `V2PaymentsSettlementAllocationIntentSubmittedEvent` with related object `v2.payments.SettlementAllocationIntent` * Add support for event notifications `V2PaymentsSettlementAllocationIntentSplitCanceledEvent`, `V2PaymentsSettlementAllocationIntentSplitCreatedEvent`, and `V2PaymentsSettlementAllocationIntentSplitSettledEvent` with related object `v2.payments.SettlementAllocationIntentSplit` +## 31.1.0 - 2025-12-16 +This release changes the pinned API version to `2025-12-15.clover`. + +* [#2126](https://github.com/stripe/stripe-java/pull/2126) Update generated code + * Add support for new resources `v2.core.AccountLink`, `v2.core.AccountPersonToken`, `v2.core.AccountPerson`, `v2.core.AccountToken`, and `v2.core.Account` + * Add support for `create` and `retrieve` methods on resources `v2.core.AccountPersonToken` and `v2.core.AccountToken` + * Add support for `create` method on resource `v2.core.AccountLink` + * Add support for `close`, `create`, `list`, `retrieve`, and `update` methods on resource `v2.core.Account` + * Add support for `create`, `delete`, `list`, `retrieve`, and `update` methods on resource `v2.core.AccountPerson` + * Add support for `customerAccount` on `CashBalance`, `ConfirmationToken.payment_method_preview`, `CreditNoteListParams`, `CreditNote`, `CustomerBalanceTransaction`, `CustomerCashBalanceTransaction`, `CustomerSessionCreateParams`, `CustomerSession`, `Customer`, `Discount`, `InvoiceCreateParams`, `InvoiceCreatePreviewParams`, `InvoiceItemCreateParams`, `InvoiceItemListParams`, `InvoiceItem`, `InvoiceListParams`, `Invoice`, `PaymentIntentCreateParams`, `PaymentIntentListParams`, `PaymentIntentUpdateParams`, `PaymentIntent`, `PaymentMethodAttachParams`, `PaymentMethodListParams`, `PaymentMethod`, `PromotionCodeCreateParams`, `PromotionCodeListParams`, `PromotionCode`, `QuoteCreateParams`, `QuoteListParams`, `QuoteUpdateParams`, `Quote`, `SetupAttempt`, `SetupIntentCreateParams`, `SetupIntentListParams`, `SetupIntentUpdateParams`, `SetupIntent`, `SubscriptionCreateParams`, `SubscriptionListParams`, `SubscriptionScheduleCreateParams`, `SubscriptionScheduleListParams`, `SubscriptionSchedule`, `Subscription`, `TaxId.owner`, `TaxIdCreateParams.owner`, `TaxIdListParams.owner`, `TaxId`, `billing.CreditBalanceSummaryRetrieveParams`, `billing.CreditBalanceSummary`, `billing.CreditBalanceTransactionListParams`, `billing.CreditGrantCreateParams`, `billing.CreditGrantListParams`, `billing.CreditGrant`, `billingportal.SessionCreateParams`, `billingportal.Session`, `checkout.SessionCreateParams`, `checkout.SessionListParams`, `checkout.Session`, `financialconnections.Account.account_holder`, `financialconnections.AccountListParams.account_holder`, `financialconnections.Session.account_holder`, and `financialconnections.SessionCreateParams.account_holder` + * Add support for `metadata` on `LineItem` and `checkout.SessionCreateParams.line_items[]` + * Add support for `paytoPayments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities` + * Add support for `signer` on `AccountCreateParams.documents.proof_of_registration`, `AccountCreateParams.documents.proof_of_ultimate_beneficial_ownership`, `AccountUpdateParams.documents.proof_of_registration`, and `AccountUpdateParams.documents.proof_of_ultimate_beneficial_ownership` + * Change `CustomerSessionCreateParams.customer`, `InvoiceItemCreateParams.customer`, `PaymentMethodAttachParams.customer`, `SubscriptionCreateParams.customer`, `billing.CreditBalanceSummaryRetrieveParams.customer`, `billing.CreditBalanceTransactionListParams.customer`, `billing.CreditGrantCreateParams.customer`, and `billingportal.SessionCreateParams.customer` to be optional + * Add support for `billingCycleAnchor` on `billingportal.Configuration.features.subscription_update`, `billingportal.ConfigurationCreateParams.features.subscription_update`, and `billingportal.ConfigurationUpdateParams.features.subscription_update` + * Add support for `payto` on `Charge.payment_method_details`, `ConfirmationToken.payment_method_preview`, `ConfirmationTokenCreateParams.payment_method_data`, `Invoice.payment_settings.payment_method_options`, `InvoiceCreateParams.payment_settings.payment_method_options`, `InvoiceUpdateParams.payment_settings.payment_method_options`, `Mandate.payment_method_details`, `PaymentAttemptRecord.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, `PaymentMethodConfiguration`, `PaymentMethodCreateParams`, `PaymentMethodUpdateParams`, `PaymentMethod`, `PaymentRecord.payment_method_details`, `SetupAttempt.payment_method_details`, `SetupIntent.payment_method_options`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentConfirmParams.payment_method_options`, `SetupIntentCreateParams.payment_method_data`, `SetupIntentCreateParams.payment_method_options`, `SetupIntentUpdateParams.payment_method_data`, `SetupIntentUpdateParams.payment_method_options`, `Subscription.payment_settings.payment_method_options`, `SubscriptionCreateParams.payment_settings.payment_method_options`, `SubscriptionUpdateParams.payment_settings.payment_method_options`, `checkout.Session.payment_method_options`, and `checkout.SessionCreateParams.payment_method_options` + * Add support for `expectedDebitDate` on `Charge.payment_method_details.acss_debit`, `Charge.payment_method_details.au_becs_debit`, `Charge.payment_method_details.bacs_debit`, `Charge.payment_method_details.nz_bank_account`, `Charge.payment_method_details.sepa_debit`, `Charge.payment_method_details.us_bank_account`, `PaymentAttemptRecord.payment_method_details.acss_debit`, `PaymentAttemptRecord.payment_method_details.au_becs_debit`, `PaymentAttemptRecord.payment_method_details.bacs_debit`, `PaymentAttemptRecord.payment_method_details.nz_bank_account`, `PaymentAttemptRecord.payment_method_details.sepa_debit`, `PaymentAttemptRecord.payment_method_details.us_bank_account`, `PaymentRecord.payment_method_details.acss_debit`, `PaymentRecord.payment_method_details.au_becs_debit`, `PaymentRecord.payment_method_details.bacs_debit`, `PaymentRecord.payment_method_details.nz_bank_account`, `PaymentRecord.payment_method_details.sepa_debit`, and `PaymentRecord.payment_method_details.us_bank_account` + * Add support for new value `payto` on enums `PaymentIntentConfirmParams.excludedPaymentMethodTypes`, `PaymentIntentCreateParams.excludedPaymentMethodTypes`, `PaymentIntentUpdateParams.excludedPaymentMethodTypes`, `SetupIntentCreateParams.excludedPaymentMethodTypes`, `SetupIntentUpdateParams.excludedPaymentMethodTypes`, and `checkout.SessionCreateParams.excludedPaymentMethodTypes` + * Add support for new value `payto` on enum `checkout.SessionCreateParams.paymentMethodTypes` + * Add support for `lineItems` on `checkout.SessionUpdateParams` + * Add support for new value `mollie` on enums `ConfirmationTokenCreateParams.payment_method_data.ideal.bank`, `PaymentIntentConfirmParams.payment_method_data.ideal.bank`, `PaymentIntentCreateParams.payment_method_data.ideal.bank`, `PaymentIntentUpdateParams.payment_method_data.ideal.bank`, `PaymentMethodCreateParams.ideal.bank`, `SetupIntentConfirmParams.payment_method_data.ideal.bank`, `SetupIntentCreateParams.payment_method_data.ideal.bank`, and `SetupIntentUpdateParams.payment_method_data.ideal.bank` + * Add support for new value `payto` on enums `ConfirmationTokenCreateParams.payment_method_data.type`, `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type` + * Add support for new value `payto` on enums `CustomerListPaymentMethodsParams.type`, `PaymentMethodCreateParams.type`, and `PaymentMethodListParams.type` + * Add support for `invoice` on `CustomerBalanceTransactionListParams` + * Add support for `relatedCustomerAccount` on `identity.VerificationSessionCreateParams`, `identity.VerificationSessionListParams`, and `identity.VerificationSession` + * Change type of `InvoiceItem.pricing.price_details.price` and `InvoiceLineItem.pricing.price_details.price` from `string` to `expandable($Price)` + * Add support for new value `payto` on enums `InvoiceCreateParams.payment_settings.paymentMethodTypes`, `InvoiceUpdateParams.payment_settings.paymentMethodTypes`, `SubscriptionCreateParams.payment_settings.paymentMethodTypes`, and `SubscriptionUpdateParams.payment_settings.paymentMethodTypes` + * Add support for `subtotal` on `InvoiceLineItem` + * Add support for `authorizationCode`, `description`, `iin`, `installments`, `issuer`, `networkAdviceCode`, `networkDeclineCode`, and `storedCredentialUsage` on `PaymentAttemptRecord.payment_method_details.card` and `PaymentRecord.payment_method_details.card` + * Add support for new value `payto` on enums `PaymentLinkCreateParams.paymentMethodTypes` and `PaymentLinkUpdateParams.paymentMethodTypes` + * Add support for `allowRedisplay` on `PaymentMethodListParams` + * Add support for `reportedBy` on `PaymentRecord` + * Add support for new values `2025-12-15.clover` and `2026-01-28.clover` on enum `WebhookEndpointCreateParams.apiVersion` + * Add support for `changes` on `v2.core.Event` +* [#2124](https://github.com/stripe/stripe-java/pull/2124) Adds the Gson version included at runtime to the X-STRIPE-CLIENT-USER-AGENT header hash +* [#2121](https://github.com/stripe/stripe-java/pull/2121) Adds `Automatic-Module-Name: stripe.java` to the jar's manifest entry + +## 31.1.0-beta.1 - 2025-11-18 +This release changes the pinned API version to `2025-11-17.preview`. + +* [#2103](https://github.com/stripe/stripe-java/pull/2103) Update generated code for beta + * Add support for new resources `v2.core.AccountPersonToken` and `v2.core.AccountToken` + * Remove support for resource `v2.payments.OffSessionPayment` + * Add support for `create` and `retrieve` methods on resources `v2.core.AccountPersonToken` and `v2.core.AccountToken` + * Remove support for `cancel`, `capture`, `create`, `list`, and `retrieve` methods on resource `v2.payments.OffSessionPayment` + * Add support for `specifiedCommercialTransactionsActUrl` on `Account.business_profile`, `AccountCreateParams.business_profile`, and `AccountUpdateParams.business_profile` + * Add support for `paypayPayments` on `Account.settings`, `AccountCreateParams.settings`, and `AccountUpdateParams.settings` + * Change type of `billing.analytics.MeterUsageRetrieveParams.meters[].dimensionFilters` from `string` to `array(string)` + * Change type of `billing.analytics.MeterUsageRetrieveParams.meters[].tenantFilters` from `string` to `array(string)` + * Add support for `carRentalData`, `flightData`, and `lodgingData` on `ChargeCaptureParams.payment_details`, `ChargeUpdateParams.payment_details`, `PaymentIntentCaptureParams.payment_details`, `PaymentIntentConfirmParams.payment_details`, `PaymentIntentCreateParams.payment_details`, and `PaymentIntentUpdateParams.payment_details` + * Add support for `supplementaryPurchaseData` on `OrderCreateParams.payment.settings.payment_method_options.klarna`, `OrderUpdateParams.payment.settings.payment_method_options.klarna`, `PaymentIntentConfirmParams.payment_method_options.klarna`, `PaymentIntentCreateParams.payment_method_options.klarna`, and `PaymentIntentUpdateParams.payment_method_options.klarna` + * Add support for `allowRedisplay` and `customerAccount` on `PaymentMethodListParams` + * Add support for `futureRequirements` on `v2.core.Account` + * Add support for `konbiniPayments` and `scriptStatementDescriptor` on `v2.core.Account.configuration.merchant`, `v2.core.AccountCreateParams.configuration.merchant`, and `v2.core.AccountUpdateParams.configuration.merchant` + * Add support for `eur` on `v2.core.Account.configuration.storer.capabilities.holds_currencies`, `v2.core.AccountCreateParams.configuration.storer.capabilities.holds_currencies`, and `v2.core.AccountUpdateParams.configuration.storer.capabilities.holds_currencies` + * Add support for `requirementsCollector` on `v2.core.Account.defaults.responsibilities` + * Remove support for `collector` on `v2.core.Account.requirements` + * Add support for `changes` on `v2.core.Event` + * Remove support for value `sepa_bank_account` from enum `v2.moneymanagement.FinancialAddressCreateParams.type` + * Add support for `accountToken` on `v2.core.AccountCreateParams` and `v2.core.AccountUpdateParams` + * Add support for new value `ar_cuit` on enums `v2.core.AccountCreateParams.identity.business_details.id_numbers[].type` and `v2.core.AccountUpdateParams.identity.business_details.id_numbers[].type` + * Add support for new value `ar_dni` on enums `v2.core.AccountCreateParams.identity.individual.id_numbers[].type`, `v2.core.AccountPersonCreateParams.id_numbers[].type`, `v2.core.AccountPersonUpdateParams.id_numbers[].type`, and `v2.core.AccountUpdateParams.identity.individual.id_numbers[].type` + * Add support for new value `future_requirements` on enums `v2.core.AccountCreateParams.include`, `v2.core.AccountRetrieveParams.include`, and `v2.core.AccountUpdateParams.include` + * Add support for `personToken` on `v2.core.AccountPersonCreateParams` and `v2.core.AccountPersonUpdateParams` + * Add support for `changes` on `v2.core.Event` + * Add support for thin event `V2CoreHealthEventGenerationFailureResolvedEvent` + * Remove support for thin events `V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent`, `V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent`, `V2PaymentsOffSessionPaymentCanceledEvent`, `V2PaymentsOffSessionPaymentCreatedEvent`, `V2PaymentsOffSessionPaymentFailedEvent`, `V2PaymentsOffSessionPaymentRequiresCaptureEvent`, and `V2PaymentsOffSessionPaymentSucceededEvent` with related object `v2.payments.OffSessionPayment` + ## 31.1.0-alpha.4 - 2025-12-04 * [#2123](https://github.com/stripe/stripe-java/pull/2123) Update generated code for private-preview * Add support for event notifications `V2IamApiKeyCreatedEvent`, `V2IamApiKeyDefaultSecretRevealedEvent`, `V2IamApiKeyExpiredEvent`, `V2IamApiKeyPermissionsUpdatedEvent`, `V2IamApiKeyRotatedEvent`, and `V2IamApiKeyUpdatedEvent` @@ -183,37 +251,6 @@ This release changes the pinned API version to `2025-11-17.preview`. * Add support for new value `2025-11-17.clover` on enum `WebhookEndpointCreateParams.apiVersion` * Add support for snapshot events `financial_connections.account.account_numbers_updated` and `financial_connections.account.upcoming_account_number_expiry` with resource `financialconnections.Account` -## 31.1.0-beta.1 - 2025-11-18 -This release changes the pinned API version to `2025-11-17.preview`. - -* [#2103](https://github.com/stripe/stripe-java/pull/2103) Update generated code for beta - * Add support for new resources `v2.core.AccountPersonToken` and `v2.core.AccountToken` - * Remove support for resource `v2.payments.OffSessionPayment` - * Add support for `create` and `retrieve` methods on resources `v2.core.AccountPersonToken` and `v2.core.AccountToken` - * Remove support for `cancel`, `capture`, `create`, `list`, and `retrieve` methods on resource `v2.payments.OffSessionPayment` - * Add support for `specifiedCommercialTransactionsActUrl` on `Account.business_profile`, `AccountCreateParams.business_profile`, and `AccountUpdateParams.business_profile` - * Add support for `paypayPayments` on `Account.settings`, `AccountCreateParams.settings`, and `AccountUpdateParams.settings` - * Change type of `billing.analytics.MeterUsageRetrieveParams.meters[].dimensionFilters` from `string` to `array(string)` - * Change type of `billing.analytics.MeterUsageRetrieveParams.meters[].tenantFilters` from `string` to `array(string)` - * Add support for `carRentalData`, `flightData`, and `lodgingData` on `ChargeCaptureParams.payment_details`, `ChargeUpdateParams.payment_details`, `PaymentIntentCaptureParams.payment_details`, `PaymentIntentConfirmParams.payment_details`, `PaymentIntentCreateParams.payment_details`, and `PaymentIntentUpdateParams.payment_details` - * Add support for `supplementaryPurchaseData` on `OrderCreateParams.payment.settings.payment_method_options.klarna`, `OrderUpdateParams.payment.settings.payment_method_options.klarna`, `PaymentIntentConfirmParams.payment_method_options.klarna`, `PaymentIntentCreateParams.payment_method_options.klarna`, and `PaymentIntentUpdateParams.payment_method_options.klarna` - * Add support for `allowRedisplay` and `customerAccount` on `PaymentMethodListParams` - * Add support for `futureRequirements` on `v2.core.Account` - * Add support for `konbiniPayments` and `scriptStatementDescriptor` on `v2.core.Account.configuration.merchant`, `v2.core.AccountCreateParams.configuration.merchant`, and `v2.core.AccountUpdateParams.configuration.merchant` - * Add support for `eur` on `v2.core.Account.configuration.storer.capabilities.holds_currencies`, `v2.core.AccountCreateParams.configuration.storer.capabilities.holds_currencies`, and `v2.core.AccountUpdateParams.configuration.storer.capabilities.holds_currencies` - * Add support for `requirementsCollector` on `v2.core.Account.defaults.responsibilities` - * Remove support for `collector` on `v2.core.Account.requirements` - * Add support for `changes` on `v2.core.Event` - * Remove support for value `sepa_bank_account` from enum `v2.moneymanagement.FinancialAddressCreateParams.type` - * Add support for `accountToken` on `v2.core.AccountCreateParams` and `v2.core.AccountUpdateParams` - * Add support for new value `ar_cuit` on enums `v2.core.AccountCreateParams.identity.business_details.id_numbers[].type` and `v2.core.AccountUpdateParams.identity.business_details.id_numbers[].type` - * Add support for new value `ar_dni` on enums `v2.core.AccountCreateParams.identity.individual.id_numbers[].type`, `v2.core.AccountPersonCreateParams.id_numbers[].type`, `v2.core.AccountPersonUpdateParams.id_numbers[].type`, and `v2.core.AccountUpdateParams.identity.individual.id_numbers[].type` - * Add support for new value `future_requirements` on enums `v2.core.AccountCreateParams.include`, `v2.core.AccountRetrieveParams.include`, and `v2.core.AccountUpdateParams.include` - * Add support for `personToken` on `v2.core.AccountPersonCreateParams` and `v2.core.AccountPersonUpdateParams` - * Add support for `changes` on `v2.core.Event` - * Add support for thin event `V2CoreHealthEventGenerationFailureResolvedEvent` - * Remove support for thin events `V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent`, `V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent`, `V2PaymentsOffSessionPaymentCanceledEvent`, `V2PaymentsOffSessionPaymentCreatedEvent`, `V2PaymentsOffSessionPaymentFailedEvent`, `V2PaymentsOffSessionPaymentRequiresCaptureEvent`, and `V2PaymentsOffSessionPaymentSucceededEvent` with related object `v2.payments.OffSessionPayment` - ## 31.0.0 - 2025-11-18 This release changes the pinned API version to `2025-11-17.clover`. diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION new file mode 100644 index 00000000000..93be1cef53b --- /dev/null +++ b/CODEGEN_VERSION @@ -0,0 +1 @@ +88aa59022b32620f4d66d6196e3b42d5a0f86bbb \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 4e4ca8e5b78..1bfc0268bdf 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2141 \ No newline at end of file +v2150 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index 61c1a6c2400..28c12348ab1 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -234,6 +234,7 @@ public 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.form", com.stripe.model.tax.Form.class); + classLookup.put("tax.location", com.stripe.model.tax.Location.class); classLookup.put("tax.registration", com.stripe.model.tax.Registration.class); classLookup.put("tax.settings", com.stripe.model.tax.Settings.class); classLookup.put("tax.transaction", com.stripe.model.tax.Transaction.class); diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index fab1459ab0a..e2a960ab0c9 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -2382,6 +2382,31 @@ public static class ScheduleDetails extends StripeObject { /** The schedule that generated this invoice. */ @SerializedName("schedule") String schedule; + + /** The subscription associated with this schedule. */ + @SerializedName("subscription") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField subscription; + + /** Get ID of expandable {@code subscription} object. */ + public String getSubscription() { + return (this.subscription != null) ? this.subscription.getId() : null; + } + + public void setSubscription(String id) { + this.subscription = ApiResource.setExpandableFieldId(id, this.subscription); + } + + /** Get expanded {@code subscription}. */ + public Subscription getSubscriptionObject() { + return (this.subscription != null) ? this.subscription.getExpanded() : null; + } + + public void setSubscriptionObject(Subscription expandableObject) { + this.subscription = + new ExpandableField(expandableObject.getId(), expandableObject); + } } /** diff --git a/src/main/java/com/stripe/model/Plan.java b/src/main/java/com/stripe/model/Plan.java index 99a23a59c21..cfb08fb1354 100644 --- a/src/main/java/com/stripe/model/Plan.java +++ b/src/main/java/com/stripe/model/Plan.java @@ -89,6 +89,13 @@ public class Plan extends ApiResource implements HasId, MetadataStore { @SerializedName("deleted") Boolean deleted; + /** + * A custom identifier for this price, such as a SKU number or product code, that can be used to + * reference records from external systems. + */ + @SerializedName("external_reference") + String externalReference; + /** Unique identifier for the object. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") diff --git a/src/main/java/com/stripe/model/Price.java b/src/main/java/com/stripe/model/Price.java index 3441e837841..0bdd27cffe6 100644 --- a/src/main/java/com/stripe/model/Price.java +++ b/src/main/java/com/stripe/model/Price.java @@ -89,6 +89,13 @@ public class Price extends ApiResource implements HasId, MetadataStore { @SerializedName("deleted") Boolean deleted; + /** + * A custom identifier for this price, such as a SKU number or product code, that can be used to + * reference records from external systems. + */ + @SerializedName("external_reference") + String externalReference; + /** Unique identifier for the object. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") diff --git a/src/main/java/com/stripe/model/Quote.java b/src/main/java/com/stripe/model/Quote.java index 2ced9d071e7..6223626b206 100644 --- a/src/main/java/com/stripe/model/Quote.java +++ b/src/main/java/com/stripe/model/Quote.java @@ -2027,14 +2027,10 @@ public static class SubscriptionData extends StripeObject { Map metadata; /** - * Configures how the quote handles billing for line transitions. Possible values are {@code - * line_start} (default) or {@code billing_period_start}. {@code line_start} bills based on the - * current state of the line, ignoring changes scheduled for future lines. {@code - * billing_period_start} bills predictively for upcoming line transitions within the current - * billing cycle, including pricing changes and service period adjustments that will occur - * before the next invoice. + * Configures how the subscription schedule handles billing for phase transitions when the quote + * is accepted. * - *

One of {@code billing_period_start}, or {@code line_start}. + *

One of {@code billing_period_start}, or {@code phase_start}. */ @SerializedName("phase_effective_at") String phaseEffectiveAt; @@ -2494,14 +2490,10 @@ public static class SubscriptionDataOverride extends StripeObject { String endBehavior; /** - * Configures how the quote handles billing for line transitions. Possible values are {@code - * line_start} (default) or {@code billing_period_start}. {@code line_start} bills based on the - * current state of the line, ignoring changes scheduled for future lines. {@code - * billing_period_start} bills predictively for upcoming line transitions within the current - * billing cycle, including pricing changes and service period adjustments that will occur - * before the next invoice. + * Configures how the subscription schedule handles billing for phase transitions when the quote + * is accepted. * - *

One of {@code billing_period_start}, or {@code line_start}. + *

One of {@code billing_period_start}, or {@code phase_start}. */ @SerializedName("phase_effective_at") String phaseEffectiveAt; diff --git a/src/main/java/com/stripe/model/QuoteLine.java b/src/main/java/com/stripe/model/QuoteLine.java index db539204a3e..c33dc407693 100644 --- a/src/main/java/com/stripe/model/QuoteLine.java +++ b/src/main/java/com/stripe/model/QuoteLine.java @@ -48,12 +48,7 @@ public class QuoteLine extends StripeObject implements HasId { CancelSubscriptionSchedule cancelSubscriptionSchedule; /** - * Configures how the subscription schedule handles billing for phase transitions. Possible values - * are {@code phase_start} (default) or {@code billing_period_start}. {@code phase_start} bills - * based on the current state of the subscription, ignoring changes scheduled in future phases. - * {@code billing_period_start} bills predictively for upcoming phase transitions within the - * current billing cycle, including pricing changes and service period adjustments that will occur - * before the next invoice. + * Configures how the subscription schedule handles billing for phase transitions. * *

One of {@code billing_period_start}, or {@code line_start}. */ diff --git a/src/main/java/com/stripe/model/QuotePreviewInvoice.java b/src/main/java/com/stripe/model/QuotePreviewInvoice.java index 3089f04e337..b07a4ef3f62 100644 --- a/src/main/java/com/stripe/model/QuotePreviewInvoice.java +++ b/src/main/java/com/stripe/model/QuotePreviewInvoice.java @@ -1250,6 +1250,31 @@ public static class ScheduleDetails extends StripeObject { /** The schedule that generated this invoice. */ @SerializedName("schedule") String schedule; + + /** The subscription associated with this schedule. */ + @SerializedName("subscription") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField subscription; + + /** Get ID of expandable {@code subscription} object. */ + public String getSubscription() { + return (this.subscription != null) ? this.subscription.getId() : null; + } + + public void setSubscription(String id) { + this.subscription = ApiResource.setExpandableFieldId(id, this.subscription); + } + + /** Get expanded {@code subscription}. */ + public Subscription getSubscriptionObject() { + return (this.subscription != null) ? this.subscription.getExpanded() : null; + } + + public void setSubscriptionObject(Subscription expandableObject) { + this.subscription = + new ExpandableField(expandableObject.getId(), expandableObject); + } } /** diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index 8ff6648628c..3f72ba63f1e 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -15,6 +15,7 @@ import com.stripe.param.SubscriptionCreateParams; import com.stripe.param.SubscriptionListParams; import com.stripe.param.SubscriptionMigrateParams; +import com.stripe.param.SubscriptionPauseParams; import com.stripe.param.SubscriptionResumeParams; import com.stripe.param.SubscriptionRetrieveParams; import com.stripe.param.SubscriptionSearchParams; @@ -967,6 +968,58 @@ public Subscription migrate(SubscriptionMigrateParams params, RequestOptions opt return getResponseGetter().request(request, Subscription.class); } + /** + * Pauses a subscription by transitioning it to the paused status. A paused subscription does not + * generate invoices and will not advance to new billing periods. The subscription can be resumed + * later using the resume endpoint. Cannot pause subscriptions with attached schedules. + */ + public Subscription pause(Map params) throws StripeException { + return pause(params, (RequestOptions) null); + } + + /** + * Pauses a subscription by transitioning it to the paused status. A paused subscription does not + * generate invoices and will not advance to new billing periods. The subscription can be resumed + * later using the resume endpoint. Cannot pause subscriptions with attached schedules. + */ + public Subscription pause(Map params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/subscriptions/%s/pause", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, Subscription.class); + } + + /** + * Pauses a subscription by transitioning it to the paused status. A paused subscription does not + * generate invoices and will not advance to new billing periods. The subscription can be resumed + * later using the resume endpoint. Cannot pause subscriptions with attached schedules. + */ + public Subscription pause(SubscriptionPauseParams params) throws StripeException { + return pause(params, (RequestOptions) null); + } + + /** + * Pauses a subscription by transitioning it to the paused status. A paused subscription does not + * generate invoices and will not advance to new billing periods. The subscription can be resumed + * later using the resume endpoint. Cannot pause subscriptions with attached schedules. + */ + public Subscription pause(SubscriptionPauseParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/subscriptions/%s/pause", ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, Subscription.class); + } + /** * Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor * and creating prorations. If a resumption invoice is generated, it must be paid or marked diff --git a/src/main/java/com/stripe/model/TaxCode.java b/src/main/java/com/stripe/model/TaxCode.java index 0d2f8b945f6..8bd65c97281 100644 --- a/src/main/java/com/stripe/model/TaxCode.java +++ b/src/main/java/com/stripe/model/TaxCode.java @@ -8,6 +8,7 @@ import com.stripe.net.ApiResource; import com.stripe.net.BaseAddress; import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; import com.stripe.param.TaxCodeListParams; import com.stripe.param.TaxCodeRetrieveParams; import java.util.Map; @@ -44,6 +45,14 @@ public class TaxCode extends ApiResource implements HasId { @SerializedName("object") String object; + /** + * An object that describes more information about the tax location required for this tax code. + * Some tax + * codes require a tax location of type {@code performance} to calculate tax correctly. + */ + @SerializedName("requirements") + Requirements requirements; + /** * A list of all tax codes available to * add to Products in order to allow specific tax calculations. @@ -135,4 +144,28 @@ public static TaxCode retrieve(String id, TaxCodeRetrieveParams params, RequestO options); return getGlobalResponseGetter().request(request, TaxCode.class); } + + /** + * For more details about Requirements, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Requirements extends StripeObject { + /** + * Describes whether a performance location is required for a successful tax calculation with a + * tax code. + * + *

One of {@code optional}, or {@code required}. + */ + @SerializedName("performance_location") + String performanceLocation; + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(requirements, responseGetter); + } } diff --git a/src/main/java/com/stripe/model/sharedpayment/GrantedToken.java b/src/main/java/com/stripe/model/sharedpayment/GrantedToken.java index 1f1033048b3..08539392a4b 100644 --- a/src/main/java/com/stripe/model/sharedpayment/GrantedToken.java +++ b/src/main/java/com/stripe/model/sharedpayment/GrantedToken.java @@ -13,7 +13,7 @@ import com.stripe.net.StripeResponseGetter; import com.stripe.param.sharedpayment.GrantedTokenCreateParams; import com.stripe.param.sharedpayment.GrantedTokenRetrieveParams; -import com.stripe.param.sharedpayment.GrantedTokenUpdateParams; +import com.stripe.param.sharedpayment.GrantedTokenRevokeParams; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -237,15 +237,31 @@ public static GrantedToken create(GrantedTokenCreateParams params, RequestOption * Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode * and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration */ - public GrantedToken update(Map params) throws StripeException { - return update(params, (RequestOptions) null); + public GrantedToken revoke() throws StripeException { + return revoke((Map) null, (RequestOptions) null); } /** * Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode * and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration */ - public GrantedToken update(Map params, RequestOptions options) + public GrantedToken revoke(RequestOptions options) throws StripeException { + return revoke((Map) null, options); + } + + /** + * Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode + * and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration + */ + public GrantedToken revoke(Map params) throws StripeException { + return revoke(params, (RequestOptions) null); + } + + /** + * Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode + * and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration + */ + public GrantedToken revoke(Map params, RequestOptions options) throws StripeException { String path = String.format( @@ -260,15 +276,15 @@ public GrantedToken update(Map params, RequestOptions options) * Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode * and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration */ - public GrantedToken update(GrantedTokenUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + public GrantedToken revoke(GrantedTokenRevokeParams params) throws StripeException { + return revoke(params, (RequestOptions) null); } /** * Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode * and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration */ - public GrantedToken update(GrantedTokenUpdateParams params, RequestOptions options) + public GrantedToken revoke(GrantedTokenRevokeParams params, RequestOptions options) throws StripeException { String path = String.format( diff --git a/src/main/java/com/stripe/model/tax/Calculation.java b/src/main/java/com/stripe/model/tax/Calculation.java index 4f2a4219eb2..bcf98d9be3b 100644 --- a/src/main/java/com/stripe/model/tax/Calculation.java +++ b/src/main/java/com/stripe/model/tax/Calculation.java @@ -472,7 +472,7 @@ public static class TaxBreakdown extends StripeObject { * Indicates whether the jurisdiction was determined by the origin (merchant's address) or * destination (customer's address). * - *

One of {@code destination}, or {@code origin}. + *

One of {@code destination}, {@code origin}, or {@code performance}. */ @SerializedName("sourcing") String sourcing; @@ -565,10 +565,12 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, - * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code - * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code - * vat}. + *

One of {@code admissions_tax}, {@code amusement_tax}, {@code attendance_tax}, {@code + * communications_tax}, {@code entertainment_tax}, {@code gross_receipts_tax}, {@code gst}, + * {@code hospitality_tax}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, + * {@code luxury_tax}, {@code pst}, {@code qst}, {@code resort_tax}, {@code + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, {@code + * tourism_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; @@ -666,9 +668,11 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, - * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code - * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code vat}. + *

One of {@code admissions_tax}, {@code amusement_tax}, {@code attendance_tax}, {@code + * communications_tax}, {@code entertainment_tax}, {@code gross_receipts_tax}, {@code gst}, + * {@code hospitality_tax}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code + * luxury_tax}, {@code pst}, {@code qst}, {@code resort_tax}, {@code retail_delivery_fee}, + * {@code rst}, {@code sales_tax}, {@code service_tax}, {@code tourism_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/CalculationLineItem.java b/src/main/java/com/stripe/model/tax/CalculationLineItem.java index fc64b94fa46..e61fee72e71 100644 --- a/src/main/java/com/stripe/model/tax/CalculationLineItem.java +++ b/src/main/java/com/stripe/model/tax/CalculationLineItem.java @@ -57,6 +57,17 @@ public class CalculationLineItem extends StripeObject implements HasId { @SerializedName("object") String object; + /** + * A tax location for a line item that acts as a performance location. This indicates that the + * line item might be taxed at the place where it is being performed at. This is helpful for + * events or other services being performed at non-customer addresses like venues or offices. This + * can be left empty for tax codes that do not require a tax location. For tax codes where the + * location requirement is "optional", this would override the customer address in most + * use cases. + */ + @SerializedName("performance_location") + String performanceLocation; + /** The ID of an existing Product. */ @SerializedName("product") String product; @@ -113,7 +124,7 @@ public static class TaxBreakdown extends StripeObject { * Indicates whether the jurisdiction was determined by the origin (merchant's address) or * destination (customer's address). * - *

One of {@code destination}, or {@code origin}. + *

One of {@code destination}, {@code origin}, or {@code performance}. */ @SerializedName("sourcing") String sourcing; @@ -206,9 +217,11 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, - * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code - * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code vat}. + *

One of {@code admissions_tax}, {@code amusement_tax}, {@code attendance_tax}, {@code + * communications_tax}, {@code entertainment_tax}, {@code gross_receipts_tax}, {@code gst}, + * {@code hospitality_tax}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code + * luxury_tax}, {@code pst}, {@code qst}, {@code resort_tax}, {@code retail_delivery_fee}, + * {@code rst}, {@code sales_tax}, {@code service_tax}, {@code tourism_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/Location.java b/src/main/java/com/stripe/model/tax/Location.java new file mode 100644 index 00000000000..e303834a2c9 --- /dev/null +++ b/src/main/java/com/stripe/model/tax/Location.java @@ -0,0 +1,240 @@ +// File generated from our OpenAPI spec +package com.stripe.model.tax; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.Address; +import com.stripe.model.HasId; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.tax.LocationCreateParams; +import com.stripe.param.tax.LocationListParams; +import com.stripe.param.tax.LocationRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** Tax locations represent venues for services, tickets, or other product types. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Location extends ApiResource implements HasId { + @SerializedName("address") + Address address; + + /** + * A descriptive text providing additional context about the tax location. This can include + * information about the venue, types of events held, services available, or any relevant details + * for better identification (e.g., "A spacious auditorium suitable for large concerts and + * events."). + */ + @SerializedName("description") + String description; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code tax.location}. + */ + @SerializedName("object") + String object; + + /** + * The type of tax location to be defined. Currently the only option is {@code performance}. + * + *

Equal to {@code performance}. + */ + @SerializedName("type") + String type; + + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public static Location create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public static Location create(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getGlobalResponseGetter().request(request, Location.class); + } + + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public static Location create(LocationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public static Location create(LocationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, Location.class); + } + + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public static LocationCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public static LocationCollection list(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, LocationCollection.class); + } + + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public static LocationCollection list(LocationListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public static LocationCollection list(LocationListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, LocationCollection.class); + } + + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public static Location retrieve(String location) throws StripeException { + return retrieve(location, (Map) null, (RequestOptions) null); + } + + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public static Location retrieve(String location, RequestOptions options) throws StripeException { + return retrieve(location, (Map) null, options); + } + + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public static Location retrieve( + String location, Map params, RequestOptions options) throws StripeException { + String path = String.format("/v1/tax/locations/%s", ApiResource.urlEncodeId(location)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, Location.class); + } + + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public static Location retrieve( + String location, LocationRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/tax/locations/%s", ApiResource.urlEncodeId(location)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, Location.class); + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(address, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/tax/LocationCollection.java b/src/main/java/com/stripe/model/tax/LocationCollection.java new file mode 100644 index 00000000000..ae8112a39fb --- /dev/null +++ b/src/main/java/com/stripe/model/tax/LocationCollection.java @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec +package com.stripe.model.tax; + +import com.stripe.model.StripeCollection; + +public class LocationCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/tax/Registration.java b/src/main/java/com/stripe/model/tax/Registration.java index 79c3c4fcfd2..46da67d03ff 100644 --- a/src/main/java/com/stripe/model/tax/Registration.java +++ b/src/main/java/com/stripe/model/tax/Registration.java @@ -2863,12 +2863,33 @@ public static class Ug extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Us extends StripeObject { + @SerializedName("admissions_tax") + AdmissionsTax admissionsTax; + + @SerializedName("attendance_tax") + AttendanceTax attendanceTax; + + @SerializedName("entertainment_tax") + EntertainmentTax entertainmentTax; + + @SerializedName("gross_receipts_tax") + GrossReceiptsTax grossReceiptsTax; + + @SerializedName("hospitality_tax") + HospitalityTax hospitalityTax; + @SerializedName("local_amusement_tax") LocalAmusementTax localAmusementTax; @SerializedName("local_lease_tax") LocalLeaseTax localLeaseTax; + @SerializedName("luxury_tax") + LuxuryTax luxuryTax; + + @SerializedName("resort_tax") + ResortTax resortTax; + /** * Two-letter US state code (ISO * 3166-2). @@ -2879,15 +2900,105 @@ public static class Us extends StripeObject { @SerializedName("state_sales_tax") StateSalesTax stateSalesTax; + @SerializedName("tourism_tax") + TourismTax tourismTax; + /** * Type of registration in the US. * - *

One of {@code local_amusement_tax}, {@code local_lease_tax}, {@code - * state_communications_tax}, {@code state_retail_delivery_fee}, or {@code state_sales_tax}. + *

One of {@code admissions_tax}, {@code attendance_tax}, {@code entertainment_tax}, {@code + * gross_receipts_tax}, {@code hospitality_tax}, {@code local_amusement_tax}, {@code + * local_lease_tax}, {@code luxury_tax}, {@code resort_tax}, {@code state_communications_tax}, + * {@code state_retail_delivery_fee}, {@code state_sales_tax}, or {@code tourism_tax}. */ @SerializedName("type") String type; + /** + * For more details about AdmissionsTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AdmissionsTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + + /** + * For more details about AttendanceTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AttendanceTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + + /** + * For more details about EntertainmentTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EntertainmentTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + + /** + * For more details about GrossReceiptsTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class GrossReceiptsTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + + /** + * For more details about HospitalityTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class HospitalityTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + /** * For more details about LocalAmusementTax, please refer to the API Reference. @@ -2920,6 +3031,40 @@ public static class LocalLeaseTax extends StripeObject { String jurisdiction; } + /** + * For more details about LuxuryTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LuxuryTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + + /** + * For more details about ResortTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ResortTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + /** * For more details about StateSalesTax, please refer to the API Reference. @@ -2957,6 +3102,23 @@ public static class Election extends StripeObject { String type; } } + + /** + * For more details about TourismTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class TourismTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } } /** diff --git a/src/main/java/com/stripe/model/tax/Transaction.java b/src/main/java/com/stripe/model/tax/Transaction.java index adb88509e17..99f048a1a82 100644 --- a/src/main/java/com/stripe/model/tax/Transaction.java +++ b/src/main/java/com/stripe/model/tax/Transaction.java @@ -533,7 +533,7 @@ public static class TaxBreakdown extends StripeObject { * Indicates whether the jurisdiction was determined by the origin (merchant's address) or * destination (customer's address). * - *

One of {@code destination}, or {@code origin}. + *

One of {@code destination}, {@code origin}, or {@code performance}. */ @SerializedName("sourcing") String sourcing; @@ -626,10 +626,12 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, - * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code - * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code - * vat}. + *

One of {@code admissions_tax}, {@code amusement_tax}, {@code attendance_tax}, {@code + * communications_tax}, {@code entertainment_tax}, {@code gross_receipts_tax}, {@code gst}, + * {@code hospitality_tax}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, + * {@code luxury_tax}, {@code pst}, {@code qst}, {@code resort_tax}, {@code + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, {@code + * tourism_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/param/InvoiceAddLinesParams.java b/src/main/java/com/stripe/param/InvoiceAddLinesParams.java index 10de188bab8..3098d036291 100644 --- a/src/main/java/com/stripe/param/InvoiceAddLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceAddLinesParams.java @@ -1649,6 +1649,14 @@ public static class TaxDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + /** * Required. A tax * code ID. @@ -1656,8 +1664,10 @@ public static class TaxDetails { @SerializedName("tax_code") String taxCode; - private TaxDetails(Map extraParams, String taxCode) { + private TaxDetails( + Map extraParams, String performanceLocation, String taxCode) { this.extraParams = extraParams; + this.performanceLocation = performanceLocation; this.taxCode = taxCode; } @@ -1668,12 +1678,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private String performanceLocation; + private String taxCode; /** Finalize and obtain parameter instance from this builder. */ public InvoiceAddLinesParams.Line.PriceData.ProductData.TaxDetails build() { return new InvoiceAddLinesParams.Line.PriceData.ProductData.TaxDetails( - this.extraParams, this.taxCode); + this.extraParams, this.performanceLocation, this.taxCode); } /** @@ -1706,6 +1718,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + /** * Required. A tax * code ID. diff --git a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java index 19b0f9dc27b..8b16f4d7a96 100644 --- a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java @@ -3901,14 +3901,7 @@ public static class Amendment { @SerializedName("discount_actions") List discountActions; - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code - * phase_start} bills based on the current state of the subscription, ignoring changes - * scheduled in future phases. {@code billing_period_start} bills predictively for upcoming - * phase transitions within the current billing cycle, including pricing changes and service - * period adjustments that will occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -4137,14 +4130,7 @@ public Builder addAllDiscountAction( return this; } - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code - * phase_start} bills based on the current state of the subscription, ignoring changes - * scheduled in future phases. {@code billing_period_start} bills predictively for upcoming - * phase transitions within the current billing cycle, including pricing changes and service - * period adjustments that will occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ public Builder setEffectiveAt( InvoiceCreatePreviewParams.ScheduleDetails.Amendment.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; @@ -9105,14 +9091,7 @@ public static class Phase { @SerializedName("duration") Duration duration; - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code - * phase_start} bills based on the current state of the subscription, ignoring changes - * scheduled in future phases. {@code billing_period_start} bills predictively for upcoming - * phase transitions within the current billing cycle, including pricing changes and service - * period adjustments that will occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -9623,14 +9602,7 @@ public Builder setDuration( return this; } - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code - * phase_start} bills based on the current state of the subscription, ignoring changes - * scheduled in future phases. {@code billing_period_start} bills predictively for upcoming - * phase transitions within the current billing cycle, including pricing changes and service - * period adjustments that will occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ public Builder setEffectiveAt( InvoiceCreatePreviewParams.ScheduleDetails.Phase.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; diff --git a/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java b/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java index cffc4d9f7f7..09bd27569f1 100644 --- a/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java @@ -1561,6 +1561,14 @@ public static class TaxDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + Object performanceLocation; + /** * Required. A tax * code ID. @@ -1568,8 +1576,10 @@ public static class TaxDetails { @SerializedName("tax_code") Object taxCode; - private TaxDetails(Map extraParams, Object taxCode) { + private TaxDetails( + Map extraParams, Object performanceLocation, Object taxCode) { this.extraParams = extraParams; + this.performanceLocation = performanceLocation; this.taxCode = taxCode; } @@ -1580,12 +1590,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Object performanceLocation; + private Object taxCode; /** Finalize and obtain parameter instance from this builder. */ public InvoiceLineItemUpdateParams.PriceData.ProductData.TaxDetails build() { return new InvoiceLineItemUpdateParams.PriceData.ProductData.TaxDetails( - this.extraParams, this.taxCode); + this.extraParams, this.performanceLocation, this.taxCode); } /** @@ -1618,6 +1630,26 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(EmptyParam performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + /** * Required. A tax * code ID. diff --git a/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java b/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java index 152754a31ae..ed641c984e7 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java @@ -1676,6 +1676,14 @@ public static class TaxDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + /** * Required. A tax * code ID. @@ -1683,8 +1691,10 @@ public static class TaxDetails { @SerializedName("tax_code") String taxCode; - private TaxDetails(Map extraParams, String taxCode) { + private TaxDetails( + Map extraParams, String performanceLocation, String taxCode) { this.extraParams = extraParams; + this.performanceLocation = performanceLocation; this.taxCode = taxCode; } @@ -1695,12 +1705,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private String performanceLocation; + private String taxCode; /** Finalize and obtain parameter instance from this builder. */ public InvoiceUpdateLinesParams.Line.PriceData.ProductData.TaxDetails build() { return new InvoiceUpdateLinesParams.Line.PriceData.ProductData.TaxDetails( - this.extraParams, this.taxCode); + this.extraParams, this.performanceLocation, this.taxCode); } /** @@ -1733,6 +1745,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + /** * Required. A tax * code ID. diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 383332536f1..901ce176588 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -3173,9 +3173,9 @@ public static class Benefit { /** French meal voucher benefit details for this PaymentIntent. */ @SerializedName("fr_meal_voucher") - FrMealVoucher frMealVoucher; + Object frMealVoucher; - private Benefit(Map extraParams, FrMealVoucher frMealVoucher) { + private Benefit(Map extraParams, Object frMealVoucher) { this.extraParams = extraParams; this.frMealVoucher = frMealVoucher; } @@ -3187,7 +3187,7 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private FrMealVoucher frMealVoucher; + private Object frMealVoucher; /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentConfirmParams.PaymentDetails.Benefit build() { @@ -3229,6 +3229,12 @@ public Builder setFrMealVoucher( this.frMealVoucher = frMealVoucher; return this; } + + /** French meal voucher benefit details for this PaymentIntent. */ + public Builder setFrMealVoucher(EmptyParam frMealVoucher) { + this.frMealVoucher = frMealVoucher; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index f42ed094cb4..41aa777caed 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -3711,9 +3711,9 @@ public static class Benefit { /** French meal voucher benefit details for this PaymentIntent. */ @SerializedName("fr_meal_voucher") - FrMealVoucher frMealVoucher; + Object frMealVoucher; - private Benefit(Map extraParams, FrMealVoucher frMealVoucher) { + private Benefit(Map extraParams, Object frMealVoucher) { this.extraParams = extraParams; this.frMealVoucher = frMealVoucher; } @@ -3725,7 +3725,7 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private FrMealVoucher frMealVoucher; + private Object frMealVoucher; /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCreateParams.PaymentDetails.Benefit build() { @@ -3767,6 +3767,12 @@ public Builder setFrMealVoucher( this.frMealVoucher = frMealVoucher; return this; } + + /** French meal voucher benefit details for this PaymentIntent. */ + public Builder setFrMealVoucher(EmptyParam frMealVoucher) { + this.frMealVoucher = frMealVoucher; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 0df0c2f5353..407e4ce52ad 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -3421,9 +3421,9 @@ public static class Benefit { /** French meal voucher benefit details for this PaymentIntent. */ @SerializedName("fr_meal_voucher") - FrMealVoucher frMealVoucher; + Object frMealVoucher; - private Benefit(Map extraParams, FrMealVoucher frMealVoucher) { + private Benefit(Map extraParams, Object frMealVoucher) { this.extraParams = extraParams; this.frMealVoucher = frMealVoucher; } @@ -3435,7 +3435,7 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private FrMealVoucher frMealVoucher; + private Object frMealVoucher; /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentUpdateParams.PaymentDetails.Benefit build() { @@ -3477,6 +3477,12 @@ public Builder setFrMealVoucher( this.frMealVoucher = frMealVoucher; return this; } + + /** French meal voucher benefit details for this PaymentIntent. */ + public Builder setFrMealVoucher(EmptyParam frMealVoucher) { + this.frMealVoucher = frMealVoucher; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 0e4efdf3443..1ab1bf683cb 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -4147,6 +4147,14 @@ public static class TaxDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + /** * Required. A tax * code ID. @@ -4154,8 +4162,10 @@ public static class TaxDetails { @SerializedName("tax_code") String taxCode; - private TaxDetails(Map extraParams, String taxCode) { + private TaxDetails( + Map extraParams, String performanceLocation, String taxCode) { this.extraParams = extraParams; + this.performanceLocation = performanceLocation; this.taxCode = taxCode; } @@ -4166,12 +4176,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private String performanceLocation; + private String taxCode; /** Finalize and obtain parameter instance from this builder. */ public PaymentLinkCreateParams.LineItem.PriceData.ProductData.TaxDetails build() { return new PaymentLinkCreateParams.LineItem.PriceData.ProductData.TaxDetails( - this.extraParams, this.taxCode); + this.extraParams, this.performanceLocation, this.taxCode); } /** @@ -4204,6 +4216,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + /** * Required. A tax * code ID. diff --git a/src/main/java/com/stripe/param/PlanCreateParams.java b/src/main/java/com/stripe/param/PlanCreateParams.java index 874c7c03d7b..2084b657094 100644 --- a/src/main/java/com/stripe/param/PlanCreateParams.java +++ b/src/main/java/com/stripe/param/PlanCreateParams.java @@ -574,6 +574,13 @@ public static class Product { @SerializedName("tax_code") String taxCode; + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + @SerializedName("tax_details") + TaxDetails taxDetails; + /** * A label that represents units of this product. When set, this will be included in customers' * receipts, invoices, Checkout, and the customer portal. @@ -589,6 +596,7 @@ private Product( String name, String statementDescriptor, String taxCode, + TaxDetails taxDetails, String unitLabel) { this.active = active; this.extraParams = extraParams; @@ -597,6 +605,7 @@ private Product( this.name = name; this.statementDescriptor = statementDescriptor; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.unitLabel = unitLabel; } @@ -619,6 +628,8 @@ public static class Builder { private String taxCode; + private TaxDetails taxDetails; + private String unitLabel; /** Finalize and obtain parameter instance from this builder. */ @@ -631,6 +642,7 @@ public PlanCreateParams.Product build() { this.name, this.statementDescriptor, this.taxCode, + this.taxDetails, this.unitLabel); } @@ -727,6 +739,15 @@ public Builder setTaxCode(String taxCode) { return this; } + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + public Builder setTaxDetails(PlanCreateParams.Product.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -736,6 +757,106 @@ public Builder setUnitLabel(String unitLabel) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + + /** + * Required. A tax + * code ID. + */ + @SerializedName("tax_code") + String taxCode; + + private TaxDetails( + Map extraParams, String performanceLocation, String taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String performanceLocation; + + private String taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public PlanCreateParams.Product.TaxDetails build() { + return new PlanCreateParams.Product.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * 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 PlanCreateParams.Product.TaxDetails#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 PlanCreateParams.Product.TaxDetails#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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** + * Required. A tax + * code ID. + */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/PriceCreateParams.java b/src/main/java/com/stripe/param/PriceCreateParams.java index 3748c9890a8..0c99c8b8b88 100644 --- a/src/main/java/com/stripe/param/PriceCreateParams.java +++ b/src/main/java/com/stripe/param/PriceCreateParams.java @@ -1232,6 +1232,13 @@ public static class ProductData { @SerializedName("tax_code") String taxCode; + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + @SerializedName("tax_details") + TaxDetails taxDetails; + /** * A label that represents units of this product. When set, this will be included in customers' * receipts, invoices, Checkout, and the customer portal. @@ -1247,6 +1254,7 @@ private ProductData( String name, String statementDescriptor, String taxCode, + TaxDetails taxDetails, String unitLabel) { this.active = active; this.extraParams = extraParams; @@ -1255,6 +1263,7 @@ private ProductData( this.name = name; this.statementDescriptor = statementDescriptor; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.unitLabel = unitLabel; } @@ -1277,6 +1286,8 @@ public static class Builder { private String taxCode; + private TaxDetails taxDetails; + private String unitLabel; /** Finalize and obtain parameter instance from this builder. */ @@ -1289,6 +1300,7 @@ public PriceCreateParams.ProductData build() { this.name, this.statementDescriptor, this.taxCode, + this.taxDetails, this.unitLabel); } @@ -1385,6 +1397,15 @@ public Builder setTaxCode(String taxCode) { return this; } + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + public Builder setTaxDetails(PriceCreateParams.ProductData.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -1394,6 +1415,106 @@ public Builder setUnitLabel(String unitLabel) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + + /** + * Required. A tax + * code ID. + */ + @SerializedName("tax_code") + String taxCode; + + private TaxDetails( + Map extraParams, String performanceLocation, String taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String performanceLocation; + + private String taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public PriceCreateParams.ProductData.TaxDetails build() { + return new PriceCreateParams.ProductData.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * 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 PriceCreateParams.ProductData.TaxDetails#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 PriceCreateParams.ProductData.TaxDetails#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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** + * Required. A tax + * code ID. + */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/ProductCreateParams.java b/src/main/java/com/stripe/param/ProductCreateParams.java index c2606bbeffb..ef38d768adb 100644 --- a/src/main/java/com/stripe/param/ProductCreateParams.java +++ b/src/main/java/com/stripe/param/ProductCreateParams.java @@ -1744,6 +1744,14 @@ public static class TaxDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + /** * Required. A tax * code ID. @@ -1751,8 +1759,10 @@ public static class TaxDetails { @SerializedName("tax_code") String taxCode; - private TaxDetails(Map extraParams, String taxCode) { + private TaxDetails( + Map extraParams, String performanceLocation, String taxCode) { this.extraParams = extraParams; + this.performanceLocation = performanceLocation; this.taxCode = taxCode; } @@ -1763,11 +1773,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private String performanceLocation; + private String taxCode; /** Finalize and obtain parameter instance from this builder. */ public ProductCreateParams.TaxDetails build() { - return new ProductCreateParams.TaxDetails(this.extraParams, this.taxCode); + return new ProductCreateParams.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); } /** @@ -1796,6 +1809,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + /** * Required. A tax * code ID. diff --git a/src/main/java/com/stripe/param/ProductUpdateParams.java b/src/main/java/com/stripe/param/ProductUpdateParams.java index 6dbc4dfb4d1..9d03daa1743 100644 --- a/src/main/java/com/stripe/param/ProductUpdateParams.java +++ b/src/main/java/com/stripe/param/ProductUpdateParams.java @@ -770,6 +770,14 @@ public static class TaxDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + Object performanceLocation; + /** * Required. A tax * code ID. @@ -777,8 +785,10 @@ public static class TaxDetails { @SerializedName("tax_code") Object taxCode; - private TaxDetails(Map extraParams, Object taxCode) { + private TaxDetails( + Map extraParams, Object performanceLocation, Object taxCode) { this.extraParams = extraParams; + this.performanceLocation = performanceLocation; this.taxCode = taxCode; } @@ -789,11 +799,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Object performanceLocation; + private Object taxCode; /** Finalize and obtain parameter instance from this builder. */ public ProductUpdateParams.TaxDetails build() { - return new ProductUpdateParams.TaxDetails(this.extraParams, this.taxCode); + return new ProductUpdateParams.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); } /** @@ -822,6 +835,26 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(EmptyParam performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + /** * Required. A tax * code ID. diff --git a/src/main/java/com/stripe/param/QuoteCreateParams.java b/src/main/java/com/stripe/param/QuoteCreateParams.java index a7a7d27a578..493d91ed975 100644 --- a/src/main/java/com/stripe/param/QuoteCreateParams.java +++ b/src/main/java/com/stripe/param/QuoteCreateParams.java @@ -1640,14 +1640,7 @@ public static class Line { @SerializedName("cancel_subscription_schedule") CancelSubscriptionSchedule cancelSubscriptionSchedule; - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code phase_start} - * bills based on the current state of the subscription, ignoring changes scheduled in future - * phases. {@code billing_period_start} bills predictively for upcoming phase transitions within - * the current billing cycle, including pricing changes and service period adjustments that will - * occur before the next invoice. - */ + /** Configures how the quote handles billing for line transitions. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -1830,14 +1823,7 @@ public Builder setCancelSubscriptionSchedule( return this; } - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code - * phase_start} bills based on the current state of the subscription, ignoring changes - * scheduled in future phases. {@code billing_period_start} bills predictively for upcoming - * phase transitions within the current billing cycle, including pricing changes and service - * period adjustments that will occur before the next invoice. - */ + /** Configures how the quote handles billing for line transitions. */ public Builder setEffectiveAt(QuoteCreateParams.Line.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; return this; @@ -6615,11 +6601,7 @@ public static class SubscriptionData { /** * Configures how the subscription schedule handles billing for phase transitions when the quote - * is accepted. Possible values are {@code phase_start} (default) or {@code - * billing_period_start}. {@code phase_start} bills based on the current state of the - * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} bills - * predictively for upcoming phase transitions within the current billing cycle, including - * pricing changes and service period adjustments that will occur before the next invoice. + * is accepted. */ @SerializedName("phase_effective_at") PhaseEffectiveAt phaseEffectiveAt; @@ -6938,12 +6920,7 @@ public Builder putAllMetadata(Map map) { /** * Configures how the subscription schedule handles billing for phase transitions when the - * quote is accepted. Possible values are {@code phase_start} (default) or {@code - * billing_period_start}. {@code phase_start} bills based on the current state of the - * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} - * bills predictively for upcoming phase transitions within the current billing cycle, - * including pricing changes and service period adjustments that will occur before the next - * invoice. + * quote is accepted. */ public Builder setPhaseEffectiveAt( QuoteCreateParams.SubscriptionData.PhaseEffectiveAt phaseEffectiveAt) { @@ -8891,8 +8868,8 @@ public enum PhaseEffectiveAt implements ApiRequestParams.EnumParam { @SerializedName("billing_period_start") BILLING_PERIOD_START("billing_period_start"), - @SerializedName("line_start") - LINE_START("line_start"); + @SerializedName("phase_start") + PHASE_START("phase_start"); @Getter(onMethod_ = {@Override}) private final String value; @@ -8982,11 +8959,7 @@ public static class SubscriptionDataOverride { /** * Configures how the subscription schedule handles billing for phase transitions when the quote - * is accepted. Possible values are {@code phase_start} (default) or {@code - * billing_period_start}. {@code phase_start} bills based on the current state of the - * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} bills - * predictively for upcoming phase transitions within the current billing cycle, including - * pricing changes and service period adjustments that will occur before the next invoice. + * is accepted. */ @SerializedName("phase_effective_at") PhaseEffectiveAt phaseEffectiveAt; @@ -9186,12 +9159,7 @@ public Builder putAllExtraParam(Map map) { /** * Configures how the subscription schedule handles billing for phase transitions when the - * quote is accepted. Possible values are {@code phase_start} (default) or {@code - * billing_period_start}. {@code phase_start} bills based on the current state of the - * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} - * bills predictively for upcoming phase transitions within the current billing cycle, - * including pricing changes and service period adjustments that will occur before the next - * invoice. + * quote is accepted. */ public Builder setPhaseEffectiveAt( QuoteCreateParams.SubscriptionDataOverride.PhaseEffectiveAt phaseEffectiveAt) { @@ -10941,8 +10909,8 @@ public enum PhaseEffectiveAt implements ApiRequestParams.EnumParam { @SerializedName("billing_period_start") BILLING_PERIOD_START("billing_period_start"), - @SerializedName("line_start") - LINE_START("line_start"); + @SerializedName("phase_start") + PHASE_START("phase_start"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/QuoteUpdateParams.java b/src/main/java/com/stripe/param/QuoteUpdateParams.java index e7918ce7043..b1ad4ffd917 100644 --- a/src/main/java/com/stripe/param/QuoteUpdateParams.java +++ b/src/main/java/com/stripe/param/QuoteUpdateParams.java @@ -1553,14 +1553,7 @@ public static class Line { @SerializedName("cancel_subscription_schedule") CancelSubscriptionSchedule cancelSubscriptionSchedule; - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code phase_start} - * bills based on the current state of the subscription, ignoring changes scheduled in future - * phases. {@code billing_period_start} bills predictively for upcoming phase transitions within - * the current billing cycle, including pricing changes and service period adjustments that will - * occur before the next invoice. - */ + /** Configures how the quote handles billing for line transitions. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -1752,14 +1745,7 @@ public Builder setCancelSubscriptionSchedule( return this; } - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code - * phase_start} bills based on the current state of the subscription, ignoring changes - * scheduled in future phases. {@code billing_period_start} bills predictively for upcoming - * phase transitions within the current billing cycle, including pricing changes and service - * period adjustments that will occur before the next invoice. - */ + /** Configures how the quote handles billing for line transitions. */ public Builder setEffectiveAt(QuoteUpdateParams.Line.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; return this; @@ -6780,11 +6766,7 @@ public static class SubscriptionData { /** * Configures how the subscription schedule handles billing for phase transitions when the quote - * is accepted. Possible values are {@code phase_start} (default) or {@code - * billing_period_start}. {@code phase_start} bills based on the current state of the - * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} bills - * predictively for upcoming phase transitions within the current billing cycle, including - * pricing changes and service period adjustments that will occur before the next invoice. + * is accepted. */ @SerializedName("phase_effective_at") PhaseEffectiveAt phaseEffectiveAt; @@ -7118,12 +7100,7 @@ public Builder putAllMetadata(Map map) { /** * Configures how the subscription schedule handles billing for phase transitions when the - * quote is accepted. Possible values are {@code phase_start} (default) or {@code - * billing_period_start}. {@code phase_start} bills based on the current state of the - * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} - * bills predictively for upcoming phase transitions within the current billing cycle, - * including pricing changes and service period adjustments that will occur before the next - * invoice. + * quote is accepted. */ public Builder setPhaseEffectiveAt( QuoteUpdateParams.SubscriptionData.PhaseEffectiveAt phaseEffectiveAt) { @@ -8899,8 +8876,8 @@ public enum PhaseEffectiveAt implements ApiRequestParams.EnumParam { @SerializedName("billing_period_start") BILLING_PERIOD_START("billing_period_start"), - @SerializedName("line_start") - LINE_START("line_start"); + @SerializedName("phase_start") + PHASE_START("phase_start"); @Getter(onMethod_ = {@Override}) private final String value; @@ -8987,11 +8964,7 @@ public static class SubscriptionDataOverride { /** * Configures how the subscription schedule handles billing for phase transitions when the quote - * is accepted. Possible values are {@code phase_start} (default) or {@code - * billing_period_start}. {@code phase_start} bills based on the current state of the - * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} bills - * predictively for upcoming phase transitions within the current billing cycle, including - * pricing changes and service period adjustments that will occur before the next invoice. + * is accepted. */ @SerializedName("phase_effective_at") PhaseEffectiveAt phaseEffectiveAt; @@ -9235,12 +9208,7 @@ public Builder putAllExtraParam(Map map) { /** * Configures how the subscription schedule handles billing for phase transitions when the - * quote is accepted. Possible values are {@code phase_start} (default) or {@code - * billing_period_start}. {@code phase_start} bills based on the current state of the - * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} - * bills predictively for upcoming phase transitions within the current billing cycle, - * including pricing changes and service period adjustments that will occur before the next - * invoice. + * quote is accepted. */ public Builder setPhaseEffectiveAt( QuoteUpdateParams.SubscriptionDataOverride.PhaseEffectiveAt phaseEffectiveAt) { @@ -11035,8 +11003,8 @@ public enum PhaseEffectiveAt implements ApiRequestParams.EnumParam { @SerializedName("billing_period_start") BILLING_PERIOD_START("billing_period_start"), - @SerializedName("line_start") - LINE_START("line_start"); + @SerializedName("phase_start") + PHASE_START("phase_start"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index 539183affda..e288e61ad85 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -12143,9 +12143,9 @@ public static class Benefit { /** French meal voucher benefit details for this SetupIntent. */ @SerializedName("fr_meal_voucher") - FrMealVoucher frMealVoucher; + Object frMealVoucher; - private Benefit(Map extraParams, FrMealVoucher frMealVoucher) { + private Benefit(Map extraParams, Object frMealVoucher) { this.extraParams = extraParams; this.frMealVoucher = frMealVoucher; } @@ -12157,7 +12157,7 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private FrMealVoucher frMealVoucher; + private Object frMealVoucher; /** Finalize and obtain parameter instance from this builder. */ public SetupIntentConfirmParams.SetupDetails.Benefit build() { @@ -12199,6 +12199,12 @@ public Builder setFrMealVoucher( this.frMealVoucher = frMealVoucher; return this; } + + /** French meal voucher benefit details for this SetupIntent. */ + public Builder setFrMealVoucher(EmptyParam frMealVoucher) { + this.frMealVoucher = frMealVoucher; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index 08d924d8a34..f836ba81a8d 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -12674,9 +12674,9 @@ public static class Benefit { /** French meal voucher benefit details for this SetupIntent. */ @SerializedName("fr_meal_voucher") - FrMealVoucher frMealVoucher; + Object frMealVoucher; - private Benefit(Map extraParams, FrMealVoucher frMealVoucher) { + private Benefit(Map extraParams, Object frMealVoucher) { this.extraParams = extraParams; this.frMealVoucher = frMealVoucher; } @@ -12688,7 +12688,7 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private FrMealVoucher frMealVoucher; + private Object frMealVoucher; /** Finalize and obtain parameter instance from this builder. */ public SetupIntentCreateParams.SetupDetails.Benefit build() { @@ -12730,6 +12730,12 @@ public Builder setFrMealVoucher( this.frMealVoucher = frMealVoucher; return this; } + + /** French meal voucher benefit details for this SetupIntent. */ + public Builder setFrMealVoucher(EmptyParam frMealVoucher) { + this.frMealVoucher = frMealVoucher; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index 7414e7feb05..f073d579de8 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -12418,9 +12418,9 @@ public static class Benefit { /** French meal voucher benefit details for this SetupIntent. */ @SerializedName("fr_meal_voucher") - FrMealVoucher frMealVoucher; + Object frMealVoucher; - private Benefit(Map extraParams, FrMealVoucher frMealVoucher) { + private Benefit(Map extraParams, Object frMealVoucher) { this.extraParams = extraParams; this.frMealVoucher = frMealVoucher; } @@ -12432,7 +12432,7 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private FrMealVoucher frMealVoucher; + private Object frMealVoucher; /** Finalize and obtain parameter instance from this builder. */ public SetupIntentUpdateParams.SetupDetails.Benefit build() { @@ -12474,6 +12474,12 @@ public Builder setFrMealVoucher( this.frMealVoucher = frMealVoucher; return this; } + + /** French meal voucher benefit details for this SetupIntent. */ + public Builder setFrMealVoucher(EmptyParam frMealVoucher) { + this.frMealVoucher = frMealVoucher; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/SubscriptionPauseParams.java b/src/main/java/com/stripe/param/SubscriptionPauseParams.java new file mode 100644 index 00000000000..67fbc645c89 --- /dev/null +++ b/src/main/java/com/stripe/param/SubscriptionPauseParams.java @@ -0,0 +1,274 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class SubscriptionPauseParams extends ApiRequestParams { + /** Controls what to bill for when pausing the subscription. */ + @SerializedName("bill_for") + BillFor billFor; + + /** 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; + + /** + * Determines how to handle debits and credits when pausing. The default is {@code + * pending_invoice_item}. + */ + @SerializedName("invoicing_behavior") + InvoicingBehavior invoicingBehavior; + + /** Required. The type of pause to apply. */ + @SerializedName("type") + Type type; + + private SubscriptionPauseParams( + BillFor billFor, + List expand, + Map extraParams, + InvoicingBehavior invoicingBehavior, + Type type) { + this.billFor = billFor; + this.expand = expand; + this.extraParams = extraParams; + this.invoicingBehavior = invoicingBehavior; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillFor billFor; + + private List expand; + + private Map extraParams; + + private InvoicingBehavior invoicingBehavior; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionPauseParams build() { + return new SubscriptionPauseParams( + this.billFor, this.expand, this.extraParams, this.invoicingBehavior, this.type); + } + + /** Controls what to bill for when pausing the subscription. */ + public Builder setBillFor(SubscriptionPauseParams.BillFor billFor) { + this.billFor = billFor; + 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 + * SubscriptionPauseParams#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 + * SubscriptionPauseParams#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 + * SubscriptionPauseParams#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 SubscriptionPauseParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Determines how to handle debits and credits when pausing. The default is {@code + * pending_invoice_item}. + */ + public Builder setInvoicingBehavior( + SubscriptionPauseParams.InvoicingBehavior invoicingBehavior) { + this.invoicingBehavior = invoicingBehavior; + return this; + } + + /** Required. The type of pause to apply. */ + public Builder setType(SubscriptionPauseParams.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillFor { + /** + * 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; + + /** + * Controls whether to debit for accrued metered usage in the current billing period. The + * default is {@code false}. + */ + @SerializedName("outstanding_usage") + Boolean outstandingUsage; + + /** + * Controls whether to credit for licensed items in the current billing period. The default is + * {@code false}. + */ + @SerializedName("unused_time") + Boolean unusedTime; + + private BillFor(Map extraParams, Boolean outstandingUsage, Boolean unusedTime) { + this.extraParams = extraParams; + this.outstandingUsage = outstandingUsage; + this.unusedTime = unusedTime; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean outstandingUsage; + + private Boolean unusedTime; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionPauseParams.BillFor build() { + return new SubscriptionPauseParams.BillFor( + this.extraParams, this.outstandingUsage, this.unusedTime); + } + + /** + * 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 + * SubscriptionPauseParams.BillFor#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 SubscriptionPauseParams.BillFor#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Controls whether to debit for accrued metered usage in the current billing period. The + * default is {@code false}. + */ + public Builder setOutstandingUsage(Boolean outstandingUsage) { + this.outstandingUsage = outstandingUsage; + return this; + } + + /** + * Controls whether to credit for licensed items in the current billing period. The default is + * {@code false}. + */ + public Builder setUnusedTime(Boolean unusedTime) { + this.unusedTime = unusedTime; + return this; + } + } + } + + public enum InvoicingBehavior implements ApiRequestParams.EnumParam { + @SerializedName("invoice") + INVOICE("invoice"), + + @SerializedName("pending_invoice_item") + PENDING_INVOICE_ITEM("pending_invoice_item"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + InvoicingBehavior(String value) { + this.value = value; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("subscription") + SUBSCRIPTION("subscription"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java index 515ab43f6c9..c612c898370 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java @@ -266,14 +266,7 @@ public static class Amendment { @SerializedName("discount_actions") List discountActions; - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code phase_start} - * bills based on the current state of the subscription, ignoring changes scheduled in future - * phases. {@code billing_period_start} bills predictively for upcoming phase transitions within - * the current billing cycle, including pricing changes and service period adjustments that will - * occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -497,14 +490,7 @@ public Builder addAllDiscountAction( return this; } - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code - * phase_start} bills based on the current state of the subscription, ignoring changes - * scheduled in future phases. {@code billing_period_start} bills predictively for upcoming - * phase transitions within the current billing cycle, including pricing changes and service - * period adjustments that will occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ public Builder setEffectiveAt( SubscriptionScheduleAmendParams.Amendment.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java index f884f21f747..3e5d3c216f3 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java @@ -1180,14 +1180,7 @@ public static class DefaultSettings { @SerializedName("on_behalf_of") Object onBehalfOf; - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code phase_start} - * bills based on the current state of the subscription, ignoring changes scheduled in future - * phases. {@code billing_period_start} bills predictively for upcoming phase transitions within - * the current billing cycle, including pricing changes and service period adjustments that will - * occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ @SerializedName("phase_effective_at") PhaseEffectiveAt phaseEffectiveAt; @@ -1417,14 +1410,7 @@ public Builder setOnBehalfOf(EmptyParam onBehalfOf) { return this; } - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code - * phase_start} bills based on the current state of the subscription, ignoring changes - * scheduled in future phases. {@code billing_period_start} bills predictively for upcoming - * phase transitions within the current billing cycle, including pricing changes and service - * period adjustments that will occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ public Builder setPhaseEffectiveAt( SubscriptionScheduleCreateParams.DefaultSettings.PhaseEffectiveAt phaseEffectiveAt) { this.phaseEffectiveAt = phaseEffectiveAt; @@ -2259,14 +2245,7 @@ public static class Phase { @SerializedName("duration") Duration duration; - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code phase_start} - * bills based on the current state of the subscription, ignoring changes scheduled in future - * phases. {@code billing_period_start} bills predictively for upcoming phase transitions within - * the current billing cycle, including pricing changes and service period adjustments that will - * occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -2751,14 +2730,7 @@ public Builder setDuration(SubscriptionScheduleCreateParams.Phase.Duration durat return this; } - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code - * phase_start} bills based on the current state of the subscription, ignoring changes - * scheduled in future phases. {@code billing_period_start} bills predictively for upcoming - * phase transitions within the current billing cycle, including pricing changes and service - * period adjustments that will occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ public Builder setEffectiveAt( SubscriptionScheduleCreateParams.Phase.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java index 0db13468498..a50e7ff074b 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java @@ -935,14 +935,7 @@ public static class DefaultSettings { @SerializedName("on_behalf_of") Object onBehalfOf; - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code phase_start} - * bills based on the current state of the subscription, ignoring changes scheduled in future - * phases. {@code billing_period_start} bills predictively for upcoming phase transitions within - * the current billing cycle, including pricing changes and service period adjustments that will - * occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ @SerializedName("phase_effective_at") PhaseEffectiveAt phaseEffectiveAt; @@ -1182,14 +1175,7 @@ public Builder setOnBehalfOf(EmptyParam onBehalfOf) { return this; } - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code - * phase_start} bills based on the current state of the subscription, ignoring changes - * scheduled in future phases. {@code billing_period_start} bills predictively for upcoming - * phase transitions within the current billing cycle, including pricing changes and service - * period adjustments that will occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ public Builder setPhaseEffectiveAt( SubscriptionScheduleUpdateParams.DefaultSettings.PhaseEffectiveAt phaseEffectiveAt) { this.phaseEffectiveAt = phaseEffectiveAt; @@ -2042,14 +2028,7 @@ public static class Phase { @SerializedName("duration") Duration duration; - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code phase_start} - * bills based on the current state of the subscription, ignoring changes scheduled in future - * phases. {@code billing_period_start} bills predictively for upcoming phase transitions within - * the current billing cycle, including pricing changes and service period adjustments that will - * occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -2566,14 +2545,7 @@ public Builder setDuration(SubscriptionScheduleUpdateParams.Phase.Duration durat return this; } - /** - * Configures how the subscription schedule handles billing for phase transitions. Possible - * values are {@code phase_start} (default) or {@code billing_period_start}. {@code - * phase_start} bills based on the current state of the subscription, ignoring changes - * scheduled in future phases. {@code billing_period_start} bills predictively for upcoming - * phase transitions within the current billing cycle, including pricing changes and service - * period adjustments that will occur before the next invoice. - */ + /** Configures how the subscription schedule handles billing for phase transitions. */ public Builder setEffectiveAt( SubscriptionScheduleUpdateParams.Phase.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 1e9ddd8ec8b..513eb654202 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -6504,6 +6504,14 @@ public static class TaxDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + /** * Required. A tax * code ID. @@ -6511,8 +6519,10 @@ public static class TaxDetails { @SerializedName("tax_code") String taxCode; - private TaxDetails(Map extraParams, String taxCode) { + private TaxDetails( + Map extraParams, String performanceLocation, String taxCode) { this.extraParams = extraParams; + this.performanceLocation = performanceLocation; this.taxCode = taxCode; } @@ -6523,12 +6533,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private String performanceLocation; + private String taxCode; /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.LineItem.PriceData.ProductData.TaxDetails build() { return new SessionCreateParams.LineItem.PriceData.ProductData.TaxDetails( - this.extraParams, this.taxCode); + this.extraParams, this.performanceLocation, this.taxCode); } /** @@ -6561,6 +6573,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + /** * Required. A tax * code ID. diff --git a/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java b/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java index 3dd1911ec49..f984abc0368 100644 --- a/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java @@ -2527,6 +2527,14 @@ public static class TaxDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + Object performanceLocation; + /** * Required. A tax * code ID. @@ -2534,8 +2542,10 @@ public static class TaxDetails { @SerializedName("tax_code") Object taxCode; - private TaxDetails(Map extraParams, Object taxCode) { + private TaxDetails( + Map extraParams, Object performanceLocation, Object taxCode) { this.extraParams = extraParams; + this.performanceLocation = performanceLocation; this.taxCode = taxCode; } @@ -2546,12 +2556,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Object performanceLocation; + private Object taxCode; /** Finalize and obtain parameter instance from this builder. */ public SessionUpdateParams.LineItem.PriceData.ProductData.TaxDetails build() { return new SessionUpdateParams.LineItem.PriceData.ProductData.TaxDetails( - this.extraParams, this.taxCode); + this.extraParams, this.performanceLocation, this.taxCode); } /** @@ -2584,6 +2596,26 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(EmptyParam performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + /** * Required. A tax * code ID. diff --git a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java index f0f7f451884..1ae29befb2e 100644 --- a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java +++ b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java @@ -37,7 +37,7 @@ public class RequestedSessionUpdateParams extends ApiRequestParams { /** The metadata for this requested session. */ @SerializedName("metadata") - Map metadata; + Object metadata; /** The payment method for this requested session. */ @SerializedName("payment_method") @@ -45,21 +45,21 @@ public class RequestedSessionUpdateParams extends ApiRequestParams { /** The payment method data for this requested session. */ @SerializedName("payment_method_data") - PaymentMethodData paymentMethodData; + Object paymentMethodData; /** The shared metadata for this requested session. */ @SerializedName("shared_metadata") - Map sharedMetadata; + Object sharedMetadata; private RequestedSessionUpdateParams( List expand, Map extraParams, FulfillmentDetails fulfillmentDetails, List lineItemDetails, - Map metadata, + Object metadata, Object paymentMethod, - PaymentMethodData paymentMethodData, - Map sharedMetadata) { + Object paymentMethodData, + Object sharedMetadata) { this.expand = expand; this.extraParams = extraParams; this.fulfillmentDetails = fulfillmentDetails; @@ -83,13 +83,13 @@ public static class Builder { private List lineItemDetails; - private Map metadata; + private Object metadata; private Object paymentMethod; - private PaymentMethodData paymentMethodData; + private Object paymentMethodData; - private Map sharedMetadata; + private Object sharedMetadata; /** Finalize and obtain parameter instance from this builder. */ public RequestedSessionUpdateParams build() { @@ -195,11 +195,12 @@ public Builder addAllLineItemDetail( * and subsequent calls add additional key/value pairs to the original map. See {@link * RequestedSessionUpdateParams#metadata} for the field documentation. */ + @SuppressWarnings("unchecked") public Builder putMetadata(String key, String value) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); } - this.metadata.put(key, value); + ((Map) this.metadata).put(key, value); return this; } @@ -208,11 +209,24 @@ public Builder putMetadata(String key, String value) { * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link RequestedSessionUpdateParams#metadata} for the field documentation. */ + @SuppressWarnings("unchecked") public Builder putAllMetadata(Map map) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); } - this.metadata.putAll(map); + ((Map) this.metadata).putAll(map); + return this; + } + + /** The metadata for this requested session. */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** The metadata for this requested session. */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; return this; } @@ -235,16 +249,23 @@ public Builder setPaymentMethodData( return this; } + /** The payment method data for this requested session. */ + public Builder setPaymentMethodData(EmptyParam paymentMethodData) { + this.paymentMethodData = paymentMethodData; + return this; + } + /** * Add a key/value pair to `sharedMetadata` 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 * RequestedSessionUpdateParams#sharedMetadata} for the field documentation. */ + @SuppressWarnings("unchecked") public Builder putSharedMetadata(String key, String value) { - if (this.sharedMetadata == null) { - this.sharedMetadata = new HashMap<>(); + if (this.sharedMetadata == null || this.sharedMetadata instanceof EmptyParam) { + this.sharedMetadata = new HashMap(); } - this.sharedMetadata.put(key, value); + ((Map) this.sharedMetadata).put(key, value); return this; } @@ -253,11 +274,24 @@ public Builder putSharedMetadata(String key, String value) { * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link RequestedSessionUpdateParams#sharedMetadata} for the field documentation. */ + @SuppressWarnings("unchecked") public Builder putAllSharedMetadata(Map map) { - if (this.sharedMetadata == null) { - this.sharedMetadata = new HashMap<>(); + if (this.sharedMetadata == null || this.sharedMetadata instanceof EmptyParam) { + this.sharedMetadata = new HashMap(); } - this.sharedMetadata.putAll(map); + ((Map) this.sharedMetadata).putAll(map); + return this; + } + + /** The shared metadata for this requested session. */ + public Builder setSharedMetadata(EmptyParam sharedMetadata) { + this.sharedMetadata = sharedMetadata; + return this; + } + + /** The shared metadata for this requested session. */ + public Builder setSharedMetadata(Map sharedMetadata) { + this.sharedMetadata = sharedMetadata; return this; } } diff --git a/src/main/java/com/stripe/param/sharedpayment/GrantedTokenUpdateParams.java b/src/main/java/com/stripe/param/sharedpayment/GrantedTokenRevokeParams.java similarity index 85% rename from src/main/java/com/stripe/param/sharedpayment/GrantedTokenUpdateParams.java rename to src/main/java/com/stripe/param/sharedpayment/GrantedTokenRevokeParams.java index 032845acc7b..7a07612158a 100644 --- a/src/main/java/com/stripe/param/sharedpayment/GrantedTokenUpdateParams.java +++ b/src/main/java/com/stripe/param/sharedpayment/GrantedTokenRevokeParams.java @@ -12,7 +12,7 @@ @Getter @EqualsAndHashCode(callSuper = false) -public class GrantedTokenUpdateParams extends ApiRequestParams { +public class GrantedTokenRevokeParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; @@ -26,7 +26,7 @@ public class GrantedTokenUpdateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private GrantedTokenUpdateParams(List expand, Map extraParams) { + private GrantedTokenRevokeParams(List expand, Map extraParams) { this.expand = expand; this.extraParams = extraParams; } @@ -41,14 +41,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public GrantedTokenUpdateParams build() { - return new GrantedTokenUpdateParams(this.expand, this.extraParams); + public GrantedTokenRevokeParams build() { + return new GrantedTokenRevokeParams(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 - * GrantedTokenUpdateParams#expand} for the field documentation. + * GrantedTokenRevokeParams#expand} for the field documentation. */ public Builder addExpand(String element) { if (this.expand == null) { @@ -61,7 +61,7 @@ public Builder addExpand(String element) { /** * 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 - * GrantedTokenUpdateParams#expand} for the field documentation. + * GrantedTokenRevokeParams#expand} for the field documentation. */ public Builder addAllExpand(List elements) { if (this.expand == null) { @@ -74,7 +74,7 @@ public Builder addAllExpand(List elements) { /** * 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 - * GrantedTokenUpdateParams#extraParams} for the field documentation. + * GrantedTokenRevokeParams#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -87,7 +87,7 @@ public Builder putExtraParam(String key, Object value) { /** * 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 GrantedTokenUpdateParams#extraParams} for the field documentation. + * See {@link GrantedTokenRevokeParams#extraParams} for the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { diff --git a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java index 10433a7db45..10c7a4675c7 100644 --- a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java @@ -1149,6 +1149,14 @@ public static class LineItem { @SerializedName("metadata") Map metadata; + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + /** * If provided, the product's {@code tax_code} will be used as the line item's {@code tax_code}. */ @@ -1188,6 +1196,7 @@ private LineItem( Long amount, Map extraParams, Map metadata, + String performanceLocation, String product, Long quantity, String reference, @@ -1196,6 +1205,7 @@ private LineItem( this.amount = amount; this.extraParams = extraParams; this.metadata = metadata; + this.performanceLocation = performanceLocation; this.product = product; this.quantity = quantity; this.reference = reference; @@ -1214,6 +1224,8 @@ public static class Builder { private Map metadata; + private String performanceLocation; + private String product; private Long quantity; @@ -1230,6 +1242,7 @@ public CalculationCreateParams.LineItem build() { this.amount, this.extraParams, this.metadata, + this.performanceLocation, this.product, this.quantity, this.reference, @@ -1300,6 +1313,16 @@ public Builder putAllMetadata(Map map) { return this; } + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + /** * If provided, the product's {@code tax_code} will be used as the line item's {@code * tax_code}. diff --git a/src/main/java/com/stripe/param/tax/LocationCreateParams.java b/src/main/java/com/stripe/param/tax/LocationCreateParams.java new file mode 100644 index 00000000000..09c005d003b --- /dev/null +++ b/src/main/java/com/stripe/param/tax/LocationCreateParams.java @@ -0,0 +1,363 @@ +// File generated from our OpenAPI spec +package com.stripe.param.tax; + +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.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class LocationCreateParams extends ApiRequestParams { + /** Required. The physical address of the tax location. */ + @SerializedName("address") + Address address; + + /** + * Details to identify the tax location by its venue, types of events held, or available services, + * such as "A spacious auditorium suitable for large concerts and events.". + */ + @SerializedName("description") + String description; + + /** 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; + + /** + * Required. The type of tax location. The only supported value is + * "performance". + */ + @SerializedName("type") + Type type; + + private LocationCreateParams( + Address address, + String description, + List expand, + Map extraParams, + Type type) { + this.address = address; + this.description = description; + this.expand = expand; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private String description; + + private List expand; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public LocationCreateParams build() { + return new LocationCreateParams( + this.address, this.description, this.expand, this.extraParams, this.type); + } + + /** Required. The physical address of the tax location. */ + public Builder setAddress(LocationCreateParams.Address address) { + this.address = address; + return this; + } + + /** + * Details to identify the tax location by its venue, types of events held, or available + * services, such as "A spacious auditorium suitable for large concerts and events.". + */ + public Builder setDescription(String description) { + this.description = description; + 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 + * LocationCreateParams#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 + * LocationCreateParams#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 + * LocationCreateParams#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 LocationCreateParams#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. The type of tax location. The only supported value is + * "performance". + */ + public Builder setType(LocationCreateParams.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + Object city; + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * 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; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + Object line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + Object line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + Object postalCode; + + /** + * State/province as an ISO 3166-2 + * subdivision code, without country prefix, such as "NY" or "TX". + */ + @SerializedName("state") + Object state; + + private Address( + Object city, + String country, + Map extraParams, + Object line1, + Object line2, + Object postalCode, + Object state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object city; + + private String country; + + private Map extraParams; + + private Object line1; + + private Object line2; + + private Object postalCode; + + private Object state; + + /** Finalize and obtain parameter instance from this builder. */ + public LocationCreateParams.Address build() { + return new LocationCreateParams.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(EmptyParam city) { + this.city = city; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + 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 + * LocationCreateParams.Address#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 LocationCreateParams.Address#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 1, such as the street, PO Box, or company name. */ + public Builder setLine1(EmptyParam line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(EmptyParam line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(EmptyParam postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * State/province as an ISO 3166-2 + * subdivision code, without country prefix, such as "NY" or "TX". + */ + public Builder setState(String state) { + this.state = state; + return this; + } + + /** + * State/province as an ISO 3166-2 + * subdivision code, without country prefix, such as "NY" or "TX". + */ + public Builder setState(EmptyParam state) { + this.state = state; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("performance") + PERFORMANCE("performance"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/tax/LocationListParams.java b/src/main/java/com/stripe/param/tax/LocationListParams.java new file mode 100644 index 00000000000..74a0c89d1b7 --- /dev/null +++ b/src/main/java/com/stripe/param/tax/LocationListParams.java @@ -0,0 +1,208 @@ +// File generated from our OpenAPI spec +package com.stripe.param.tax; + +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.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class LocationListParams 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; + + /** + * Required. Type of the tax location. Currently the only option is {@code + * performance}. + */ + @SerializedName("type") + Type type; + + private LocationListParams( + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter, + Type type) { + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.startingAfter = startingAfter; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String endingBefore; + + private List expand; + + private Map extraParams; + + private Long limit; + + private String startingAfter; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public LocationListParams build() { + return new LocationListParams( + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter, + this.type); + } + + /** + * 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 + * LocationListParams#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 + * LocationListParams#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 + * LocationListParams#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 LocationListParams#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; + } + + /** + * Required. Type of the tax location. Currently the only option is {@code + * performance}. + */ + public Builder setType(LocationListParams.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("performance") + PERFORMANCE("performance"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/tax/LocationRetrieveParams.java b/src/main/java/com/stripe/param/tax/LocationRetrieveParams.java new file mode 100644 index 00000000000..7bf5d7457eb --- /dev/null +++ b/src/main/java/com/stripe/param/tax/LocationRetrieveParams.java @@ -0,0 +1,100 @@ +// File generated from our OpenAPI spec +package com.stripe.param.tax; + +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.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class LocationRetrieveParams 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 LocationRetrieveParams(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 LocationRetrieveParams build() { + return new LocationRetrieveParams(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 + * LocationRetrieveParams#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 + * LocationRetrieveParams#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 + * LocationRetrieveParams#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 LocationRetrieveParams#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/tax/RegistrationCreateParams.java b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java index 3a272c23e08..4db517cb554 100644 --- a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java @@ -16161,12 +16161,33 @@ public enum Type implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("admissions_tax") + ADMISSIONS_TAX("admissions_tax"), + + @SerializedName("attendance_tax") + ATTENDANCE_TAX("attendance_tax"), + + @SerializedName("entertainment_tax") + ENTERTAINMENT_TAX("entertainment_tax"), + + @SerializedName("gross_receipts_tax") + GROSS_RECEIPTS_TAX("gross_receipts_tax"), + + @SerializedName("hospitality_tax") + HOSPITALITY_TAX("hospitality_tax"), + @SerializedName("local_amusement_tax") LOCAL_AMUSEMENT_TAX("local_amusement_tax"), @SerializedName("local_lease_tax") LOCAL_LEASE_TAX("local_lease_tax"), + @SerializedName("luxury_tax") + LUXURY_TAX("luxury_tax"), + + @SerializedName("resort_tax") + RESORT_TAX("resort_tax"), + @SerializedName("state_communications_tax") STATE_COMMUNICATIONS_TAX("state_communications_tax"), @@ -16174,7 +16195,10 @@ public enum Type implements ApiRequestParams.EnumParam { STATE_RETAIL_DELIVERY_FEE("state_retail_delivery_fee"), @SerializedName("state_sales_tax") - STATE_SALES_TAX("state_sales_tax"); + STATE_SALES_TAX("state_sales_tax"), + + @SerializedName("tourism_tax") + TOURISM_TAX("tourism_tax"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/service/SubscriptionService.java b/src/main/java/com/stripe/service/SubscriptionService.java index 8ddcf9cc3a9..1613c3ae1a4 100644 --- a/src/main/java/com/stripe/service/SubscriptionService.java +++ b/src/main/java/com/stripe/service/SubscriptionService.java @@ -19,6 +19,7 @@ import com.stripe.param.SubscriptionCreateParams; import com.stripe.param.SubscriptionListParams; import com.stripe.param.SubscriptionMigrateParams; +import com.stripe.param.SubscriptionPauseParams; import com.stripe.param.SubscriptionResumeParams; import com.stripe.param.SubscriptionRetrieveParams; import com.stripe.param.SubscriptionSearchParams; @@ -581,6 +582,34 @@ public Subscription migrate( options); return this.request(request, Subscription.class); } + /** + * Pauses a subscription by transitioning it to the paused status. A paused subscription does not + * generate invoices and will not advance to new billing periods. The subscription can be resumed + * later using the resume endpoint. Cannot pause subscriptions with attached schedules. + */ + public Subscription pause(String subscription, SubscriptionPauseParams params) + throws StripeException { + return pause(subscription, params, (RequestOptions) null); + } + /** + * Pauses a subscription by transitioning it to the paused status. A paused subscription does not + * generate invoices and will not advance to new billing periods. The subscription can be resumed + * later using the resume endpoint. Cannot pause subscriptions with attached schedules. + */ + public Subscription pause( + String subscription, SubscriptionPauseParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/subscriptions/%s/pause", ApiResource.urlEncodeId(subscription)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Subscription.class); + } /** * Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor * and creating prorations. If a resumption invoice is generated, it must be paid or marked diff --git a/src/main/java/com/stripe/service/TaxService.java b/src/main/java/com/stripe/service/TaxService.java index bb805e3527d..c359f37c717 100644 --- a/src/main/java/com/stripe/service/TaxService.java +++ b/src/main/java/com/stripe/service/TaxService.java @@ -21,6 +21,10 @@ public com.stripe.service.tax.FormService forms() { return new com.stripe.service.tax.FormService(this.getResponseGetter()); } + public com.stripe.service.tax.LocationService locations() { + return new com.stripe.service.tax.LocationService(this.getResponseGetter()); + } + public com.stripe.service.tax.RegistrationService registrations() { return new com.stripe.service.tax.RegistrationService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/tax/LocationService.java b/src/main/java/com/stripe/service/tax/LocationService.java new file mode 100644 index 00000000000..4f62322aa36 --- /dev/null +++ b/src/main/java/com/stripe/service/tax/LocationService.java @@ -0,0 +1,129 @@ +// File generated from our OpenAPI spec +package com.stripe.service.tax; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.StripeCollection; +import com.stripe.model.tax.Location; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.ApiService; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.tax.LocationCreateParams; +import com.stripe.param.tax.LocationListParams; +import com.stripe.param.tax.LocationRetrieveParams; + +public final class LocationService extends ApiService { + public LocationService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public StripeCollection list(LocationListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public StripeCollection list(LocationListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public Location create(LocationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public Location create(LocationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Location.class); + } + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public Location retrieve(String location, LocationRetrieveParams params) throws StripeException { + return retrieve(location, params, (RequestOptions) null); + } + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public Location retrieve(String location, RequestOptions options) throws StripeException { + return retrieve(location, (LocationRetrieveParams) null, options); + } + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public Location retrieve(String location) throws StripeException { + return retrieve(location, (LocationRetrieveParams) null, (RequestOptions) null); + } + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public Location retrieve(String location, LocationRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/tax/locations/%s", ApiResource.urlEncodeId(location)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Location.class); + } +} diff --git a/src/main/java/com/stripe/service/testhelpers/sharedpayment/GrantedTokenService.java b/src/main/java/com/stripe/service/testhelpers/sharedpayment/GrantedTokenService.java index 9ac86518c78..74b761d2976 100644 --- a/src/main/java/com/stripe/service/testhelpers/sharedpayment/GrantedTokenService.java +++ b/src/main/java/com/stripe/service/testhelpers/sharedpayment/GrantedTokenService.java @@ -11,7 +11,7 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.sharedpayment.GrantedTokenCreateParams; -import com.stripe.param.sharedpayment.GrantedTokenUpdateParams; +import com.stripe.param.sharedpayment.GrantedTokenRevokeParams; public final class GrantedTokenService extends ApiService { public GrantedTokenService(StripeResponseGetter responseGetter) { @@ -45,32 +45,32 @@ public GrantedToken create(GrantedTokenCreateParams params, RequestOptions optio * Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode * and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration */ - public GrantedToken update(String sharedPaymentGrantedToken, GrantedTokenUpdateParams params) + public GrantedToken revoke(String sharedPaymentGrantedToken, GrantedTokenRevokeParams params) throws StripeException { - return update(sharedPaymentGrantedToken, params, (RequestOptions) null); + return revoke(sharedPaymentGrantedToken, params, (RequestOptions) null); } /** * Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode * and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration */ - public GrantedToken update(String sharedPaymentGrantedToken, RequestOptions options) + public GrantedToken revoke(String sharedPaymentGrantedToken, RequestOptions options) throws StripeException { - return update(sharedPaymentGrantedToken, (GrantedTokenUpdateParams) null, options); + return revoke(sharedPaymentGrantedToken, (GrantedTokenRevokeParams) null, options); } /** * Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode * and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration */ - public GrantedToken update(String sharedPaymentGrantedToken) throws StripeException { - return update( - sharedPaymentGrantedToken, (GrantedTokenUpdateParams) null, (RequestOptions) null); + public GrantedToken revoke(String sharedPaymentGrantedToken) throws StripeException { + return revoke( + sharedPaymentGrantedToken, (GrantedTokenRevokeParams) null, (RequestOptions) null); } /** * Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode * and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration */ - public GrantedToken update( - String sharedPaymentGrantedToken, GrantedTokenUpdateParams params, RequestOptions options) + public GrantedToken revoke( + String sharedPaymentGrantedToken, GrantedTokenRevokeParams params, RequestOptions options) throws StripeException { String path = String.format(