diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3c1d2e64d9b..0ad25f52ebc 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2022 \ No newline at end of file +v2023 \ No newline at end of file diff --git a/src/main/java/com/stripe/events/V2BillingBillSettingUpdatedEvent.java b/src/main/java/com/stripe/events/V2BillingBillSettingUpdatedEvent.java new file mode 100644 index 00000000000..21fa0a13c73 --- /dev/null +++ b/src/main/java/com/stripe/events/V2BillingBillSettingUpdatedEvent.java @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.Event; +import com.stripe.model.v2.billing.BillSetting; +import java.time.Instant; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2BillingBillSettingUpdatedEvent extends Event { + /** Data for the v2.billing.bill_setting.updated event. */ + @SerializedName("data") + V2BillingBillSettingUpdatedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** Timestamp of when the object was updated. */ + @SerializedName("updated") + Instant updated; + } + + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BillSetting fetchRelatedObject() throws StripeException { + return (BillSetting) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEvent.java index 52c041f9338..e18e72ec8e8 100644 --- a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEvent.java +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEvent.java @@ -21,11 +21,13 @@ public static final class EventData { /** * Open Enum. The capability which had its status updated. * - *

One of {@code financial_addressses.bank_accounts}, {@code holds_currencies.eur}, {@code - * holds_currencies.gbp}, {@code holds_currencies.usd}, {@code inbound_transfers.bank_accounts}, - * {@code outbound_payments.bank_accounts}, {@code outbound_payments.cards}, {@code - * outbound_payments.financial_accounts}, {@code outbound_transfers.bank_accounts}, or {@code - * outbound_transfers.financial_accounts}. + *

One of {@code financial_addressses.bank_accounts}, {@code + * financial_addressses.crypto_wallets}, {@code holds_currencies.eur}, {@code + * holds_currencies.gbp}, {@code holds_currencies.usd}, {@code holds_currencies.usdc}, {@code + * inbound_transfers.bank_accounts}, {@code outbound_payments.bank_accounts}, {@code + * outbound_payments.cards}, {@code outbound_payments.crypto_wallets}, {@code + * outbound_payments.financial_accounts}, {@code outbound_transfers.bank_accounts}, {@code + * outbound_transfers.crypto_wallets}, or {@code outbound_transfers.financial_accounts}. */ @SerializedName("updated_capability") String updatedCapability; diff --git a/src/main/java/com/stripe/exception/StripeException.java b/src/main/java/com/stripe/exception/StripeException.java index d677c3cf252..ebd21d25afb 100644 --- a/src/main/java/com/stripe/exception/StripeException.java +++ b/src/main/java/com/stripe/exception/StripeException.java @@ -146,6 +146,9 @@ public static StripeException parseV2Exception( case "quota_exceeded": return com.stripe.exception.QuotaExceededException.parse( body, statusCode, requestId, responseGetter); + case "rate_limit": + return com.stripe.exception.RateLimitException.parse( + body, statusCode, requestId, responseGetter); case "recipient_not_notifiable": return com.stripe.exception.RecipientNotNotifiableException.parse( body, statusCode, requestId, responseGetter); diff --git a/src/main/java/com/stripe/model/Dispute.java b/src/main/java/com/stripe/model/Dispute.java index fcf6f667b98..a5dbd0f7613 100644 --- a/src/main/java/com/stripe/model/Dispute.java +++ b/src/main/java/com/stripe/model/Dispute.java @@ -150,8 +150,8 @@ public class Dispute extends ApiResource * warning_under_review}, {@code warning_closed}, {@code needs_response}, {@code under_review}, * {@code won}, {@code lost}, or {@code prevented}. * - *

One of {@code lost}, {@code needs_response}, {@code under_review}, {@code warning_closed}, - * {@code warning_needs_response}, {@code warning_under_review}, or {@code won}. + *

One of {@code lost}, {@code needs_response}, {@code prevented}, {@code under_review}, {@code + * warning_closed}, {@code warning_needs_response}, {@code warning_under_review}, or {@code won}. */ @SerializedName("status") String status; diff --git a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java index c08e50db0c8..fcbdf4e516a 100644 --- a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java @@ -27,12 +27,22 @@ public final class EventDataClassLookup { classLookup.put("v2.core.event", com.stripe.model.v2.Event.class); classLookup.put("v2.core.event_destination", com.stripe.model.v2.EventDestination.class); + classLookup.put("v2.billing.bill_setting", com.stripe.model.v2.billing.BillSetting.class); + classLookup.put( + "v2.billing.bill_setting_version", com.stripe.model.v2.billing.BillSettingVersion.class); + classLookup.put("v2.billing.cadence", com.stripe.model.v2.billing.Cadence.class); + classLookup.put( + "v2.billing.collection_setting", com.stripe.model.v2.billing.CollectionSetting.class); + classLookup.put( + "v2.billing.collection_setting_version", + com.stripe.model.v2.billing.CollectionSettingVersion.class); classLookup.put("v2.billing.meter_event", com.stripe.model.v2.billing.MeterEvent.class); classLookup.put( "v2.billing.meter_event_adjustment", com.stripe.model.v2.billing.MeterEventAdjustment.class); classLookup.put( "v2.billing.meter_event_session", com.stripe.model.v2.billing.MeterEventSession.class); + classLookup.put("v2.billing.profile", com.stripe.model.v2.billing.Profile.class); classLookup.put("v2.core.account", com.stripe.model.v2.core.Account.class); classLookup.put("v2.core.account_link", com.stripe.model.v2.core.AccountLink.class); @@ -92,6 +102,9 @@ public final class EventDataClassLookup { com.stripe.events.V1BillingMeterErrorReportTriggeredEvent.class); eventClassLookup.put( "v1.billing.meter.no_meter_found", com.stripe.events.V1BillingMeterNoMeterFoundEvent.class); + eventClassLookup.put( + "v2.billing.bill_setting.updated", + com.stripe.events.V2BillingBillSettingUpdatedEvent.class); eventClassLookup.put( "v2.core.account.closed", com.stripe.events.V2CoreAccountClosedEvent.class); eventClassLookup.put( diff --git a/src/main/java/com/stripe/model/v2/billing/BillSetting.java b/src/main/java/com/stripe/model/v2/billing/BillSetting.java new file mode 100644 index 00000000000..822aeafce24 --- /dev/null +++ b/src/main/java/com/stripe/model/v2/billing/BillSetting.java @@ -0,0 +1,138 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import java.time.Instant; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * BillSetting is responsible for settings which dictate generating bills, which include settings + * for calculating totals on bills, tax on bill items, as well as how to generate and present + * invoices. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class BillSetting extends StripeObject implements HasId { + /** Settings related to calculating a bill. */ + @SerializedName("calculation") + Calculation calculation; + + /** Timestamp of when the object was created. */ + @SerializedName("created") + Instant created; + + /** An optional field for adding a display name for the BillSetting object. */ + @SerializedName("display_name") + String displayName; + + /** The ID of the BillSetting object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** Settings related to invoice behavior. */ + @SerializedName("invoice") + Invoice invoice; + + /** The ID of the invoice rendering template to be used when generating invoices. */ + @SerializedName("invoice_rendering_template") + String invoiceRenderingTemplate; + + /** + * The latest version of the current settings object. This will be Updated every time an attribute + * of the settings is updated. + */ + @SerializedName("latest_version") + String latestVersion; + + /** + * The current live version of the settings object. This can be different from latest_version if + * settings are updated without setting live_version='latest'. + */ + @SerializedName("live_version") + String liveVersion; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * A lookup key used to retrieve settings dynamically from a static string. This may be up to 200 + * characters. + */ + @SerializedName("lookup_key") + String lookupKey; + + /** + * String representing the object's type. Objects of the same type share the same value of the + * object field. + * + *

Equal to {@code v2.billing.bill_setting}. + */ + @SerializedName("object") + String object; + + /** Settings related to calculating a bill. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Calculation extends StripeObject { + /** Settings for calculating tax. */ + @SerializedName("tax") + Tax tax; + + /** Settings for calculating tax. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tax extends StripeObject { + /** + * Determines if tax will be calculated automatically based on a PTC or manually based on + * rules defined by the merchant. Defaults to "manual". + * + *

One of {@code automatic}, or {@code manual}. + */ + @SerializedName("type") + String type; + } + } + + /** Settings related to invoice behavior. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Invoice extends StripeObject { + /** The amount of time until the invoice will be overdue for payment. */ + @SerializedName("time_until_due") + TimeUntilDue timeUntilDue; + + /** The amount of time until the invoice will be overdue for payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class TimeUntilDue extends StripeObject { + /** + * The interval unit for the time until due. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The number of interval units. For example, if interval=day and interval_count=30, the + * invoice will be due in 30 days. + */ + @SerializedName("interval_count") + Long intervalCount; + } + } +} diff --git a/src/main/java/com/stripe/model/v2/billing/BillSettingVersion.java b/src/main/java/com/stripe/model/v2/billing/BillSettingVersion.java new file mode 100644 index 00000000000..8824e58fa93 --- /dev/null +++ b/src/main/java/com/stripe/model/v2/billing/BillSettingVersion.java @@ -0,0 +1,108 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import java.time.Instant; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class BillSettingVersion extends StripeObject implements HasId { + /** Settings related to calculating a bill. */ + @SerializedName("calculation") + Calculation calculation; + + /** Timestamp of when the object was created. */ + @SerializedName("created") + Instant created; + + /** The ID of the BillSettingVersion object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** Settings related to invoice behavior. */ + @SerializedName("invoice") + Invoice invoice; + + /** The ID of the invoice rendering template to be used when generating invoices. */ + @SerializedName("invoice_rendering_template") + String invoiceRenderingTemplate; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * String representing the object's type. Objects of the same type share the same value of the + * object field. + * + *

Equal to {@code v2.billing.bill_setting_version}. + */ + @SerializedName("object") + String object; + + /** Settings related to calculating a bill. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Calculation extends StripeObject { + /** Settings for calculating tax. */ + @SerializedName("tax") + Tax tax; + + /** Settings for calculating tax. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tax extends StripeObject { + /** + * Determines if tax will be calculated automatically based on a PTC or manually based on + * rules defined by the merchant. Defaults to "manual". + * + *

One of {@code automatic}, or {@code manual}. + */ + @SerializedName("type") + String type; + } + } + + /** Settings related to invoice behavior. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Invoice extends StripeObject { + /** The amount of time until the invoice will be overdue for payment. */ + @SerializedName("time_until_due") + TimeUntilDue timeUntilDue; + + /** The amount of time until the invoice will be overdue for payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class TimeUntilDue extends StripeObject { + /** + * The interval unit for the time until due. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The number of interval units. For example, if interval=day and interval_count=30, the + * invoice will be due in 30 days. + */ + @SerializedName("interval_count") + Long intervalCount; + } + } +} diff --git a/src/main/java/com/stripe/model/v2/billing/Cadence.java b/src/main/java/com/stripe/model/v2/billing/Cadence.java new file mode 100644 index 00000000000..d2ee08750fe --- /dev/null +++ b/src/main/java/com/stripe/model/v2/billing/Cadence.java @@ -0,0 +1,794 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import java.time.Instant; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Cadence extends StripeObject implements HasId { + /** The billing cycle is the object that defines future billing cycle dates. */ + @SerializedName("billing_cycle") + BillingCycle billingCycle; + + /** Timestamp of when the object was created. */ + @SerializedName("created") + Instant created; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * A lookup key used to retrieve cadences dynamically from a static string. Maximum length of 200 + * characters. + */ + @SerializedName("lookup_key") + String lookupKey; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** The date that the billing cadence will next bill. Null if the cadence is not active. */ + @SerializedName("next_billing_date") + Instant nextBillingDate; + + /** + * String representing the object's type. Objects of the same type share the same value of the + * object field. + * + *

Equal to {@code v2.billing.cadence}. + */ + @SerializedName("object") + String object; + + /** The payer determines the entity financially responsible for the bill. */ + @SerializedName("payer") + Payer payer; + + /** The settings associated with the cadence. */ + @SerializedName("settings") + Settings settings; + + /** Settings data that contains expanded billing settings configuration with actual values. */ + @SerializedName("settings_data") + SettingsData settingsData; + + /** + * The current status of the cadence. + * + *

One of {@code active}, or {@code canceled}. + */ + @SerializedName("status") + String status; + + /** The ID of the Test Clock. */ + @SerializedName("test_clock") + String testClock; + + /** The billing cycle is the object that defines future billing cycle dates. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingCycle extends StripeObject { + /** Specific configuration for determining billing dates when type=day. */ + @SerializedName("day") + Day day; + + /** + * The number of intervals (specified in the interval attribute) between cadence billings. For + * example, type=month and interval_count=3 bills every 3 months. + */ + @SerializedName("interval_count") + Long intervalCount; + + /** Specific configuration for determining billing dates when type=month. */ + @SerializedName("month") + Month month; + + /** + * The frequency at which a cadence bills. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("type") + String type; + + /** Specific configuration for determining billing dates when type=week. */ + @SerializedName("week") + Week week; + + /** Specific configuration for determining billing dates when type=year. */ + @SerializedName("year") + Year year; + + /** Specific configuration for determining billing dates when type=day. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Day extends StripeObject { + /** The time at which the billing cycle ends. */ + @SerializedName("time") + Time time; + + /** The time at which the billing cycle ends. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Time extends StripeObject { + /** + * The hour at which the billing cycle ends. This must be an integer between 0 and 23, + * inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + @SerializedName("hour") + Long hour; + + /** + * The minute at which the billing cycle ends. Must be an integer between 0 and 59, + * inclusive. + */ + @SerializedName("minute") + Long minute; + + /** + * The second at which the billing cycle ends. Must be an integer between 0 and 59, + * inclusive. + */ + @SerializedName("second") + Long second; + } + } + + /** Specific configuration for determining billing dates when type=month. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Month extends StripeObject { + /** + * The day to anchor the billing on for a type="month" billing cycle from 1-31. If + * this number is greater than the number of days in the month being billed, this will anchor + * to the last day of the month. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * The month to anchor the billing on for a type="month" billing cycle from 1-12. + * Occurrences are calculated from the month anchor. + */ + @SerializedName("month_of_year") + Long monthOfYear; + + /** The time at which the billing cycle ends. */ + @SerializedName("time") + Time time; + + /** The time at which the billing cycle ends. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Time extends StripeObject { + /** + * The hour at which the billing cycle ends. This must be an integer between 0 and 23, + * inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + @SerializedName("hour") + Long hour; + + /** + * The minute at which the billing cycle ends. Must be an integer between 0 and 59, + * inclusive. + */ + @SerializedName("minute") + Long minute; + + /** + * The second at which the billing cycle ends. Must be an integer between 0 and 59, + * inclusive. + */ + @SerializedName("second") + Long second; + } + } + + /** Specific configuration for determining billing dates when type=week. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Week extends StripeObject { + /** + * The day of the week to bill the type=week billing cycle on. Numbered from 1-7 for Monday to + * Sunday respectively, based on the ISO-8601 week day numbering. + */ + @SerializedName("day_of_week") + Long dayOfWeek; + + /** The time at which the billing cycle ends. */ + @SerializedName("time") + Time time; + + /** The time at which the billing cycle ends. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Time extends StripeObject { + /** + * The hour at which the billing cycle ends. This must be an integer between 0 and 23, + * inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + @SerializedName("hour") + Long hour; + + /** + * The minute at which the billing cycle ends. Must be an integer between 0 and 59, + * inclusive. + */ + @SerializedName("minute") + Long minute; + + /** + * The second at which the billing cycle ends. Must be an integer between 0 and 59, + * inclusive. + */ + @SerializedName("second") + Long second; + } + } + + /** Specific configuration for determining billing dates when type=year. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Year extends StripeObject { + /** + * The day to anchor the billing on for a type="month" billing cycle from 1-31. If + * this number is greater than the number of days in the month being billed, this will anchor + * to the last day of the month. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * The month to bill on from 1-12. If not provided, this will default to the month the cadence + * was created. + */ + @SerializedName("month_of_year") + Long monthOfYear; + + /** The time at which the billing cycle ends. */ + @SerializedName("time") + Time time; + + /** The time at which the billing cycle ends. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Time extends StripeObject { + /** + * The hour at which the billing cycle ends. This must be an integer between 0 and 23, + * inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + @SerializedName("hour") + Long hour; + + /** + * The minute at which the billing cycle ends. Must be an integer between 0 and 59, + * inclusive. + */ + @SerializedName("minute") + Long minute; + + /** + * The second at which the billing cycle ends. Must be an integer between 0 and 59, + * inclusive. + */ + @SerializedName("second") + Long second; + } + } + } + + /** The payer determines the entity financially responsible for the bill. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Payer extends StripeObject { + /** The ID of the Billing Profile object which determines how a bill will be paid. */ + @SerializedName("billing_profile") + String billingProfile; + + /** The ID of the Customer object. */ + @SerializedName("customer") + String customer; + + /** + * A string identifying the type of the payer. Currently the only supported value is {@code + * customer}. + * + *

Equal to {@code customer}. + */ + @SerializedName("type") + String type; + } + + /** The settings associated with the cadence. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Settings extends StripeObject { + /** + * Settings that configure bills generation, which includes calculating totals, tax, and + * presenting invoices. + */ + @SerializedName("bill") + Bill bill; + + /** Settings that configure and manage the behavior of collecting payments. */ + @SerializedName("collection") + Collection collection; + + /** + * Settings that configure bills generation, which includes calculating totals, tax, and + * presenting invoices. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Bill extends StripeObject implements HasId { + /** The ID of the referenced settings object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** Returns the Settings Version when the cadence is pinned to a specific version. */ + @SerializedName("version") + String version; + } + + /** Settings that configure and manage the behavior of collecting payments. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Collection extends StripeObject implements HasId { + /** The ID of the referenced settings object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** Returns the Settings Version when the cadence is pinned to a specific version. */ + @SerializedName("version") + String version; + } + } + + /** Settings data that contains expanded billing settings configuration with actual values. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SettingsData extends StripeObject { + /** Expanded bill settings data with actual configuration values. */ + @SerializedName("bill") + Bill bill; + + /** Expanded collection settings data with actual configuration values. */ + @SerializedName("collection") + Collection collection; + + /** Expanded bill settings data with actual configuration values. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Bill extends StripeObject { + /** Settings related to calculating a bill. */ + @SerializedName("calculation") + Calculation calculation; + + /** Settings related to invoice behavior. */ + @SerializedName("invoice") + Invoice invoice; + + /** The ID of the invoice rendering template to be used when generating invoices. */ + @SerializedName("invoice_rendering_template") + String invoiceRenderingTemplate; + + /** Settings related to calculating a bill. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Calculation extends StripeObject { + /** Settings for calculating tax. */ + @SerializedName("tax") + Tax tax; + + /** Settings for calculating tax. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tax extends StripeObject { + /** + * Determines if tax will be calculated automatically based on a PTC or manually based on + * rules defined by the merchant. Defaults to "manual". + * + *

One of {@code automatic}, or {@code manual}. + */ + @SerializedName("type") + String type; + } + } + + /** Settings related to invoice behavior. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Invoice extends StripeObject { + /** The amount of time until the invoice will be overdue for payment. */ + @SerializedName("time_until_due") + TimeUntilDue timeUntilDue; + + /** The amount of time until the invoice will be overdue for payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class TimeUntilDue extends StripeObject { + /** + * The interval unit for the time until due. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The number of interval units. For example, if interval=day and interval_count=30, the + * invoice will be due in 30 days. + */ + @SerializedName("interval_count") + Long intervalCount; + } + } + } + + /** Expanded collection settings data with actual configuration values. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Collection extends StripeObject { + /** + * Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay + * this bill at the end of the period using the payment method attached to the payer profile. + * When sending an invoice, Stripe will email your payer profile an invoice with payment + * instructions. Defaults to automatic. + * + *

One of {@code automatic}, or {@code send_invoice}. + */ + @SerializedName("collection_method") + String collectionMethod; + + /** Email delivery settings. */ + @SerializedName("email_delivery") + EmailDelivery emailDelivery; + + /** + * The ID of the PaymentMethodConfiguration object, which controls which payment methods are + * displayed to your customers. + */ + @SerializedName("payment_method_configuration") + String paymentMethodConfiguration; + + /** Payment Method specific configuration stored on the object. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + + /** Email delivery settings. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EmailDelivery extends StripeObject { + /** + * Controls emails for when the payment is due. For example after the invoice is finilized + * and transition to Open state. + */ + @SerializedName("payment_due") + PaymentDue paymentDue; + + /** + * Controls emails for when the payment is due. For example after the invoice is finilized + * and transition to Open state. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDue extends StripeObject { + /** If true an email for the invoice would be generated and sent out. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * If true the payment link to hosted invocie page would be included in email and PDF of + * the invoice. + */ + @SerializedName("include_payment_link") + Boolean includePaymentLink; + } + } + + /** Payment Method specific configuration stored on the object. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodOptions extends StripeObject { + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method + * options. + */ + @SerializedName("acss_debit") + AcssDebit acssDebit; + + /** This sub-hash contains details about the Bancontact payment method. */ + @SerializedName("bancontact") + Bancontact bancontact; + + /** This sub-hash contains details about the Card payment method options. */ + @SerializedName("card") + Card card; + + /** This sub-hash contains details about the Bank transfer payment method options. */ + @SerializedName("customer_balance") + CustomerBalance customerBalance; + + /** This sub-hash contains details about the Konbini payment method options. */ + @SerializedName("konbini") + Map konbini; + + /** This sub-hash contains details about the SEPA Direct Debit payment method options. */ + @SerializedName("sepa_debit") + Map sepaDebit; + + /** This sub-hash contains details about the ACH direct debit payment method options. */ + @SerializedName("us_bank_account") + UsBankAccount usBankAccount; + + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method + * options. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AcssDebit extends StripeObject { + /** Additional fields for Mandate creation. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * Verification method. + * + *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. + */ + @SerializedName("verification_method") + String verificationMethod; + + /** Additional fields for Mandate creation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** + * Transaction type of the mandate. + * + *

One of {@code business}, or {@code personal}. + */ + @SerializedName("transaction_type") + String transactionType; + } + } + + /** This sub-hash contains details about the Bancontact payment method. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Bancontact extends StripeObject { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected + * to. + * + *

One of {@code de}, {@code en}, {@code fr}, or {@code nl}. + */ + @SerializedName("preferred_language") + String preferredLanguage; + } + + /** This sub-hash contains details about the Card payment method options. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** Configuration options for setting up an eMandate for cards issued in India. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * Selected network to process the payment on. Depends on the available networks of the + * card. + */ + @SerializedName("network") + String network; + + /** + * An advanced option 3D Secure. We strongly recommend that you rely on our SCA Engine to + * automatically prompt your customers for authentication based on risk level and other + * requirements. However, if you wish to request 3D Secure based on logic from your + * own fraud engine, provide this option. Read our guide on manually + * requesting 3D Secure for more information on how this configuration interacts with + * Radar and our SCA Engine. + * + *

One of {@code any}, {@code automatic}, or {@code challenge}. + */ + @SerializedName("request_three_d_secure") + String requestThreeDSecure; + + /** Configuration options for setting up an eMandate for cards issued in India. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ + @SerializedName("amount_type") + String amountType; + + /** A description of the mandate that is meant to be displayed to the customer. */ + @SerializedName("description") + String description; + } + } + + /** This sub-hash contains details about the Bank transfer payment method options. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomerBalance extends StripeObject { + /** + * Configuration for the bank transfer funding type, if the {@code funding_type} is set to + * {@code bank_transfer}. + */ + @SerializedName("bank_transfer") + BankTransfer bankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer + * balance. Currently the only supported value is {@code bank_transfer}. + * + *

Equal to {@code bank_transfer}. + */ + @SerializedName("funding_type") + String fundingType; + + /** + * Configuration for the bank transfer funding type, if the {@code funding_type} is set to + * {@code bank_transfer}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BankTransfer extends StripeObject { + /** + * Configuration for {@code eu_bank_transfer} funding type. Required if {@code type} is + * {@code eu_bank_transfer}. + */ + @SerializedName("eu_bank_transfer") + EuBankTransfer euBankTransfer; + + /** + * The bank transfer type that can be used for funding. + * + *

One of {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code + * jp_bank_transfer}, {@code mx_bank_transfer}, or {@code us_bank_transfer}. + */ + @SerializedName("type") + String type; + + /** + * Configuration for {@code eu_bank_transfer} funding type. Required if {@code type} is + * {@code eu_bank_transfer}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EuBankTransfer extends StripeObject { + /** + * The desired country code of the bank account information. + * + *

One of {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE}, or {@code + * NL}. + */ + @SerializedName("country") + String country; + } + } + } + + /** This sub-hash contains details about the ACH direct debit payment method options. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UsBankAccount extends StripeObject { + /** Additional fields for Financial Connections Session creation. */ + @SerializedName("financial_connections") + FinancialConnections financialConnections; + + /** + * Verification method. + * + *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. + */ + @SerializedName("verification_method") + String verificationMethod; + + /** Additional fields for Financial Connections Session creation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FinancialConnections extends StripeObject { + /** + * Provide filters for the linked accounts that the customer can select for the payment + * method. + */ + @SerializedName("filters") + Filters filters; + + /** + * The list of permissions to request. If this parameter is passed, the {@code + * payment_method} permission must be included. + */ + @SerializedName("permissions") + List permissions; + + /** List of data features that you would like to retrieve upon account creation. */ + @SerializedName("prefetch") + List prefetch; + + /** + * Provide filters for the linked accounts that the customer can select for the payment + * method. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Filters extends StripeObject { + /** The account subcategories to use to filter for selectable accounts. */ + @SerializedName("account_subcategories") + List accountSubcategories; + } + } + } + } + } + } +} diff --git a/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java b/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java new file mode 100644 index 00000000000..5825c0a88b5 --- /dev/null +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java @@ -0,0 +1,381 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import java.time.Instant; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** Settings that configure and manage the behavior of collecting payments. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class CollectionSetting extends StripeObject implements HasId { + /** + * Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this + * bill at the end of the period using the payment method attached to the payer profile. When + * sending an invoice, Stripe will email your payer profile an invoice with payment instructions. + * Defaults to automatic. + * + *

One of {@code automatic}, or {@code send_invoice}. + */ + @SerializedName("collection_method") + String collectionMethod; + + /** Timestamp of when the object was created. */ + @SerializedName("created") + Instant created; + + /** An optional field for adding a display name for the CollectionSetting object. */ + @SerializedName("display_name") + String displayName; + + /** Email delivery settings. */ + @SerializedName("email_delivery") + EmailDelivery emailDelivery; + + /** The ID of the CollectionSetting. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * The latest version of the current settings object. This will be Updated every time an attribute + * of the settings is updated. + */ + @SerializedName("latest_version") + String latestVersion; + + /** + * The current live version of the settings object. This can be different from latest_version if + * settings are updated without setting live_version='latest'. + */ + @SerializedName("live_version") + String liveVersion; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * A lookup key used to retrieve settings dynamically from a static string. This may be up to 200 + * characters. + */ + @SerializedName("lookup_key") + String lookupKey; + + /** + * String representing the object's type. Objects of the same type share the same value of the + * object field. + * + *

Equal to {@code v2.billing.collection_setting}. + */ + @SerializedName("object") + String object; + + /** + * The ID of the PaymentMethodConfiguration object, which controls which payment methods are + * displayed to your customers. + */ + @SerializedName("payment_method_configuration") + String paymentMethodConfiguration; + + /** Payment Method specific configuration stored on the object. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + + /** Email delivery settings. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EmailDelivery extends StripeObject { + /** + * Controls emails for when the payment is due. For example after the invoice is finilized and + * transition to Open state. + */ + @SerializedName("payment_due") + PaymentDue paymentDue; + + /** + * Controls emails for when the payment is due. For example after the invoice is finilized and + * transition to Open state. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDue extends StripeObject { + /** If true an email for the invoice would be generated and sent out. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * If true the payment link to hosted invocie page would be included in email and PDF of the + * invoice. + */ + @SerializedName("include_payment_link") + Boolean includePaymentLink; + } + } + + /** Payment Method specific configuration stored on the object. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodOptions extends StripeObject { + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method + * options. + */ + @SerializedName("acss_debit") + AcssDebit acssDebit; + + /** This sub-hash contains details about the Bancontact payment method. */ + @SerializedName("bancontact") + Bancontact bancontact; + + /** This sub-hash contains details about the Card payment method options. */ + @SerializedName("card") + Card card; + + /** This sub-hash contains details about the Bank transfer payment method options. */ + @SerializedName("customer_balance") + CustomerBalance customerBalance; + + /** This sub-hash contains details about the Konbini payment method options. */ + @SerializedName("konbini") + Map konbini; + + /** This sub-hash contains details about the SEPA Direct Debit payment method options. */ + @SerializedName("sepa_debit") + Map sepaDebit; + + /** This sub-hash contains details about the ACH direct debit payment method options. */ + @SerializedName("us_bank_account") + UsBankAccount usBankAccount; + + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method + * options. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AcssDebit extends StripeObject { + /** Additional fields for Mandate creation. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * Verification method. + * + *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. + */ + @SerializedName("verification_method") + String verificationMethod; + + /** Additional fields for Mandate creation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** + * Transaction type of the mandate. + * + *

One of {@code business}, or {@code personal}. + */ + @SerializedName("transaction_type") + String transactionType; + } + } + + /** This sub-hash contains details about the Bancontact payment method. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Bancontact extends StripeObject { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + * + *

One of {@code de}, {@code en}, {@code fr}, or {@code nl}. + */ + @SerializedName("preferred_language") + String preferredLanguage; + } + + /** This sub-hash contains details about the Card payment method options. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** Configuration options for setting up an eMandate for cards issued in India. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * Selected network to process the payment on. Depends on the available networks of the card. + */ + @SerializedName("network") + String network; + + /** + * An advanced option 3D Secure. We strongly recommend that you rely on our SCA Engine to + * automatically prompt your customers for authentication based on risk level and other requirements. + * However, if you wish to request 3D Secure based on logic from your own fraud engine, + * provide this option. Read our guide on manually + * requesting 3D Secure for more information on how this configuration interacts with + * Radar and our SCA Engine. + * + *

One of {@code any}, {@code automatic}, or {@code challenge}. + */ + @SerializedName("request_three_d_secure") + String requestThreeDSecure; + + /** Configuration options for setting up an eMandate for cards issued in India. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ + @SerializedName("amount_type") + String amountType; + + /** A description of the mandate that is meant to be displayed to the customer. */ + @SerializedName("description") + String description; + } + } + + /** This sub-hash contains details about the Bank transfer payment method options. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomerBalance extends StripeObject { + /** + * Configuration for the bank transfer funding type, if the {@code funding_type} is set to + * {@code bank_transfer}. + */ + @SerializedName("bank_transfer") + BankTransfer bankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. + * Currently the only supported value is {@code bank_transfer}. + * + *

Equal to {@code bank_transfer}. + */ + @SerializedName("funding_type") + String fundingType; + + /** + * Configuration for the bank transfer funding type, if the {@code funding_type} is set to + * {@code bank_transfer}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BankTransfer extends StripeObject { + /** + * Configuration for {@code eu_bank_transfer} funding type. Required if {@code type} is + * {@code eu_bank_transfer}. + */ + @SerializedName("eu_bank_transfer") + EuBankTransfer euBankTransfer; + + /** + * The bank transfer type that can be used for funding. + * + *

One of {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, + * {@code mx_bank_transfer}, or {@code us_bank_transfer}. + */ + @SerializedName("type") + String type; + + /** + * Configuration for {@code eu_bank_transfer} funding type. Required if {@code type} is + * {@code eu_bank_transfer}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EuBankTransfer extends StripeObject { + /** + * The desired country code of the bank account information. + * + *

One of {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE}, or {@code NL}. + */ + @SerializedName("country") + String country; + } + } + } + + /** This sub-hash contains details about the ACH direct debit payment method options. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UsBankAccount extends StripeObject { + /** Additional fields for Financial Connections Session creation. */ + @SerializedName("financial_connections") + FinancialConnections financialConnections; + + /** + * Verification method. + * + *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. + */ + @SerializedName("verification_method") + String verificationMethod; + + /** Additional fields for Financial Connections Session creation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FinancialConnections extends StripeObject { + /** + * Provide filters for the linked accounts that the customer can select for the payment + * method. + */ + @SerializedName("filters") + Filters filters; + + /** + * The list of permissions to request. If this parameter is passed, the {@code + * payment_method} permission must be included. + */ + @SerializedName("permissions") + List permissions; + + /** List of data features that you would like to retrieve upon account creation. */ + @SerializedName("prefetch") + List prefetch; + + /** + * Provide filters for the linked accounts that the customer can select for the payment + * method. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Filters extends StripeObject { + /** The account subcategories to use to filter for selectable accounts. */ + @SerializedName("account_subcategories") + List accountSubcategories; + } + } + } + } +} diff --git a/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java b/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java new file mode 100644 index 00000000000..d111fb5721c --- /dev/null +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java @@ -0,0 +1,355 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import java.time.Instant; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class CollectionSettingVersion extends StripeObject implements HasId { + /** + * Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this + * bill at the end of the period using the payment method attached to the payer profile. When + * sending an invoice, Stripe will email your payer profile an invoice with payment instructions. + * Defaults to automatic. + * + *

One of {@code automatic}, or {@code send_invoice}. + */ + @SerializedName("collection_method") + String collectionMethod; + + /** Timestamp of when the object was created. */ + @SerializedName("created") + Instant created; + + /** Email delivery settings. */ + @SerializedName("email_delivery") + EmailDelivery emailDelivery; + + /** The ID of the CollectionSettingVersion object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * String representing the object's type. Objects of the same type share the same value of the + * object field. + * + *

Equal to {@code v2.billing.collection_setting_version}. + */ + @SerializedName("object") + String object; + + /** + * The ID of the PaymentMethodConfiguration object, which controls which payment methods are + * displayed to your customers. + */ + @SerializedName("payment_method_configuration") + String paymentMethodConfiguration; + + /** Payment Method specific configuration stored on the object. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + + /** Email delivery settings. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EmailDelivery extends StripeObject { + /** + * Controls emails for when the payment is due. For example after the invoice is finilized and + * transition to Open state. + */ + @SerializedName("payment_due") + PaymentDue paymentDue; + + /** + * Controls emails for when the payment is due. For example after the invoice is finilized and + * transition to Open state. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDue extends StripeObject { + /** If true an email for the invoice would be generated and sent out. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * If true the payment link to hosted invocie page would be included in email and PDF of the + * invoice. + */ + @SerializedName("include_payment_link") + Boolean includePaymentLink; + } + } + + /** Payment Method specific configuration stored on the object. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodOptions extends StripeObject { + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method + * options. + */ + @SerializedName("acss_debit") + AcssDebit acssDebit; + + /** This sub-hash contains details about the Bancontact payment method. */ + @SerializedName("bancontact") + Bancontact bancontact; + + /** This sub-hash contains details about the Card payment method options. */ + @SerializedName("card") + Card card; + + /** This sub-hash contains details about the Bank transfer payment method options. */ + @SerializedName("customer_balance") + CustomerBalance customerBalance; + + /** This sub-hash contains details about the Konbini payment method options. */ + @SerializedName("konbini") + Map konbini; + + /** This sub-hash contains details about the SEPA Direct Debit payment method options. */ + @SerializedName("sepa_debit") + Map sepaDebit; + + /** This sub-hash contains details about the ACH direct debit payment method options. */ + @SerializedName("us_bank_account") + UsBankAccount usBankAccount; + + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method + * options. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AcssDebit extends StripeObject { + /** Additional fields for Mandate creation. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * Verification method. + * + *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. + */ + @SerializedName("verification_method") + String verificationMethod; + + /** Additional fields for Mandate creation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** + * Transaction type of the mandate. + * + *

One of {@code business}, or {@code personal}. + */ + @SerializedName("transaction_type") + String transactionType; + } + } + + /** This sub-hash contains details about the Bancontact payment method. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Bancontact extends StripeObject { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + * + *

One of {@code de}, {@code en}, {@code fr}, or {@code nl}. + */ + @SerializedName("preferred_language") + String preferredLanguage; + } + + /** This sub-hash contains details about the Card payment method options. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** Configuration options for setting up an eMandate for cards issued in India. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * Selected network to process the payment on. Depends on the available networks of the card. + */ + @SerializedName("network") + String network; + + /** + * An advanced option 3D Secure. We strongly recommend that you rely on our SCA Engine to + * automatically prompt your customers for authentication based on risk level and other requirements. + * However, if you wish to request 3D Secure based on logic from your own fraud engine, + * provide this option. Read our guide on manually + * requesting 3D Secure for more information on how this configuration interacts with + * Radar and our SCA Engine. + * + *

One of {@code any}, {@code automatic}, or {@code challenge}. + */ + @SerializedName("request_three_d_secure") + String requestThreeDSecure; + + /** Configuration options for setting up an eMandate for cards issued in India. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ + @SerializedName("amount_type") + String amountType; + + /** A description of the mandate that is meant to be displayed to the customer. */ + @SerializedName("description") + String description; + } + } + + /** This sub-hash contains details about the Bank transfer payment method options. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomerBalance extends StripeObject { + /** + * Configuration for the bank transfer funding type, if the {@code funding_type} is set to + * {@code bank_transfer}. + */ + @SerializedName("bank_transfer") + BankTransfer bankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. + * Currently the only supported value is {@code bank_transfer}. + * + *

Equal to {@code bank_transfer}. + */ + @SerializedName("funding_type") + String fundingType; + + /** + * Configuration for the bank transfer funding type, if the {@code funding_type} is set to + * {@code bank_transfer}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BankTransfer extends StripeObject { + /** + * Configuration for {@code eu_bank_transfer} funding type. Required if {@code type} is + * {@code eu_bank_transfer}. + */ + @SerializedName("eu_bank_transfer") + EuBankTransfer euBankTransfer; + + /** + * The bank transfer type that can be used for funding. + * + *

One of {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, + * {@code mx_bank_transfer}, or {@code us_bank_transfer}. + */ + @SerializedName("type") + String type; + + /** + * Configuration for {@code eu_bank_transfer} funding type. Required if {@code type} is + * {@code eu_bank_transfer}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EuBankTransfer extends StripeObject { + /** + * The desired country code of the bank account information. + * + *

One of {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE}, or {@code NL}. + */ + @SerializedName("country") + String country; + } + } + } + + /** This sub-hash contains details about the ACH direct debit payment method options. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UsBankAccount extends StripeObject { + /** Additional fields for Financial Connections Session creation. */ + @SerializedName("financial_connections") + FinancialConnections financialConnections; + + /** + * Verification method. + * + *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. + */ + @SerializedName("verification_method") + String verificationMethod; + + /** Additional fields for Financial Connections Session creation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FinancialConnections extends StripeObject { + /** + * Provide filters for the linked accounts that the customer can select for the payment + * method. + */ + @SerializedName("filters") + Filters filters; + + /** + * The list of permissions to request. If this parameter is passed, the {@code + * payment_method} permission must be included. + */ + @SerializedName("permissions") + List permissions; + + /** List of data features that you would like to retrieve upon account creation. */ + @SerializedName("prefetch") + List prefetch; + + /** + * Provide filters for the linked accounts that the customer can select for the payment + * method. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Filters extends StripeObject { + /** The account subcategories to use to filter for selectable accounts. */ + @SerializedName("account_subcategories") + List accountSubcategories; + } + } + } + } +} diff --git a/src/main/java/com/stripe/model/v2/billing/Profile.java b/src/main/java/com/stripe/model/v2/billing/Profile.java new file mode 100644 index 00000000000..3daf425ea3c --- /dev/null +++ b/src/main/java/com/stripe/model/v2/billing/Profile.java @@ -0,0 +1,75 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import java.time.Instant; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Profile extends StripeObject implements HasId { + /** Timestamp of when the object was created. */ + @SerializedName("created") + Instant created; + + /** The ID of the customer object. */ + @SerializedName("customer") + String customer; + + /** The ID of the payment method object. */ + @SerializedName("default_payment_method") + String defaultPaymentMethod; + + /** A customer-facing name for the billing profile. Maximum length of 250 characters. */ + @SerializedName("display_name") + String displayName; + + /** The ID of the billing profile object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * An internal key you can use to search for a particular billing profile. Maximum length of 200 + * characters. + */ + @SerializedName("lookup_key") + String lookupKey; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing + * additional information about the object in a structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value of the + * object field. + * + *

Equal to {@code v2.billing.profile}. + */ + @SerializedName("object") + String object; + + /** + * The current status of the billing profile. + * + *

One of {@code active}, or {@code inactive}. + */ + @SerializedName("status") + String status; +} diff --git a/src/main/java/com/stripe/model/v2/core/Account.java b/src/main/java/com/stripe/model/v2/core/Account.java index 073e0293c5d..a16cbb7b410 100644 --- a/src/main/java/com/stripe/model/v2/core/Account.java +++ b/src/main/java/com/stripe/model/v2/core/Account.java @@ -3376,7 +3376,7 @@ public static class Recipient extends StripeObject { /** * The payout method to be used as a default outbound destination. This will allow the - * PayoutMethod to be omitted on OutboundPayments made through the dashboard. + * PayoutMethod to be omitted on OutboundPayments made through the dashboard or APIs. */ @SerializedName("default_outbound_destination") DefaultOutboundDestination defaultOutboundDestination; @@ -3719,7 +3719,7 @@ public static class StatusDetail extends StripeObject { /** * The payout method to be used as a default outbound destination. This will allow the - * PayoutMethod to be omitted on OutboundPayments made through the dashboard. + * PayoutMethod to be omitted on OutboundPayments made through the dashboard or APIs. */ @Getter @Setter @@ -3736,23 +3736,23 @@ public static class DefaultOutboundDestination extends StripeObject implements H *

One of {@code at_bank_account}, {@code au_bank_account}, {@code ba_bank_account}, * {@code be_bank_account}, {@code bg_bank_account}, {@code bj_bank_account}, {@code * bs_bank_account}, {@code card}, {@code ca_bank_account}, {@code ch_bank_account}, {@code - * ci_bank_account}, {@code cy_bank_account}, {@code cz_bank_account}, {@code - * de_bank_account}, {@code dk_bank_account}, {@code ec_bank_account}, {@code - * ee_bank_account}, {@code es_bank_account}, {@code et_bank_account}, {@code - * fi_bank_account}, {@code fr_bank_account}, {@code gb_bank_account}, {@code - * gr_bank_account}, {@code hr_bank_account}, {@code hu_bank_account}, {@code - * id_bank_account}, {@code ie_bank_account}, {@code il_bank_account}, {@code - * in_bank_account}, {@code is_bank_account}, {@code it_bank_account}, {@code - * ke_bank_account}, {@code li_bank_account}, {@code lt_bank_account}, {@code - * lu_bank_account}, {@code lv_bank_account}, {@code mn_bank_account}, {@code - * mt_bank_account}, {@code mu_bank_account}, {@code mx_bank_account}, {@code - * na_bank_account}, {@code nl_bank_account}, {@code no_bank_account}, {@code - * nz_bank_account}, {@code pa_bank_account}, {@code ph_bank_account}, {@code - * pl_bank_account}, {@code pt_bank_account}, {@code ro_bank_account}, {@code - * rs_bank_account}, {@code se_bank_account}, {@code sg_bank_account}, {@code - * si_bank_account}, {@code sk_bank_account}, {@code sn_bank_account}, {@code - * sv_bank_account}, {@code tn_bank_account}, {@code tr_bank_account}, {@code - * us_bank_account}, or {@code za_bank_account}. + * ci_bank_account}, {@code crypto_wallet}, {@code cy_bank_account}, {@code + * cz_bank_account}, {@code de_bank_account}, {@code dk_bank_account}, {@code + * ec_bank_account}, {@code ee_bank_account}, {@code es_bank_account}, {@code + * et_bank_account}, {@code fi_bank_account}, {@code fr_bank_account}, {@code + * gb_bank_account}, {@code gr_bank_account}, {@code hr_bank_account}, {@code + * hu_bank_account}, {@code id_bank_account}, {@code ie_bank_account}, {@code + * il_bank_account}, {@code in_bank_account}, {@code is_bank_account}, {@code + * it_bank_account}, {@code ke_bank_account}, {@code li_bank_account}, {@code + * lt_bank_account}, {@code lu_bank_account}, {@code lv_bank_account}, {@code + * mn_bank_account}, {@code mt_bank_account}, {@code mu_bank_account}, {@code + * mx_bank_account}, {@code na_bank_account}, {@code nl_bank_account}, {@code + * no_bank_account}, {@code nz_bank_account}, {@code pa_bank_account}, {@code + * ph_bank_account}, {@code pl_bank_account}, {@code pt_bank_account}, {@code + * ro_bank_account}, {@code rs_bank_account}, {@code se_bank_account}, {@code + * sg_bank_account}, {@code si_bank_account}, {@code sk_bank_account}, {@code + * sn_bank_account}, {@code sv_bank_account}, {@code tn_bank_account}, {@code + * tr_bank_account}, {@code us_bank_account}, or {@code za_bank_account}. */ @SerializedName("type") String type; @@ -4365,10 +4365,35 @@ public static class Defaults extends StripeObject { @SerializedName("locales") List locales; + /** Account profile information. */ + @SerializedName("profile") + Profile profile; + /** Default responsibilities held by either Stripe or the platform. */ @SerializedName("responsibilities") Responsibilities responsibilities; + /** Account profile information. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Profile extends StripeObject { + /** The business's publicly-available website. */ + @SerializedName("business_url") + String businessUrl; + + /** The company’s legal name. */ + @SerializedName("doing_business_as") + String doingBusinessAs; + + /** + * Internal-only description of the product sold or service provided by the business. It's + * used by Stripe for risk and underwriting purposes. + */ + @SerializedName("product_description") + String productDescription; + } + /** Default responsibilities held by either Stripe or the platform. */ @Getter @Setter @@ -4640,10 +4665,6 @@ public static class BusinessDetails extends StripeObject { @SerializedName("documents") Documents documents; - /** The company’s legal name. */ - @SerializedName("doing_business_as") - String doingBusinessAs; - /** * An estimated upper bound of employees, contractors, vendors, etc. currently working for the * business. @@ -4663,13 +4684,6 @@ public static class BusinessDetails extends StripeObject { @SerializedName("phone") String phone; - /** - * Internal-only description of the product sold or service provided by the business. It’s - * used by Stripe for risk and underwriting purposes. - */ - @SerializedName("product_description") - String productDescription; - /** The business legal name. */ @SerializedName("registered_name") String registeredName; @@ -4699,10 +4713,6 @@ public static class BusinessDetails extends StripeObject { @SerializedName("structure") String structure; - /** The business's publicly available website. */ - @SerializedName("url") - String url; - /** The company’s primary address. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAddress.java b/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAddress.java index 84d42e783d5..a7b8fc6a1fc 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAddress.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAddress.java @@ -59,6 +59,10 @@ public class FinancialAddress extends StripeObject implements HasId { @SerializedName("object") String object; + /** Open Enum. The currency the FinancialAddress settles into the FinancialAccount. */ + @SerializedName("settlement_currency") + String settlementCurrency; + /** * Closed Enum. An enum representing the status of the FinancialAddress. This indicates whether or * not the FinancialAddress can be used for any money movement flows. @@ -85,10 +89,17 @@ public static class Credentials extends StripeObject { @SerializedName("gb_bank_account") GbBankAccount gbBankAccount; + /** + * The credentials of the SEPA Bank Account for the FinancialAddress. This contains unique + * banking details such as the IBAN, BIC, etc. of a SEPA bank account. + */ + @SerializedName("sepa_bank_account") + SepaBankAccount sepaBankAccount; + /** * Open Enum. The type of Credentials that are provisioned for the FinancialAddress. * - *

One of {@code gb_bank_account}, or {@code us_bank_account}. + *

One of {@code gb_bank_account}, {@code sepa_bank_account}, or {@code us_bank_account}. */ @SerializedName("type") String type; @@ -129,6 +140,43 @@ public static class GbBankAccount extends StripeObject { String sortCode; } + /** + * The credentials of the SEPA Bank Account for the FinancialAddress. This contains unique + * banking details such as the IBAN, BIC, etc. of a SEPA bank account. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SepaBankAccount extends StripeObject { + /** The account holder name to be used during bank transfers. */ + @SerializedName("account_holder_name") + String accountHolderName; + + /** The name of the Bank. */ + @SerializedName("bank_name") + String bankName; + + /** The BIC of the SEPA Bank Account. */ + @SerializedName("bic") + String bic; + + /** The originating country of the SEPA Bank account. */ + @SerializedName("country") + String country; + + /** The IBAN of the SEPA Bank Account. */ + @SerializedName("iban") + String iban; + + /** + * The last four digits of the SEPA Bank Account number. This will always be returned. To view + * the full account number when retrieving or listing FinancialAddresses, use the {@code + * include} request parameter. + */ + @SerializedName("last4") + String last4; + } + /** * The credentials of the US Bank Account for the FinancialAddress. This contains unique banking * details such as the routing number, account number, etc. of a US bank account. diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java index 07e925b9171..aedc34af7ed 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java @@ -129,22 +129,25 @@ public static class From extends StripeObject { public static class FxQuote extends StripeObject { /** * The duration the exchange rate lock remains valid from creation time. Allowed value is - * five_minutes. + * five_minutes or none. * - *

Equal to {@code five_minutes}. + *

One of {@code five_minutes}, or {@code none}. */ @SerializedName("lock_duration") String lockDuration; - /** Time at which the rate lock will expire, measured in seconds since the Unix epoch. */ + /** + * Time at which the rate lock will expire, measured in seconds since the Unix epoch. Null when + * rate locking is not supported. + */ @SerializedName("lock_expires_at") Instant lockExpiresAt; /** * Lock status of the quote. Transitions from active to expired once past the lock_expires_at - * timestamp. Value can be active or expired. + * timestamp. Value can be active, expired or none. * - *

One of {@code active}, or {@code expired}. + *

One of {@code active}, {@code expired}, or {@code none}. */ @SerializedName("lock_status") String lockStatus; diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java index 4d2af2abd08..fb276a6d89d 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java @@ -59,7 +59,7 @@ public class PayoutMethod extends StripeObject implements HasId { /** * Closed Enum. The type of payout method. * - *

One of {@code bank_account}, or {@code card}. + *

One of {@code bank_account}, {@code card}, or {@code crypto_wallet}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java index a1f7fbb28fd..06ad381d4bd 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java @@ -31,7 +31,7 @@ public class ReceivedCredit extends StripeObject implements HasId { /** * This object stores details about the originating banking transaction that resulted in the - * ReceivedCredit. Present if {@code type} field value is {@code external_credit}. + * ReceivedCredit. Present if {@code type} field value is {@code bank_transfer}. */ @SerializedName("bank_transfer") BankTransfer bankTransfer; @@ -141,7 +141,7 @@ public static class BalanceTransfer extends StripeObject { /** * This object stores details about the originating banking transaction that resulted in the - * ReceivedCredit. Present if {@code type} field value is {@code external_credit}. + * ReceivedCredit. Present if {@code type} field value is {@code bank_transfer}. */ @Getter @Setter @@ -152,34 +152,41 @@ public static class BankTransfer extends StripeObject { String financialAddress; /** - * Hash containing the transaction bank details. Present if {@code payment_method_type} field - * value is {@code gb_bank_account}. + * Hash containing the transaction bank details. Present if {@code origin_type} field value is + * {@code gb_bank_account}. */ @SerializedName("gb_bank_account") GbBankAccount gbBankAccount; /** - * Open Enum. Indicates the type of source via from which external funds originated. + * Open Enum. Indicates the origin of source from which external funds originated from. * - *

One of {@code gb_bank_account}, or {@code us_bank_account}. + *

One of {@code gb_bank_account}, {@code sepa_bank_account}, or {@code us_bank_account}. */ - @SerializedName("payment_method_type") - String paymentMethodType; + @SerializedName("origin_type") + String originType; + + /** + * Hash containing the transaction bank details. Present if {@code origin_type} field value is + * {@code sepa_bank_account}. + */ + @SerializedName("sepa_bank_account") + SepaBankAccount sepaBankAccount; /** Freeform string set by originator of the external ReceivedCredit. */ @SerializedName("statement_descriptor") String statementDescriptor; /** - * Hash containing the transaction bank details. Present if {@code payment_method_type} field - * value is {@code us_bank_account}. + * Hash containing the transaction bank details. Present if {@code origin_type} field value is + * {@code us_bank_account}. */ @SerializedName("us_bank_account") UsBankAccount usBankAccount; /** - * Hash containing the transaction bank details. Present if {@code payment_method_type} field - * value is {@code gb_bank_account}. + * Hash containing the transaction bank details. Present if {@code origin_type} field value is + * {@code gb_bank_account}. */ @Getter @Setter @@ -211,8 +218,45 @@ public static class GbBankAccount extends StripeObject { } /** - * Hash containing the transaction bank details. Present if {@code payment_method_type} field - * value is {@code us_bank_account}. + * Hash containing the transaction bank details. Present if {@code origin_type} field value is + * {@code sepa_bank_account}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SepaBankAccount extends StripeObject { + /** The account holder name of the bank account the transfer was received from. */ + @SerializedName("account_holder_name") + String accountHolderName; + + /** The bank name the transfer was received from. */ + @SerializedName("bank_name") + String bankName; + + /** The BIC of the SEPA account. */ + @SerializedName("bic") + String bic; + + /** The origination country of the bank transfer. */ + @SerializedName("country") + String country; + + /** The IBAN that originated the transfer. */ + @SerializedName("iban") + String iban; + + /** + * The money transmission network used to send funds for this ReceivedCredit. + * + *

Equal to {@code sepa_credit_transfer}. + */ + @SerializedName("network") + String network; + } + + /** + * Hash containing the transaction bank details. Present if {@code origin_type} field value is + * {@code us_bank_account}. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java b/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java index 0d26e1c7c28..594c0caa161 100644 --- a/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java +++ b/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java @@ -6,6 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.v2.Amount; import java.time.Instant; +import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -16,6 +17,10 @@ @Setter @EqualsAndHashCode(callSuper = false) public class OffSessionPayment extends StripeObject implements HasId { + /** Provides industry-specific information about the amount. */ + @SerializedName("amount_details") + AmountDetails amountDetails; + /** The “presentment amount” to be collected from the customer. */ @SerializedName("amount_requested") Amount amountRequested; @@ -46,12 +51,13 @@ public class OffSessionPayment extends StripeObject implements HasId { /** * The reason why the OffSessionPayment failed. * - *

One of {@code rejected_by_partner}, or {@code retries_exhausted}. + *

One of {@code authorization_expired}, {@code rejected_by_partner}, or {@code + * retries_exhausted}. */ @SerializedName("failure_reason") String failureReason; - /** Unique identifier for the object.. */ + /** Unique identifier for the object. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") String id; @@ -102,6 +108,10 @@ public class OffSessionPayment extends StripeObject implements HasId { @SerializedName("payment_record") String paymentRecord; + /** Details about the payments orchestration configuration. */ + @SerializedName("payments_orchestration") + PaymentsOrchestration paymentsOrchestration; + /** Details about the OffSessionPayment retries. */ @SerializedName("retry_details") RetryDetails retryDetails; @@ -144,6 +154,115 @@ public class OffSessionPayment extends StripeObject implements HasId { @SerializedName("transfer_data") TransferData transferData; + /** Provides industry-specific information about the amount. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountDetails extends StripeObject { + /** The amount the total transaction was discounted for. */ + @SerializedName("discount_amount") + Long discountAmount; + + /** + * A list of line items, each containing information about a product in the PaymentIntent. There + * is a maximum of 100 line items. + */ + @SerializedName("line_items") + List lineItems; + + /** Contains information about the shipping portion of the amount. */ + @SerializedName("shipping") + Shipping shipping; + + /** Contains information about the tax portion of the amount. */ + @SerializedName("tax") + Tax tax; + + /** + * For more details about LineItem, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LineItem extends StripeObject { + /** The amount an item was discounted for. Positive integer. */ + @SerializedName("discount_amount") + Long discountAmount; + + /** Unique identifier of the product. At most 12 characters long. */ + @SerializedName("product_code") + String productCode; + + /** Name of the product. At most 100 characters long. */ + @SerializedName("product_name") + String productName; + + /** Number of items of the product. Positive integer. */ + @SerializedName("quantity") + Long quantity; + + /** Contains information about the tax on the item. */ + @SerializedName("tax") + Tax tax; + + /** Cost of the product. Non-negative integer. */ + @SerializedName("unit_cost") + Long unitCost; + + /** Contains information about the tax on the item. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tax extends StripeObject { + /** Total portion of the amount that is for tax. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + } + } + + /** Contains information about the shipping portion of the amount. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Shipping extends StripeObject { + /** Portion of the amount that is for shipping. */ + @SerializedName("amount") + Long amount; + + /** The postal code that represents the shipping source. */ + @SerializedName("from_postal_code") + String fromPostalCode; + + /** The postal code that represents the shipping destination. */ + @SerializedName("to_postal_code") + String toPostalCode; + } + + /** Contains information about the tax portion of the amount. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tax extends StripeObject { + /** Total portion of the amount that is for tax. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + } + } + + /** Details about the payments orchestration configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentsOrchestration extends StripeObject { + /** + * True when you want to enable payments orchestration for this off-session payment. False + * otherwise. + */ + @SerializedName("enabled") + Boolean enabled; + } + /** Details about the OffSessionPayment retries. */ @Getter @Setter @@ -153,10 +272,14 @@ public static class RetryDetails extends StripeObject { @SerializedName("attempts") Long attempts; + /** The pre-configured retry policy to use for the payment. */ + @SerializedName("retry_policy") + String retryPolicy; + /** * Indicates the strategy for how you want Stripe to retry the payment. * - *

One of {@code none}, or {@code smart}. + *

One of {@code heuristic}, {@code none}, {@code scheduled}, or {@code smart}. */ @SerializedName("retry_strategy") String retryStrategy; diff --git a/src/main/java/com/stripe/param/v2/billing/BillSettingCreateParams.java b/src/main/java/com/stripe/param/v2/billing/BillSettingCreateParams.java new file mode 100644 index 00000000000..606585fd130 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/BillSettingCreateParams.java @@ -0,0 +1,496 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class BillSettingCreateParams extends ApiRequestParams { + /** Settings related to calculating a bill. */ + @SerializedName("calculation") + Calculation calculation; + + /** + * An optional customer-facing display name for the CollectionSetting object. Maximum length of + * 250 characters. + */ + @SerializedName("display_name") + String displayName; + + /** + * 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; + + /** Settings related to invoice behavior. */ + @SerializedName("invoice") + Invoice invoice; + + /** The ID of the invoice rendering template to be used when generating invoices. */ + @SerializedName("invoice_rendering_template") + String invoiceRenderingTemplate; + + /** + * A lookup key used to retrieve settings dynamically from a static string. This may be up to 200 + * characters. + */ + @SerializedName("lookup_key") + String lookupKey; + + private BillSettingCreateParams( + Calculation calculation, + String displayName, + Map extraParams, + Invoice invoice, + String invoiceRenderingTemplate, + String lookupKey) { + this.calculation = calculation; + this.displayName = displayName; + this.extraParams = extraParams; + this.invoice = invoice; + this.invoiceRenderingTemplate = invoiceRenderingTemplate; + this.lookupKey = lookupKey; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Calculation calculation; + + private String displayName; + + private Map extraParams; + + private Invoice invoice; + + private String invoiceRenderingTemplate; + + private String lookupKey; + + /** Finalize and obtain parameter instance from this builder. */ + public BillSettingCreateParams build() { + return new BillSettingCreateParams( + this.calculation, + this.displayName, + this.extraParams, + this.invoice, + this.invoiceRenderingTemplate, + this.lookupKey); + } + + /** Settings related to calculating a bill. */ + public Builder setCalculation(BillSettingCreateParams.Calculation calculation) { + this.calculation = calculation; + return this; + } + + /** + * An optional customer-facing display name for the CollectionSetting object. Maximum length of + * 250 characters. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + 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 + * BillSettingCreateParams#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 BillSettingCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Settings related to invoice behavior. */ + public Builder setInvoice(BillSettingCreateParams.Invoice invoice) { + this.invoice = invoice; + return this; + } + + /** The ID of the invoice rendering template to be used when generating invoices. */ + public Builder setInvoiceRenderingTemplate(String invoiceRenderingTemplate) { + this.invoiceRenderingTemplate = invoiceRenderingTemplate; + return this; + } + + /** + * A lookup key used to retrieve settings dynamically from a static string. This may be up to + * 200 characters. + */ + public Builder setLookupKey(String lookupKey) { + this.lookupKey = lookupKey; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Calculation { + /** + * 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; + + /** Settings for calculating tax. */ + @SerializedName("tax") + Tax tax; + + private Calculation(Map extraParams, Tax tax) { + this.extraParams = extraParams; + this.tax = tax; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Tax tax; + + /** Finalize and obtain parameter instance from this builder. */ + public BillSettingCreateParams.Calculation build() { + return new BillSettingCreateParams.Calculation(this.extraParams, this.tax); + } + + /** + * 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 + * BillSettingCreateParams.Calculation#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 BillSettingCreateParams.Calculation#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Settings for calculating tax. */ + public Builder setTax(BillSettingCreateParams.Calculation.Tax tax) { + this.tax = tax; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * 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. Determines if tax will be calculated automatically based on a + * PTC or manually based on rules defined by the merchant. Defaults to "manual". + */ + @SerializedName("type") + Type type; + + private Tax(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public BillSettingCreateParams.Calculation.Tax build() { + return new BillSettingCreateParams.Calculation.Tax(this.extraParams, this.type); + } + + /** + * 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 BillSettingCreateParams.Calculation.Tax#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 BillSettingCreateParams.Calculation.Tax#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. Determines if tax will be calculated automatically based on a + * PTC or manually based on rules defined by the merchant. Defaults to "manual". + */ + public Builder setType(BillSettingCreateParams.Calculation.Tax.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Invoice { + /** + * 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; + + /** The amount of time until the invoice will be overdue for payment. */ + @SerializedName("time_until_due") + TimeUntilDue timeUntilDue; + + private Invoice(Map extraParams, TimeUntilDue timeUntilDue) { + this.extraParams = extraParams; + this.timeUntilDue = timeUntilDue; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private TimeUntilDue timeUntilDue; + + /** Finalize and obtain parameter instance from this builder. */ + public BillSettingCreateParams.Invoice build() { + return new BillSettingCreateParams.Invoice(this.extraParams, this.timeUntilDue); + } + + /** + * 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 + * BillSettingCreateParams.Invoice#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 BillSettingCreateParams.Invoice#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The amount of time until the invoice will be overdue for payment. */ + public Builder setTimeUntilDue(BillSettingCreateParams.Invoice.TimeUntilDue timeUntilDue) { + this.timeUntilDue = timeUntilDue; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TimeUntilDue { + /** + * 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 interval unit for the time until due. */ + @SerializedName("interval") + Interval interval; + + /** + * Required. The number of interval units. For example, if interval=day and + * interval_count=30, the invoice will be due in 30 days. + */ + @SerializedName("interval_count") + Long intervalCount; + + private TimeUntilDue(Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public BillSettingCreateParams.Invoice.TimeUntilDue build() { + return new BillSettingCreateParams.Invoice.TimeUntilDue( + this.extraParams, this.interval, this.intervalCount); + } + + /** + * 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 BillSettingCreateParams.Invoice.TimeUntilDue#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 BillSettingCreateParams.Invoice.TimeUntilDue#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 interval unit for the time until due. */ + public Builder setInterval(BillSettingCreateParams.Invoice.TimeUntilDue.Interval interval) { + this.interval = interval; + return this; + } + + /** + * Required. The number of interval units. For example, if interval=day and + * interval_count=30, the invoice will be due in 30 days. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/BillSettingListParams.java b/src/main/java/com/stripe/param/v2/billing/BillSettingListParams.java new file mode 100644 index 00000000000..b972c7ab601 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/BillSettingListParams.java @@ -0,0 +1,117 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +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 BillSettingListParams extends ApiRequestParams { + /** + * 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; + + /** Optionally set the maximum number of results per page. Defaults to 20. */ + @SerializedName("limit") + Long limit; + + /** + * Only return the settings with these lookup_keys, if any exist. You can specify up to 10 + * lookup_keys. + */ + @SerializedName("lookup_keys") + List lookupKeys; + + private BillSettingListParams( + Map extraParams, Long limit, List lookupKeys) { + this.extraParams = extraParams; + this.limit = limit; + this.lookupKeys = lookupKeys; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long limit; + + private List lookupKeys; + + /** Finalize and obtain parameter instance from this builder. */ + public BillSettingListParams build() { + return new BillSettingListParams(this.extraParams, this.limit, this.lookupKeys); + } + + /** + * 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 + * BillSettingListParams#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 BillSettingListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Optionally set the maximum number of results per page. Defaults to 20. */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Add an element to `lookupKeys` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * BillSettingListParams#lookupKeys} for the field documentation. + */ + public Builder addLookupKey(String element) { + if (this.lookupKeys == null) { + this.lookupKeys = new ArrayList<>(); + } + this.lookupKeys.add(element); + return this; + } + + /** + * Add all elements to `lookupKeys` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * BillSettingListParams#lookupKeys} for the field documentation. + */ + public Builder addAllLookupKey(List elements) { + if (this.lookupKeys == null) { + this.lookupKeys = new ArrayList<>(); + } + this.lookupKeys.addAll(elements); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/BillSettingUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/BillSettingUpdateParams.java new file mode 100644 index 00000000000..e9aeba82b85 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/BillSettingUpdateParams.java @@ -0,0 +1,551 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class BillSettingUpdateParams extends ApiRequestParams { + /** Settings related to calculating a bill. */ + @SerializedName("calculation") + Calculation calculation; + + /** + * An optional customer-facing display name for the BillSetting object. To remove the display + * name, set it to an empty string in the request. Maximum length of 250 characters. + */ + @SerializedName("display_name") + Object displayName; + + /** + * 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; + + /** Settings related to invoice behavior. */ + @SerializedName("invoice") + Invoice invoice; + + /** The ID of the invoice rendering template to be used when generating invoices. */ + @SerializedName("invoice_rendering_template") + Object invoiceRenderingTemplate; + + /** + * Optionally change the live version of the BillSetting. Providing {@code live_version = + * "latest"} will set the BillSetting' {@code live_version} to its latest version. + */ + @SerializedName("live_version") + Object liveVersion; + + /** + * A lookup key used to retrieve settings dynamically from a static string. This may be up to 200 + * characters. + */ + @SerializedName("lookup_key") + Object lookupKey; + + private BillSettingUpdateParams( + Calculation calculation, + Object displayName, + Map extraParams, + Invoice invoice, + Object invoiceRenderingTemplate, + Object liveVersion, + Object lookupKey) { + this.calculation = calculation; + this.displayName = displayName; + this.extraParams = extraParams; + this.invoice = invoice; + this.invoiceRenderingTemplate = invoiceRenderingTemplate; + this.liveVersion = liveVersion; + this.lookupKey = lookupKey; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Calculation calculation; + + private Object displayName; + + private Map extraParams; + + private Invoice invoice; + + private Object invoiceRenderingTemplate; + + private Object liveVersion; + + private Object lookupKey; + + /** Finalize and obtain parameter instance from this builder. */ + public BillSettingUpdateParams build() { + return new BillSettingUpdateParams( + this.calculation, + this.displayName, + this.extraParams, + this.invoice, + this.invoiceRenderingTemplate, + this.liveVersion, + this.lookupKey); + } + + /** Settings related to calculating a bill. */ + public Builder setCalculation(BillSettingUpdateParams.Calculation calculation) { + this.calculation = calculation; + return this; + } + + /** + * An optional customer-facing display name for the BillSetting object. To remove the display + * name, set it to an empty string in the request. Maximum length of 250 characters. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * An optional customer-facing display name for the BillSetting object. To remove the display + * name, set it to an empty string in the request. Maximum length of 250 characters. + */ + public Builder setDisplayName(EmptyParam displayName) { + this.displayName = displayName; + 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 + * BillSettingUpdateParams#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 BillSettingUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Settings related to invoice behavior. */ + public Builder setInvoice(BillSettingUpdateParams.Invoice invoice) { + this.invoice = invoice; + return this; + } + + /** The ID of the invoice rendering template to be used when generating invoices. */ + public Builder setInvoiceRenderingTemplate(String invoiceRenderingTemplate) { + this.invoiceRenderingTemplate = invoiceRenderingTemplate; + return this; + } + + /** The ID of the invoice rendering template to be used when generating invoices. */ + public Builder setInvoiceRenderingTemplate(EmptyParam invoiceRenderingTemplate) { + this.invoiceRenderingTemplate = invoiceRenderingTemplate; + return this; + } + + /** + * Optionally change the live version of the BillSetting. Providing {@code live_version = + * "latest"} will set the BillSetting' {@code live_version} to its latest version. + */ + public Builder setLiveVersion(String liveVersion) { + this.liveVersion = liveVersion; + return this; + } + + /** + * Optionally change the live version of the BillSetting. Providing {@code live_version = + * "latest"} will set the BillSetting' {@code live_version} to its latest version. + */ + public Builder setLiveVersion(EmptyParam liveVersion) { + this.liveVersion = liveVersion; + return this; + } + + /** + * A lookup key used to retrieve settings dynamically from a static string. This may be up to + * 200 characters. + */ + public Builder setLookupKey(String lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** + * A lookup key used to retrieve settings dynamically from a static string. This may be up to + * 200 characters. + */ + public Builder setLookupKey(EmptyParam lookupKey) { + this.lookupKey = lookupKey; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Calculation { + /** + * 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; + + /** Settings for calculating tax. */ + @SerializedName("tax") + Tax tax; + + private Calculation(Map extraParams, Tax tax) { + this.extraParams = extraParams; + this.tax = tax; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Tax tax; + + /** Finalize and obtain parameter instance from this builder. */ + public BillSettingUpdateParams.Calculation build() { + return new BillSettingUpdateParams.Calculation(this.extraParams, this.tax); + } + + /** + * 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 + * BillSettingUpdateParams.Calculation#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 BillSettingUpdateParams.Calculation#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Settings for calculating tax. */ + public Builder setTax(BillSettingUpdateParams.Calculation.Tax tax) { + this.tax = tax; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * 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. Determines if tax will be calculated automatically based on a + * PTC or manually based on rules defined by the merchant. Defaults to "manual". + */ + @SerializedName("type") + Type type; + + private Tax(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public BillSettingUpdateParams.Calculation.Tax build() { + return new BillSettingUpdateParams.Calculation.Tax(this.extraParams, this.type); + } + + /** + * 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 BillSettingUpdateParams.Calculation.Tax#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 BillSettingUpdateParams.Calculation.Tax#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. Determines if tax will be calculated automatically based on a + * PTC or manually based on rules defined by the merchant. Defaults to "manual". + */ + public Builder setType(BillSettingUpdateParams.Calculation.Tax.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Invoice { + /** + * 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; + + /** The amount of time until the invoice will be overdue for payment. */ + @SerializedName("time_until_due") + TimeUntilDue timeUntilDue; + + private Invoice(Map extraParams, TimeUntilDue timeUntilDue) { + this.extraParams = extraParams; + this.timeUntilDue = timeUntilDue; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private TimeUntilDue timeUntilDue; + + /** Finalize and obtain parameter instance from this builder. */ + public BillSettingUpdateParams.Invoice build() { + return new BillSettingUpdateParams.Invoice(this.extraParams, this.timeUntilDue); + } + + /** + * 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 + * BillSettingUpdateParams.Invoice#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 BillSettingUpdateParams.Invoice#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The amount of time until the invoice will be overdue for payment. */ + public Builder setTimeUntilDue(BillSettingUpdateParams.Invoice.TimeUntilDue timeUntilDue) { + this.timeUntilDue = timeUntilDue; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TimeUntilDue { + /** + * 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 interval unit for the time until due. */ + @SerializedName("interval") + Interval interval; + + /** + * Required. The number of interval units. For example, if interval=day and + * interval_count=30, the invoice will be due in 30 days. + */ + @SerializedName("interval_count") + Long intervalCount; + + private TimeUntilDue(Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public BillSettingUpdateParams.Invoice.TimeUntilDue build() { + return new BillSettingUpdateParams.Invoice.TimeUntilDue( + this.extraParams, this.interval, this.intervalCount); + } + + /** + * 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 BillSettingUpdateParams.Invoice.TimeUntilDue#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 BillSettingUpdateParams.Invoice.TimeUntilDue#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 interval unit for the time until due. */ + public Builder setInterval(BillSettingUpdateParams.Invoice.TimeUntilDue.Interval interval) { + this.interval = interval; + return this; + } + + /** + * Required. The number of interval units. For example, if interval=day and + * interval_count=30, the invoice will be due in 30 days. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/CadenceCreateParams.java b/src/main/java/com/stripe/param/v2/billing/CadenceCreateParams.java new file mode 100644 index 00000000000..47cc41179bc --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/CadenceCreateParams.java @@ -0,0 +1,1606 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class CadenceCreateParams extends ApiRequestParams { + /** + * Required. The billing cycle is the object that defines future billing cycle + * dates. + */ + @SerializedName("billing_cycle") + BillingCycle billingCycle; + + /** + * 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 lookup key used to retrieve cadences dynamically from a static string. Maximum length of 200 + * characters. + */ + @SerializedName("lookup_key") + String lookupKey; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** + * Required. The payer determines the entity financially responsible for the + * bill. + */ + @SerializedName("payer") + Payer payer; + + /** The settings associated with the cadence. */ + @SerializedName("settings") + Settings settings; + + private CadenceCreateParams( + BillingCycle billingCycle, + Map extraParams, + String lookupKey, + Map metadata, + Payer payer, + Settings settings) { + this.billingCycle = billingCycle; + this.extraParams = extraParams; + this.lookupKey = lookupKey; + this.metadata = metadata; + this.payer = payer; + this.settings = settings; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillingCycle billingCycle; + + private Map extraParams; + + private String lookupKey; + + private Map metadata; + + private Payer payer; + + private Settings settings; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams build() { + return new CadenceCreateParams( + this.billingCycle, + this.extraParams, + this.lookupKey, + this.metadata, + this.payer, + this.settings); + } + + /** + * Required. The billing cycle is the object that defines future billing cycle + * dates. + */ + public Builder setBillingCycle(CadenceCreateParams.BillingCycle billingCycle) { + this.billingCycle = billingCycle; + 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 + * CadenceCreateParams#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 CadenceCreateParams#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 lookup key used to retrieve cadences dynamically from a static string. Maximum length of + * 200 characters. + */ + public Builder setLookupKey(String lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, + * and subsequent calls add additional key/value pairs to the original map. See {@link + * CadenceCreateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link CadenceCreateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** + * Required. The payer determines the entity financially responsible for the + * bill. + */ + public Builder setPayer(CadenceCreateParams.Payer payer) { + this.payer = payer; + return this; + } + + /** The settings associated with the cadence. */ + public Builder setSettings(CadenceCreateParams.Settings settings) { + this.settings = settings; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingCycle { + /** Specific configuration for determining billing dates when type=day. */ + @SerializedName("day") + Day day; + + /** + * 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; + + /** + * The number of intervals (specified in the interval attribute) between cadence billings. For + * example, type=month and interval_count=3 bills every 3 months. If this is not provided, it + * will default to 1. + */ + @SerializedName("interval_count") + Long intervalCount; + + /** Specific configuration for determining billing dates when type=month. */ + @SerializedName("month") + Month month; + + /** Required. The frequency at which a cadence bills. */ + @SerializedName("type") + Type type; + + /** Specific configuration for determining billing dates when type=week. */ + @SerializedName("week") + Week week; + + /** Specific configuration for determining billing dates when type=year. */ + @SerializedName("year") + Year year; + + private BillingCycle( + Day day, + Map extraParams, + Long intervalCount, + Month month, + Type type, + Week week, + Year year) { + this.day = day; + this.extraParams = extraParams; + this.intervalCount = intervalCount; + this.month = month; + this.type = type; + this.week = week; + this.year = year; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Day day; + + private Map extraParams; + + private Long intervalCount; + + private Month month; + + private Type type; + + private Week week; + + private Year year; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.BillingCycle build() { + return new CadenceCreateParams.BillingCycle( + this.day, + this.extraParams, + this.intervalCount, + this.month, + this.type, + this.week, + this.year); + } + + /** Specific configuration for determining billing dates when type=day. */ + public Builder setDay(CadenceCreateParams.BillingCycle.Day day) { + this.day = day; + 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 + * CadenceCreateParams.BillingCycle#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 CadenceCreateParams.BillingCycle#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * The number of intervals (specified in the interval attribute) between cadence billings. For + * example, type=month and interval_count=3 bills every 3 months. If this is not provided, it + * will default to 1. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + + /** Specific configuration for determining billing dates when type=month. */ + public Builder setMonth(CadenceCreateParams.BillingCycle.Month month) { + this.month = month; + return this; + } + + /** Required. The frequency at which a cadence bills. */ + public Builder setType(CadenceCreateParams.BillingCycle.Type type) { + this.type = type; + return this; + } + + /** Specific configuration for determining billing dates when type=week. */ + public Builder setWeek(CadenceCreateParams.BillingCycle.Week week) { + this.week = week; + return this; + } + + /** Specific configuration for determining billing dates when type=year. */ + public Builder setYear(CadenceCreateParams.BillingCycle.Year year) { + this.year = year; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Day { + /** + * 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; + + /** + * The time at which the billing cycle ends. This field is optional, and if not provided, it + * will default to the time at which the cadence was created in UTC timezone. + */ + @SerializedName("time") + Time time; + + private Day(Map extraParams, Time time) { + this.extraParams = extraParams; + this.time = time; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Time time; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.BillingCycle.Day build() { + return new CadenceCreateParams.BillingCycle.Day(this.extraParams, this.time); + } + + /** + * 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 CadenceCreateParams.BillingCycle.Day#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 CadenceCreateParams.BillingCycle.Day#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * The time at which the billing cycle ends. This field is optional, and if not provided, it + * will default to the time at which the cadence was created in UTC timezone. + */ + public Builder setTime(CadenceCreateParams.BillingCycle.Day.Time time) { + this.time = time; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Time { + /** + * 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 hour at which the billing cycle ends. This must be an + * integer between 0 and 23, inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + @SerializedName("hour") + Long hour; + + /** + * Required. The minute at which the billing cycle ends. Must be an integer + * between 0 and 59, inclusive. + */ + @SerializedName("minute") + Long minute; + + /** + * Required. The second at which the billing cycle ends. Must be an integer + * between 0 and 59, inclusive. + */ + @SerializedName("second") + Long second; + + private Time(Map extraParams, Long hour, Long minute, Long second) { + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.BillingCycle.Day.Time build() { + return new CadenceCreateParams.BillingCycle.Day.Time( + this.extraParams, this.hour, this.minute, this.second); + } + + /** + * 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 CadenceCreateParams.BillingCycle.Day.Time#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 CadenceCreateParams.BillingCycle.Day.Time#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 hour at which the billing cycle ends. This must be an + * integer between 0 and 23, inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** + * Required. The minute at which the billing cycle ends. Must be an + * integer between 0 and 59, inclusive. + */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** + * Required. The second at which the billing cycle ends. Must be an + * integer between 0 and 59, inclusive. + */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Month { + /** + * Required. The day to anchor the billing on for a type="month" + * billing cycle from 1-31. If this number is greater than the number of days in the month + * being billed, this will anchor to the last day of the month. If not provided, this will + * default to the day the cadence was created. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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; + + /** + * The month to anchor the billing on for a type="month" billing cycle from 1-12. If + * not provided, this will default to the month the cadence was created. This setting can only + * be used for monthly billing cycles with {@code interval_count} of 2, 3, 4 or 6. All + * occurrences will be calculated from month provided. + */ + @SerializedName("month_of_year") + Long monthOfYear; + + /** + * The time at which the billing cycle ends. This field is optional, and if not provided, it + * will default to the time at which the cadence was created in UTC timezone. + */ + @SerializedName("time") + Time time; + + private Month(Long dayOfMonth, Map extraParams, Long monthOfYear, Time time) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.monthOfYear = monthOfYear; + this.time = time; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long monthOfYear; + + private Time time; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.BillingCycle.Month build() { + return new CadenceCreateParams.BillingCycle.Month( + this.dayOfMonth, this.extraParams, this.monthOfYear, this.time); + } + + /** + * Required. The day to anchor the billing on for a type="month" + * billing cycle from 1-31. If this number is greater than the number of days in the month + * being billed, this will anchor to the last day of the month. If not provided, this will + * default to the day the cadence was created. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 CadenceCreateParams.BillingCycle.Month#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 CadenceCreateParams.BillingCycle.Month#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * The month to anchor the billing on for a type="month" billing cycle from 1-12. + * If not provided, this will default to the month the cadence was created. This setting can + * only be used for monthly billing cycles with {@code interval_count} of 2, 3, 4 or 6. All + * occurrences will be calculated from month provided. + */ + public Builder setMonthOfYear(Long monthOfYear) { + this.monthOfYear = monthOfYear; + return this; + } + + /** + * The time at which the billing cycle ends. This field is optional, and if not provided, it + * will default to the time at which the cadence was created in UTC timezone. + */ + public Builder setTime(CadenceCreateParams.BillingCycle.Month.Time time) { + this.time = time; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Time { + /** + * 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 hour at which the billing cycle ends. This must be an + * integer between 0 and 23, inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + @SerializedName("hour") + Long hour; + + /** + * Required. The minute at which the billing cycle ends. Must be an integer + * between 0 and 59, inclusive. + */ + @SerializedName("minute") + Long minute; + + /** + * Required. The second at which the billing cycle ends. Must be an integer + * between 0 and 59, inclusive. + */ + @SerializedName("second") + Long second; + + private Time(Map extraParams, Long hour, Long minute, Long second) { + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.BillingCycle.Month.Time build() { + return new CadenceCreateParams.BillingCycle.Month.Time( + this.extraParams, this.hour, this.minute, this.second); + } + + /** + * 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 CadenceCreateParams.BillingCycle.Month.Time#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 CadenceCreateParams.BillingCycle.Month.Time#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 hour at which the billing cycle ends. This must be an + * integer between 0 and 23, inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** + * Required. The minute at which the billing cycle ends. Must be an + * integer between 0 and 59, inclusive. + */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** + * Required. The second at which the billing cycle ends. Must be an + * integer between 0 and 59, inclusive. + */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Week { + /** + * Required. The day of the week to bill the type=week billing cycle on. + * Numbered from 1-7 for Monday to Sunday respectively, based on the ISO-8601 week day + * numbering. If not provided, this will default to the day the cadence was created. + */ + @SerializedName("day_of_week") + Long dayOfWeek; + + /** + * 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; + + /** + * The time at which the billing cycle ends. This field is optional, and if not provided, it + * will default to the time at which the cadence was created in UTC timezone. + */ + @SerializedName("time") + Time time; + + private Week(Long dayOfWeek, Map extraParams, Time time) { + this.dayOfWeek = dayOfWeek; + this.extraParams = extraParams; + this.time = time; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfWeek; + + private Map extraParams; + + private Time time; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.BillingCycle.Week build() { + return new CadenceCreateParams.BillingCycle.Week( + this.dayOfWeek, this.extraParams, this.time); + } + + /** + * Required. The day of the week to bill the type=week billing cycle on. + * Numbered from 1-7 for Monday to Sunday respectively, based on the ISO-8601 week day + * numbering. If not provided, this will default to the day the cadence was created. + */ + public Builder setDayOfWeek(Long dayOfWeek) { + this.dayOfWeek = dayOfWeek; + 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 CadenceCreateParams.BillingCycle.Week#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 CadenceCreateParams.BillingCycle.Week#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * The time at which the billing cycle ends. This field is optional, and if not provided, it + * will default to the time at which the cadence was created in UTC timezone. + */ + public Builder setTime(CadenceCreateParams.BillingCycle.Week.Time time) { + this.time = time; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Time { + /** + * 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 hour at which the billing cycle ends. This must be an + * integer between 0 and 23, inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + @SerializedName("hour") + Long hour; + + /** + * Required. The minute at which the billing cycle ends. Must be an integer + * between 0 and 59, inclusive. + */ + @SerializedName("minute") + Long minute; + + /** + * Required. The second at which the billing cycle ends. Must be an integer + * between 0 and 59, inclusive. + */ + @SerializedName("second") + Long second; + + private Time(Map extraParams, Long hour, Long minute, Long second) { + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.BillingCycle.Week.Time build() { + return new CadenceCreateParams.BillingCycle.Week.Time( + this.extraParams, this.hour, this.minute, this.second); + } + + /** + * 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 CadenceCreateParams.BillingCycle.Week.Time#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 CadenceCreateParams.BillingCycle.Week.Time#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 hour at which the billing cycle ends. This must be an + * integer between 0 and 23, inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** + * Required. The minute at which the billing cycle ends. Must be an + * integer between 0 and 59, inclusive. + */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** + * Required. The second at which the billing cycle ends. Must be an + * integer between 0 and 59, inclusive. + */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Year { + /** + * The day to anchor the billing on for a type="month" billing cycle from 1-31. If + * this number is greater than the number of days in the month being billed, this will anchor + * to the last day of the month. If not provided, this will default to the day the cadence was + * created. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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; + + /** + * The month to bill on from 1-12. If not provided, this will default to the month the cadence + * was created. + */ + @SerializedName("month_of_year") + Long monthOfYear; + + /** + * The time at which the billing cycle ends. This field is optional, and if not provided, it + * will default to the time at which the cadence was created in UTC timezone. + */ + @SerializedName("time") + Time time; + + private Year(Long dayOfMonth, Map extraParams, Long monthOfYear, Time time) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.monthOfYear = monthOfYear; + this.time = time; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long monthOfYear; + + private Time time; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.BillingCycle.Year build() { + return new CadenceCreateParams.BillingCycle.Year( + this.dayOfMonth, this.extraParams, this.monthOfYear, this.time); + } + + /** + * The day to anchor the billing on for a type="month" billing cycle from 1-31. If + * this number is greater than the number of days in the month being billed, this will + * anchor to the last day of the month. If not provided, this will default to the day the + * cadence was created. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 CadenceCreateParams.BillingCycle.Year#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 CadenceCreateParams.BillingCycle.Year#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * The month to bill on from 1-12. If not provided, this will default to the month the + * cadence was created. + */ + public Builder setMonthOfYear(Long monthOfYear) { + this.monthOfYear = monthOfYear; + return this; + } + + /** + * The time at which the billing cycle ends. This field is optional, and if not provided, it + * will default to the time at which the cadence was created in UTC timezone. + */ + public Builder setTime(CadenceCreateParams.BillingCycle.Year.Time time) { + this.time = time; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Time { + /** + * 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 hour at which the billing cycle ends. This must be an + * integer between 0 and 23, inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + @SerializedName("hour") + Long hour; + + /** + * Required. The minute at which the billing cycle ends. Must be an integer + * between 0 and 59, inclusive. + */ + @SerializedName("minute") + Long minute; + + /** + * Required. The second at which the billing cycle ends. Must be an integer + * between 0 and 59, inclusive. + */ + @SerializedName("second") + Long second; + + private Time(Map extraParams, Long hour, Long minute, Long second) { + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.BillingCycle.Year.Time build() { + return new CadenceCreateParams.BillingCycle.Year.Time( + this.extraParams, this.hour, this.minute, this.second); + } + + /** + * 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 CadenceCreateParams.BillingCycle.Year.Time#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 CadenceCreateParams.BillingCycle.Year.Time#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 hour at which the billing cycle ends. This must be an + * integer between 0 and 23, inclusive. 0 represents midnight, and 23 represents 11 PM. + */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** + * Required. The minute at which the billing cycle ends. Must be an + * integer between 0 and 59, inclusive. + */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** + * Required. The second at which the billing cycle ends. Must be an + * integer between 0 and 59, inclusive. + */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Payer { + /** + * Required. The ID of the Billing Profile object which determines how a bill + * will be paid. + */ + @SerializedName("billing_profile") + String billingProfile; + + /** + * 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 Payer(String billingProfile, Map extraParams) { + this.billingProfile = billingProfile; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String billingProfile; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.Payer build() { + return new CadenceCreateParams.Payer(this.billingProfile, this.extraParams); + } + + /** + * Required. The ID of the Billing Profile object which determines how a bill + * will be paid. + */ + public Builder setBillingProfile(String billingProfile) { + this.billingProfile = billingProfile; + 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 + * CadenceCreateParams.Payer#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 CadenceCreateParams.Payer#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * Settings that configure bill generation, which includes calculating totals, tax, and + * presenting invoices. If no setting is provided here, the settings from the customer + * referenced on the payer will be used. If no customer settings are present, the merchant + * default settings will be used. + */ + @SerializedName("bill") + Bill bill; + + /** + * Settings that configure and manage the behavior of collecting payments. If no setting is + * provided here, the settings from the customer referenced from the payer will be used if they + * exist. If no customer settings are present, the merchant default settings will be used. + */ + @SerializedName("collection") + Collection collection; + + /** + * 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 Settings(Bill bill, Collection collection, Map extraParams) { + this.bill = bill; + this.collection = collection; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Bill bill; + + private Collection collection; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.Settings build() { + return new CadenceCreateParams.Settings(this.bill, this.collection, this.extraParams); + } + + /** + * Settings that configure bill generation, which includes calculating totals, tax, and + * presenting invoices. If no setting is provided here, the settings from the customer + * referenced on the payer will be used. If no customer settings are present, the merchant + * default settings will be used. + */ + public Builder setBill(CadenceCreateParams.Settings.Bill bill) { + this.bill = bill; + return this; + } + + /** + * Settings that configure and manage the behavior of collecting payments. If no setting is + * provided here, the settings from the customer referenced from the payer will be used if + * they exist. If no customer settings are present, the merchant default settings will be + * used. + */ + public Builder setCollection(CadenceCreateParams.Settings.Collection collection) { + this.collection = collection; + 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 + * CadenceCreateParams.Settings#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 CadenceCreateParams.Settings#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Bill { + /** + * 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 ID of the referenced settings object. */ + @SerializedName("id") + String id; + + /** + * An optional field to specify the version of the Settings to use. If not provided, this will + * always default to the live version any time the settings are used. + */ + @SerializedName("version") + String version; + + private Bill(Map extraParams, String id, String version) { + this.extraParams = extraParams; + this.id = id; + this.version = version; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String id; + + private String version; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.Settings.Bill build() { + return new CadenceCreateParams.Settings.Bill(this.extraParams, this.id, this.version); + } + + /** + * 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 CadenceCreateParams.Settings.Bill#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 CadenceCreateParams.Settings.Bill#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 ID of the referenced settings object. */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** + * An optional field to specify the version of the Settings to use. If not provided, this + * will always default to the live version any time the settings are used. + */ + public Builder setVersion(String version) { + this.version = version; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Collection { + /** + * 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 ID of the referenced settings object. */ + @SerializedName("id") + String id; + + /** + * An optional field to specify the version of the Settings to use. If not provided, this will + * always default to the live version any time the settings are used. + */ + @SerializedName("version") + String version; + + private Collection(Map extraParams, String id, String version) { + this.extraParams = extraParams; + this.id = id; + this.version = version; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String id; + + private String version; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceCreateParams.Settings.Collection build() { + return new CadenceCreateParams.Settings.Collection( + this.extraParams, this.id, this.version); + } + + /** + * 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 CadenceCreateParams.Settings.Collection#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 CadenceCreateParams.Settings.Collection#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 ID of the referenced settings object. */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** + * An optional field to specify the version of the Settings to use. If not provided, this + * will always default to the live version any time the settings are used. + */ + public Builder setVersion(String version) { + this.version = version; + return this; + } + } + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/CadenceListParams.java b/src/main/java/com/stripe/param/v2/billing/CadenceListParams.java new file mode 100644 index 00000000000..035c6b37d13 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/CadenceListParams.java @@ -0,0 +1,312 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +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 CadenceListParams extends ApiRequestParams { + /** + * 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; + + /** Additional resource to include in the response. */ + @SerializedName("include") + List include; + + /** Optionally set the maximum number of results per page. Defaults to 20. */ + @SerializedName("limit") + Long limit; + + /** + * Only return the cadences with these lookup_keys, if any exist. You can specify up to 10 + * lookup_keys. Mutually exclusive with {@code test_clock} and {@code payer}. + */ + @SerializedName("lookup_keys") + List lookupKeys; + + /** + * If provided, only cadences that specifically reference the payer will be returned. Mutually + * exclusive with {@code test_clock} and {@code lookup_keys}. + */ + @SerializedName("payer") + Payer payer; + + /** + * If provided, only cadences that specifically reference the provided test clock ID (via the + * customer's test clock) will be returned. Mutually exclusive with {@code payer}. + */ + @SerializedName("test_clock") + String testClock; + + private CadenceListParams( + Map extraParams, + List include, + Long limit, + List lookupKeys, + Payer payer, + String testClock) { + this.extraParams = extraParams; + this.include = include; + this.limit = limit; + this.lookupKeys = lookupKeys; + this.payer = payer; + this.testClock = testClock; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List include; + + private Long limit; + + private List lookupKeys; + + private Payer payer; + + private String testClock; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceListParams build() { + return new CadenceListParams( + this.extraParams, this.include, this.limit, this.lookupKeys, this.payer, this.testClock); + } + + /** + * 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 + * CadenceListParams#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 CadenceListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * CadenceListParams#include} for the field documentation. + */ + public Builder addInclude(CadenceListParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * CadenceListParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + + /** Optionally set the maximum number of results per page. Defaults to 20. */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Add an element to `lookupKeys` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * CadenceListParams#lookupKeys} for the field documentation. + */ + public Builder addLookupKey(String element) { + if (this.lookupKeys == null) { + this.lookupKeys = new ArrayList<>(); + } + this.lookupKeys.add(element); + return this; + } + + /** + * Add all elements to `lookupKeys` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * CadenceListParams#lookupKeys} for the field documentation. + */ + public Builder addAllLookupKey(List elements) { + if (this.lookupKeys == null) { + this.lookupKeys = new ArrayList<>(); + } + this.lookupKeys.addAll(elements); + return this; + } + + /** + * If provided, only cadences that specifically reference the payer will be returned. Mutually + * exclusive with {@code test_clock} and {@code lookup_keys}. + */ + public Builder setPayer(CadenceListParams.Payer payer) { + this.payer = payer; + return this; + } + + /** + * If provided, only cadences that specifically reference the provided test clock ID (via the + * customer's test clock) will be returned. Mutually exclusive with {@code payer}. + */ + public Builder setTestClock(String testClock) { + this.testClock = testClock; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Payer { + /** + * The ID of the Customer object. If provided, only cadences that specifically reference the + * provided customer ID will be returned. + */ + @SerializedName("customer") + String customer; + + /** + * 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. A string identifying the type of the payer. Currently the only + * supported value is {@code customer}. + */ + @SerializedName("type") + Type type; + + private Payer(String customer, Map extraParams, Type type) { + this.customer = customer; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String customer; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceListParams.Payer build() { + return new CadenceListParams.Payer(this.customer, this.extraParams, this.type); + } + + /** + * The ID of the Customer object. If provided, only cadences that specifically reference the + * provided customer ID will be returned. + */ + public Builder setCustomer(String customer) { + this.customer = customer; + 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 + * CadenceListParams.Payer#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 CadenceListParams.Payer#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. A string identifying the type of the payer. Currently the only + * supported value is {@code customer}. + */ + public Builder setType(CadenceListParams.Payer.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("customer") + CUSTOMER("customer"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("settings_data") + SETTINGS_DATA("settings_data"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/CadenceRetrieveParams.java b/src/main/java/com/stripe/param/v2/billing/CadenceRetrieveParams.java new file mode 100644 index 00000000000..1f3f91bcb5e --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/CadenceRetrieveParams.java @@ -0,0 +1,113 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +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 CadenceRetrieveParams extends ApiRequestParams { + /** + * 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; + + /** Additional resource to include in the response. */ + @SerializedName("include") + List include; + + private CadenceRetrieveParams( + Map extraParams, List include) { + this.extraParams = extraParams; + this.include = include; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List include; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceRetrieveParams build() { + return new CadenceRetrieveParams(this.extraParams, this.include); + } + + /** + * 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 + * CadenceRetrieveParams#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 CadenceRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * CadenceRetrieveParams#include} for the field documentation. + */ + public Builder addInclude(CadenceRetrieveParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * CadenceRetrieveParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("settings_data") + SETTINGS_DATA("settings_data"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/CadenceUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/CadenceUpdateParams.java new file mode 100644 index 00000000000..25d57dff2cd --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/CadenceUpdateParams.java @@ -0,0 +1,575 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class CadenceUpdateParams extends ApiRequestParams { + /** + * 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 lookup key used to retrieve cadences dynamically from a static string. Maximum length of 200 + * characters. + */ + @SerializedName("lookup_key") + Object lookupKey; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** The payer determines the entity financially responsible for the bill. */ + @SerializedName("payer") + Payer payer; + + /** The settings associated with the cadence. */ + @SerializedName("settings") + Settings settings; + + private CadenceUpdateParams( + Map extraParams, + Object lookupKey, + Map metadata, + Payer payer, + Settings settings) { + this.extraParams = extraParams; + this.lookupKey = lookupKey; + this.metadata = metadata; + this.payer = payer; + this.settings = settings; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object lookupKey; + + private Map metadata; + + private Payer payer; + + private Settings settings; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceUpdateParams build() { + return new CadenceUpdateParams( + this.extraParams, this.lookupKey, this.metadata, this.payer, this.settings); + } + + /** + * 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 + * CadenceUpdateParams#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 CadenceUpdateParams#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 lookup key used to retrieve cadences dynamically from a static string. Maximum length of + * 200 characters. + */ + public Builder setLookupKey(String lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** + * A lookup key used to retrieve cadences dynamically from a static string. Maximum length of + * 200 characters. + */ + public Builder setLookupKey(EmptyParam lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, + * and subsequent calls add additional key/value pairs to the original map. See {@link + * CadenceUpdateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, + * and subsequent calls add additional key/value pairs to the original map. See {@link + * CadenceUpdateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, EmptyParam value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * Map values can only be one of the following types: `String`, `EmptyParam`. See {@link + * CadenceUpdateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (!map.values().stream().allMatch(v -> v instanceof String || v instanceof EmptyParam)) { + throw new IllegalArgumentException( + "All map values must one of the following types: String, EmptyParam"); + } + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** The payer determines the entity financially responsible for the bill. */ + public Builder setPayer(CadenceUpdateParams.Payer payer) { + this.payer = payer; + return this; + } + + /** The settings associated with the cadence. */ + public Builder setSettings(CadenceUpdateParams.Settings settings) { + this.settings = settings; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Payer { + /** The ID of the Billing Profile object which determines how a bill will be paid. */ + @SerializedName("billing_profile") + Object billingProfile; + + /** + * 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 Payer(Object billingProfile, Map extraParams) { + this.billingProfile = billingProfile; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object billingProfile; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceUpdateParams.Payer build() { + return new CadenceUpdateParams.Payer(this.billingProfile, this.extraParams); + } + + /** The ID of the Billing Profile object which determines how a bill will be paid. */ + public Builder setBillingProfile(String billingProfile) { + this.billingProfile = billingProfile; + return this; + } + + /** The ID of the Billing Profile object which determines how a bill will be paid. */ + public Builder setBillingProfile(EmptyParam billingProfile) { + this.billingProfile = billingProfile; + 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 + * CadenceUpdateParams.Payer#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 CadenceUpdateParams.Payer#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * Settings that configure bills generation, which includes calculating totals, tax, and + * presenting invoices. If null is provided, the current bill settings will be removed from the + * billing cadence. + */ + @SerializedName("bill") + Bill bill; + + /** + * Settings that configure and manage the behavior of collecting payments. If null is provided, + * the current collection settings will be removed from the billing cadence. + */ + @SerializedName("collection") + Collection collection; + + /** + * 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 Settings(Bill bill, Collection collection, Map extraParams) { + this.bill = bill; + this.collection = collection; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Bill bill; + + private Collection collection; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceUpdateParams.Settings build() { + return new CadenceUpdateParams.Settings(this.bill, this.collection, this.extraParams); + } + + /** + * Settings that configure bills generation, which includes calculating totals, tax, and + * presenting invoices. If null is provided, the current bill settings will be removed from + * the billing cadence. + */ + public Builder setBill(CadenceUpdateParams.Settings.Bill bill) { + this.bill = bill; + return this; + } + + /** + * Settings that configure and manage the behavior of collecting payments. If null is + * provided, the current collection settings will be removed from the billing cadence. + */ + public Builder setCollection(CadenceUpdateParams.Settings.Collection collection) { + this.collection = collection; + 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 + * CadenceUpdateParams.Settings#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 CadenceUpdateParams.Settings#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Bill { + /** + * 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 ID of the referenced settings object. */ + @SerializedName("id") + Object id; + + /** + * An optional field to specify the version of Settings to use. If not provided, this will + * always default to the {@code live_version} specified on the setting, any time the settings + * are used. Using a specific version here will prevent the settings from updating, and is + * discouraged for cadences. To clear a pinned version, set the version to null. + */ + @SerializedName("version") + Object version; + + private Bill(Map extraParams, Object id, Object version) { + this.extraParams = extraParams; + this.id = id; + this.version = version; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object id; + + private Object version; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceUpdateParams.Settings.Bill build() { + return new CadenceUpdateParams.Settings.Bill(this.extraParams, this.id, this.version); + } + + /** + * 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 CadenceUpdateParams.Settings.Bill#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 CadenceUpdateParams.Settings.Bill#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 ID of the referenced settings object. */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** Required. The ID of the referenced settings object. */ + public Builder setId(EmptyParam id) { + this.id = id; + return this; + } + + /** + * An optional field to specify the version of Settings to use. If not provided, this will + * always default to the {@code live_version} specified on the setting, any time the + * settings are used. Using a specific version here will prevent the settings from updating, + * and is discouraged for cadences. To clear a pinned version, set the version to null. + */ + public Builder setVersion(String version) { + this.version = version; + return this; + } + + /** + * An optional field to specify the version of Settings to use. If not provided, this will + * always default to the {@code live_version} specified on the setting, any time the + * settings are used. Using a specific version here will prevent the settings from updating, + * and is discouraged for cadences. To clear a pinned version, set the version to null. + */ + public Builder setVersion(EmptyParam version) { + this.version = version; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Collection { + /** + * 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 ID of the referenced settings object. */ + @SerializedName("id") + Object id; + + /** + * An optional field to specify the version of Settings to use. If not provided, this will + * always default to the {@code live_version} specified on the setting, any time the settings + * are used. Using a specific version here will prevent the settings from updating, and is + * discouraged for cadences. To clear a pinned version, set the version to null. + */ + @SerializedName("version") + Object version; + + private Collection(Map extraParams, Object id, Object version) { + this.extraParams = extraParams; + this.id = id; + this.version = version; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object id; + + private Object version; + + /** Finalize and obtain parameter instance from this builder. */ + public CadenceUpdateParams.Settings.Collection build() { + return new CadenceUpdateParams.Settings.Collection( + this.extraParams, this.id, this.version); + } + + /** + * 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 CadenceUpdateParams.Settings.Collection#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 CadenceUpdateParams.Settings.Collection#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 ID of the referenced settings object. */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** Required. The ID of the referenced settings object. */ + public Builder setId(EmptyParam id) { + this.id = id; + return this; + } + + /** + * An optional field to specify the version of Settings to use. If not provided, this will + * always default to the {@code live_version} specified on the setting, any time the + * settings are used. Using a specific version here will prevent the settings from updating, + * and is discouraged for cadences. To clear a pinned version, set the version to null. + */ + public Builder setVersion(String version) { + this.version = version; + return this; + } + + /** + * An optional field to specify the version of Settings to use. If not provided, this will + * always default to the {@code live_version} specified on the setting, any time the + * settings are used. Using a specific version here will prevent the settings from updating, + * and is discouraged for cadences. To clear a pinned version, set the version to null. + */ + public Builder setVersion(EmptyParam version) { + this.version = version; + return this; + } + } + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java new file mode 100644 index 00000000000..1e5d4125b6f --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java @@ -0,0 +1,2008 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +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 CollectionSettingCreateParams extends ApiRequestParams { + /** + * Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this + * bill at the end of the period using the payment method attached to the payer profile. When + * sending an invoice, Stripe will email your payer profile an invoice with payment instructions. + * Defaults to automatic. + */ + @SerializedName("collection_method") + CollectionMethod collectionMethod; + + /** + * An optional customer-facing display name for the CollectionSetting object. Maximum length of + * 250 characters. + */ + @SerializedName("display_name") + String displayName; + + /** Email delivery setting. */ + @SerializedName("email_delivery") + EmailDelivery emailDelivery; + + /** + * 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 lookup key used to retrieve settings dynamically from a static string. This may be up to 200 + * characters. + */ + @SerializedName("lookup_key") + String lookupKey; + + /** + * The ID of the PaymentMethodConfiguration object, which controls which payment methods are + * displayed to your customers. + */ + @SerializedName("payment_method_configuration") + String paymentMethodConfiguration; + + /** Payment Method specific configuration to be stored on the object. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + + private CollectionSettingCreateParams( + CollectionMethod collectionMethod, + String displayName, + EmailDelivery emailDelivery, + Map extraParams, + String lookupKey, + String paymentMethodConfiguration, + PaymentMethodOptions paymentMethodOptions) { + this.collectionMethod = collectionMethod; + this.displayName = displayName; + this.emailDelivery = emailDelivery; + this.extraParams = extraParams; + this.lookupKey = lookupKey; + this.paymentMethodConfiguration = paymentMethodConfiguration; + this.paymentMethodOptions = paymentMethodOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CollectionMethod collectionMethod; + + private String displayName; + + private EmailDelivery emailDelivery; + + private Map extraParams; + + private String lookupKey; + + private String paymentMethodConfiguration; + + private PaymentMethodOptions paymentMethodOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams build() { + return new CollectionSettingCreateParams( + this.collectionMethod, + this.displayName, + this.emailDelivery, + this.extraParams, + this.lookupKey, + this.paymentMethodConfiguration, + this.paymentMethodOptions); + } + + /** + * Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay + * this bill at the end of the period using the payment method attached to the payer profile. + * When sending an invoice, Stripe will email your payer profile an invoice with payment + * instructions. Defaults to automatic. + */ + public Builder setCollectionMethod( + CollectionSettingCreateParams.CollectionMethod collectionMethod) { + this.collectionMethod = collectionMethod; + return this; + } + + /** + * An optional customer-facing display name for the CollectionSetting object. Maximum length of + * 250 characters. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** Email delivery setting. */ + public Builder setEmailDelivery(CollectionSettingCreateParams.EmailDelivery emailDelivery) { + this.emailDelivery = emailDelivery; + 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 + * CollectionSettingCreateParams#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 CollectionSettingCreateParams#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 lookup key used to retrieve settings dynamically from a static string. This may be up to + * 200 characters. + */ + public Builder setLookupKey(String lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** + * The ID of the PaymentMethodConfiguration object, which controls which payment methods are + * displayed to your customers. + */ + public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } + + /** Payment Method specific configuration to be stored on the object. */ + public Builder setPaymentMethodOptions( + CollectionSettingCreateParams.PaymentMethodOptions paymentMethodOptions) { + this.paymentMethodOptions = paymentMethodOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class EmailDelivery { + /** + * 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 emails for when the payment is due. For example after the invoice is finilized and + * transition to Open state. + */ + @SerializedName("payment_due") + PaymentDue paymentDue; + + private EmailDelivery(Map extraParams, PaymentDue paymentDue) { + this.extraParams = extraParams; + this.paymentDue = paymentDue; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private PaymentDue paymentDue; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.EmailDelivery build() { + return new CollectionSettingCreateParams.EmailDelivery(this.extraParams, this.paymentDue); + } + + /** + * 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 + * CollectionSettingCreateParams.EmailDelivery#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 CollectionSettingCreateParams.EmailDelivery#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 emails for when the payment is due. For example after the invoice is finilized and + * transition to Open state. + */ + public Builder setPaymentDue( + CollectionSettingCreateParams.EmailDelivery.PaymentDue paymentDue) { + this.paymentDue = paymentDue; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDue { + /** + * Required. If true an email for the invoice would be generated and sent + * out. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * 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. If true the payment link to hosted invocie page would be + * included in email and PDF of the invoice. + */ + @SerializedName("include_payment_link") + Boolean includePaymentLink; + + private PaymentDue( + Boolean enabled, Map extraParams, Boolean includePaymentLink) { + this.enabled = enabled; + this.extraParams = extraParams; + this.includePaymentLink = includePaymentLink; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Boolean includePaymentLink; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.EmailDelivery.PaymentDue build() { + return new CollectionSettingCreateParams.EmailDelivery.PaymentDue( + this.enabled, this.extraParams, this.includePaymentLink); + } + + /** + * Required. If true an email for the invoice would be generated and sent + * out. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + 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 CollectionSettingCreateParams.EmailDelivery.PaymentDue#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 CollectionSettingCreateParams.EmailDelivery.PaymentDue#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. If true the payment link to hosted invocie page would be + * included in email and PDF of the invoice. + */ + public Builder setIncludePaymentLink(Boolean includePaymentLink) { + this.includePaymentLink = includePaymentLink; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodOptions { + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method + * options. + */ + @SerializedName("acss_debit") + AcssDebit acssDebit; + + /** This sub-hash contains details about the Bancontact payment method. */ + @SerializedName("bancontact") + Bancontact bancontact; + + /** This sub-hash contains details about the Card payment method options. */ + @SerializedName("card") + Card card; + + /** This sub-hash contains details about the Bank transfer payment method options. */ + @SerializedName("customer_balance") + CustomerBalance customerBalance; + + /** + * 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; + + /** This sub-hash contains details about the Konbini payment method options. */ + @SerializedName("konbini") + Map konbini; + + /** This sub-hash contains details about the SEPA Direct Debit payment method options. */ + @SerializedName("sepa_debit") + Map sepaDebit; + + /** This sub-hash contains details about the ACH direct debit payment method options. */ + @SerializedName("us_bank_account") + UsBankAccount usBankAccount; + + private PaymentMethodOptions( + AcssDebit acssDebit, + Bancontact bancontact, + Card card, + CustomerBalance customerBalance, + Map extraParams, + Map konbini, + Map sepaDebit, + UsBankAccount usBankAccount) { + this.acssDebit = acssDebit; + this.bancontact = bancontact; + this.card = card; + this.customerBalance = customerBalance; + this.extraParams = extraParams; + this.konbini = konbini; + this.sepaDebit = sepaDebit; + this.usBankAccount = usBankAccount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private AcssDebit acssDebit; + + private Bancontact bancontact; + + private Card card; + + private CustomerBalance customerBalance; + + private Map extraParams; + + private Map konbini; + + private Map sepaDebit; + + private UsBankAccount usBankAccount; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions build() { + return new CollectionSettingCreateParams.PaymentMethodOptions( + this.acssDebit, + this.bancontact, + this.card, + this.customerBalance, + this.extraParams, + this.konbini, + this.sepaDebit, + this.usBankAccount); + } + + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method + * options. + */ + public Builder setAcssDebit( + CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit acssDebit) { + this.acssDebit = acssDebit; + return this; + } + + /** This sub-hash contains details about the Bancontact payment method. */ + public Builder setBancontact( + CollectionSettingCreateParams.PaymentMethodOptions.Bancontact bancontact) { + this.bancontact = bancontact; + return this; + } + + /** This sub-hash contains details about the Card payment method options. */ + public Builder setCard(CollectionSettingCreateParams.PaymentMethodOptions.Card card) { + this.card = card; + return this; + } + + /** This sub-hash contains details about the Bank transfer payment method options. */ + public Builder setCustomerBalance( + CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance customerBalance) { + this.customerBalance = customerBalance; + 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 + * CollectionSettingCreateParams.PaymentMethodOptions#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 CollectionSettingCreateParams.PaymentMethodOptions#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add a key/value pair to `konbini` 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 + * CollectionSettingCreateParams.PaymentMethodOptions#konbini} for the field documentation. + */ + public Builder putKonbini(String key, Object value) { + if (this.konbini == null) { + this.konbini = new HashMap<>(); + } + this.konbini.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `konbini` 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 CollectionSettingCreateParams.PaymentMethodOptions#konbini} for the field + * documentation. + */ + public Builder putAllKonbini(Map map) { + if (this.konbini == null) { + this.konbini = new HashMap<>(); + } + this.konbini.putAll(map); + return this; + } + + /** + * Add a key/value pair to `sepaDebit` 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 + * CollectionSettingCreateParams.PaymentMethodOptions#sepaDebit} for the field documentation. + */ + public Builder putSepaDebit(String key, Object value) { + if (this.sepaDebit == null) { + this.sepaDebit = new HashMap<>(); + } + this.sepaDebit.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `sepaDebit` 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 CollectionSettingCreateParams.PaymentMethodOptions#sepaDebit} for the field + * documentation. + */ + public Builder putAllSepaDebit(Map map) { + if (this.sepaDebit == null) { + this.sepaDebit = new HashMap<>(); + } + this.sepaDebit.putAll(map); + return this; + } + + /** This sub-hash contains details about the ACH direct debit payment method options. */ + public Builder setUsBankAccount( + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { + this.usBankAccount = usBankAccount; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AcssDebit { + /** + * 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; + + /** Additional fields for Mandate creation. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** Verification method. */ + @SerializedName("verification_method") + VerificationMethod verificationMethod; + + private AcssDebit( + Map extraParams, + MandateOptions mandateOptions, + VerificationMethod verificationMethod) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.verificationMethod = verificationMethod; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private VerificationMethod verificationMethod; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit build() { + return new CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit( + this.extraParams, this.mandateOptions, this.verificationMethod); + } + + /** + * 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 CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit#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 CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Additional fields for Mandate creation. */ + public Builder setMandateOptions( + CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + /** Verification method. */ + public Builder setVerificationMethod( + CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { + this.verificationMethod = verificationMethod; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** + * 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; + + /** Transaction type of the mandate. */ + @SerializedName("transaction_type") + TransactionType transactionType; + + private MandateOptions(Map extraParams, TransactionType transactionType) { + this.extraParams = extraParams; + this.transactionType = transactionType; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private TransactionType transactionType; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions + build() { + return new CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions( + this.extraParams, this.transactionType); + } + + /** + * 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 + * CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions#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 + * CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Transaction type of the mandate. */ + public Builder setTransactionType( + CollectionSettingCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions + .TransactionType + transactionType) { + this.transactionType = transactionType; + return this; + } + } + + public enum TransactionType implements ApiRequestParams.EnumParam { + @SerializedName("business") + BUSINESS("business"), + + @SerializedName("personal") + PERSONAL("personal"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TransactionType(String value) { + this.value = value; + } + } + } + + public enum VerificationMethod implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("instant") + INSTANT("instant"), + + @SerializedName("microdeposits") + MICRODEPOSITS("microdeposits"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + VerificationMethod(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Bancontact { + /** + * 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; + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + @SerializedName("preferred_language") + PreferredLanguage preferredLanguage; + + private Bancontact(Map extraParams, PreferredLanguage preferredLanguage) { + this.extraParams = extraParams; + this.preferredLanguage = preferredLanguage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private PreferredLanguage preferredLanguage; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions.Bancontact build() { + return new CollectionSettingCreateParams.PaymentMethodOptions.Bancontact( + this.extraParams, this.preferredLanguage); + } + + /** + * 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 + * CollectionSettingCreateParams.PaymentMethodOptions.Bancontact#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 + * CollectionSettingCreateParams.PaymentMethodOptions.Bancontact#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected + * to. + */ + public Builder setPreferredLanguage( + CollectionSettingCreateParams.PaymentMethodOptions.Bancontact.PreferredLanguage + preferredLanguage) { + this.preferredLanguage = preferredLanguage; + return this; + } + } + + public enum PreferredLanguage implements ApiRequestParams.EnumParam { + @SerializedName("de") + DE("de"), + + @SerializedName("en") + EN("en"), + + @SerializedName("fr") + FR("fr"), + + @SerializedName("nl") + NL("nl"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLanguage(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** + * 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; + + /** Configuration options for setting up an eMandate for cards issued in India. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * Selected network to process the payment on. Depends on the available networks of the card. + */ + @SerializedName("network") + String network; + + /** + * An advanced option 3D Secure. We strongly recommend that you rely on our SCA Engine to + * automatically prompt your customers for authentication based on risk level and other requirements. + * However, if you wish to request 3D Secure based on logic from your own fraud engine, + * provide this option. Read our guide on manually + * requesting 3D Secure for more information on how this configuration interacts with + * Radar and our SCA Engine. + */ + @SerializedName("request_three_d_secure") + RequestThreeDSecure requestThreeDSecure; + + private Card( + Map extraParams, + MandateOptions mandateOptions, + String network, + RequestThreeDSecure requestThreeDSecure) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.network = network; + this.requestThreeDSecure = requestThreeDSecure; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private String network; + + private RequestThreeDSecure requestThreeDSecure; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions.Card build() { + return new CollectionSettingCreateParams.PaymentMethodOptions.Card( + this.extraParams, this.mandateOptions, this.network, this.requestThreeDSecure); + } + + /** + * 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 CollectionSettingCreateParams.PaymentMethodOptions.Card#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 CollectionSettingCreateParams.PaymentMethodOptions.Card#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate for cards issued in India. */ + public Builder setMandateOptions( + CollectionSettingCreateParams.PaymentMethodOptions.Card.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + /** + * Selected network to process the payment on. Depends on the available networks of the + * card. + */ + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + /** + * An advanced option 3D Secure. We strongly recommend that you rely on our SCA Engine to + * automatically prompt your customers for authentication based on risk level and other + * requirements. However, if you wish to request 3D Secure based on logic from your own + * fraud engine, provide this option. Read our guide on manually + * requesting 3D Secure for more information on how this configuration interacts with + * Radar and our SCA Engine. + */ + public Builder setRequestThreeDSecure( + CollectionSettingCreateParams.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { + this.requestThreeDSecure = requestThreeDSecure; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ + @SerializedName("amount_type") + AmountType amountType; + + /** A description of the mandate that is meant to be displayed to the customer. */ + @SerializedName("description") + String description; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions.Card.MandateOptions build() { + return new CollectionSettingCreateParams.PaymentMethodOptions.Card.MandateOptions( + this.amount, this.amountType, this.description, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ + public Builder setAmountType( + CollectionSettingCreateParams.PaymentMethodOptions.Card.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** A description of the mandate that is meant to be displayed to the customer. */ + public Builder setDescription(String description) { + this.description = description; + 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 + * CollectionSettingCreateParams.PaymentMethodOptions.Card.MandateOptions#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 + * CollectionSettingCreateParams.PaymentMethodOptions.Card.MandateOptions#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum RequestThreeDSecure implements ApiRequestParams.EnumParam { + @SerializedName("any") + ANY("any"), + + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("challenge") + CHALLENGE("challenge"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestThreeDSecure(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the {@code funding_type} is set to + * {@code bank_transfer}. + */ + @SerializedName("bank_transfer") + BankTransfer bankTransfer; + + /** + * 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; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. + * Currently the only supported value is {@code bank_transfer}. + */ + @SerializedName("funding_type") + FundingType fundingType; + + private CustomerBalance( + BankTransfer bankTransfer, Map extraParams, FundingType fundingType) { + this.bankTransfer = bankTransfer; + this.extraParams = extraParams; + this.fundingType = fundingType; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BankTransfer bankTransfer; + + private Map extraParams; + + private FundingType fundingType; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance build() { + return new CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance( + this.bankTransfer, this.extraParams, this.fundingType); + } + + /** + * Configuration for the bank transfer funding type, if the {@code funding_type} is set to + * {@code bank_transfer}. + */ + public Builder setBankTransfer( + CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + bankTransfer) { + this.bankTransfer = bankTransfer; + 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 + * CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance#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 + * CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * The funding method type to be used when there are not enough funds in the customer + * balance. Currently the only supported value is {@code bank_transfer}. + */ + public Builder setFundingType( + CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance.FundingType + fundingType) { + this.fundingType = fundingType; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BankTransfer { + /** + * Configuration for {@code eu_bank_transfer} funding type. Required if {@code type} is + * {@code eu_bank_transfer}. + */ + @SerializedName("eu_bank_transfer") + EuBankTransfer euBankTransfer; + + /** + * 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; + + /** The bank transfer type that can be used for funding. */ + @SerializedName("type") + Type type; + + private BankTransfer( + EuBankTransfer euBankTransfer, Map extraParams, Type type) { + this.euBankTransfer = euBankTransfer; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private EuBankTransfer euBankTransfer; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + build() { + return new CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance + .BankTransfer(this.euBankTransfer, this.extraParams, this.type); + } + + /** + * Configuration for {@code eu_bank_transfer} funding type. Required if {@code type} is + * {@code eu_bank_transfer}. + */ + public Builder setEuBankTransfer( + CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer + euBankTransfer) { + this.euBankTransfer = euBankTransfer; + 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 + * CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer#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 + * CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The bank transfer type that can be used for funding. */ + public Builder setType( + CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class EuBankTransfer { + /** + * Required. The desired country code of the bank account information. + */ + @SerializedName("country") + Country 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; + + private EuBankTransfer(Country country, Map extraParams) { + this.country = country; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Country country; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer + build() { + return new CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer(this.country, this.extraParams); + } + + /** + * Required. The desired country code of the bank account information. + */ + public Builder setCountry( + CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer.Country + 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 + * CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer#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 + * CollectionSettingCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum Country implements ApiRequestParams.EnumParam { + @SerializedName("BE") + BE("BE"), + + @SerializedName("DE") + DE("DE"), + + @SerializedName("ES") + ES("ES"), + + @SerializedName("FR") + FR("FR"), + + @SerializedName("IE") + IE("IE"), + + @SerializedName("NL") + NL("NL"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Country(String value) { + this.value = value; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("eu_bank_transfer") + EU_BANK_TRANSFER("eu_bank_transfer"), + + @SerializedName("gb_bank_transfer") + GB_BANK_TRANSFER("gb_bank_transfer"), + + @SerializedName("jp_bank_transfer") + JP_BANK_TRANSFER("jp_bank_transfer"), + + @SerializedName("mx_bank_transfer") + MX_BANK_TRANSFER("mx_bank_transfer"), + + @SerializedName("us_bank_transfer") + US_BANK_TRANSFER("us_bank_transfer"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum FundingType implements ApiRequestParams.EnumParam { + @SerializedName("bank_transfer") + BANK_TRANSFER("bank_transfer"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + FundingType(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class UsBankAccount { + /** + * 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. Additional fields for Financial Connections Session creation. + */ + @SerializedName("financial_connections") + FinancialConnections financialConnections; + + /** Required. Verification method. */ + @SerializedName("verification_method") + VerificationMethod verificationMethod; + + private UsBankAccount( + Map extraParams, + FinancialConnections financialConnections, + VerificationMethod verificationMethod) { + this.extraParams = extraParams; + this.financialConnections = financialConnections; + this.verificationMethod = verificationMethod; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private FinancialConnections financialConnections; + + private VerificationMethod verificationMethod; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount build() { + return new CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount( + this.extraParams, this.financialConnections, this.verificationMethod); + } + + /** + * 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 + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount#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 + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount#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. Additional fields for Financial Connections Session creation. + */ + public Builder setFinancialConnections( + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { + this.financialConnections = financialConnections; + return this; + } + + /** Required. Verification method. */ + public Builder setVerificationMethod( + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { + this.verificationMethod = verificationMethod; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class FinancialConnections { + /** + * 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; + + /** + * Provide filters for the linked accounts that the customer can select for the payment + * method. + */ + @SerializedName("filters") + Filters filters; + + /** + * The list of permissions to request. If this parameter is passed, the {@code + * payment_method} permission must be included. + */ + @SerializedName("permissions") + List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; + + /** List of data features that you would like to retrieve upon account creation. */ + @SerializedName("prefetch") + List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Prefetch> + prefetch; + + private FinancialConnections( + Map extraParams, + Filters filters, + List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions, + List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Prefetch> + prefetch) { + this.extraParams = extraParams; + this.filters = filters; + this.permissions = permissions; + this.prefetch = prefetch; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Filters filters; + + private List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; + + private List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Prefetch> + prefetch; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections + build() { + return new CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections( + this.extraParams, this.filters, this.permissions, this.prefetch); + } + + /** + * 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 + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#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 + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Provide filters for the linked accounts that the customer can select for the payment + * method. + */ + public Builder setFilters( + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Filters + filters) { + this.filters = filters; + return this; + } + + /** + * Add an element to `permissions` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} + * for the field documentation. + */ + public Builder addPermission( + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission + element) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(element); + return this; + } + + /** + * Add all elements to `permissions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} + * for the field documentation. + */ + public Builder addAllPermission( + List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.addAll(elements); + return this; + } + + /** + * Add an element to `prefetch` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#prefetch} + * for the field documentation. + */ + public Builder addPrefetch( + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Prefetch + element) { + if (this.prefetch == null) { + this.prefetch = new ArrayList<>(); + } + this.prefetch.add(element); + return this; + } + + /** + * Add all elements to `prefetch` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#prefetch} + * for the field documentation. + */ + public Builder addAllPrefetch( + List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Prefetch> + elements) { + if (this.prefetch == null) { + this.prefetch = new ArrayList<>(); + } + this.prefetch.addAll(elements); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Filters { + /** The account subcategories to use to filter for selectable accounts. */ + @SerializedName("account_subcategories") + List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters.AccountSubcategory> + accountSubcategories; + + /** + * 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 Filters( + List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters.AccountSubcategory> + accountSubcategories, + Map extraParams) { + this.accountSubcategories = accountSubcategories; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters.AccountSubcategory> + accountSubcategories; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters + build() { + return new CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters(this.accountSubcategories, this.extraParams); + } + + /** + * Add an element to `accountSubcategories` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original + * list. See {@link + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories} + * for the field documentation. + */ + public Builder addAccountSubcategory( + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters.AccountSubcategory + element) { + if (this.accountSubcategories == null) { + this.accountSubcategories = new ArrayList<>(); + } + this.accountSubcategories.add(element); + return this; + } + + /** + * Add all elements to `accountSubcategories` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original + * list. See {@link + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories} + * for the field documentation. + */ + public Builder addAllAccountSubcategory( + List< + CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters.AccountSubcategory> + elements) { + if (this.accountSubcategories == null) { + this.accountSubcategories = new ArrayList<>(); + } + this.accountSubcategories.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 + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#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 + * CollectionSettingCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AccountSubcategory implements ApiRequestParams.EnumParam { + @SerializedName("checking") + CHECKING("checking"), + + @SerializedName("savings") + SAVINGS("savings"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AccountSubcategory(String value) { + this.value = value; + } + } + } + + public enum Permission implements ApiRequestParams.EnumParam { + @SerializedName("balances") + BALANCES("balances"), + + @SerializedName("ownership") + OWNERSHIP("ownership"), + + @SerializedName("payment_method") + PAYMENT_METHOD("payment_method"), + + @SerializedName("transactions") + TRANSACTIONS("transactions"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Permission(String value) { + this.value = value; + } + } + + public enum Prefetch implements ApiRequestParams.EnumParam { + @SerializedName("balances") + BALANCES("balances"), + + @SerializedName("ownership") + OWNERSHIP("ownership"), + + @SerializedName("transactions") + TRANSACTIONS("transactions"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Prefetch(String value) { + this.value = value; + } + } + } + + public enum VerificationMethod implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("instant") + INSTANT("instant"), + + @SerializedName("microdeposits") + MICRODEPOSITS("microdeposits"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + VerificationMethod(String value) { + this.value = value; + } + } + } + } + + public enum CollectionMethod implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("send_invoice") + SEND_INVOICE("send_invoice"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CollectionMethod(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingListParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingListParams.java new file mode 100644 index 00000000000..e08cd2d1289 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingListParams.java @@ -0,0 +1,117 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +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 CollectionSettingListParams extends ApiRequestParams { + /** + * 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; + + /** Optionally set the maximum number of results per page. Defaults to 20. */ + @SerializedName("limit") + Long limit; + + /** + * Only return the settings with these lookup_keys, if any exist. You can specify up to 10 + * lookup_keys. + */ + @SerializedName("lookup_keys") + List lookupKeys; + + private CollectionSettingListParams( + Map extraParams, Long limit, List lookupKeys) { + this.extraParams = extraParams; + this.limit = limit; + this.lookupKeys = lookupKeys; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long limit; + + private List lookupKeys; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingListParams build() { + return new CollectionSettingListParams(this.extraParams, this.limit, this.lookupKeys); + } + + /** + * 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 + * CollectionSettingListParams#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 CollectionSettingListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Optionally set the maximum number of results per page. Defaults to 20. */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Add an element to `lookupKeys` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * CollectionSettingListParams#lookupKeys} for the field documentation. + */ + public Builder addLookupKey(String element) { + if (this.lookupKeys == null) { + this.lookupKeys = new ArrayList<>(); + } + this.lookupKeys.add(element); + return this; + } + + /** + * Add all elements to `lookupKeys` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * CollectionSettingListParams#lookupKeys} for the field documentation. + */ + public Builder addAllLookupKey(List elements) { + if (this.lookupKeys == null) { + this.lookupKeys = new ArrayList<>(); + } + this.lookupKeys.addAll(elements); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java new file mode 100644 index 00000000000..2642012da02 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java @@ -0,0 +1,2086 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +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 CollectionSettingUpdateParams extends ApiRequestParams { + /** + * Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this + * bill at the end of the period using the payment method attached to the payer profile. When + * sending an invoice, Stripe will email your payer profile an invoice with payment instructions. + */ + @SerializedName("collection_method") + CollectionMethod collectionMethod; + + /** + * An optional customer-facing display name for the CollectionSetting object. To remove the + * display name, set it to an empty string in the request. Maximum length of 250 characters. + */ + @SerializedName("display_name") + Object displayName; + + /** Email delivery settings. */ + @SerializedName("email_delivery") + EmailDelivery emailDelivery; + + /** + * 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; + + /** + * Optionally change the live version of the CollectionSetting. Billing Cadences and other objects + * that refer to this CollectionSetting will use this version when no overrides are set. Providing + * {@code live_version = "latest"} will set the CollectionSetting's {@code live_version} to its + * latest version. + */ + @SerializedName("live_version") + Object liveVersion; + + /** + * A lookup key used to retrieve settings dynamically from a static string. This may be up to 200 + * characters. + */ + @SerializedName("lookup_key") + Object lookupKey; + + /** + * The ID of the PaymentMethodConfiguration object, which controls which payment methods are + * displayed to your customers. + */ + @SerializedName("payment_method_configuration") + Object paymentMethodConfiguration; + + /** Payment Method specific configuration to be stored on the object. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + + private CollectionSettingUpdateParams( + CollectionMethod collectionMethod, + Object displayName, + EmailDelivery emailDelivery, + Map extraParams, + Object liveVersion, + Object lookupKey, + Object paymentMethodConfiguration, + PaymentMethodOptions paymentMethodOptions) { + this.collectionMethod = collectionMethod; + this.displayName = displayName; + this.emailDelivery = emailDelivery; + this.extraParams = extraParams; + this.liveVersion = liveVersion; + this.lookupKey = lookupKey; + this.paymentMethodConfiguration = paymentMethodConfiguration; + this.paymentMethodOptions = paymentMethodOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CollectionMethod collectionMethod; + + private Object displayName; + + private EmailDelivery emailDelivery; + + private Map extraParams; + + private Object liveVersion; + + private Object lookupKey; + + private Object paymentMethodConfiguration; + + private PaymentMethodOptions paymentMethodOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams build() { + return new CollectionSettingUpdateParams( + this.collectionMethod, + this.displayName, + this.emailDelivery, + this.extraParams, + this.liveVersion, + this.lookupKey, + this.paymentMethodConfiguration, + this.paymentMethodOptions); + } + + /** + * Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay + * this bill at the end of the period using the payment method attached to the payer profile. + * When sending an invoice, Stripe will email your payer profile an invoice with payment + * instructions. + */ + public Builder setCollectionMethod( + CollectionSettingUpdateParams.CollectionMethod collectionMethod) { + this.collectionMethod = collectionMethod; + return this; + } + + /** + * An optional customer-facing display name for the CollectionSetting object. To remove the + * display name, set it to an empty string in the request. Maximum length of 250 characters. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * An optional customer-facing display name for the CollectionSetting object. To remove the + * display name, set it to an empty string in the request. Maximum length of 250 characters. + */ + public Builder setDisplayName(EmptyParam displayName) { + this.displayName = displayName; + return this; + } + + /** Email delivery settings. */ + public Builder setEmailDelivery(CollectionSettingUpdateParams.EmailDelivery emailDelivery) { + this.emailDelivery = emailDelivery; + 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 + * CollectionSettingUpdateParams#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 CollectionSettingUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Optionally change the live version of the CollectionSetting. Billing Cadences and other + * objects that refer to this CollectionSetting will use this version when no overrides are set. + * Providing {@code live_version = "latest"} will set the CollectionSetting's {@code + * live_version} to its latest version. + */ + public Builder setLiveVersion(String liveVersion) { + this.liveVersion = liveVersion; + return this; + } + + /** + * Optionally change the live version of the CollectionSetting. Billing Cadences and other + * objects that refer to this CollectionSetting will use this version when no overrides are set. + * Providing {@code live_version = "latest"} will set the CollectionSetting's {@code + * live_version} to its latest version. + */ + public Builder setLiveVersion(EmptyParam liveVersion) { + this.liveVersion = liveVersion; + return this; + } + + /** + * A lookup key used to retrieve settings dynamically from a static string. This may be up to + * 200 characters. + */ + public Builder setLookupKey(String lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** + * A lookup key used to retrieve settings dynamically from a static string. This may be up to + * 200 characters. + */ + public Builder setLookupKey(EmptyParam lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** + * The ID of the PaymentMethodConfiguration object, which controls which payment methods are + * displayed to your customers. + */ + public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } + + /** + * The ID of the PaymentMethodConfiguration object, which controls which payment methods are + * displayed to your customers. + */ + public Builder setPaymentMethodConfiguration(EmptyParam paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } + + /** Payment Method specific configuration to be stored on the object. */ + public Builder setPaymentMethodOptions( + CollectionSettingUpdateParams.PaymentMethodOptions paymentMethodOptions) { + this.paymentMethodOptions = paymentMethodOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class EmailDelivery { + /** + * 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 emails for when the payment is due. For example after the invoice is finilized and + * transition to Open state. + */ + @SerializedName("payment_due") + PaymentDue paymentDue; + + private EmailDelivery(Map extraParams, PaymentDue paymentDue) { + this.extraParams = extraParams; + this.paymentDue = paymentDue; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private PaymentDue paymentDue; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.EmailDelivery build() { + return new CollectionSettingUpdateParams.EmailDelivery(this.extraParams, this.paymentDue); + } + + /** + * 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 + * CollectionSettingUpdateParams.EmailDelivery#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 CollectionSettingUpdateParams.EmailDelivery#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 emails for when the payment is due. For example after the invoice is finilized and + * transition to Open state. + */ + public Builder setPaymentDue( + CollectionSettingUpdateParams.EmailDelivery.PaymentDue paymentDue) { + this.paymentDue = paymentDue; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDue { + /** + * Required. If true an email for the invoice would be generated and sent + * out. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * 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. If true the payment link to hosted invocie page would be + * included in email and PDF of the invoice. + */ + @SerializedName("include_payment_link") + Boolean includePaymentLink; + + private PaymentDue( + Boolean enabled, Map extraParams, Boolean includePaymentLink) { + this.enabled = enabled; + this.extraParams = extraParams; + this.includePaymentLink = includePaymentLink; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Boolean includePaymentLink; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.EmailDelivery.PaymentDue build() { + return new CollectionSettingUpdateParams.EmailDelivery.PaymentDue( + this.enabled, this.extraParams, this.includePaymentLink); + } + + /** + * Required. If true an email for the invoice would be generated and sent + * out. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + 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 CollectionSettingUpdateParams.EmailDelivery.PaymentDue#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 CollectionSettingUpdateParams.EmailDelivery.PaymentDue#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. If true the payment link to hosted invocie page would be + * included in email and PDF of the invoice. + */ + public Builder setIncludePaymentLink(Boolean includePaymentLink) { + this.includePaymentLink = includePaymentLink; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodOptions { + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method + * options. + */ + @SerializedName("acss_debit") + AcssDebit acssDebit; + + /** This sub-hash contains details about the Bancontact payment method. */ + @SerializedName("bancontact") + Bancontact bancontact; + + /** This sub-hash contains details about the Card payment method options. */ + @SerializedName("card") + Card card; + + /** This sub-hash contains details about the Bank transfer payment method options. */ + @SerializedName("customer_balance") + CustomerBalance customerBalance; + + /** + * 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; + + /** This sub-hash contains details about the Konbini payment method options. */ + @SerializedName("konbini") + Map konbini; + + /** This sub-hash contains details about the SEPA Direct Debit payment method options. */ + @SerializedName("sepa_debit") + Map sepaDebit; + + /** This sub-hash contains details about the ACH direct debit payment method options. */ + @SerializedName("us_bank_account") + UsBankAccount usBankAccount; + + private PaymentMethodOptions( + AcssDebit acssDebit, + Bancontact bancontact, + Card card, + CustomerBalance customerBalance, + Map extraParams, + Map konbini, + Map sepaDebit, + UsBankAccount usBankAccount) { + this.acssDebit = acssDebit; + this.bancontact = bancontact; + this.card = card; + this.customerBalance = customerBalance; + this.extraParams = extraParams; + this.konbini = konbini; + this.sepaDebit = sepaDebit; + this.usBankAccount = usBankAccount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private AcssDebit acssDebit; + + private Bancontact bancontact; + + private Card card; + + private CustomerBalance customerBalance; + + private Map extraParams; + + private Map konbini; + + private Map sepaDebit; + + private UsBankAccount usBankAccount; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions( + this.acssDebit, + this.bancontact, + this.card, + this.customerBalance, + this.extraParams, + this.konbini, + this.sepaDebit, + this.usBankAccount); + } + + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method + * options. + */ + public Builder setAcssDebit( + CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit acssDebit) { + this.acssDebit = acssDebit; + return this; + } + + /** This sub-hash contains details about the Bancontact payment method. */ + public Builder setBancontact( + CollectionSettingUpdateParams.PaymentMethodOptions.Bancontact bancontact) { + this.bancontact = bancontact; + return this; + } + + /** This sub-hash contains details about the Card payment method options. */ + public Builder setCard(CollectionSettingUpdateParams.PaymentMethodOptions.Card card) { + this.card = card; + return this; + } + + /** This sub-hash contains details about the Bank transfer payment method options. */ + public Builder setCustomerBalance( + CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance customerBalance) { + this.customerBalance = customerBalance; + 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 + * CollectionSettingUpdateParams.PaymentMethodOptions#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 CollectionSettingUpdateParams.PaymentMethodOptions#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add a key/value pair to `konbini` 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 + * CollectionSettingUpdateParams.PaymentMethodOptions#konbini} for the field documentation. + */ + public Builder putKonbini(String key, Object value) { + if (this.konbini == null) { + this.konbini = new HashMap<>(); + } + this.konbini.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `konbini` 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 CollectionSettingUpdateParams.PaymentMethodOptions#konbini} for the field + * documentation. + */ + public Builder putAllKonbini(Map map) { + if (this.konbini == null) { + this.konbini = new HashMap<>(); + } + this.konbini.putAll(map); + return this; + } + + /** + * Add a key/value pair to `sepaDebit` 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 + * CollectionSettingUpdateParams.PaymentMethodOptions#sepaDebit} for the field documentation. + */ + public Builder putSepaDebit(String key, Object value) { + if (this.sepaDebit == null) { + this.sepaDebit = new HashMap<>(); + } + this.sepaDebit.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `sepaDebit` 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 CollectionSettingUpdateParams.PaymentMethodOptions#sepaDebit} for the field + * documentation. + */ + public Builder putAllSepaDebit(Map map) { + if (this.sepaDebit == null) { + this.sepaDebit = new HashMap<>(); + } + this.sepaDebit.putAll(map); + return this; + } + + /** This sub-hash contains details about the ACH direct debit payment method options. */ + public Builder setUsBankAccount( + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { + this.usBankAccount = usBankAccount; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AcssDebit { + /** + * 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; + + /** Additional fields for Mandate creation. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** Verification method. */ + @SerializedName("verification_method") + VerificationMethod verificationMethod; + + private AcssDebit( + Map extraParams, + MandateOptions mandateOptions, + VerificationMethod verificationMethod) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.verificationMethod = verificationMethod; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private VerificationMethod verificationMethod; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit( + this.extraParams, this.mandateOptions, this.verificationMethod); + } + + /** + * 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 CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit#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 CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Additional fields for Mandate creation. */ + public Builder setMandateOptions( + CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + /** Verification method. */ + public Builder setVerificationMethod( + CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { + this.verificationMethod = verificationMethod; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** + * 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; + + /** Transaction type of the mandate. */ + @SerializedName("transaction_type") + TransactionType transactionType; + + private MandateOptions(Map extraParams, TransactionType transactionType) { + this.extraParams = extraParams; + this.transactionType = transactionType; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private TransactionType transactionType; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions + build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions( + this.extraParams, this.transactionType); + } + + /** + * 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 + * CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions#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 + * CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Transaction type of the mandate. */ + public Builder setTransactionType( + CollectionSettingUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions + .TransactionType + transactionType) { + this.transactionType = transactionType; + return this; + } + } + + public enum TransactionType implements ApiRequestParams.EnumParam { + @SerializedName("business") + BUSINESS("business"), + + @SerializedName("personal") + PERSONAL("personal"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TransactionType(String value) { + this.value = value; + } + } + } + + public enum VerificationMethod implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("instant") + INSTANT("instant"), + + @SerializedName("microdeposits") + MICRODEPOSITS("microdeposits"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + VerificationMethod(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Bancontact { + /** + * 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; + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + @SerializedName("preferred_language") + PreferredLanguage preferredLanguage; + + private Bancontact(Map extraParams, PreferredLanguage preferredLanguage) { + this.extraParams = extraParams; + this.preferredLanguage = preferredLanguage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private PreferredLanguage preferredLanguage; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions.Bancontact build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions.Bancontact( + this.extraParams, this.preferredLanguage); + } + + /** + * 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 + * CollectionSettingUpdateParams.PaymentMethodOptions.Bancontact#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 + * CollectionSettingUpdateParams.PaymentMethodOptions.Bancontact#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected + * to. + */ + public Builder setPreferredLanguage( + CollectionSettingUpdateParams.PaymentMethodOptions.Bancontact.PreferredLanguage + preferredLanguage) { + this.preferredLanguage = preferredLanguage; + return this; + } + } + + public enum PreferredLanguage implements ApiRequestParams.EnumParam { + @SerializedName("de") + DE("de"), + + @SerializedName("en") + EN("en"), + + @SerializedName("fr") + FR("fr"), + + @SerializedName("nl") + NL("nl"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLanguage(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** + * 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; + + /** Configuration options for setting up an eMandate for cards issued in India. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * Selected network to process the payment on. Depends on the available networks of the card. + */ + @SerializedName("network") + Object network; + + /** + * An advanced option 3D Secure. We strongly recommend that you rely on our SCA Engine to + * automatically prompt your customers for authentication based on risk level and other requirements. + * However, if you wish to request 3D Secure based on logic from your own fraud engine, + * provide this option. Read our guide on manually + * requesting 3D Secure for more information on how this configuration interacts with + * Radar and our SCA Engine. + */ + @SerializedName("request_three_d_secure") + RequestThreeDSecure requestThreeDSecure; + + private Card( + Map extraParams, + MandateOptions mandateOptions, + Object network, + RequestThreeDSecure requestThreeDSecure) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.network = network; + this.requestThreeDSecure = requestThreeDSecure; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private Object network; + + private RequestThreeDSecure requestThreeDSecure; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions.Card build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions.Card( + this.extraParams, this.mandateOptions, this.network, this.requestThreeDSecure); + } + + /** + * 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 CollectionSettingUpdateParams.PaymentMethodOptions.Card#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 CollectionSettingUpdateParams.PaymentMethodOptions.Card#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate for cards issued in India. */ + public Builder setMandateOptions( + CollectionSettingUpdateParams.PaymentMethodOptions.Card.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + /** + * Selected network to process the payment on. Depends on the available networks of the + * card. + */ + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + /** + * Selected network to process the payment on. Depends on the available networks of the + * card. + */ + public Builder setNetwork(EmptyParam network) { + this.network = network; + return this; + } + + /** + * An advanced option 3D Secure. We strongly recommend that you rely on our SCA Engine to + * automatically prompt your customers for authentication based on risk level and other + * requirements. However, if you wish to request 3D Secure based on logic from your own + * fraud engine, provide this option. Read our guide on manually + * requesting 3D Secure for more information on how this configuration interacts with + * Radar and our SCA Engine. + */ + public Builder setRequestThreeDSecure( + CollectionSettingUpdateParams.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { + this.requestThreeDSecure = requestThreeDSecure; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ + @SerializedName("amount_type") + AmountType amountType; + + /** A description of the mandate that is meant to be displayed to the customer. */ + @SerializedName("description") + Object description; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + Object description, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private Object description; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions.Card.MandateOptions build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions.Card.MandateOptions( + this.amount, this.amountType, this.description, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ + public Builder setAmountType( + CollectionSettingUpdateParams.PaymentMethodOptions.Card.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** A description of the mandate that is meant to be displayed to the customer. */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** A description of the mandate that is meant to be displayed to the customer. */ + public Builder setDescription(EmptyParam description) { + this.description = description; + 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 + * CollectionSettingUpdateParams.PaymentMethodOptions.Card.MandateOptions#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 + * CollectionSettingUpdateParams.PaymentMethodOptions.Card.MandateOptions#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum RequestThreeDSecure implements ApiRequestParams.EnumParam { + @SerializedName("any") + ANY("any"), + + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("challenge") + CHALLENGE("challenge"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestThreeDSecure(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the {@code funding_type} is set to + * {@code bank_transfer}. + */ + @SerializedName("bank_transfer") + BankTransfer bankTransfer; + + /** + * 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; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. + * Currently the only supported value is {@code bank_transfer}. + */ + @SerializedName("funding_type") + FundingType fundingType; + + private CustomerBalance( + BankTransfer bankTransfer, Map extraParams, FundingType fundingType) { + this.bankTransfer = bankTransfer; + this.extraParams = extraParams; + this.fundingType = fundingType; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BankTransfer bankTransfer; + + private Map extraParams; + + private FundingType fundingType; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance( + this.bankTransfer, this.extraParams, this.fundingType); + } + + /** + * Configuration for the bank transfer funding type, if the {@code funding_type} is set to + * {@code bank_transfer}. + */ + public Builder setBankTransfer( + CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + bankTransfer) { + this.bankTransfer = bankTransfer; + 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 + * CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance#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 + * CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * The funding method type to be used when there are not enough funds in the customer + * balance. Currently the only supported value is {@code bank_transfer}. + */ + public Builder setFundingType( + CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance.FundingType + fundingType) { + this.fundingType = fundingType; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BankTransfer { + /** + * Configuration for {@code eu_bank_transfer} funding type. Required if {@code type} is + * {@code eu_bank_transfer}. + */ + @SerializedName("eu_bank_transfer") + EuBankTransfer euBankTransfer; + + /** + * 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; + + /** The bank transfer type that can be used for funding. */ + @SerializedName("type") + Type type; + + private BankTransfer( + EuBankTransfer euBankTransfer, Map extraParams, Type type) { + this.euBankTransfer = euBankTransfer; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private EuBankTransfer euBankTransfer; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance + .BankTransfer(this.euBankTransfer, this.extraParams, this.type); + } + + /** + * Configuration for {@code eu_bank_transfer} funding type. Required if {@code type} is + * {@code eu_bank_transfer}. + */ + public Builder setEuBankTransfer( + CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer + euBankTransfer) { + this.euBankTransfer = euBankTransfer; + 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 + * CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer#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 + * CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The bank transfer type that can be used for funding. */ + public Builder setType( + CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class EuBankTransfer { + /** + * Required. The desired country code of the bank account information. + */ + @SerializedName("country") + Country 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; + + private EuBankTransfer(Country country, Map extraParams) { + this.country = country; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Country country; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer + build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer(this.country, this.extraParams); + } + + /** + * Required. The desired country code of the bank account information. + */ + public Builder setCountry( + CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer.Country + 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 + * CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer#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 + * CollectionSettingUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum Country implements ApiRequestParams.EnumParam { + @SerializedName("BE") + BE("BE"), + + @SerializedName("DE") + DE("DE"), + + @SerializedName("ES") + ES("ES"), + + @SerializedName("FR") + FR("FR"), + + @SerializedName("IE") + IE("IE"), + + @SerializedName("NL") + NL("NL"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Country(String value) { + this.value = value; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("eu_bank_transfer") + EU_BANK_TRANSFER("eu_bank_transfer"), + + @SerializedName("gb_bank_transfer") + GB_BANK_TRANSFER("gb_bank_transfer"), + + @SerializedName("jp_bank_transfer") + JP_BANK_TRANSFER("jp_bank_transfer"), + + @SerializedName("mx_bank_transfer") + MX_BANK_TRANSFER("mx_bank_transfer"), + + @SerializedName("us_bank_transfer") + US_BANK_TRANSFER("us_bank_transfer"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum FundingType implements ApiRequestParams.EnumParam { + @SerializedName("bank_transfer") + BANK_TRANSFER("bank_transfer"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + FundingType(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class UsBankAccount { + /** + * 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. Additional fields for Financial Connections Session creation. + */ + @SerializedName("financial_connections") + FinancialConnections financialConnections; + + /** Required. Verification method. */ + @SerializedName("verification_method") + VerificationMethod verificationMethod; + + private UsBankAccount( + Map extraParams, + FinancialConnections financialConnections, + VerificationMethod verificationMethod) { + this.extraParams = extraParams; + this.financialConnections = financialConnections; + this.verificationMethod = verificationMethod; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private FinancialConnections financialConnections; + + private VerificationMethod verificationMethod; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount( + this.extraParams, this.financialConnections, this.verificationMethod); + } + + /** + * 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 + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount#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 + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount#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. Additional fields for Financial Connections Session creation. + */ + public Builder setFinancialConnections( + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { + this.financialConnections = financialConnections; + return this; + } + + /** Required. Verification method. */ + public Builder setVerificationMethod( + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { + this.verificationMethod = verificationMethod; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class FinancialConnections { + /** + * 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; + + /** + * Provide filters for the linked accounts that the customer can select for the payment + * method. + */ + @SerializedName("filters") + Filters filters; + + /** + * The list of permissions to request. If this parameter is passed, the {@code + * payment_method} permission must be included. + */ + @SerializedName("permissions") + List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; + + /** List of data features that you would like to retrieve upon account creation. */ + @SerializedName("prefetch") + List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Prefetch> + prefetch; + + private FinancialConnections( + Map extraParams, + Filters filters, + List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions, + List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Prefetch> + prefetch) { + this.extraParams = extraParams; + this.filters = filters; + this.permissions = permissions; + this.prefetch = prefetch; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Filters filters; + + private List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; + + private List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Prefetch> + prefetch; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections + build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections( + this.extraParams, this.filters, this.permissions, this.prefetch); + } + + /** + * 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 + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#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 + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Provide filters for the linked accounts that the customer can select for the payment + * method. + */ + public Builder setFilters( + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Filters + filters) { + this.filters = filters; + return this; + } + + /** + * Add an element to `permissions` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} + * for the field documentation. + */ + public Builder addPermission( + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission + element) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(element); + return this; + } + + /** + * Add all elements to `permissions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} + * for the field documentation. + */ + public Builder addAllPermission( + List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.addAll(elements); + return this; + } + + /** + * Add an element to `prefetch` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#prefetch} + * for the field documentation. + */ + public Builder addPrefetch( + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Prefetch + element) { + if (this.prefetch == null) { + this.prefetch = new ArrayList<>(); + } + this.prefetch.add(element); + return this; + } + + /** + * Add all elements to `prefetch` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#prefetch} + * for the field documentation. + */ + public Builder addAllPrefetch( + List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Prefetch> + elements) { + if (this.prefetch == null) { + this.prefetch = new ArrayList<>(); + } + this.prefetch.addAll(elements); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Filters { + /** The account subcategories to use to filter for selectable accounts. */ + @SerializedName("account_subcategories") + List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters.AccountSubcategory> + accountSubcategories; + + /** + * 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 Filters( + List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters.AccountSubcategory> + accountSubcategories, + Map extraParams) { + this.accountSubcategories = accountSubcategories; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters.AccountSubcategory> + accountSubcategories; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters + build() { + return new CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters(this.accountSubcategories, this.extraParams); + } + + /** + * Add an element to `accountSubcategories` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original + * list. See {@link + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories} + * for the field documentation. + */ + public Builder addAccountSubcategory( + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters.AccountSubcategory + element) { + if (this.accountSubcategories == null) { + this.accountSubcategories = new ArrayList<>(); + } + this.accountSubcategories.add(element); + return this; + } + + /** + * Add all elements to `accountSubcategories` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original + * list. See {@link + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories} + * for the field documentation. + */ + public Builder addAllAccountSubcategory( + List< + CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Filters.AccountSubcategory> + elements) { + if (this.accountSubcategories == null) { + this.accountSubcategories = new ArrayList<>(); + } + this.accountSubcategories.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 + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#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 + * CollectionSettingUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AccountSubcategory implements ApiRequestParams.EnumParam { + @SerializedName("checking") + CHECKING("checking"), + + @SerializedName("savings") + SAVINGS("savings"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AccountSubcategory(String value) { + this.value = value; + } + } + } + + public enum Permission implements ApiRequestParams.EnumParam { + @SerializedName("balances") + BALANCES("balances"), + + @SerializedName("ownership") + OWNERSHIP("ownership"), + + @SerializedName("payment_method") + PAYMENT_METHOD("payment_method"), + + @SerializedName("transactions") + TRANSACTIONS("transactions"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Permission(String value) { + this.value = value; + } + } + + public enum Prefetch implements ApiRequestParams.EnumParam { + @SerializedName("balances") + BALANCES("balances"), + + @SerializedName("ownership") + OWNERSHIP("ownership"), + + @SerializedName("transactions") + TRANSACTIONS("transactions"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Prefetch(String value) { + this.value = value; + } + } + } + + public enum VerificationMethod implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("instant") + INSTANT("instant"), + + @SerializedName("microdeposits") + MICRODEPOSITS("microdeposits"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + VerificationMethod(String value) { + this.value = value; + } + } + } + } + + public enum CollectionMethod implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("send_invoice") + SEND_INVOICE("send_invoice"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CollectionMethod(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/MeterEventStreamCreateParams.java b/src/main/java/com/stripe/param/v2/billing/MeterEventStreamCreateParams.java index 5b0d475cd51..8712b57029c 100644 --- a/src/main/java/com/stripe/param/v2/billing/MeterEventStreamCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/MeterEventStreamCreateParams.java @@ -14,7 +14,10 @@ @Getter @EqualsAndHashCode(callSuper = false) public class MeterEventStreamCreateParams extends ApiRequestParams { - /** Required. List of meter events to include in the request. */ + /** + * Required. List of meter events to include in the request. Supports up to 100 + * events per request. + */ @SerializedName("events") List events; diff --git a/src/main/java/com/stripe/param/v2/billing/ProfileCreateParams.java b/src/main/java/com/stripe/param/v2/billing/ProfileCreateParams.java new file mode 100644 index 00000000000..6617f372830 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/ProfileCreateParams.java @@ -0,0 +1,171 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class ProfileCreateParams extends ApiRequestParams { + /** Required. The ID of the customer object. */ + @SerializedName("customer") + String customer; + + /** The ID of the payment method object. */ + @SerializedName("default_payment_method") + String defaultPaymentMethod; + + /** A customer-facing name for the billing profile. Maximum length of 250 characters. */ + @SerializedName("display_name") + String displayName; + + /** + * 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; + + /** + * An internal key you can use to search for a particular billing profile. It must be unique among + * billing profiles for a given customer. Maximum length of 200 characters. + */ + @SerializedName("lookup_key") + String lookupKey; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing + * additional information about the object in a structured format. + */ + @SerializedName("metadata") + Map metadata; + + private ProfileCreateParams( + String customer, + String defaultPaymentMethod, + String displayName, + Map extraParams, + String lookupKey, + Map metadata) { + this.customer = customer; + this.defaultPaymentMethod = defaultPaymentMethod; + this.displayName = displayName; + this.extraParams = extraParams; + this.lookupKey = lookupKey; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String customer; + + private String defaultPaymentMethod; + + private String displayName; + + private Map extraParams; + + private String lookupKey; + + private Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public ProfileCreateParams build() { + return new ProfileCreateParams( + this.customer, + this.defaultPaymentMethod, + this.displayName, + this.extraParams, + this.lookupKey, + this.metadata); + } + + /** Required. The ID of the customer object. */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + /** The ID of the payment method object. */ + public Builder setDefaultPaymentMethod(String defaultPaymentMethod) { + this.defaultPaymentMethod = defaultPaymentMethod; + return this; + } + + /** A customer-facing name for the billing profile. Maximum length of 250 characters. */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + 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 + * ProfileCreateParams#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 ProfileCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * An internal key you can use to search for a particular billing profile. It must be unique + * among billing profiles for a given customer. Maximum length of 200 characters. + */ + public Builder setLookupKey(String lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, + * and subsequent calls add additional key/value pairs to the original map. See {@link + * ProfileCreateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link ProfileCreateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/ProfileListParams.java b/src/main/java/com/stripe/param/v2/billing/ProfileListParams.java new file mode 100644 index 00000000000..07204f7c48b --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/ProfileListParams.java @@ -0,0 +1,200 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +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 ProfileListParams extends ApiRequestParams { + /** + * Filter billing profiles by a customer. Mutually exclusive with {@code lookup_keys} and {@code + * default_payment_method}. + */ + @SerializedName("customer") + String customer; + + /** + * Filter billing profiles by a default payment method. Mutually exclusive with {@code customer} + * and {@code lookup_keys}. + */ + @SerializedName("default_payment_method") + String defaultPaymentMethod; + + /** + * 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; + + /** Optionally set the maximum number of results per page. Defaults to 10. */ + @SerializedName("limit") + Long limit; + + /** + * Required. Filter billing profiles by lookup keys. Mutually exclusive with + * {@code customer} and {@code default_payment_method}. You can specify up to 10 lookup_keys. + */ + @SerializedName("lookup_keys") + List lookupKeys; + + /** + * Filter billing profiles by status. Can be combined with all other filters. If not provided, all + * billing profiles will be returned. + */ + @SerializedName("status") + Status status; + + private ProfileListParams( + String customer, + String defaultPaymentMethod, + Map extraParams, + Long limit, + List lookupKeys, + Status status) { + this.customer = customer; + this.defaultPaymentMethod = defaultPaymentMethod; + this.extraParams = extraParams; + this.limit = limit; + this.lookupKeys = lookupKeys; + this.status = status; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String customer; + + private String defaultPaymentMethod; + + private Map extraParams; + + private Long limit; + + private List lookupKeys; + + private Status status; + + /** Finalize and obtain parameter instance from this builder. */ + public ProfileListParams build() { + return new ProfileListParams( + this.customer, + this.defaultPaymentMethod, + this.extraParams, + this.limit, + this.lookupKeys, + this.status); + } + + /** + * Filter billing profiles by a customer. Mutually exclusive with {@code lookup_keys} and {@code + * default_payment_method}. + */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + /** + * Filter billing profiles by a default payment method. Mutually exclusive with {@code customer} + * and {@code lookup_keys}. + */ + public Builder setDefaultPaymentMethod(String defaultPaymentMethod) { + this.defaultPaymentMethod = defaultPaymentMethod; + 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 + * ProfileListParams#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 ProfileListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Optionally set the maximum number of results per page. Defaults to 10. */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Add an element to `lookupKeys` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * ProfileListParams#lookupKeys} for the field documentation. + */ + public Builder addLookupKey(String element) { + if (this.lookupKeys == null) { + this.lookupKeys = new ArrayList<>(); + } + this.lookupKeys.add(element); + return this; + } + + /** + * Add all elements to `lookupKeys` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * ProfileListParams#lookupKeys} for the field documentation. + */ + public Builder addAllLookupKey(List elements) { + if (this.lookupKeys == null) { + this.lookupKeys = new ArrayList<>(); + } + this.lookupKeys.addAll(elements); + return this; + } + + /** + * Filter billing profiles by status. Can be combined with all other filters. If not provided, + * all billing profiles will be returned. + */ + public Builder setStatus(ProfileListParams.Status status) { + this.status = status; + return this; + } + } + + public enum Status implements ApiRequestParams.EnumParam { + @SerializedName("active") + ACTIVE("active"), + + @SerializedName("inactive") + INACTIVE("inactive"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Status(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/ProfileUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/ProfileUpdateParams.java new file mode 100644 index 00000000000..2d2bbe52119 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/ProfileUpdateParams.java @@ -0,0 +1,208 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class ProfileUpdateParams extends ApiRequestParams { + /** The ID of the payment method object. */ + @SerializedName("default_payment_method") + Object defaultPaymentMethod; + + /** + * A customer-facing name for the billing profile. Maximum length of 250 characters. To remove the + * display_name from the object, set it to null in the request. + */ + @SerializedName("display_name") + Object displayName; + + /** + * 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; + + /** + * An internal key you can use to search for a particular billing profile. It must be unique among + * billing profiles for a given customer. Maximum length of 200 characters. To remove the + * lookup_key from the object, set it to null in the request. + */ + @SerializedName("lookup_key") + Object lookupKey; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing + * additional information about the object in a structured format. + */ + @SerializedName("metadata") + Map metadata; + + private ProfileUpdateParams( + Object defaultPaymentMethod, + Object displayName, + Map extraParams, + Object lookupKey, + Map metadata) { + this.defaultPaymentMethod = defaultPaymentMethod; + this.displayName = displayName; + this.extraParams = extraParams; + this.lookupKey = lookupKey; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object defaultPaymentMethod; + + private Object displayName; + + private Map extraParams; + + private Object lookupKey; + + private Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public ProfileUpdateParams build() { + return new ProfileUpdateParams( + this.defaultPaymentMethod, + this.displayName, + this.extraParams, + this.lookupKey, + this.metadata); + } + + /** The ID of the payment method object. */ + public Builder setDefaultPaymentMethod(String defaultPaymentMethod) { + this.defaultPaymentMethod = defaultPaymentMethod; + return this; + } + + /** The ID of the payment method object. */ + public Builder setDefaultPaymentMethod(EmptyParam defaultPaymentMethod) { + this.defaultPaymentMethod = defaultPaymentMethod; + return this; + } + + /** + * A customer-facing name for the billing profile. Maximum length of 250 characters. To remove + * the display_name from the object, set it to null in the request. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * A customer-facing name for the billing profile. Maximum length of 250 characters. To remove + * the display_name from the object, set it to null in the request. + */ + public Builder setDisplayName(EmptyParam displayName) { + this.displayName = displayName; + 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 + * ProfileUpdateParams#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 ProfileUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * An internal key you can use to search for a particular billing profile. It must be unique + * among billing profiles for a given customer. Maximum length of 200 characters. To remove the + * lookup_key from the object, set it to null in the request. + */ + public Builder setLookupKey(String lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** + * An internal key you can use to search for a particular billing profile. It must be unique + * among billing profiles for a given customer. Maximum length of 200 characters. To remove the + * lookup_key from the object, set it to null in the request. + */ + public Builder setLookupKey(EmptyParam lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, + * and subsequent calls add additional key/value pairs to the original map. See {@link + * ProfileUpdateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, + * and subsequent calls add additional key/value pairs to the original map. See {@link + * ProfileUpdateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, EmptyParam value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * Map values can only be one of the following types: `String`, `EmptyParam`. See {@link + * ProfileUpdateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (!map.values().stream().allMatch(v -> v instanceof String || v instanceof EmptyParam)) { + throw new IllegalArgumentException( + "All map values must one of the following types: String, EmptyParam"); + } + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/billsettings/VersionListParams.java b/src/main/java/com/stripe/param/v2/billing/billsettings/VersionListParams.java new file mode 100644 index 00000000000..0a30abc86b4 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/billsettings/VersionListParams.java @@ -0,0 +1,78 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing.billsettings; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class VersionListParams extends ApiRequestParams { + /** + * 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; + + /** Optionally set the maximum number of results per page. Defaults to 20. */ + @SerializedName("limit") + Long limit; + + private VersionListParams(Map extraParams, Long limit) { + this.extraParams = extraParams; + this.limit = limit; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long limit; + + /** Finalize and obtain parameter instance from this builder. */ + public VersionListParams build() { + return new VersionListParams(this.extraParams, this.limit); + } + + /** + * 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 + * VersionListParams#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 VersionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Optionally set the maximum number of results per page. Defaults to 20. */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/collectionsettings/VersionListParams.java b/src/main/java/com/stripe/param/v2/billing/collectionsettings/VersionListParams.java new file mode 100644 index 00000000000..412c300cb3c --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/collectionsettings/VersionListParams.java @@ -0,0 +1,78 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing.collectionsettings; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class VersionListParams extends ApiRequestParams { + /** + * 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; + + /** Optionally set the maximum number of results per page. Defaults to 20. */ + @SerializedName("limit") + Long limit; + + private VersionListParams(Map extraParams, Long limit) { + this.extraParams = extraParams; + this.limit = limit; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long limit; + + /** Finalize and obtain parameter instance from this builder. */ + public VersionListParams build() { + return new VersionListParams(this.extraParams, this.limit); + } + + /** + * 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 + * VersionListParams#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 VersionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Optionally set the maximum number of results per page. Defaults to 20. */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java index b7c6c388685..3be6931bc5a 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java @@ -9023,6 +9023,10 @@ public static class Defaults { @SerializedName("locales") List locales; + /** Account profile information. */ + @SerializedName("profile") + Profile profile; + /** Default responsibilities held by either Stripe or the platform. */ @SerializedName("responsibilities") Responsibilities responsibilities; @@ -9031,10 +9035,12 @@ private Defaults( String currency, Map extraParams, List locales, + Profile profile, Responsibilities responsibilities) { this.currency = currency; this.extraParams = extraParams; this.locales = locales; + this.profile = profile; this.responsibilities = responsibilities; } @@ -9049,12 +9055,14 @@ public static class Builder { private List locales; + private Profile profile; + private Responsibilities responsibilities; /** Finalize and obtain parameter instance from this builder. */ public AccountCreateParams.Defaults build() { return new AccountCreateParams.Defaults( - this.currency, this.extraParams, this.locales, this.responsibilities); + this.currency, this.extraParams, this.locales, this.profile, this.responsibilities); } /** @@ -9119,6 +9127,12 @@ public Builder addAllLocale(List elements) return this; } + /** Account profile information. */ + public Builder setProfile(AccountCreateParams.Defaults.Profile profile) { + this.profile = profile; + return this; + } + /** Default responsibilities held by either Stripe or the platform. */ public Builder setResponsibilities( AccountCreateParams.Defaults.Responsibilities responsibilities) { @@ -9127,6 +9141,114 @@ public Builder setResponsibilities( } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Profile { + /** The business's publicly-available website. */ + @SerializedName("business_url") + String businessUrl; + + /** The name which is used by the business. */ + @SerializedName("doing_business_as") + String doingBusinessAs; + + /** + * 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; + + /** + * Internal-only description of the product sold or service provided by the business. It's + * used by Stripe for risk and underwriting purposes. + */ + @SerializedName("product_description") + String productDescription; + + private Profile( + String businessUrl, + String doingBusinessAs, + Map extraParams, + String productDescription) { + this.businessUrl = businessUrl; + this.doingBusinessAs = doingBusinessAs; + this.extraParams = extraParams; + this.productDescription = productDescription; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String businessUrl; + + private String doingBusinessAs; + + private Map extraParams; + + private String productDescription; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Defaults.Profile build() { + return new AccountCreateParams.Defaults.Profile( + this.businessUrl, this.doingBusinessAs, this.extraParams, this.productDescription); + } + + /** The business's publicly-available website. */ + public Builder setBusinessUrl(String businessUrl) { + this.businessUrl = businessUrl; + return this; + } + + /** The name which is used by the business. */ + public Builder setDoingBusinessAs(String doingBusinessAs) { + this.doingBusinessAs = doingBusinessAs; + 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 AccountCreateParams.Defaults.Profile#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 AccountCreateParams.Defaults.Profile#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Internal-only description of the product sold or service provided by the business. It's + * used by Stripe for risk and underwriting purposes. + */ + public Builder setProductDescription(String productDescription) { + this.productDescription = productDescription; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Responsibilities { @@ -10536,10 +10658,6 @@ public static class BusinessDetails { @SerializedName("documents") Documents documents; - /** The name which is used by the business. */ - @SerializedName("doing_business_as") - String doingBusinessAs; - /** * An estimated upper bound of employees, contractors, vendors, etc. currently working for the * business. @@ -10568,13 +10686,6 @@ public static class BusinessDetails { @SerializedName("phone") String phone; - /** - * Internal-only description of the product sold or service provided by the business. It's - * used by Stripe for risk and underwriting purposes. - */ - @SerializedName("product_description") - String productDescription; - /** The business legal name. */ @SerializedName("registered_name") String registeredName; @@ -10591,41 +10702,31 @@ public static class BusinessDetails { @SerializedName("structure") Structure structure; - /** The business's publicly available website. */ - @SerializedName("url") - String url; - private BusinessDetails( Address address, AnnualRevenue annualRevenue, Documents documents, - String doingBusinessAs, Long estimatedWorkerCount, Map extraParams, List idNumbers, MonthlyEstimatedRevenue monthlyEstimatedRevenue, String phone, - String productDescription, String registeredName, ScriptAddresses scriptAddresses, ScriptNames scriptNames, - Structure structure, - String url) { + Structure structure) { this.address = address; this.annualRevenue = annualRevenue; this.documents = documents; - this.doingBusinessAs = doingBusinessAs; this.estimatedWorkerCount = estimatedWorkerCount; this.extraParams = extraParams; this.idNumbers = idNumbers; this.monthlyEstimatedRevenue = monthlyEstimatedRevenue; this.phone = phone; - this.productDescription = productDescription; this.registeredName = registeredName; this.scriptAddresses = scriptAddresses; this.scriptNames = scriptNames; this.structure = structure; - this.url = url; } public static Builder builder() { @@ -10639,8 +10740,6 @@ public static class Builder { private Documents documents; - private String doingBusinessAs; - private Long estimatedWorkerCount; private Map extraParams; @@ -10651,8 +10750,6 @@ public static class Builder { private String phone; - private String productDescription; - private String registeredName; private ScriptAddresses scriptAddresses; @@ -10661,26 +10758,21 @@ public static class Builder { private Structure structure; - private String url; - /** Finalize and obtain parameter instance from this builder. */ public AccountCreateParams.Identity.BusinessDetails build() { return new AccountCreateParams.Identity.BusinessDetails( this.address, this.annualRevenue, this.documents, - this.doingBusinessAs, this.estimatedWorkerCount, this.extraParams, this.idNumbers, this.monthlyEstimatedRevenue, this.phone, - this.productDescription, this.registeredName, this.scriptAddresses, this.scriptNames, - this.structure, - this.url); + this.structure); } /** The business registration address of the business entity. */ @@ -10703,12 +10795,6 @@ public Builder setDocuments( return this; } - /** The name which is used by the business. */ - public Builder setDoingBusinessAs(String doingBusinessAs) { - this.doingBusinessAs = doingBusinessAs; - return this; - } - /** * An estimated upper bound of employees, contractors, vendors, etc. currently working for * the business. @@ -10787,15 +10873,6 @@ public Builder setPhone(String phone) { return this; } - /** - * Internal-only description of the product sold or service provided by the business. It's - * used by Stripe for risk and underwriting purposes. - */ - public Builder setProductDescription(String productDescription) { - this.productDescription = productDescription; - return this; - } - /** The business legal name. */ public Builder setRegisteredName(String registeredName) { this.registeredName = registeredName; @@ -10822,12 +10899,6 @@ public Builder setStructure( this.structure = structure; return this; } - - /** The business's publicly available website. */ - public Builder setUrl(String url) { - this.url = url; - return this; - } } @Getter diff --git a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java index c79aadb314c..751ce0e79b7 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java @@ -7382,7 +7382,9 @@ public static class Recipient { * The payout method id to be used as a default outbound destination. This will allow the * PayoutMethod to be omitted on OutboundPayments made through API or sending payouts via * dashboard. Can also be explicitly set to {@code null} to clear the existing default - * outbound destination. + * outbound destination. For further details about creating an Outbound Destination, see Collect + * recipient's payment details. */ @SerializedName("default_outbound_destination") Object defaultOutboundDestination; @@ -7446,7 +7448,9 @@ public Builder setCapabilities( * The payout method id to be used as a default outbound destination. This will allow the * PayoutMethod to be omitted on OutboundPayments made through API or sending payouts via * dashboard. Can also be explicitly set to {@code null} to clear the existing default - * outbound destination. + * outbound destination. For further details about creating an Outbound Destination, see Collect + * recipient's payment details. */ public Builder setDefaultOutboundDestination(String defaultOutboundDestination) { this.defaultOutboundDestination = defaultOutboundDestination; @@ -7457,7 +7461,9 @@ public Builder setDefaultOutboundDestination(String defaultOutboundDestination) * The payout method id to be used as a default outbound destination. This will allow the * PayoutMethod to be omitted on OutboundPayments made through API or sending payouts via * dashboard. Can also be explicitly set to {@code null} to clear the existing default - * outbound destination. + * outbound destination. For further details about creating an Outbound Destination, see Collect + * recipient's payment details. */ public Builder setDefaultOutboundDestination(EmptyParam defaultOutboundDestination) { this.defaultOutboundDestination = defaultOutboundDestination; @@ -9496,6 +9502,10 @@ public static class Defaults { @SerializedName("locales") List locales; + /** Account profile information. */ + @SerializedName("profile") + Profile profile; + /** Default responsibilities held by either Stripe or the platform. */ @SerializedName("responsibilities") Responsibilities responsibilities; @@ -9504,10 +9514,12 @@ private Defaults( Object currency, Map extraParams, List locales, + Profile profile, Responsibilities responsibilities) { this.currency = currency; this.extraParams = extraParams; this.locales = locales; + this.profile = profile; this.responsibilities = responsibilities; } @@ -9522,12 +9534,14 @@ public static class Builder { private List locales; + private Profile profile; + private Responsibilities responsibilities; /** Finalize and obtain parameter instance from this builder. */ public AccountUpdateParams.Defaults build() { return new AccountUpdateParams.Defaults( - this.currency, this.extraParams, this.locales, this.responsibilities); + this.currency, this.extraParams, this.locales, this.profile, this.responsibilities); } /** @@ -9602,6 +9616,12 @@ public Builder addAllLocale(List elements) return this; } + /** Account profile information. */ + public Builder setProfile(AccountUpdateParams.Defaults.Profile profile) { + this.profile = profile; + return this; + } + /** Default responsibilities held by either Stripe or the platform. */ public Builder setResponsibilities( AccountUpdateParams.Defaults.Responsibilities responsibilities) { @@ -9610,6 +9630,135 @@ public Builder setResponsibilities( } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Profile { + /** The business's publicly-available website. */ + @SerializedName("business_url") + Object businessUrl; + + /** The name which is used by the business. */ + @SerializedName("doing_business_as") + Object doingBusinessAs; + + /** + * 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; + + /** + * Internal-only description of the product sold or service provided by the business. It's + * used by Stripe for risk and underwriting purposes. + */ + @SerializedName("product_description") + Object productDescription; + + private Profile( + Object businessUrl, + Object doingBusinessAs, + Map extraParams, + Object productDescription) { + this.businessUrl = businessUrl; + this.doingBusinessAs = doingBusinessAs; + this.extraParams = extraParams; + this.productDescription = productDescription; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object businessUrl; + + private Object doingBusinessAs; + + private Map extraParams; + + private Object productDescription; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Defaults.Profile build() { + return new AccountUpdateParams.Defaults.Profile( + this.businessUrl, this.doingBusinessAs, this.extraParams, this.productDescription); + } + + /** The business's publicly-available website. */ + public Builder setBusinessUrl(String businessUrl) { + this.businessUrl = businessUrl; + return this; + } + + /** The business's publicly-available website. */ + public Builder setBusinessUrl(EmptyParam businessUrl) { + this.businessUrl = businessUrl; + return this; + } + + /** The name which is used by the business. */ + public Builder setDoingBusinessAs(String doingBusinessAs) { + this.doingBusinessAs = doingBusinessAs; + return this; + } + + /** The name which is used by the business. */ + public Builder setDoingBusinessAs(EmptyParam doingBusinessAs) { + this.doingBusinessAs = doingBusinessAs; + 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 AccountUpdateParams.Defaults.Profile#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 AccountUpdateParams.Defaults.Profile#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Internal-only description of the product sold or service provided by the business. It's + * used by Stripe for risk and underwriting purposes. + */ + public Builder setProductDescription(String productDescription) { + this.productDescription = productDescription; + return this; + } + + /** + * Internal-only description of the product sold or service provided by the business. It's + * used by Stripe for risk and underwriting purposes. + */ + public Builder setProductDescription(EmptyParam productDescription) { + this.productDescription = productDescription; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Responsibilities { @@ -11090,10 +11239,6 @@ public static class BusinessDetails { @SerializedName("documents") Documents documents; - /** The name which is used by the business. */ - @SerializedName("doing_business_as") - Object doingBusinessAs; - /** * An estimated upper bound of employees, contractors, vendors, etc. currently working for the * business. @@ -11122,13 +11267,6 @@ public static class BusinessDetails { @SerializedName("phone") Object phone; - /** - * Internal-only description of the product sold or service provided by the business. It’s - * used by Stripe for risk and underwriting purposes. - */ - @SerializedName("product_description") - Object productDescription; - /** The business legal name. */ @SerializedName("registered_name") Object registeredName; @@ -11145,41 +11283,31 @@ public static class BusinessDetails { @SerializedName("structure") Structure structure; - /** The business's publicly available website. */ - @SerializedName("url") - Object url; - private BusinessDetails( Address address, AnnualRevenue annualRevenue, Documents documents, - Object doingBusinessAs, Long estimatedWorkerCount, Map extraParams, List idNumbers, MonthlyEstimatedRevenue monthlyEstimatedRevenue, Object phone, - Object productDescription, Object registeredName, ScriptAddresses scriptAddresses, ScriptNames scriptNames, - Structure structure, - Object url) { + Structure structure) { this.address = address; this.annualRevenue = annualRevenue; this.documents = documents; - this.doingBusinessAs = doingBusinessAs; this.estimatedWorkerCount = estimatedWorkerCount; this.extraParams = extraParams; this.idNumbers = idNumbers; this.monthlyEstimatedRevenue = monthlyEstimatedRevenue; this.phone = phone; - this.productDescription = productDescription; this.registeredName = registeredName; this.scriptAddresses = scriptAddresses; this.scriptNames = scriptNames; this.structure = structure; - this.url = url; } public static Builder builder() { @@ -11193,8 +11321,6 @@ public static class Builder { private Documents documents; - private Object doingBusinessAs; - private Long estimatedWorkerCount; private Map extraParams; @@ -11205,8 +11331,6 @@ public static class Builder { private Object phone; - private Object productDescription; - private Object registeredName; private ScriptAddresses scriptAddresses; @@ -11215,26 +11339,21 @@ public static class Builder { private Structure structure; - private Object url; - /** Finalize and obtain parameter instance from this builder. */ public AccountUpdateParams.Identity.BusinessDetails build() { return new AccountUpdateParams.Identity.BusinessDetails( this.address, this.annualRevenue, this.documents, - this.doingBusinessAs, this.estimatedWorkerCount, this.extraParams, this.idNumbers, this.monthlyEstimatedRevenue, this.phone, - this.productDescription, this.registeredName, this.scriptAddresses, this.scriptNames, - this.structure, - this.url); + this.structure); } /** The business registration address of the business entity. */ @@ -11257,18 +11376,6 @@ public Builder setDocuments( return this; } - /** The name which is used by the business. */ - public Builder setDoingBusinessAs(String doingBusinessAs) { - this.doingBusinessAs = doingBusinessAs; - return this; - } - - /** The name which is used by the business. */ - public Builder setDoingBusinessAs(EmptyParam doingBusinessAs) { - this.doingBusinessAs = doingBusinessAs; - return this; - } - /** * An estimated upper bound of employees, contractors, vendors, etc. currently working for * the business. @@ -11353,24 +11460,6 @@ public Builder setPhone(EmptyParam phone) { return this; } - /** - * Internal-only description of the product sold or service provided by the business. It’s - * used by Stripe for risk and underwriting purposes. - */ - public Builder setProductDescription(String productDescription) { - this.productDescription = productDescription; - return this; - } - - /** - * Internal-only description of the product sold or service provided by the business. It’s - * used by Stripe for risk and underwriting purposes. - */ - public Builder setProductDescription(EmptyParam productDescription) { - this.productDescription = productDescription; - return this; - } - /** The business legal name. */ public Builder setRegisteredName(String registeredName) { this.registeredName = registeredName; @@ -11403,18 +11492,6 @@ public Builder setStructure( this.structure = structure; return this; } - - /** The business's publicly available website. */ - public Builder setUrl(String url) { - this.url = url; - return this; - } - - /** The business's publicly available website. */ - public Builder setUrl(EmptyParam url) { - this.url = url; - return this; - } } @Getter diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAddressCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAddressCreateParams.java index 6d63e32b118..2eed79ad4d9 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAddressCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAddressCreateParams.java @@ -11,13 +11,6 @@ @Getter @EqualsAndHashCode(callSuper = false) public class FinancialAddressCreateParams extends ApiRequestParams { - /** - * Required. Open Enum. The currency the FinancialAddress should support. - * Currently, only the {@code usd} and {@code gbp} values are supported. - */ - @SerializedName("currency") - String currency; - /** * 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 @@ -34,11 +27,15 @@ public class FinancialAddressCreateParams extends ApiRequestParams { @SerializedName("financial_account") String financialAccount; + /** Required. The type of FinancialAddress details to provision. */ + @SerializedName("type") + Type type; + private FinancialAddressCreateParams( - String currency, Map extraParams, String financialAccount) { - this.currency = currency; + Map extraParams, String financialAccount, Type type) { this.extraParams = extraParams; this.financialAccount = financialAccount; + this.type = type; } public static Builder builder() { @@ -46,25 +43,15 @@ public static Builder builder() { } public static class Builder { - private String currency; - private Map extraParams; private String financialAccount; + private Type type; + /** Finalize and obtain parameter instance from this builder. */ public FinancialAddressCreateParams build() { - return new FinancialAddressCreateParams( - this.currency, this.extraParams, this.financialAccount); - } - - /** - * Required. Open Enum. The currency the FinancialAddress should support. - * Currently, only the {@code usd} and {@code gbp} values are supported. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; + return new FinancialAddressCreateParams(this.extraParams, this.financialAccount, this.type); } /** @@ -101,5 +88,29 @@ public Builder setFinancialAccount(String financialAccount) { this.financialAccount = financialAccount; return this; } + + /** Required. The type of FinancialAddress details to provision. */ + public Builder setType(FinancialAddressCreateParams.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("gb_bank_account") + GB_BANK_ACCOUNT("gb_bank_account"), + + @SerializedName("sepa_bank_account") + SEPA_BANK_ACCOUNT("sepa_bank_account"), + + @SerializedName("us_bank_account") + US_BANK_ACCOUNT("us_bank_account"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java index bd00528301b..91aeb2870da 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java @@ -499,7 +499,10 @@ public enum Type implements ApiRequestParams.EnumParam { BANK_ACCOUNT("bank_account"), @SerializedName("card") - CARD("card"); + CARD("card"), + + @SerializedName("crypto_wallet") + CRYPTO_WALLET("crypto_wallet"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java index 549f5910120..d40727bc9b0 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java @@ -535,7 +535,10 @@ public enum Type implements ApiRequestParams.EnumParam { BANK_ACCOUNT("bank_account"), @SerializedName("card") - CARD("card"); + CARD("card"), + + @SerializedName("crypto_wallet") + CRYPTO_WALLET("crypto_wallet"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/v2/payments/OffSessionPaymentCreateParams.java b/src/main/java/com/stripe/param/v2/payments/OffSessionPaymentCreateParams.java index bfbd00c1cb5..0bc6f32556f 100644 --- a/src/main/java/com/stripe/param/v2/payments/OffSessionPaymentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/payments/OffSessionPaymentCreateParams.java @@ -4,7 +4,10 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.v2.Amount; +import java.time.Instant; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -16,6 +19,10 @@ public class OffSessionPaymentCreateParams extends ApiRequestParams { @SerializedName("amount") Amount amount; + /** Provides industry-specific information about the amount. */ + @SerializedName("amount_details") + AmountDetails amountDetails; + /** Required. The frequency of the underlying payment. */ @SerializedName("cadence") Cadence cadence; @@ -33,6 +40,10 @@ public class OffSessionPaymentCreateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** This hash contains details about the Mandate to create. */ + @SerializedName("mandate_data") + MandateData mandateData; + /** * Required. Set of key-value * pairs that you can attach to an object. This can be useful for storing additional @@ -51,6 +62,14 @@ public class OffSessionPaymentCreateParams extends ApiRequestParams { @SerializedName("payment_method") String paymentMethod; + /** Payment method options for the off-session payment. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + + /** Details about the payments orchestration configuration. */ + @SerializedName("payments_orchestration") + PaymentsOrchestration paymentsOrchestration; + /** Details about the OffSessionPayment retries. */ @SerializedName("retry_details") RetryDetails retryDetails; @@ -88,24 +107,32 @@ public class OffSessionPaymentCreateParams extends ApiRequestParams { private OffSessionPaymentCreateParams( Amount amount, + AmountDetails amountDetails, Cadence cadence, String customer, Map extraParams, + MandateData mandateData, Map metadata, String onBehalfOf, String paymentMethod, + PaymentMethodOptions paymentMethodOptions, + PaymentsOrchestration paymentsOrchestration, RetryDetails retryDetails, String statementDescriptor, String statementDescriptorSuffix, String testClock, TransferData transferData) { this.amount = amount; + this.amountDetails = amountDetails; this.cadence = cadence; this.customer = customer; this.extraParams = extraParams; + this.mandateData = mandateData; this.metadata = metadata; this.onBehalfOf = onBehalfOf; this.paymentMethod = paymentMethod; + this.paymentMethodOptions = paymentMethodOptions; + this.paymentsOrchestration = paymentsOrchestration; this.retryDetails = retryDetails; this.statementDescriptor = statementDescriptor; this.statementDescriptorSuffix = statementDescriptorSuffix; @@ -120,18 +147,26 @@ public static Builder builder() { public static class Builder { private Amount amount; + private AmountDetails amountDetails; + private Cadence cadence; private String customer; private Map extraParams; + private MandateData mandateData; + private Map metadata; private String onBehalfOf; private String paymentMethod; + private PaymentMethodOptions paymentMethodOptions; + + private PaymentsOrchestration paymentsOrchestration; + private RetryDetails retryDetails; private String statementDescriptor; @@ -146,12 +181,16 @@ public static class Builder { public OffSessionPaymentCreateParams build() { return new OffSessionPaymentCreateParams( this.amount, + this.amountDetails, this.cadence, this.customer, this.extraParams, + this.mandateData, this.metadata, this.onBehalfOf, this.paymentMethod, + this.paymentMethodOptions, + this.paymentsOrchestration, this.retryDetails, this.statementDescriptor, this.statementDescriptorSuffix, @@ -165,6 +204,12 @@ public Builder setAmount(Amount amount) { return this; } + /** Provides industry-specific information about the amount. */ + public Builder setAmountDetails(OffSessionPaymentCreateParams.AmountDetails amountDetails) { + this.amountDetails = amountDetails; + return this; + } + /** Required. The frequency of the underlying payment. */ public Builder setCadence(OffSessionPaymentCreateParams.Cadence cadence) { this.cadence = cadence; @@ -203,6 +248,12 @@ public Builder putAllExtraParam(Map map) { return this; } + /** This hash contains details about the Mandate to create. */ + public Builder setMandateData(OffSessionPaymentCreateParams.MandateData mandateData) { + this.mandateData = mandateData; + return this; + } + /** * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, * and subsequent calls add additional key/value pairs to the original map. See {@link @@ -241,6 +292,20 @@ public Builder setPaymentMethod(String paymentMethod) { return this; } + /** Payment method options for the off-session payment. */ + public Builder setPaymentMethodOptions( + OffSessionPaymentCreateParams.PaymentMethodOptions paymentMethodOptions) { + this.paymentMethodOptions = paymentMethodOptions; + return this; + } + + /** Details about the payments orchestration configuration. */ + public Builder setPaymentsOrchestration( + OffSessionPaymentCreateParams.PaymentsOrchestration paymentsOrchestration) { + this.paymentsOrchestration = paymentsOrchestration; + return this; + } + /** Details about the OffSessionPayment retries. */ public Builder setRetryDetails(OffSessionPaymentCreateParams.RetryDetails retryDetails) { this.retryDetails = retryDetails; @@ -287,6 +352,965 @@ public Builder setTransferData(OffSessionPaymentCreateParams.TransferData transf } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AmountDetails { + /** The amount the total transaction was discounted for. */ + @SerializedName("discount_amount") + Long discountAmount; + + /** + * 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. A list of line items, each containing information about a product + * in the PaymentIntent. There is a maximum of 100 line items. + */ + @SerializedName("line_items") + List lineItems; + + /** Contains information about the shipping portion of the amount. */ + @SerializedName("shipping") + Shipping shipping; + + /** Contains information about the tax portion of the amount. */ + @SerializedName("tax") + Tax tax; + + private AmountDetails( + Long discountAmount, + Map extraParams, + List lineItems, + Shipping shipping, + Tax tax) { + this.discountAmount = discountAmount; + this.extraParams = extraParams; + this.lineItems = lineItems; + this.shipping = shipping; + this.tax = tax; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long discountAmount; + + private Map extraParams; + + private List lineItems; + + private Shipping shipping; + + private Tax tax; + + /** Finalize and obtain parameter instance from this builder. */ + public OffSessionPaymentCreateParams.AmountDetails build() { + return new OffSessionPaymentCreateParams.AmountDetails( + this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + } + + /** The amount the total transaction was discounted for. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + 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 + * OffSessionPaymentCreateParams.AmountDetails#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 OffSessionPaymentCreateParams.AmountDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `lineItems` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * OffSessionPaymentCreateParams.AmountDetails#lineItems} for the field documentation. + */ + public Builder addLineItem(OffSessionPaymentCreateParams.AmountDetails.LineItem element) { + if (this.lineItems == null) { + this.lineItems = new ArrayList<>(); + } + this.lineItems.add(element); + return this; + } + + /** + * Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * OffSessionPaymentCreateParams.AmountDetails#lineItems} for the field documentation. + */ + public Builder addAllLineItem( + List elements) { + if (this.lineItems == null) { + this.lineItems = new ArrayList<>(); + } + this.lineItems.addAll(elements); + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping(OffSessionPaymentCreateParams.AmountDetails.Shipping shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(OffSessionPaymentCreateParams.AmountDetails.Tax tax) { + this.tax = tax; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineItem { + /** The amount an item was discounted for. Positive integer. */ + @SerializedName("discount_amount") + Long discountAmount; + + /** + * 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; + + /** Unique identifier of the product. At most 12 characters long. */ + @SerializedName("product_code") + String productCode; + + /** Required. Name of the product. At most 100 characters long. */ + @SerializedName("product_name") + String productName; + + /** Required. Number of items of the product. Positive integer. */ + @SerializedName("quantity") + Long quantity; + + /** Contains information about the tax on the item. */ + @SerializedName("tax") + Tax tax; + + /** Required. Cost of the product. Non-negative integer. */ + @SerializedName("unit_cost") + Long unitCost; + + private LineItem( + Long discountAmount, + Map extraParams, + String productCode, + String productName, + Long quantity, + Tax tax, + Long unitCost) { + this.discountAmount = discountAmount; + this.extraParams = extraParams; + this.productCode = productCode; + this.productName = productName; + this.quantity = quantity; + this.tax = tax; + this.unitCost = unitCost; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long discountAmount; + + private Map extraParams; + + private String productCode; + + private String productName; + + private Long quantity; + + private Tax tax; + + private Long unitCost; + + /** Finalize and obtain parameter instance from this builder. */ + public OffSessionPaymentCreateParams.AmountDetails.LineItem build() { + return new OffSessionPaymentCreateParams.AmountDetails.LineItem( + this.discountAmount, + this.extraParams, + this.productCode, + this.productName, + this.quantity, + this.tax, + this.unitCost); + } + + /** The amount an item was discounted for. Positive integer. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + 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 OffSessionPaymentCreateParams.AmountDetails.LineItem#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 OffSessionPaymentCreateParams.AmountDetails.LineItem#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Unique identifier of the product. At most 12 characters long. */ + public Builder setProductCode(String productCode) { + this.productCode = productCode; + return this; + } + + /** Required. Name of the product. At most 100 characters long. */ + public Builder setProductName(String productName) { + this.productName = productName; + return this; + } + + /** Required. Number of items of the product. Positive integer. */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** Contains information about the tax on the item. */ + public Builder setTax(OffSessionPaymentCreateParams.AmountDetails.LineItem.Tax tax) { + this.tax = tax; + return this; + } + + /** Required. Cost of the product. Non-negative integer. */ + public Builder setUnitCost(Long unitCost) { + this.unitCost = unitCost; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * 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; + + /** Total portion of the amount that is for tax. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public OffSessionPaymentCreateParams.AmountDetails.LineItem.Tax build() { + return new OffSessionPaymentCreateParams.AmountDetails.LineItem.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * 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 OffSessionPaymentCreateParams.AmountDetails.LineItem.Tax#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 OffSessionPaymentCreateParams.AmountDetails.LineItem.Tax#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Total portion of the amount that is for tax. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Shipping { + /** Portion of the amount that is for shipping. */ + @SerializedName("amount") + Long amount; + + /** + * 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; + + /** The postal code that represents the shipping source. */ + @SerializedName("from_postal_code") + String fromPostalCode; + + /** The postal code that represents the shipping destination. */ + @SerializedName("to_postal_code") + String toPostalCode; + + private Shipping( + Long amount, + Map extraParams, + String fromPostalCode, + String toPostalCode) { + this.amount = amount; + this.extraParams = extraParams; + this.fromPostalCode = fromPostalCode; + this.toPostalCode = toPostalCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private Map extraParams; + + private String fromPostalCode; + + private String toPostalCode; + + /** Finalize and obtain parameter instance from this builder. */ + public OffSessionPaymentCreateParams.AmountDetails.Shipping build() { + return new OffSessionPaymentCreateParams.AmountDetails.Shipping( + this.amount, this.extraParams, this.fromPostalCode, this.toPostalCode); + } + + /** Portion of the amount that is for shipping. */ + public Builder setAmount(Long amount) { + this.amount = amount; + 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 OffSessionPaymentCreateParams.AmountDetails.Shipping#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 OffSessionPaymentCreateParams.AmountDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The postal code that represents the shipping source. */ + public Builder setFromPostalCode(String fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** The postal code that represents the shipping destination. */ + public Builder setToPostalCode(String toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * 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; + + /** Total portion of the amount that is for tax. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public OffSessionPaymentCreateParams.AmountDetails.Tax build() { + return new OffSessionPaymentCreateParams.AmountDetails.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * 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 OffSessionPaymentCreateParams.AmountDetails.Tax#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 OffSessionPaymentCreateParams.AmountDetails.Tax#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Total portion of the amount that is for tax. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateData { + /** + * Required. This hash contains details about the customer acceptance of the + * Mandate. + */ + @SerializedName("customer_acceptance") + CustomerAcceptance customerAcceptance; + + /** + * 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 MandateData(CustomerAcceptance customerAcceptance, Map extraParams) { + this.customerAcceptance = customerAcceptance; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CustomerAcceptance customerAcceptance; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public OffSessionPaymentCreateParams.MandateData build() { + return new OffSessionPaymentCreateParams.MandateData( + this.customerAcceptance, this.extraParams); + } + + /** + * Required. This hash contains details about the customer acceptance of the + * Mandate. + */ + public Builder setCustomerAcceptance( + OffSessionPaymentCreateParams.MandateData.CustomerAcceptance customerAcceptance) { + this.customerAcceptance = customerAcceptance; + 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 + * OffSessionPaymentCreateParams.MandateData#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 OffSessionPaymentCreateParams.MandateData#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CustomerAcceptance { + /** The time at which the customer accepted the Mandate. */ + @SerializedName("accepted_at") + Instant acceptedAt; + + /** + * 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 customer acceptance information included with the + * Mandate. + */ + @SerializedName("type") + Type type; + + private CustomerAcceptance(Instant acceptedAt, Map extraParams, Type type) { + this.acceptedAt = acceptedAt; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Instant acceptedAt; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public OffSessionPaymentCreateParams.MandateData.CustomerAcceptance build() { + return new OffSessionPaymentCreateParams.MandateData.CustomerAcceptance( + this.acceptedAt, this.extraParams, this.type); + } + + /** The time at which the customer accepted the Mandate. */ + public Builder setAcceptedAt(Instant acceptedAt) { + this.acceptedAt = acceptedAt; + 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 OffSessionPaymentCreateParams.MandateData.CustomerAcceptance#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 OffSessionPaymentCreateParams.MandateData.CustomerAcceptance#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 customer acceptance information included with the + * Mandate. + */ + public Builder setType( + OffSessionPaymentCreateParams.MandateData.CustomerAcceptance.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("offline") + OFFLINE("offline"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodOptions { + /** Payment method options for the card payment type. */ + @SerializedName("card") + Card card; + + /** + * 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 PaymentMethodOptions(Card card, Map extraParams) { + this.card = card; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Card card; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public OffSessionPaymentCreateParams.PaymentMethodOptions build() { + return new OffSessionPaymentCreateParams.PaymentMethodOptions(this.card, this.extraParams); + } + + /** Payment method options for the card payment type. */ + public Builder setCard(OffSessionPaymentCreateParams.PaymentMethodOptions.Card card) { + this.card = card; + 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 + * OffSessionPaymentCreateParams.PaymentMethodOptions#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 OffSessionPaymentCreateParams.PaymentMethodOptions#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** + * 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. If you are making a Credential On File transaction with a + * previously saved card, you should pass the Network Transaction ID from a prior initial + * authorization on Stripe (from a successful SetupIntent or a PaymentIntent with {@code + * setup_future_usage} set), or one that you have obtained from another payment processor. + * This is a token from the network which uniquely identifies the transaction. Visa calls this + * the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the + * Acquirer Reference Data. Note that you should pass in a Network Transaction ID if you have + * one, regardless of whether this is a Customer-Initiated Transaction (CIT) or a + * Merchant-Initiated Transaction (MIT). + */ + @SerializedName("network_transaction_id") + String networkTransactionId; + + private Card(Map extraParams, String networkTransactionId) { + this.extraParams = extraParams; + this.networkTransactionId = networkTransactionId; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String networkTransactionId; + + /** Finalize and obtain parameter instance from this builder. */ + public OffSessionPaymentCreateParams.PaymentMethodOptions.Card build() { + return new OffSessionPaymentCreateParams.PaymentMethodOptions.Card( + this.extraParams, this.networkTransactionId); + } + + /** + * 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 OffSessionPaymentCreateParams.PaymentMethodOptions.Card#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 OffSessionPaymentCreateParams.PaymentMethodOptions.Card#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. If you are making a Credential On File transaction with a + * previously saved card, you should pass the Network Transaction ID from a prior initial + * authorization on Stripe (from a successful SetupIntent or a PaymentIntent with {@code + * setup_future_usage} set), or one that you have obtained from another payment processor. + * This is a token from the network which uniquely identifies the transaction. Visa calls + * this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls + * this the Acquirer Reference Data. Note that you should pass in a Network Transaction ID + * if you have one, regardless of whether this is a Customer-Initiated Transaction (CIT) or + * a Merchant-Initiated Transaction (MIT). + */ + public Builder setNetworkTransactionId(String networkTransactionId) { + this.networkTransactionId = networkTransactionId; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentsOrchestration { + /** + * Required. True when you want to enable payments orchestration for this + * off-session payment. False otherwise. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * 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 PaymentsOrchestration(Boolean enabled, Map extraParams) { + this.enabled = enabled; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public OffSessionPaymentCreateParams.PaymentsOrchestration build() { + return new OffSessionPaymentCreateParams.PaymentsOrchestration( + this.enabled, this.extraParams); + } + + /** + * Required. True when you want to enable payments orchestration for this + * off-session payment. False otherwise. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + 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 + * OffSessionPaymentCreateParams.PaymentsOrchestration#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 OffSessionPaymentCreateParams.PaymentsOrchestration#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class RetryDetails { @@ -299,6 +1323,10 @@ public static class RetryDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** The pre-configured retry policy to use for the payment. */ + @SerializedName("retry_policy") + String retryPolicy; + /** * Required. Indicates the strategy for how you want Stripe to retry the * payment. @@ -306,8 +1334,10 @@ public static class RetryDetails { @SerializedName("retry_strategy") RetryStrategy retryStrategy; - private RetryDetails(Map extraParams, RetryStrategy retryStrategy) { + private RetryDetails( + Map extraParams, String retryPolicy, RetryStrategy retryStrategy) { this.extraParams = extraParams; + this.retryPolicy = retryPolicy; this.retryStrategy = retryStrategy; } @@ -318,11 +1348,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private String retryPolicy; + private RetryStrategy retryStrategy; /** Finalize and obtain parameter instance from this builder. */ public OffSessionPaymentCreateParams.RetryDetails build() { - return new OffSessionPaymentCreateParams.RetryDetails(this.extraParams, this.retryStrategy); + return new OffSessionPaymentCreateParams.RetryDetails( + this.extraParams, this.retryPolicy, this.retryStrategy); } /** @@ -352,6 +1385,12 @@ public Builder putAllExtraParam(Map map) { return this; } + /** The pre-configured retry policy to use for the payment. */ + public Builder setRetryPolicy(String retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + /** * Required. Indicates the strategy for how you want Stripe to retry the * payment. @@ -364,9 +1403,15 @@ public Builder setRetryStrategy( } public enum RetryStrategy implements ApiRequestParams.EnumParam { + @SerializedName("heuristic") + HEURISTIC("heuristic"), + @SerializedName("none") NONE("none"), + @SerializedName("scheduled") + SCHEDULED("scheduled"), + @SerializedName("smart") SMART("smart"); diff --git a/src/main/java/com/stripe/service/v2/BillingService.java b/src/main/java/com/stripe/service/v2/BillingService.java index 9c33a8697d1..2c8581d9108 100644 --- a/src/main/java/com/stripe/service/v2/BillingService.java +++ b/src/main/java/com/stripe/service/v2/BillingService.java @@ -9,6 +9,18 @@ public BillingService(StripeResponseGetter responseGetter) { super(responseGetter); } + public com.stripe.service.v2.billing.BillSettingService billSettings() { + return new com.stripe.service.v2.billing.BillSettingService(this.getResponseGetter()); + } + + public com.stripe.service.v2.billing.CadenceService cadences() { + return new com.stripe.service.v2.billing.CadenceService(this.getResponseGetter()); + } + + public com.stripe.service.v2.billing.CollectionSettingService collectionSettings() { + return new com.stripe.service.v2.billing.CollectionSettingService(this.getResponseGetter()); + } + public com.stripe.service.v2.billing.MeterEventAdjustmentService meterEventAdjustments() { return new com.stripe.service.v2.billing.MeterEventAdjustmentService(this.getResponseGetter()); } @@ -24,4 +36,8 @@ public com.stripe.service.v2.billing.MeterEventStreamService meterEventStream() public com.stripe.service.v2.billing.MeterEventService meterEvents() { return new com.stripe.service.v2.billing.MeterEventService(this.getResponseGetter()); } + + public com.stripe.service.v2.billing.ProfileService profiles() { + return new com.stripe.service.v2.billing.ProfileService(this.getResponseGetter()); + } } diff --git a/src/main/java/com/stripe/service/v2/billing/BillSettingService.java b/src/main/java/com/stripe/service/v2/billing/BillSettingService.java new file mode 100644 index 00000000000..76ddaec0bbb --- /dev/null +++ b/src/main/java/com/stripe/service/v2/billing/BillSettingService.java @@ -0,0 +1,114 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.billing; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.StripeCollection; +import com.stripe.model.v2.billing.BillSetting; +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.v2.billing.BillSettingCreateParams; +import com.stripe.param.v2.billing.BillSettingListParams; +import com.stripe.param.v2.billing.BillSettingUpdateParams; + +public final class BillSettingService extends ApiService { + public BillSettingService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** List all BillSetting objects. */ + public StripeCollection list(BillSettingListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + /** List all BillSetting objects. */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((BillSettingListParams) null, options); + } + /** List all BillSetting objects. */ + public StripeCollection list() throws StripeException { + return list((BillSettingListParams) null, (RequestOptions) null); + } + /** List all BillSetting objects. */ + public StripeCollection list(BillSettingListParams params, RequestOptions options) + throws StripeException { + String path = "/v2/billing/bill_settings"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } + /** Create a BillSetting object. */ + public BillSetting create(BillSettingCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** Create a BillSetting object. */ + public BillSetting create(RequestOptions options) throws StripeException { + return create((BillSettingCreateParams) null, options); + } + /** Create a BillSetting object. */ + public BillSetting create() throws StripeException { + return create((BillSettingCreateParams) null, (RequestOptions) null); + } + /** Create a BillSetting object. */ + public BillSetting create(BillSettingCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v2/billing/bill_settings"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, BillSetting.class); + } + /** Retrieve a BillSetting object by ID. */ + public BillSetting retrieve(String id) throws StripeException { + return retrieve(id, (RequestOptions) null); + } + /** Retrieve a BillSetting object by ID. */ + public BillSetting retrieve(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/billing/bill_settings/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + return this.request(request, BillSetting.class); + } + /** Update fields on an existing BillSetting object. */ + public BillSetting update(String id, BillSettingUpdateParams params) throws StripeException { + return update(id, params, (RequestOptions) null); + } + /** Update fields on an existing BillSetting object. */ + public BillSetting update(String id, RequestOptions options) throws StripeException { + return update(id, (BillSettingUpdateParams) null, options); + } + /** Update fields on an existing BillSetting object. */ + public BillSetting update(String id) throws StripeException { + return update(id, (BillSettingUpdateParams) null, (RequestOptions) null); + } + /** Update fields on an existing BillSetting object. */ + public BillSetting update(String id, BillSettingUpdateParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v2/billing/bill_settings/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, BillSetting.class); + } + + public com.stripe.service.v2.billing.billsettings.VersionService versions() { + return new com.stripe.service.v2.billing.billsettings.VersionService(this.getResponseGetter()); + } +} diff --git a/src/main/java/com/stripe/service/v2/billing/CadenceService.java b/src/main/java/com/stripe/service/v2/billing/CadenceService.java new file mode 100644 index 00000000000..575f5e8d070 --- /dev/null +++ b/src/main/java/com/stripe/service/v2/billing/CadenceService.java @@ -0,0 +1,127 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.billing; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.StripeCollection; +import com.stripe.model.v2.billing.Cadence; +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.v2.billing.CadenceCreateParams; +import com.stripe.param.v2.billing.CadenceListParams; +import com.stripe.param.v2.billing.CadenceRetrieveParams; +import com.stripe.param.v2.billing.CadenceUpdateParams; + +public final class CadenceService extends ApiService { + public CadenceService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** List Billing Cadences. */ + public StripeCollection list(CadenceListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + /** List Billing Cadences. */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((CadenceListParams) null, options); + } + /** List Billing Cadences. */ + public StripeCollection list() throws StripeException { + return list((CadenceListParams) null, (RequestOptions) null); + } + /** List Billing Cadences. */ + public StripeCollection list(CadenceListParams params, RequestOptions options) + throws StripeException { + String path = "/v2/billing/cadences"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } + /** Create a Billing Cadence object. */ + public Cadence create(CadenceCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** Create a Billing Cadence object. */ + public Cadence create(CadenceCreateParams params, RequestOptions options) throws StripeException { + String path = "/v2/billing/cadences"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Cadence.class); + } + /** Retrieve a Billing Cadence object. */ + public Cadence retrieve(String id, CadenceRetrieveParams params) throws StripeException { + return retrieve(id, params, (RequestOptions) null); + } + /** Retrieve a Billing Cadence object. */ + public Cadence retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (CadenceRetrieveParams) null, options); + } + /** Retrieve a Billing Cadence object. */ + public Cadence retrieve(String id) throws StripeException { + return retrieve(id, (CadenceRetrieveParams) null, (RequestOptions) null); + } + /** Retrieve a Billing Cadence object. */ + public Cadence retrieve(String id, CadenceRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v2/billing/cadences/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Cadence.class); + } + /** Update a Billing Cadence object. */ + public Cadence update(String id, CadenceUpdateParams params) throws StripeException { + return update(id, params, (RequestOptions) null); + } + /** Update a Billing Cadence object. */ + public Cadence update(String id, RequestOptions options) throws StripeException { + return update(id, (CadenceUpdateParams) null, options); + } + /** Update a Billing Cadence object. */ + public Cadence update(String id) throws StripeException { + return update(id, (CadenceUpdateParams) null, (RequestOptions) null); + } + /** Update a Billing Cadence object. */ + public Cadence update(String id, CadenceUpdateParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v2/billing/cadences/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Cadence.class); + } + /** Cancel the Billing Cadence. */ + public Cadence cancel(String id) throws StripeException { + return cancel(id, (RequestOptions) null); + } + /** Cancel the Billing Cadence. */ + public Cadence cancel(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/billing/cadences/%s/cancel", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); + return this.request(request, Cadence.class); + } +} diff --git a/src/main/java/com/stripe/service/v2/billing/CollectionSettingService.java b/src/main/java/com/stripe/service/v2/billing/CollectionSettingService.java new file mode 100644 index 00000000000..fae0ac50dd9 --- /dev/null +++ b/src/main/java/com/stripe/service/v2/billing/CollectionSettingService.java @@ -0,0 +1,118 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.billing; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.StripeCollection; +import com.stripe.model.v2.billing.CollectionSetting; +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.v2.billing.CollectionSettingCreateParams; +import com.stripe.param.v2.billing.CollectionSettingListParams; +import com.stripe.param.v2.billing.CollectionSettingUpdateParams; + +public final class CollectionSettingService extends ApiService { + public CollectionSettingService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** List all CollectionSetting objects. */ + public StripeCollection list(CollectionSettingListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + /** List all CollectionSetting objects. */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((CollectionSettingListParams) null, options); + } + /** List all CollectionSetting objects. */ + public StripeCollection list() throws StripeException { + return list((CollectionSettingListParams) null, (RequestOptions) null); + } + /** List all CollectionSetting objects. */ + public StripeCollection list( + CollectionSettingListParams params, RequestOptions options) throws StripeException { + String path = "/v2/billing/collection_settings"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } + /** Create a CollectionSetting object. */ + public CollectionSetting create(CollectionSettingCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** Create a CollectionSetting object. */ + public CollectionSetting create(RequestOptions options) throws StripeException { + return create((CollectionSettingCreateParams) null, options); + } + /** Create a CollectionSetting object. */ + public CollectionSetting create() throws StripeException { + return create((CollectionSettingCreateParams) null, (RequestOptions) null); + } + /** Create a CollectionSetting object. */ + public CollectionSetting create(CollectionSettingCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v2/billing/collection_settings"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, CollectionSetting.class); + } + /** Retrieve a CollectionSetting by ID. */ + public CollectionSetting retrieve(String id) throws StripeException { + return retrieve(id, (RequestOptions) null); + } + /** Retrieve a CollectionSetting by ID. */ + public CollectionSetting retrieve(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/billing/collection_settings/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + return this.request(request, CollectionSetting.class); + } + /** Update fields on an existing CollectionSetting. */ + public CollectionSetting update(String id, CollectionSettingUpdateParams params) + throws StripeException { + return update(id, params, (RequestOptions) null); + } + /** Update fields on an existing CollectionSetting. */ + public CollectionSetting update(String id, RequestOptions options) throws StripeException { + return update(id, (CollectionSettingUpdateParams) null, options); + } + /** Update fields on an existing CollectionSetting. */ + public CollectionSetting update(String id) throws StripeException { + return update(id, (CollectionSettingUpdateParams) null, (RequestOptions) null); + } + /** Update fields on an existing CollectionSetting. */ + public CollectionSetting update( + String id, CollectionSettingUpdateParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v2/billing/collection_settings/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, CollectionSetting.class); + } + + public com.stripe.service.v2.billing.collectionsettings.VersionService versions() { + return new com.stripe.service.v2.billing.collectionsettings.VersionService( + this.getResponseGetter()); + } +} diff --git a/src/main/java/com/stripe/service/v2/billing/ProfileService.java b/src/main/java/com/stripe/service/v2/billing/ProfileService.java new file mode 100644 index 00000000000..fbdaa83869c --- /dev/null +++ b/src/main/java/com/stripe/service/v2/billing/ProfileService.java @@ -0,0 +1,93 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.billing; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.StripeCollection; +import com.stripe.model.v2.billing.Profile; +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.v2.billing.ProfileCreateParams; +import com.stripe.param.v2.billing.ProfileListParams; +import com.stripe.param.v2.billing.ProfileUpdateParams; + +public final class ProfileService extends ApiService { + public ProfileService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** List Billing Profiles. */ + public StripeCollection list(ProfileListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + /** List Billing Profiles. */ + public StripeCollection list(ProfileListParams params, RequestOptions options) + throws StripeException { + String path = "/v2/billing/profiles"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } + /** Create a BillingProfile object. */ + public Profile create(ProfileCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** Create a BillingProfile object. */ + public Profile create(ProfileCreateParams params, RequestOptions options) throws StripeException { + String path = "/v2/billing/profiles"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Profile.class); + } + /** Retrieve a BillingProfile object. */ + public Profile retrieve(String id) throws StripeException { + return retrieve(id, (RequestOptions) null); + } + /** Retrieve a BillingProfile object. */ + public Profile retrieve(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/billing/profiles/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + return this.request(request, Profile.class); + } + /** Update a BillingProfile object. */ + public Profile update(String id, ProfileUpdateParams params) throws StripeException { + return update(id, params, (RequestOptions) null); + } + /** Update a BillingProfile object. */ + public Profile update(String id, RequestOptions options) throws StripeException { + return update(id, (ProfileUpdateParams) null, options); + } + /** Update a BillingProfile object. */ + public Profile update(String id) throws StripeException { + return update(id, (ProfileUpdateParams) null, (RequestOptions) null); + } + /** Update a BillingProfile object. */ + public Profile update(String id, ProfileUpdateParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v2/billing/profiles/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Profile.class); + } +} diff --git a/src/main/java/com/stripe/service/v2/billing/billsettings/VersionService.java b/src/main/java/com/stripe/service/v2/billing/billsettings/VersionService.java new file mode 100644 index 00000000000..adb817c01cb --- /dev/null +++ b/src/main/java/com/stripe/service/v2/billing/billsettings/VersionService.java @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.billing.billsettings; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.StripeCollection; +import com.stripe.model.v2.billing.BillSettingVersion; +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.v2.billing.billsettings.VersionListParams; + +public final class VersionService extends ApiService { + public VersionService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** List all BillSettingVersions by BillSetting ID. */ + public StripeCollection list(String billSettingId, VersionListParams params) + throws StripeException { + return list(billSettingId, params, (RequestOptions) null); + } + /** List all BillSettingVersions by BillSetting ID. */ + public StripeCollection list(String billSettingId, RequestOptions options) + throws StripeException { + return list(billSettingId, (VersionListParams) null, options); + } + /** List all BillSettingVersions by BillSetting ID. */ + public StripeCollection list(String billSettingId) throws StripeException { + return list(billSettingId, (VersionListParams) null, (RequestOptions) null); + } + /** List all BillSettingVersions by BillSetting ID. */ + public StripeCollection list( + String billSettingId, VersionListParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v2/billing/bill_settings/%s/versions", ApiResource.urlEncodeId(billSettingId)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request( + request, new TypeToken>() {}.getType()); + } + /** Retrieve a BillSettingVersion by ID. */ + public BillSettingVersion retrieve(String billSettingId, String id) throws StripeException { + return retrieve(billSettingId, id, (RequestOptions) null); + } + /** Retrieve a BillSettingVersion by ID. */ + public BillSettingVersion retrieve(String billSettingId, String id, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v2/billing/bill_settings/%s/versions/%s", + ApiResource.urlEncodeId(billSettingId), ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + return this.request(request, BillSettingVersion.class); + } +} diff --git a/src/main/java/com/stripe/service/v2/billing/collectionsettings/VersionService.java b/src/main/java/com/stripe/service/v2/billing/collectionsettings/VersionService.java new file mode 100644 index 00000000000..d1b8377b344 --- /dev/null +++ b/src/main/java/com/stripe/service/v2/billing/collectionsettings/VersionService.java @@ -0,0 +1,71 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.billing.collectionsettings; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.StripeCollection; +import com.stripe.model.v2.billing.CollectionSettingVersion; +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.v2.billing.collectionsettings.VersionListParams; + +public final class VersionService extends ApiService { + public VersionService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** List all CollectionSettingVersions by CollectionSetting ID. */ + public StripeCollection list( + String collectionSettingId, VersionListParams params) throws StripeException { + return list(collectionSettingId, params, (RequestOptions) null); + } + /** List all CollectionSettingVersions by CollectionSetting ID. */ + public StripeCollection list( + String collectionSettingId, RequestOptions options) throws StripeException { + return list(collectionSettingId, (VersionListParams) null, options); + } + /** List all CollectionSettingVersions by CollectionSetting ID. */ + public StripeCollection list(String collectionSettingId) + throws StripeException { + return list(collectionSettingId, (VersionListParams) null, (RequestOptions) null); + } + /** List all CollectionSettingVersions by CollectionSetting ID. */ + public StripeCollection list( + String collectionSettingId, VersionListParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v2/billing/collection_settings/%s/versions", + ApiResource.urlEncodeId(collectionSettingId)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request( + request, new TypeToken>() {}.getType()); + } + /** Retrieve a CollectionSetting Version by ID. */ + public CollectionSettingVersion retrieve(String collectionSettingId, String id) + throws StripeException { + return retrieve(collectionSettingId, id, (RequestOptions) null); + } + /** Retrieve a CollectionSetting Version by ID. */ + public CollectionSettingVersion retrieve( + String collectionSettingId, String id, RequestOptions options) throws StripeException { + String path = + String.format( + "/v2/billing/collection_settings/%s/versions/%s", + ApiResource.urlEncodeId(collectionSettingId), ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + return this.request(request, CollectionSettingVersion.class); + } +} diff --git a/src/main/java/com/stripe/service/v2/core/AccountService.java b/src/main/java/com/stripe/service/v2/core/AccountService.java index a140809df6c..a0d19e3ac01 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountService.java @@ -2,6 +2,7 @@ package com.stripe.service.v2.core; import com.google.gson.reflect.TypeToken; +import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.StripeCollection; import com.stripe.model.v2.core.Account; @@ -93,20 +94,22 @@ public Account create(AccountCreateParams params, RequestOptions options) throws return this.request(request, Account.class); } /** Retrieves the details of an Account. */ - public Account retrieve(String id, AccountRetrieveParams params) throws StripeException { + public Account retrieve(String id, AccountRetrieveParams params) + throws StripeException, RateLimitException { return retrieve(id, params, (RequestOptions) null); } /** Retrieves the details of an Account. */ - public Account retrieve(String id, RequestOptions options) throws StripeException { + public Account retrieve(String id, RequestOptions options) + throws StripeException, RateLimitException { return retrieve(id, (AccountRetrieveParams) null, options); } /** Retrieves the details of an Account. */ - public Account retrieve(String id) throws StripeException { + public Account retrieve(String id) throws StripeException, RateLimitException { return retrieve(id, (AccountRetrieveParams) null, (RequestOptions) null); } /** Retrieves the details of an Account. */ public Account retrieve(String id, AccountRetrieveParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest( @@ -118,20 +121,22 @@ public Account retrieve(String id, AccountRetrieveParams params, RequestOptions return this.request(request, Account.class); } /** Updates the details of an Account. */ - public Account update(String id, AccountUpdateParams params) throws StripeException { + public Account update(String id, AccountUpdateParams params) + throws StripeException, RateLimitException { return update(id, params, (RequestOptions) null); } /** Updates the details of an Account. */ - public Account update(String id, RequestOptions options) throws StripeException { + public Account update(String id, RequestOptions options) + throws StripeException, RateLimitException { return update(id, (AccountUpdateParams) null, options); } /** Updates the details of an Account. */ - public Account update(String id) throws StripeException { + public Account update(String id) throws StripeException, RateLimitException { return update(id, (AccountUpdateParams) null, (RequestOptions) null); } /** Updates the details of an Account. */ public Account update(String id, AccountUpdateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest( diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index bee9d64d7fb..2e42c70b433 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -24360,6 +24360,508 @@ public void testWebhookEndpointsPost2ServicesNonNamespaced() throws StripeExcept null); } + @Test + public void testV2BillingBillSettingGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/bill_settings", + null, + null, + new TypeToken< + com.stripe.model.v2.StripeCollection< + com.stripe.model.v2.billing.BillSetting>>() {}.getType(), + "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.bill_setting\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.BillSettingListParams params = + com.stripe.param.v2.billing.BillSettingListParams.builder().build(); + + com.stripe.model.v2.StripeCollection stripeCollection = + client.v2().billing().billSettings().list(params); + assertNotNull(stripeCollection); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/bill_settings", + params.toMap(), + null); + } + + @Test + public void testV2BillingBillSettingPostServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/bill_settings", + null, + null, + com.stripe.model.v2.billing.BillSetting.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.bill_setting\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.BillSettingCreateParams params = + com.stripe.param.v2.billing.BillSettingCreateParams.builder().build(); + + com.stripe.model.v2.billing.BillSetting billSetting = + client.v2().billing().billSettings().create(params); + assertNotNull(billSetting); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/bill_settings", + params.toMap(), + null); + } + + @Test + public void testV2BillingBillSettingGet2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/bill_settings/id_123", + null, + null, + com.stripe.model.v2.billing.BillSetting.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.bill_setting\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.billing.BillSetting billSetting = + client.v2().billing().billSettings().retrieve("id_123"); + assertNotNull(billSetting); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/bill_settings/id_123", + null, + null); + } + + @Test + public void testV2BillingBillSettingPost2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/bill_settings/id_123", + null, + null, + com.stripe.model.v2.billing.BillSetting.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.bill_setting\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.BillSettingUpdateParams params = + com.stripe.param.v2.billing.BillSettingUpdateParams.builder().build(); + + com.stripe.model.v2.billing.BillSetting billSetting = + client.v2().billing().billSettings().update("id_123", params); + assertNotNull(billSetting); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/bill_settings/id_123", + params.toMap(), + null); + } + + @Test + public void testV2BillingBillSettingsVersionGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/bill_settings/bill_setting_id_123/versions", + null, + null, + new TypeToken< + com.stripe.model.v2.StripeCollection< + com.stripe.model.v2.billing.BillSettingVersion>>() {}.getType(), + "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.bill_setting_version\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.billsettings.VersionListParams params = + com.stripe.param.v2.billing.billsettings.VersionListParams.builder().build(); + + com.stripe.model.v2.StripeCollection + stripeCollection = + client.v2().billing().billSettings().versions().list("bill_setting_id_123", params); + assertNotNull(stripeCollection); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/bill_settings/bill_setting_id_123/versions", + params.toMap(), + null); + } + + @Test + public void testV2BillingBillSettingsVersionGet2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/bill_settings/bill_setting_id_123/versions/id_123", + null, + null, + com.stripe.model.v2.billing.BillSettingVersion.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.bill_setting_version\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.billing.BillSettingVersion billSettingVersion = + client.v2().billing().billSettings().versions().retrieve("bill_setting_id_123", "id_123"); + assertNotNull(billSettingVersion); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/bill_settings/bill_setting_id_123/versions/id_123", + null, + null); + } + + @Test + public void testV2BillingCadenceGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/cadences", + null, + null, + new TypeToken< + com.stripe.model.v2.StripeCollection< + com.stripe.model.v2.billing.Cadence>>() {}.getType(), + "{\"data\":[{\"billing_cycle\":{\"interval_count\":797691627,\"type\":\"week\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.cadence\",\"payer\":{\"billing_profile\":\"billing_profile\",\"type\":\"customer\"},\"status\":\"active\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.CadenceListParams params = + com.stripe.param.v2.billing.CadenceListParams.builder().build(); + + com.stripe.model.v2.StripeCollection stripeCollection = + client.v2().billing().cadences().list(params); + assertNotNull(stripeCollection); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/cadences", + params.toMap(), + null); + } + + @Test + public void testV2BillingCadencePostServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/cadences", + null, + null, + com.stripe.model.v2.billing.Cadence.class, + "{\"billing_cycle\":{\"interval_count\":797691627,\"type\":\"week\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.cadence\",\"payer\":{\"billing_profile\":\"billing_profile\",\"type\":\"customer\"},\"status\":\"active\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.CadenceCreateParams params = + com.stripe.param.v2.billing.CadenceCreateParams.builder() + .setBillingCycle( + com.stripe.param.v2.billing.CadenceCreateParams.BillingCycle.builder() + .setIntervalCount(797691627L) + .setType(com.stripe.param.v2.billing.CadenceCreateParams.BillingCycle.Type.WEEK) + .setDay( + com.stripe.param.v2.billing.CadenceCreateParams.BillingCycle.Day.builder() + .setTime( + com.stripe.param.v2.billing.CadenceCreateParams.BillingCycle.Day + .Time.builder() + .setHour(3208676L) + .setMinute(1074026988L) + .setSecond(906279820L) + .build()) + .build()) + .setMonth( + com.stripe.param.v2.billing.CadenceCreateParams.BillingCycle.Month.builder() + .setDayOfMonth(1361669285L) + .setMonthOfYear(82933018L) + .setTime( + com.stripe.param.v2.billing.CadenceCreateParams.BillingCycle.Month + .Time.builder() + .setHour(3208676L) + .setMinute(1074026988L) + .setSecond(906279820L) + .build()) + .build()) + .setWeek( + com.stripe.param.v2.billing.CadenceCreateParams.BillingCycle.Week.builder() + .setDayOfWeek(43636807L) + .setTime( + com.stripe.param.v2.billing.CadenceCreateParams.BillingCycle.Week + .Time.builder() + .setHour(3208676L) + .setMinute(1074026988L) + .setSecond(906279820L) + .build()) + .build()) + .setYear( + com.stripe.param.v2.billing.CadenceCreateParams.BillingCycle.Year.builder() + .setDayOfMonth(1361669285L) + .setMonthOfYear(82933018L) + .setTime( + com.stripe.param.v2.billing.CadenceCreateParams.BillingCycle.Year + .Time.builder() + .setHour(3208676L) + .setMinute(1074026988L) + .setSecond(906279820L) + .build()) + .build()) + .build()) + .setPayer( + com.stripe.param.v2.billing.CadenceCreateParams.Payer.builder() + .setBillingProfile("billing_profile") + .build()) + .build(); + + com.stripe.model.v2.billing.Cadence cadence = client.v2().billing().cadences().create(params); + assertNotNull(cadence); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/cadences", + params.toMap(), + null); + } + + @Test + public void testV2BillingCadenceGet2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/cadences/id_123", + null, + null, + com.stripe.model.v2.billing.Cadence.class, + "{\"billing_cycle\":{\"interval_count\":797691627,\"type\":\"week\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.cadence\",\"payer\":{\"billing_profile\":\"billing_profile\",\"type\":\"customer\"},\"status\":\"active\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.CadenceRetrieveParams params = + com.stripe.param.v2.billing.CadenceRetrieveParams.builder().build(); + + com.stripe.model.v2.billing.Cadence cadence = + client.v2().billing().cadences().retrieve("id_123", params); + assertNotNull(cadence); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/cadences/id_123", + params.toMap(), + null); + } + + @Test + public void testV2BillingCadencePost2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/cadences/id_123", + null, + null, + com.stripe.model.v2.billing.Cadence.class, + "{\"billing_cycle\":{\"interval_count\":797691627,\"type\":\"week\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.cadence\",\"payer\":{\"billing_profile\":\"billing_profile\",\"type\":\"customer\"},\"status\":\"active\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.CadenceUpdateParams params = + com.stripe.param.v2.billing.CadenceUpdateParams.builder().build(); + + com.stripe.model.v2.billing.Cadence cadence = + client.v2().billing().cadences().update("id_123", params); + assertNotNull(cadence); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/cadences/id_123", + params.toMap(), + null); + } + + @Test + public void testV2BillingCadencePost3Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/cadences/id_123/cancel", + null, + null, + com.stripe.model.v2.billing.Cadence.class, + "{\"billing_cycle\":{\"interval_count\":797691627,\"type\":\"week\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.cadence\",\"payer\":{\"billing_profile\":\"billing_profile\",\"type\":\"customer\"},\"status\":\"active\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.billing.Cadence cadence = client.v2().billing().cadences().cancel("id_123"); + assertNotNull(cadence); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/cadences/id_123/cancel", + null, + null); + } + + @Test + public void testV2BillingCollectionSettingGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/collection_settings", + null, + null, + new TypeToken< + com.stripe.model.v2.StripeCollection< + com.stripe.model.v2.billing.CollectionSetting>>() {}.getType(), + "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.collection_setting\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.CollectionSettingListParams params = + com.stripe.param.v2.billing.CollectionSettingListParams.builder().build(); + + com.stripe.model.v2.StripeCollection + stripeCollection = client.v2().billing().collectionSettings().list(params); + assertNotNull(stripeCollection); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/collection_settings", + params.toMap(), + null); + } + + @Test + public void testV2BillingCollectionSettingPostServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/collection_settings", + null, + null, + com.stripe.model.v2.billing.CollectionSetting.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.collection_setting\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.CollectionSettingCreateParams params = + com.stripe.param.v2.billing.CollectionSettingCreateParams.builder().build(); + + com.stripe.model.v2.billing.CollectionSetting collectionSetting = + client.v2().billing().collectionSettings().create(params); + assertNotNull(collectionSetting); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/collection_settings", + params.toMap(), + null); + } + + @Test + public void testV2BillingCollectionSettingGet2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/collection_settings/id_123", + null, + null, + com.stripe.model.v2.billing.CollectionSetting.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.collection_setting\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.billing.CollectionSetting collectionSetting = + client.v2().billing().collectionSettings().retrieve("id_123"); + assertNotNull(collectionSetting); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/collection_settings/id_123", + null, + null); + } + + @Test + public void testV2BillingCollectionSettingPost2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/collection_settings/id_123", + null, + null, + com.stripe.model.v2.billing.CollectionSetting.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.collection_setting\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.CollectionSettingUpdateParams params = + com.stripe.param.v2.billing.CollectionSettingUpdateParams.builder().build(); + + com.stripe.model.v2.billing.CollectionSetting collectionSetting = + client.v2().billing().collectionSettings().update("id_123", params); + assertNotNull(collectionSetting); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/collection_settings/id_123", + params.toMap(), + null); + } + + @Test + public void testV2BillingCollectionSettingsVersionGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/collection_settings/collection_setting_id_123/versions", + null, + null, + new TypeToken< + com.stripe.model.v2.StripeCollection< + com.stripe.model.v2.billing.CollectionSettingVersion>>() {}.getType(), + "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.collection_setting_version\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.collectionsettings.VersionListParams params = + com.stripe.param.v2.billing.collectionsettings.VersionListParams.builder().build(); + + com.stripe.model.v2.StripeCollection + stripeCollection = + client + .v2() + .billing() + .collectionSettings() + .versions() + .list("collection_setting_id_123", params); + assertNotNull(stripeCollection); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/collection_settings/collection_setting_id_123/versions", + params.toMap(), + null); + } + + @Test + public void testV2BillingCollectionSettingsVersionGet2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/collection_settings/collection_setting_id_123/versions/id_123", + null, + null, + com.stripe.model.v2.billing.CollectionSettingVersion.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.collection_setting_version\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.billing.CollectionSettingVersion collectionSettingVersion = + client + .v2() + .billing() + .collectionSettings() + .versions() + .retrieve("collection_setting_id_123", "id_123"); + assertNotNull(collectionSettingVersion); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/collection_settings/collection_setting_id_123/versions/id_123", + null, + null); + } + @Test public void testV2BillingMeterEventPostServices() throws StripeException { stubRequest( @@ -24477,6 +24979,104 @@ public void testV2BillingMeterEventStreamPostServices() throws StripeException { null); } + @Test + public void testV2BillingProfileGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/profiles", + null, + null, + new TypeToken< + com.stripe.model.v2.StripeCollection< + com.stripe.model.v2.billing.Profile>>() {}.getType(), + "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.profile\",\"status\":\"active\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.ProfileListParams params = + com.stripe.param.v2.billing.ProfileListParams.builder().addLookupKey("lookup_keys").build(); + + com.stripe.model.v2.StripeCollection stripeCollection = + client.v2().billing().profiles().list(params); + assertNotNull(stripeCollection); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/profiles", + params.toMap(), + null); + } + + @Test + public void testV2BillingProfilePostServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/profiles", + null, + null, + com.stripe.model.v2.billing.Profile.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.profile\",\"status\":\"active\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.ProfileCreateParams params = + com.stripe.param.v2.billing.ProfileCreateParams.builder().setCustomer("customer").build(); + + com.stripe.model.v2.billing.Profile profile = client.v2().billing().profiles().create(params); + assertNotNull(profile); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/profiles", + params.toMap(), + null); + } + + @Test + public void testV2BillingProfileGet2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/profiles/id_123", + null, + null, + com.stripe.model.v2.billing.Profile.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.profile\",\"status\":\"active\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.billing.Profile profile = + client.v2().billing().profiles().retrieve("id_123"); + assertNotNull(profile); + verifyRequest( + BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/billing/profiles/id_123", null, null); + } + + @Test + public void testV2BillingProfilePost2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/profiles/id_123", + null, + null, + com.stripe.model.v2.billing.Profile.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.profile\",\"status\":\"active\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.ProfileUpdateParams params = + com.stripe.param.v2.billing.ProfileUpdateParams.builder().build(); + + com.stripe.model.v2.billing.Profile profile = + client.v2().billing().profiles().update("id_123", params); + assertNotNull(profile); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/profiles/id_123", + params.toMap(), + null); + } + @Test public void testV2CoreAccountGetServices() throws StripeException { stubRequest( @@ -25467,8 +26067,10 @@ public void testV2MoneyManagementFinancialAddressPostServices() throws StripeExc com.stripe.param.v2.moneymanagement.FinancialAddressCreateParams params = com.stripe.param.v2.moneymanagement.FinancialAddressCreateParams.builder() - .setCurrency("usd") .setFinancialAccount("financial_account") + .setType( + com.stripe.param.v2.moneymanagement.FinancialAddressCreateParams.Type + .GB_BANK_ACCOUNT) .build(); com.stripe.model.v2.moneymanagement.FinancialAddress financialAddress = @@ -25719,7 +26321,7 @@ public void testV2MoneyManagementOutboundPaymentQuotePostServices() throws Strip null, null, com.stripe.model.v2.moneymanagement.OutboundPaymentQuote.class, - "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_expires_at\":\"1970-01-18T15:15:29.586Z\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundPaymentQuoteCreateParams params = @@ -25758,7 +26360,7 @@ public void testV2MoneyManagementOutboundPaymentQuoteGetServices() throws Stripe null, null, com.stripe.model.v2.moneymanagement.OutboundPaymentQuote.class, - "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_expires_at\":\"1970-01-18T15:15:29.586Z\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundPaymentQuote outboundPaymentQuote = @@ -26350,7 +26952,7 @@ public void testV2PaymentsOffSessionPaymentGetServices() throws StripeException new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.payments.OffSessionPayment>>() {}.getType(), - "{\"data\":[{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"none\"},\"status\":\"pending\"}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.payments.OffSessionPaymentListParams params = @@ -26376,7 +26978,7 @@ public void testV2PaymentsOffSessionPaymentPostServices() throws StripeException null, null, com.stripe.model.v2.payments.OffSessionPayment.class, - "{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"none\"},\"status\":\"pending\"}"); + "{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.payments.OffSessionPaymentCreateParams params = @@ -26409,7 +27011,7 @@ public void testV2PaymentsOffSessionPaymentGet2Services() throws StripeException null, null, com.stripe.model.v2.payments.OffSessionPayment.class, - "{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"none\"},\"status\":\"pending\"}"); + "{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.payments.OffSessionPayment offSessionPayment = @@ -26432,7 +27034,7 @@ public void testV2PaymentsOffSessionPaymentPost2Services() throws StripeExceptio null, null, com.stripe.model.v2.payments.OffSessionPayment.class, - "{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"none\"},\"status\":\"pending\"}"); + "{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.payments.OffSessionPayment offSessionPayment = @@ -26658,8 +27260,10 @@ public void testFinancialAccountNotOpenErrorServices() throws StripeException { com.stripe.param.v2.moneymanagement.FinancialAddressCreateParams params = com.stripe.param.v2.moneymanagement.FinancialAddressCreateParams.builder() - .setCurrency("usd") .setFinancialAccount("financial_account") + .setType( + com.stripe.param.v2.moneymanagement.FinancialAddressCreateParams.Type + .GB_BANK_ACCOUNT) .build(); try { @@ -26862,6 +27466,35 @@ public void testQuotaExceededErrorServices() throws StripeException { null); } + @Test + public void testRateLimitErrorServices() throws StripeException { + stubRequestReturnError( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/accounts/id_123", + null, + null, + "{\"error\":{\"type\":\"rate_limit\",\"code\":\"account_rate_limit_exceeded\"}}", + 400); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.AccountRetrieveParams params = + com.stripe.param.v2.core.AccountRetrieveParams.builder().build(); + + try { + client.v2().core().accounts().retrieve("id_123", params); + } catch (RateLimitException e) { + + } + ; + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/accounts/id_123", + params.toMap(), + null); + } + @Test public void testRecipientNotNotifiableErrorServices() throws StripeException { stubRequestReturnError(