diff --git a/API_VERSION b/API_VERSION index 65234144801..7fa3a2d3c56 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -b3c36f1e05eaa7339c3d0d5e862e76cfff6c6bed \ No newline at end of file +577fcb57736b925392ea563c0284df9002c75ac9 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d1d1d36216a..8a7edbe6821 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2080 \ No newline at end of file +v2100 \ No newline at end of file diff --git a/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropFiringEvent.java b/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropFiringEvent.java index cda1b5566b2..139037fe617 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropFiringEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropFiringEvent.java @@ -52,14 +52,19 @@ public static final class Impact { * *

One of {@code acss_debit}, {@code affirm}, {@code afterpay_clearpay}, {@code alipay}, * {@code alma}, {@code amazon_pay}, {@code apple_pay}, {@code au_becs_debit}, {@code - * bacs_debit}, {@code bancontact}, {@code blik}, {@code boleto}, {@code card}, {@code - * card_present}, {@code cartes_bancaires}, {@code cashapp}, {@code dummy_passthrough_card}, - * {@code eps}, {@code fpx}, {@code giropay}, {@code grabpay}, {@code ideal}, {@code - * interac_present}, {@code kakao_pay}, {@code klarna}, {@code konbini}, {@code link}, {@code - * mobilepay}, {@code multibanco}, {@code naver_pay}, {@code oxxo}, {@code p24}, {@code - * paper_check}, {@code paynow}, {@code paypal}, {@code payto}, {@code pay_by_bank}, {@code - * pix}, {@code promptpay}, {@code revolut_pay}, {@code sepa_debit}, {@code sofort}, {@code - * swish}, {@code twint}, {@code upi}, {@code wechat_pay}, or {@code zip}. + * bacs_debit}, {@code bancontact}, {@code billie}, {@code blik}, {@code boleto}, {@code + * card}, {@code card_present}, {@code cartes_bancaires}, {@code cashapp}, {@code crypto}, + * {@code dummy_passthrough_card}, {@code eps}, {@code fpx}, {@code giropay}, {@code grabpay}, + * {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna}, {@code konbini}, + * {@code kriya}, {@code kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, {@code + * mondu}, {@code multibanco}, {@code naver_pay}, {@code ng_bank}, {@code ng_bank_transfer}, + * {@code ng_card}, {@code ng_market}, {@code ng_ussd}, {@code ng_wallet}, {@code oxxo}, + * {@code p24}, {@code paper_check}, {@code payco}, {@code paynow}, {@code paypal}, {@code + * paypay}, {@code payto}, {@code pay_by_bank}, {@code pix}, {@code promptpay}, {@code + * rechnung}, {@code revolut_pay}, {@code samsung_pay}, {@code satispay}, {@code scalapay}, + * {@code sepa_debit}, {@code sequra}, {@code sofort}, {@code sunbit}, {@code swish}, {@code + * twint}, {@code upi}, {@code us_bank_account}, {@code vipps}, {@code wechat_pay}, or {@code + * zip}. */ @SerializedName("payment_method_type") String paymentMethodType; diff --git a/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropResolvedEvent.java b/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropResolvedEvent.java index ff95bf1ca54..7d58035ee57 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropResolvedEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropResolvedEvent.java @@ -52,14 +52,19 @@ public static final class Impact { * *

One of {@code acss_debit}, {@code affirm}, {@code afterpay_clearpay}, {@code alipay}, * {@code alma}, {@code amazon_pay}, {@code apple_pay}, {@code au_becs_debit}, {@code - * bacs_debit}, {@code bancontact}, {@code blik}, {@code boleto}, {@code card}, {@code - * card_present}, {@code cartes_bancaires}, {@code cashapp}, {@code dummy_passthrough_card}, - * {@code eps}, {@code fpx}, {@code giropay}, {@code grabpay}, {@code ideal}, {@code - * interac_present}, {@code kakao_pay}, {@code klarna}, {@code konbini}, {@code link}, {@code - * mobilepay}, {@code multibanco}, {@code naver_pay}, {@code oxxo}, {@code p24}, {@code - * paper_check}, {@code paynow}, {@code paypal}, {@code payto}, {@code pay_by_bank}, {@code - * pix}, {@code promptpay}, {@code revolut_pay}, {@code sepa_debit}, {@code sofort}, {@code - * swish}, {@code twint}, {@code upi}, {@code wechat_pay}, or {@code zip}. + * bacs_debit}, {@code bancontact}, {@code billie}, {@code blik}, {@code boleto}, {@code + * card}, {@code card_present}, {@code cartes_bancaires}, {@code cashapp}, {@code crypto}, + * {@code dummy_passthrough_card}, {@code eps}, {@code fpx}, {@code giropay}, {@code grabpay}, + * {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna}, {@code konbini}, + * {@code kriya}, {@code kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, {@code + * mondu}, {@code multibanco}, {@code naver_pay}, {@code ng_bank}, {@code ng_bank_transfer}, + * {@code ng_card}, {@code ng_market}, {@code ng_ussd}, {@code ng_wallet}, {@code oxxo}, + * {@code p24}, {@code paper_check}, {@code payco}, {@code paynow}, {@code paypal}, {@code + * paypay}, {@code payto}, {@code pay_by_bank}, {@code pix}, {@code promptpay}, {@code + * rechnung}, {@code revolut_pay}, {@code samsung_pay}, {@code satispay}, {@code scalapay}, + * {@code sepa_debit}, {@code sequra}, {@code sofort}, {@code sunbit}, {@code swish}, {@code + * twint}, {@code upi}, {@code us_bank_account}, {@code vipps}, {@code wechat_pay}, or {@code + * zip}. */ @SerializedName("payment_method_type") String paymentMethodType; diff --git a/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorFiringEvent.java b/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorFiringEvent.java index ec947aace23..ca3ccc38792 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorFiringEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorFiringEvent.java @@ -44,14 +44,19 @@ public static final class Impact { * *

One of {@code acss_debit}, {@code affirm}, {@code afterpay_clearpay}, {@code alipay}, * {@code alma}, {@code amazon_pay}, {@code apple_pay}, {@code au_becs_debit}, {@code - * bacs_debit}, {@code bancontact}, {@code blik}, {@code boleto}, {@code card}, {@code - * card_present}, {@code cartes_bancaires}, {@code cashapp}, {@code dummy_passthrough_card}, - * {@code eps}, {@code fpx}, {@code giropay}, {@code grabpay}, {@code ideal}, {@code - * interac_present}, {@code kakao_pay}, {@code klarna}, {@code konbini}, {@code link}, {@code - * mobilepay}, {@code multibanco}, {@code naver_pay}, {@code oxxo}, {@code p24}, {@code - * paper_check}, {@code paynow}, {@code paypal}, {@code payto}, {@code pay_by_bank}, {@code - * pix}, {@code promptpay}, {@code revolut_pay}, {@code sepa_debit}, {@code sofort}, {@code - * swish}, {@code twint}, {@code upi}, {@code wechat_pay}, or {@code zip}. + * bacs_debit}, {@code bancontact}, {@code billie}, {@code blik}, {@code boleto}, {@code + * card}, {@code card_present}, {@code cartes_bancaires}, {@code cashapp}, {@code crypto}, + * {@code dummy_passthrough_card}, {@code eps}, {@code fpx}, {@code giropay}, {@code grabpay}, + * {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna}, {@code konbini}, + * {@code kriya}, {@code kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, {@code + * mondu}, {@code multibanco}, {@code naver_pay}, {@code ng_bank}, {@code ng_bank_transfer}, + * {@code ng_card}, {@code ng_market}, {@code ng_ussd}, {@code ng_wallet}, {@code oxxo}, + * {@code p24}, {@code paper_check}, {@code payco}, {@code paynow}, {@code paypal}, {@code + * paypay}, {@code payto}, {@code pay_by_bank}, {@code pix}, {@code promptpay}, {@code + * rechnung}, {@code revolut_pay}, {@code samsung_pay}, {@code satispay}, {@code scalapay}, + * {@code sepa_debit}, {@code sequra}, {@code sofort}, {@code sunbit}, {@code swish}, {@code + * twint}, {@code upi}, {@code us_bank_account}, {@code vipps}, {@code wechat_pay}, or {@code + * zip}. */ @SerializedName("payment_method_type") String paymentMethodType; diff --git a/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorResolvedEvent.java b/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorResolvedEvent.java index d0ee47824ab..ee80cfba4af 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorResolvedEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorResolvedEvent.java @@ -44,14 +44,19 @@ public static final class Impact { * *

One of {@code acss_debit}, {@code affirm}, {@code afterpay_clearpay}, {@code alipay}, * {@code alma}, {@code amazon_pay}, {@code apple_pay}, {@code au_becs_debit}, {@code - * bacs_debit}, {@code bancontact}, {@code blik}, {@code boleto}, {@code card}, {@code - * card_present}, {@code cartes_bancaires}, {@code cashapp}, {@code dummy_passthrough_card}, - * {@code eps}, {@code fpx}, {@code giropay}, {@code grabpay}, {@code ideal}, {@code - * interac_present}, {@code kakao_pay}, {@code klarna}, {@code konbini}, {@code link}, {@code - * mobilepay}, {@code multibanco}, {@code naver_pay}, {@code oxxo}, {@code p24}, {@code - * paper_check}, {@code paynow}, {@code paypal}, {@code payto}, {@code pay_by_bank}, {@code - * pix}, {@code promptpay}, {@code revolut_pay}, {@code sepa_debit}, {@code sofort}, {@code - * swish}, {@code twint}, {@code upi}, {@code wechat_pay}, or {@code zip}. + * bacs_debit}, {@code bancontact}, {@code billie}, {@code blik}, {@code boleto}, {@code + * card}, {@code card_present}, {@code cartes_bancaires}, {@code cashapp}, {@code crypto}, + * {@code dummy_passthrough_card}, {@code eps}, {@code fpx}, {@code giropay}, {@code grabpay}, + * {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna}, {@code konbini}, + * {@code kriya}, {@code kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, {@code + * mondu}, {@code multibanco}, {@code naver_pay}, {@code ng_bank}, {@code ng_bank_transfer}, + * {@code ng_card}, {@code ng_market}, {@code ng_ussd}, {@code ng_wallet}, {@code oxxo}, + * {@code p24}, {@code paper_check}, {@code payco}, {@code paynow}, {@code paypal}, {@code + * paypay}, {@code payto}, {@code pay_by_bank}, {@code pix}, {@code promptpay}, {@code + * rechnung}, {@code revolut_pay}, {@code samsung_pay}, {@code satispay}, {@code scalapay}, + * {@code sepa_debit}, {@code sequra}, {@code sofort}, {@code sunbit}, {@code swish}, {@code + * twint}, {@code upi}, {@code us_bank_account}, {@code vipps}, {@code wechat_pay}, or {@code + * zip}. */ @SerializedName("payment_method_type") String paymentMethodType; diff --git a/src/main/java/com/stripe/events/V2MoneyManagementTransactionCreatedEvent.java b/src/main/java/com/stripe/events/V2MoneyManagementTransactionCreatedEvent.java index cade559a382..834b719f513 100644 --- a/src/main/java/com/stripe/events/V2MoneyManagementTransactionCreatedEvent.java +++ b/src/main/java/com/stripe/events/V2MoneyManagementTransactionCreatedEvent.java @@ -7,9 +7,22 @@ import com.stripe.model.v2.core.Event.RelatedObject; import com.stripe.model.v2.moneymanagement.Transaction; import lombok.Getter; +import lombok.Setter; @Getter public final class V2MoneyManagementTransactionCreatedEvent extends Event { + /** Data for the v2.money_management.transaction.created event. */ + @SerializedName("data") + V2MoneyManagementTransactionCreatedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** Id of the v1 Transaction corresponding to this Transaction. */ + @SerializedName("v1_id") + String v1Id; + } + @SerializedName("related_object") /** Object containing the reference to API resource relevant to the event. */ diff --git a/src/main/java/com/stripe/exception/FeatureNotEnabledException.java b/src/main/java/com/stripe/exception/FeatureNotEnabledException.java index 11fdaddd5f2..a1e24a0e4d1 100644 --- a/src/main/java/com/stripe/exception/FeatureNotEnabledException.java +++ b/src/main/java/com/stripe/exception/FeatureNotEnabledException.java @@ -6,10 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** - * Error returned when recipient does not have the active features required to receive funds from - * this OutboundPayment request. - */ +/** The user attempts to create an outbound flow from a closed Financial Account. */ public final class FeatureNotEnabledException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/model/billing/Meter.java b/src/main/java/com/stripe/model/billing/Meter.java index 3eb2b3a91d8..647148e11a2 100644 --- a/src/main/java/com/stripe/model/billing/Meter.java +++ b/src/main/java/com/stripe/model/billing/Meter.java @@ -18,6 +18,7 @@ import com.stripe.param.billing.MeterReactivateParams; import com.stripe.param.billing.MeterRetrieveParams; import com.stripe.param.billing.MeterUpdateParams; +import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -45,6 +46,10 @@ public class Meter extends ApiResource implements HasId { @SerializedName("default_aggregation") DefaultAggregation defaultAggregation; + /** Set of keys that will be used to group meter events by. */ + @SerializedName("dimension_payload_keys") + List dimensionPayloadKeys; + /** The meter's name. */ @SerializedName("display_name") String displayName; diff --git a/src/main/java/com/stripe/model/billing/MeterEventSummary.java b/src/main/java/com/stripe/model/billing/MeterEventSummary.java index 477fa928113..770961d5907 100644 --- a/src/main/java/com/stripe/model/billing/MeterEventSummary.java +++ b/src/main/java/com/stripe/model/billing/MeterEventSummary.java @@ -35,6 +35,10 @@ public class MeterEventSummary extends ApiResource implements HasId { @SerializedName("aggregated_value") BigDecimal aggregatedValue; + /** Key-value pairs of dimension values for event summaries with grouping on dimensions. */ + @SerializedName("dimensions") + Map dimensions; + /** End timestamp for this event summary (exclusive). Must be aligned with minute boundaries. */ @SerializedName("end_time") Long endTime; diff --git a/src/main/java/com/stripe/model/delegatedcheckout/RequestedSession.java b/src/main/java/com/stripe/model/delegatedcheckout/RequestedSession.java index 02b49f6d707..7b5979ec678 100644 --- a/src/main/java/com/stripe/model/delegatedcheckout/RequestedSession.java +++ b/src/main/java/com/stripe/model/delegatedcheckout/RequestedSession.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.exception.StripeException; import com.stripe.model.HasId; +import com.stripe.model.MetadataStore; import com.stripe.model.StripeObject; import com.stripe.net.ApiRequest; import com.stripe.net.ApiRequestParams; @@ -16,6 +17,7 @@ import com.stripe.param.delegatedcheckout.RequestedSessionExpireParams; import com.stripe.param.delegatedcheckout.RequestedSessionRetrieveParams; import com.stripe.param.delegatedcheckout.RequestedSessionUpdateParams; +import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -25,7 +27,20 @@ @Getter @Setter @EqualsAndHashCode(callSuper = false) -public class RequestedSession extends ApiResource implements HasId { +public class RequestedSession extends ApiResource + implements HasId, MetadataStore { + /** The subtotal amount of the requested session. */ + @SerializedName("amount_subtotal") + Long amountSubtotal; + + /** The total amount of the requested session. */ + @SerializedName("amount_total") + Long amountTotal; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created_at") + Long createdAt; + /** * Three-letter ISO currency code, * in lowercase. Must be a supported currency. @@ -37,6 +52,11 @@ public class RequestedSession extends ApiResource implements HasId { @SerializedName("customer") String customer; + /** Time at which the requested session expires. Measured in seconds since the Unix epoch. */ + @SerializedName("expires_at") + Long expiresAt; + + /** The details of the fulfillment. */ @SerializedName("fulfillment_details") FulfillmentDetails fulfillmentDetails; @@ -45,6 +65,10 @@ public class RequestedSession extends ApiResource implements HasId { @SerializedName("id") String id; + /** The line items to be purchased. */ + @SerializedName("line_item_details") + List lineItemDetails; + /** * Has the value {@code true} if the object exists in live mode or the value {@code false} if the * object exists in test mode. @@ -52,6 +76,15 @@ public class RequestedSession extends ApiResource implements HasId { @SerializedName("livemode") Boolean livemode; + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @Getter(onMethod_ = {@Override}) + @SerializedName("metadata") + Map metadata; + /** * String representing the object's type. Objects of the same type share the same value. * @@ -60,6 +93,48 @@ public class RequestedSession extends ApiResource implements HasId { @SerializedName("object") String object; + /** The details of the order. */ + @SerializedName("order_details") + OrderDetails orderDetails; + + /** The payment method used for the requested session. */ + @SerializedName("payment_method") + String paymentMethod; + + @SerializedName("seller_details") + SellerDetails sellerDetails; + + /** + * Whether or not the payment method should be saved for future use. + * + *

Equal to {@code on_session}. + */ + @SerializedName("setup_future_usage") + String setupFutureUsage; + + /** The metadata shared with the seller. */ + @SerializedName("shared_metadata") + Map sharedMetadata; + + /** The SPT used for payment. */ + @SerializedName("shared_payment_issued_token") + String sharedPaymentIssuedToken; + + /** + * The status of the requested session. + * + *

One of {@code completed}, {@code expired}, or {@code open}. + */ + @SerializedName("status") + String status; + + @SerializedName("total_details") + TotalDetails totalDetails; + + /** Time at which the object was last updated. Measured in seconds since the Unix epoch. */ + @SerializedName("updated_at") + Long updatedAt; + /** Confirms a requested session. */ public RequestedSession confirm() throws StripeException { return confirm((Map) null, (RequestOptions) null); @@ -239,11 +314,13 @@ public static RequestedSession retrieve( } /** Updates a requested session. */ + @Override public RequestedSession update(Map params) throws StripeException { return update(params, (RequestOptions) null); } /** Updates a requested session. */ + @Override public RequestedSession update(Map params, RequestOptions options) throws StripeException { String path = @@ -283,11 +360,248 @@ public RequestedSession update(RequestedSessionUpdateParams params, RequestOptio @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class FulfillmentDetails extends StripeObject {} + public static class FulfillmentDetails extends StripeObject { + /** The fulfillment address. */ + @SerializedName("address") + Address address; + + /** The email address for the fulfillment details. */ + @SerializedName("email") + String email; + + /** The fulfillment options. */ + @SerializedName("fulfillment_options") + List fulfillmentOptions; + + /** The name for the fulfillment details. */ + @SerializedName("name") + String name; + + /** The phone number for the fulfillment details. */ + @SerializedName("phone") + String phone; + + /** The fulfillment option. */ + @SerializedName("selected_fulfillment_option") + SelectedFulfillmentOption selectedFulfillmentOption; + + /** + * For more details about Address, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + } + + /** + * For more details about FulfillmentOption, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FulfillmentOption extends StripeObject { + /** The shipping option. */ + @SerializedName("shipping") + Shipping shipping; + + /** The type of the fulfillment option. */ + @SerializedName("type") + String type; + + /** + * For more details about Shipping, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Shipping extends StripeObject { + /** The shipping options. */ + @SerializedName("shipping_options") + List + shippingOptions; + + /** + * For more details about ShippingOption, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ShippingOption extends StripeObject { + /** The description of the shipping option. */ + @SerializedName("description") + String description; + + /** The display name of the shipping option. */ + @SerializedName("display_name") + String displayName; + + /** The earliest delivery time of the shipping option. */ + @SerializedName("earliest_delivery_time") + Long earliestDeliveryTime; + + /** The key of the shipping option. */ + @SerializedName("key") + String key; + + /** The latest delivery time of the shipping option. */ + @SerializedName("latest_delivery_time") + Long latestDeliveryTime; + + /** The shipping amount of the shipping option. */ + @SerializedName("shipping_amount") + Long shippingAmount; + } + } + } + + /** + * For more details about SelectedFulfillmentOption, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SelectedFulfillmentOption extends StripeObject { + /** The shipping option. */ + @SerializedName("shipping") + Shipping shipping; + + /** The type of the selected fulfillment option. */ + @SerializedName("type") + String type; + + /** + * For more details about Shipping, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Shipping extends StripeObject { + /** The shipping option. */ + @SerializedName("shipping_option") + String shippingOption; + } + } + } + + /** + * For more details about LineItemDetail, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LineItemDetail extends StripeObject { + /** The description of the line item. */ + @SerializedName("description") + String description; + + /** The images of the line item. */ + @SerializedName("images") + List images; + + /** The key of the line item. */ + @SerializedName("key") + String key; + + /** The name of the line item. */ + @SerializedName("name") + String name; + + /** The quantity of the line item. */ + @SerializedName("quantity") + Long quantity; + + /** The SKU ID of the line item. */ + @SerializedName("sku_id") + String skuId; + + /** The unit amount of the line item. */ + @SerializedName("unit_amount") + Long unitAmount; + } + + /** + * For more details about OrderDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OrderDetails extends StripeObject { + /** The URL to the order status. */ + @SerializedName("order_status_url") + String orderStatusUrl; + } + + /** + * For more details about SellerDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SellerDetails extends StripeObject {} + + /** + * For more details about TotalDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class TotalDetails extends StripeObject { + /** The amount discount of the total details. */ + @SerializedName("amount_discount") + Long amountDiscount; + + /** The amount fulfillment of the total details. */ + @SerializedName("amount_fulfillment") + Long amountFulfillment; + + /** The amount tax of the total details. */ + @SerializedName("amount_tax") + Long amountTax; + } @Override public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(fulfillmentDetails, responseGetter); + trySetResponseGetter(orderDetails, responseGetter); + trySetResponseGetter(sellerDetails, responseGetter); + trySetResponseGetter(totalDetails, responseGetter); } } diff --git a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java index d4e4594889f..a4f137323bb 100644 --- a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java @@ -125,6 +125,9 @@ public final class EventDataClassLookup { classLookup.put( "v2.billing.pricing_plan_subscription", com.stripe.model.v2.billing.PricingPlanSubscription.class); + classLookup.put( + "v2.billing.pricing_plan_subscription_components", + com.stripe.model.v2.billing.PricingPlanSubscriptionComponents.class); classLookup.put( "v2.billing.pricing_plan_version", com.stripe.model.v2.billing.PricingPlanVersion.class); classLookup.put("v2.billing.profile", com.stripe.model.v2.billing.Profile.class); diff --git a/src/main/java/com/stripe/model/v2/billing/Cadence.java b/src/main/java/com/stripe/model/v2/billing/Cadence.java index 86c630ee680..8462ef78971 100644 --- a/src/main/java/com/stripe/model/v2/billing/Cadence.java +++ b/src/main/java/com/stripe/model/v2/billing/Cadence.java @@ -567,15 +567,15 @@ public static class Collection extends StripeObject { @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. + * Controls emails for when the payment is due. For example after the invoice is finalized + * and transitions 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. + * Controls emails for when the payment is due. For example after the invoice is finalized + * and transitions to Open state. */ @Getter @Setter @@ -586,7 +586,7 @@ public static class PaymentDue extends StripeObject { Boolean enabled; /** - * If true the payment link to hosted invocie page would be included in email and PDF of + * If true the payment link to hosted invoice page would be included in email and PDF of * the invoice. */ @SerializedName("include_payment_link") diff --git a/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java b/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java index 5825c0a88b5..5e699c71989 100644 --- a/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java @@ -98,15 +98,15 @@ public class CollectionSetting extends StripeObject implements HasId { @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. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions 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. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ @Getter @Setter @@ -117,7 +117,7 @@ public static class PaymentDue extends StripeObject { Boolean enabled; /** - * If true the payment link to hosted invocie page would be included in email and PDF of the + * If true the payment link to hosted invoice page would be included in email and PDF of the * invoice. */ @SerializedName("include_payment_link") diff --git a/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java b/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java index d111fb5721c..2b620865a26 100644 --- a/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java @@ -72,15 +72,15 @@ public class CollectionSettingVersion extends StripeObject implements HasId { @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. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions 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. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ @Getter @Setter @@ -91,7 +91,7 @@ public static class PaymentDue extends StripeObject { Boolean enabled; /** - * If true the payment link to hosted invocie page would be included in email and PDF of the + * If true the payment link to hosted invoice page would be included in email and PDF of the * invoice. */ @SerializedName("include_payment_link") diff --git a/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscriptionComponents.java b/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscriptionComponents.java new file mode 100644 index 00000000000..6f0971cfed2 --- /dev/null +++ b/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscriptionComponents.java @@ -0,0 +1,64 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.StripeObject; +import java.util.List; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** A set of component subscriptions for a Pricing Plan Subscription. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class PricingPlanSubscriptionComponents extends StripeObject { + /** The component subscriptions of the Pricing Plan Subscription. */ + @SerializedName("components") + List components; + + /** + * 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.pricing_plan_subscription_components}. + */ + @SerializedName("object") + String object; + + /** + * For more details about Component, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Component extends StripeObject { + /** The ID of the License Fee Subscription. */ + @SerializedName("license_fee_subscription") + String licenseFeeSubscription; + + /** The Pricing Plan Component associated with this component subscription. */ + @SerializedName("pricing_plan_component") + String pricingPlanComponent; + + /** The ID of the Rate Card Subscription. */ + @SerializedName("rate_card_subscription") + String rateCardSubscription; + + /** + * The type of subscription. + * + *

One of {@code license_fee_subscription}, or {@code rate_card_subscription}. + */ + @SerializedName("type") + String type; + } +} 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 8ca3f013526..c9d42a753e9 100644 --- a/src/main/java/com/stripe/model/v2/core/Account.java +++ b/src/main/java/com/stripe/model/v2/core/Account.java @@ -28,6 +28,10 @@ public class Account extends StripeObject implements HasId { @SerializedName("applied_configurations") List appliedConfigurations; + /** A value indicating if the Account has been closed. */ + @SerializedName("closed") + Boolean closed; + /** * An Account Configuration which allows the Account to take on a key persona across Stripe * products. @@ -657,7 +661,8 @@ public static class AutomaticIndirectTax extends StripeObject { * 'identity_address'. Will only be used for automatic tax calculation on the customer's * Invoices and Subscriptions. * - *

One of {@code identity_address}, {@code ip_address}, or {@code shipping_address}. + *

One of {@code identity_address}, {@code ip_address}, {@code payment_method}, or {@code + * shipping_address}. */ @SerializedName("location_source") String locationSource; @@ -4383,6 +4388,10 @@ public static class HoldsCurrencies extends StripeObject { @SerializedName("gbp") Gbp gbp; + /** Can hold storage-type funds on Stripe in USD. */ + @SerializedName("usd") + Usd usd; + /** Can hold storage-type funds on Stripe in GBP. */ @Getter @Setter @@ -4438,6 +4447,62 @@ public static class StatusDetail extends StripeObject { String resolution; } } + + /** Can hold storage-type funds on Stripe in USD. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Usd extends StripeObject { + /** Whether the Capability has been requested. */ + @SerializedName("requested") + Boolean requested; + + /** + * The status of the Capability. + * + *

One of {@code active}, {@code pending}, {@code restricted}, or {@code + * unsupported}. + */ + @SerializedName("status") + String status; + + /** + * Additional details regarding the status of the Capability. {@code status_details} + * will be empty if the Capability's status is {@code active}. + */ + @SerializedName("status_details") + List + statusDetails; + + /** + * For more details about StatusDetail, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StatusDetail extends StripeObject { + /** + * Machine-readable code explaining the reason for the Capability to be in its current + * status. + * + *

One of {@code determining_status}, {@code requirements_past_due}, {@code + * requirements_pending_verification}, {@code restricted_other}, {@code + * unsupported_business}, {@code unsupported_country}, or {@code + * unsupported_entity_type}. + */ + @SerializedName("code") + String code; + + /** + * Machine-readable code explaining how to make the Capability active. + * + *

One of {@code contact_stripe}, {@code no_resolution}, or {@code provide_info}. + */ + @SerializedName("resolution") + String resolution; + } + } } /** Can pull funds from an external source, owned by yourself, to a FinancialAccount. */ @@ -4900,7 +4965,8 @@ public static class Responsibilities extends StripeObject { * A value indicating the responsible payer of a bundle of Stripe fees for pricing-control * eligible products on this Account. * - *

One of {@code application}, or {@code stripe}. + *

One of {@code application}, {@code application_custom}, {@code application_express}, or + * {@code stripe}. */ @SerializedName("fees_collector") String feesCollector; @@ -4921,7 +4987,10 @@ public static class Responsibilities extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Identity extends StripeObject { - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ @SerializedName("attestations") Attestations attestations; @@ -4953,7 +5022,10 @@ public static class Identity extends StripeObject { @SerializedName("individual") Individual individual; - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -4976,6 +5048,13 @@ public static class Attestations extends StripeObject { @SerializedName("persons_provided") PersonsProvided personsProvided; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** Attestations of accepted terms of service agreements. */ @SerializedName("terms_of_service") TermsOfService termsOfService; @@ -5068,6 +5147,31 @@ public static class PersonsProvided extends StripeObject { String ownershipExemptionReason; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration extends StripeObject { + /** + * The time marking when the representative attestation was made. Represented as a RFC 3339 + * date & time UTC value in millisecond precision, for example: + * 2022-09-18T13:22:18.123Z. + */ + @SerializedName("date") + Instant date; + + /** The IP address from which the representative attestation was made. */ + @SerializedName("ip") + String ip; + + /** The user agent of the browser from which the representative attestation was made. */ + @SerializedName("user_agent") + String userAgent; + } + /** Attestations of accepted terms of service agreements. */ @Getter @Setter @@ -7307,16 +7411,17 @@ public static class RestrictsCapability extends StripeObject { * commercial.stripe.prepaid_card}, {@code crypto}, {@code eps_payments}, {@code * financial_addresses.bank_accounts}, {@code fpx_payments}, {@code * gb_bank_transfer_payments}, {@code grabpay_payments}, {@code holds_currencies.gbp}, - * {@code ideal_payments}, {@code inbound_transfers.financial_accounts}, {@code - * jcb_payments}, {@code jp_bank_transfer_payments}, {@code kakao_pay_payments}, {@code - * klarna_payments}, {@code konbini_payments}, {@code kr_card_payments}, {@code - * link_payments}, {@code mobilepay_payments}, {@code multibanco_payments}, {@code - * mx_bank_transfer_payments}, {@code naver_pay_payments}, {@code - * outbound_payments.bank_accounts}, {@code outbound_payments.cards}, {@code - * outbound_payments.financial_accounts}, {@code outbound_transfers.bank_accounts}, {@code - * outbound_transfers.financial_accounts}, {@code oxxo_payments}, {@code p24_payments}, - * {@code payco_payments}, {@code paynow_payments}, {@code pay_by_bank_payments}, {@code - * promptpay_payments}, {@code revolut_pay_payments}, {@code samsung_pay_payments}, {@code + * {@code holds_currencies.usd}, {@code ideal_payments}, {@code + * inbound_transfers.financial_accounts}, {@code jcb_payments}, {@code + * jp_bank_transfer_payments}, {@code kakao_pay_payments}, {@code klarna_payments}, {@code + * konbini_payments}, {@code kr_card_payments}, {@code link_payments}, {@code + * mobilepay_payments}, {@code multibanco_payments}, {@code mx_bank_transfer_payments}, + * {@code naver_pay_payments}, {@code outbound_payments.bank_accounts}, {@code + * outbound_payments.cards}, {@code outbound_payments.financial_accounts}, {@code + * outbound_transfers.bank_accounts}, {@code outbound_transfers.financial_accounts}, + * {@code oxxo_payments}, {@code p24_payments}, {@code payco_payments}, {@code + * paynow_payments}, {@code pay_by_bank_payments}, {@code promptpay_payments}, {@code + * revolut_pay_payments}, {@code samsung_pay_payments}, {@code * sepa_bank_transfer_payments}, {@code sepa_debit_payments}, {@code * stripe_balance.payouts}, {@code stripe_balance.stripe_transfers}, {@code * swish_payments}, {@code twint_payments}, {@code us_bank_transfer_payments}, or {@code diff --git a/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java b/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java index a2ac614c1c3..9dd736d44fc 100644 --- a/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java +++ b/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java @@ -72,4 +72,49 @@ public class UsBankAccount extends StripeObject implements HasId { /** The ACH routing number of the bank account. */ @SerializedName("routing_number") String routingNumber; + + /** The bank account verification details. */ + @SerializedName("verification") + Verification verification; + + /** The bank account verification details. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Verification extends StripeObject { + /** The microdeposit verification details if the status is awaiting verification. */ + @SerializedName("microdeposit_verification_details") + MicrodepositVerificationDetails microdepositVerificationDetails; + + /** + * The bank account verification status. + * + *

One of {@code awaiting_verification}, {@code unverified}, {@code verification_failed}, or + * {@code verified}. + */ + @SerializedName("status") + String status; + + /** The microdeposit verification details if the status is awaiting verification. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MicrodepositVerificationDetails extends StripeObject { + /** Time when microdeposits will expire and have to be re-sent. */ + @SerializedName("expires") + Instant expires; + + /** + * Microdeposit type can be amounts or descriptor_type. + * + *

One of {@code amounts}, or {@code descriptor_code}. + */ + @SerializedName("microdeposit_type") + String microdepositType; + + /** Time when microdeposits were sent. */ + @SerializedName("sent") + Instant sent; + } + } } diff --git a/src/main/java/com/stripe/param/billing/MeterCreateParams.java b/src/main/java/com/stripe/param/billing/MeterCreateParams.java index 2081cf3fe27..b627a18a1f5 100644 --- a/src/main/java/com/stripe/param/billing/MeterCreateParams.java +++ b/src/main/java/com/stripe/param/billing/MeterCreateParams.java @@ -21,6 +21,13 @@ public class MeterCreateParams extends ApiRequestParams { @SerializedName("default_aggregation") DefaultAggregation defaultAggregation; + /** + * Set of keys that will be used to group meter events by. Each key must be present in the event + * payload. + */ + @SerializedName("dimension_payload_keys") + List dimensionPayloadKeys; + /** Required. The meter’s name. Not visible to the customer. */ @SerializedName("display_name") String displayName; @@ -56,6 +63,7 @@ public class MeterCreateParams extends ApiRequestParams { private MeterCreateParams( CustomerMapping customerMapping, DefaultAggregation defaultAggregation, + List dimensionPayloadKeys, String displayName, String eventName, EventTimeWindow eventTimeWindow, @@ -64,6 +72,7 @@ private MeterCreateParams( ValueSettings valueSettings) { this.customerMapping = customerMapping; this.defaultAggregation = defaultAggregation; + this.dimensionPayloadKeys = dimensionPayloadKeys; this.displayName = displayName; this.eventName = eventName; this.eventTimeWindow = eventTimeWindow; @@ -81,6 +90,8 @@ public static class Builder { private DefaultAggregation defaultAggregation; + private List dimensionPayloadKeys; + private String displayName; private String eventName; @@ -98,6 +109,7 @@ public MeterCreateParams build() { return new MeterCreateParams( this.customerMapping, this.defaultAggregation, + this.dimensionPayloadKeys, this.displayName, this.eventName, this.eventTimeWindow, @@ -118,6 +130,32 @@ public Builder setDefaultAggregation(MeterCreateParams.DefaultAggregation defaul return this; } + /** + * Add an element to `dimensionPayloadKeys` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link MeterCreateParams#dimensionPayloadKeys} for the field documentation. + */ + public Builder addDimensionPayloadKey(String element) { + if (this.dimensionPayloadKeys == null) { + this.dimensionPayloadKeys = new ArrayList<>(); + } + this.dimensionPayloadKeys.add(element); + return this; + } + + /** + * Add all elements to `dimensionPayloadKeys` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link MeterCreateParams#dimensionPayloadKeys} for the field documentation. + */ + public Builder addAllDimensionPayloadKey(List elements) { + if (this.dimensionPayloadKeys == null) { + this.dimensionPayloadKeys = new ArrayList<>(); + } + this.dimensionPayloadKeys.addAll(elements); + return this; + } + /** Required. The meter’s name. Not visible to the customer. */ public Builder setDisplayName(String displayName) { this.displayName = displayName; diff --git a/src/main/java/com/stripe/param/billing/MeterEventSummariesParams.java b/src/main/java/com/stripe/param/billing/MeterEventSummariesParams.java index 58a97672643..c6028960f01 100644 --- a/src/main/java/com/stripe/param/billing/MeterEventSummariesParams.java +++ b/src/main/java/com/stripe/param/billing/MeterEventSummariesParams.java @@ -17,6 +17,20 @@ public class MeterEventSummariesParams extends ApiRequestParams { @SerializedName("customer") String customer; + /** + * Key-value pairs used to filter meter events by dimension values. If specified, event summaries + * will be generated with only matching meter events. + */ + @SerializedName("dimension_filters") + Map dimensionFilters; + + /** + * List of dimension payload keys to group by. If specified, event summaries will be grouped by + * the given dimension payload key values. + */ + @SerializedName("dimension_group_by_keys") + List dimensionGroupByKeys; + /** * Required. The timestamp from when to stop aggregating meter events * (exclusive). Must be aligned with minute boundaries. @@ -80,6 +94,8 @@ public class MeterEventSummariesParams extends ApiRequestParams { private MeterEventSummariesParams( String customer, + Map dimensionFilters, + List dimensionGroupByKeys, Long endTime, String endingBefore, List expand, @@ -89,6 +105,8 @@ private MeterEventSummariesParams( String startingAfter, ValueGroupingWindow valueGroupingWindow) { this.customer = customer; + this.dimensionFilters = dimensionFilters; + this.dimensionGroupByKeys = dimensionGroupByKeys; this.endTime = endTime; this.endingBefore = endingBefore; this.expand = expand; @@ -106,6 +124,10 @@ public static Builder builder() { public static class Builder { private String customer; + private Map dimensionFilters; + + private List dimensionGroupByKeys; + private Long endTime; private String endingBefore; @@ -126,6 +148,8 @@ public static class Builder { public MeterEventSummariesParams build() { return new MeterEventSummariesParams( this.customer, + this.dimensionFilters, + this.dimensionGroupByKeys, this.endTime, this.endingBefore, this.expand, @@ -142,6 +166,58 @@ public Builder setCustomer(String customer) { return this; } + /** + * Add a key/value pair to `dimensionFilters` 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 MeterEventSummariesParams#dimensionFilters} for the field documentation. + */ + public Builder putDimensionFilter(String key, String value) { + if (this.dimensionFilters == null) { + this.dimensionFilters = new HashMap<>(); + } + this.dimensionFilters.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `dimensionFilters` 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 MeterEventSummariesParams#dimensionFilters} for the field documentation. + */ + public Builder putAllDimensionFilter(Map map) { + if (this.dimensionFilters == null) { + this.dimensionFilters = new HashMap<>(); + } + this.dimensionFilters.putAll(map); + return this; + } + + /** + * Add an element to `dimensionGroupByKeys` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link MeterEventSummariesParams#dimensionGroupByKeys} for the field documentation. + */ + public Builder addDimensionGroupByKey(String element) { + if (this.dimensionGroupByKeys == null) { + this.dimensionGroupByKeys = new ArrayList<>(); + } + this.dimensionGroupByKeys.add(element); + return this; + } + + /** + * Add all elements to `dimensionGroupByKeys` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link MeterEventSummariesParams#dimensionGroupByKeys} for the field documentation. + */ + public Builder addAllDimensionGroupByKey(List elements) { + if (this.dimensionGroupByKeys == null) { + this.dimensionGroupByKeys = new ArrayList<>(); + } + this.dimensionGroupByKeys.addAll(elements); + return this; + } + /** * Required. The timestamp from when to stop aggregating meter events * (exclusive). Must be aligned with minute boundaries. diff --git a/src/main/java/com/stripe/param/billing/MeterEventSummaryListParams.java b/src/main/java/com/stripe/param/billing/MeterEventSummaryListParams.java index 4649c8453b9..9e1dd4a6784 100644 --- a/src/main/java/com/stripe/param/billing/MeterEventSummaryListParams.java +++ b/src/main/java/com/stripe/param/billing/MeterEventSummaryListParams.java @@ -17,6 +17,20 @@ public class MeterEventSummaryListParams extends ApiRequestParams { @SerializedName("customer") String customer; + /** + * Key-value pairs used to filter meter events by dimension values. If specified, event summaries + * will be generated with only matching meter events. + */ + @SerializedName("dimension_filters") + Map dimensionFilters; + + /** + * List of dimension payload keys to group by. If specified, event summaries will be grouped by + * the given dimension payload key values. + */ + @SerializedName("dimension_group_by_keys") + List dimensionGroupByKeys; + /** * Required. The timestamp from when to stop aggregating meter events * (exclusive). Must be aligned with minute boundaries. @@ -80,6 +94,8 @@ public class MeterEventSummaryListParams extends ApiRequestParams { private MeterEventSummaryListParams( String customer, + Map dimensionFilters, + List dimensionGroupByKeys, Long endTime, String endingBefore, List expand, @@ -89,6 +105,8 @@ private MeterEventSummaryListParams( String startingAfter, ValueGroupingWindow valueGroupingWindow) { this.customer = customer; + this.dimensionFilters = dimensionFilters; + this.dimensionGroupByKeys = dimensionGroupByKeys; this.endTime = endTime; this.endingBefore = endingBefore; this.expand = expand; @@ -106,6 +124,10 @@ public static Builder builder() { public static class Builder { private String customer; + private Map dimensionFilters; + + private List dimensionGroupByKeys; + private Long endTime; private String endingBefore; @@ -126,6 +148,8 @@ public static class Builder { public MeterEventSummaryListParams build() { return new MeterEventSummaryListParams( this.customer, + this.dimensionFilters, + this.dimensionGroupByKeys, this.endTime, this.endingBefore, this.expand, @@ -142,6 +166,58 @@ public Builder setCustomer(String customer) { return this; } + /** + * Add a key/value pair to `dimensionFilters` 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 MeterEventSummaryListParams#dimensionFilters} for the field documentation. + */ + public Builder putDimensionFilter(String key, String value) { + if (this.dimensionFilters == null) { + this.dimensionFilters = new HashMap<>(); + } + this.dimensionFilters.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `dimensionFilters` 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 MeterEventSummaryListParams#dimensionFilters} for the field documentation. + */ + public Builder putAllDimensionFilter(Map map) { + if (this.dimensionFilters == null) { + this.dimensionFilters = new HashMap<>(); + } + this.dimensionFilters.putAll(map); + return this; + } + + /** + * Add an element to `dimensionGroupByKeys` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link MeterEventSummaryListParams#dimensionGroupByKeys} for the field documentation. + */ + public Builder addDimensionGroupByKey(String element) { + if (this.dimensionGroupByKeys == null) { + this.dimensionGroupByKeys = new ArrayList<>(); + } + this.dimensionGroupByKeys.add(element); + return this; + } + + /** + * Add all elements to `dimensionGroupByKeys` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link MeterEventSummaryListParams#dimensionGroupByKeys} for the field documentation. + */ + public Builder addAllDimensionGroupByKey(List elements) { + if (this.dimensionGroupByKeys == null) { + this.dimensionGroupByKeys = new ArrayList<>(); + } + this.dimensionGroupByKeys.addAll(elements); + return this; + } + /** * Required. The timestamp from when to stop aggregating meter events * (exclusive). Must be aligned with minute boundaries. diff --git a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java index 7128e78ed87..e6fdd5e2e24 100644 --- a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java +++ b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java @@ -13,6 +13,14 @@ @Getter @EqualsAndHashCode(callSuper = false) public class RequestedSessionCreateParams extends ApiRequestParams { + /** Required. The currency for this requested session. */ + @SerializedName("currency") + String currency; + + /** The customer for this requested session. */ + @SerializedName("customer") + String customer; + /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; @@ -26,9 +34,69 @@ public class RequestedSessionCreateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private RequestedSessionCreateParams(List expand, Map extraParams) { + /** The details of the fulfillment. */ + @SerializedName("fulfillment_details") + FulfillmentDetails fulfillmentDetails; + + /** Required. The details of the line items. */ + @SerializedName("line_item_details") + List lineItemDetails; + + /** The metadata for this requested session. */ + @SerializedName("metadata") + Map metadata; + + /** The payment method for this requested session. */ + @SerializedName("payment_method") + String paymentMethod; + + /** The payment method data for this requested session. */ + @SerializedName("payment_method_data") + PaymentMethodData paymentMethodData; + + /** The risk details for this requested session. */ + @SerializedName("risk_details") + RiskDetails riskDetails; + + /** Required. The details of the seller. */ + @SerializedName("seller_details") + SellerDetails sellerDetails; + + /** The setup future usage for this requested session. */ + @SerializedName("setup_future_usage") + SetupFutureUsage setupFutureUsage; + + /** The shared metadata for this requested session. */ + @SerializedName("shared_metadata") + Map sharedMetadata; + + private RequestedSessionCreateParams( + String currency, + String customer, + List expand, + Map extraParams, + FulfillmentDetails fulfillmentDetails, + List lineItemDetails, + Map metadata, + String paymentMethod, + PaymentMethodData paymentMethodData, + RiskDetails riskDetails, + SellerDetails sellerDetails, + SetupFutureUsage setupFutureUsage, + Map sharedMetadata) { + this.currency = currency; + this.customer = customer; this.expand = expand; this.extraParams = extraParams; + this.fulfillmentDetails = fulfillmentDetails; + this.lineItemDetails = lineItemDetails; + this.metadata = metadata; + this.paymentMethod = paymentMethod; + this.paymentMethodData = paymentMethodData; + this.riskDetails = riskDetails; + this.sellerDetails = sellerDetails; + this.setupFutureUsage = setupFutureUsage; + this.sharedMetadata = sharedMetadata; } public static Builder builder() { @@ -36,13 +104,60 @@ public static Builder builder() { } public static class Builder { + private String currency; + + private String customer; + private List expand; private Map extraParams; + private FulfillmentDetails fulfillmentDetails; + + private List lineItemDetails; + + private Map metadata; + + private String paymentMethod; + + private PaymentMethodData paymentMethodData; + + private RiskDetails riskDetails; + + private SellerDetails sellerDetails; + + private SetupFutureUsage setupFutureUsage; + + private Map sharedMetadata; + /** Finalize and obtain parameter instance from this builder. */ public RequestedSessionCreateParams build() { - return new RequestedSessionCreateParams(this.expand, this.extraParams); + return new RequestedSessionCreateParams( + this.currency, + this.customer, + this.expand, + this.extraParams, + this.fulfillmentDetails, + this.lineItemDetails, + this.metadata, + this.paymentMethod, + this.paymentMethodData, + this.riskDetails, + this.sellerDetails, + this.setupFutureUsage, + this.sharedMetadata); + } + + /** Required. The currency for this requested session. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** The customer for this requested session. */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; } /** @@ -96,5 +211,1273 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** The details of the fulfillment. */ + public Builder setFulfillmentDetails( + RequestedSessionCreateParams.FulfillmentDetails fulfillmentDetails) { + this.fulfillmentDetails = fulfillmentDetails; + return this; + } + + /** + * Add an element to `lineItemDetails` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RequestedSessionCreateParams#lineItemDetails} for the field documentation. + */ + public Builder addLineItemDetail(RequestedSessionCreateParams.LineItemDetail element) { + if (this.lineItemDetails == null) { + this.lineItemDetails = new ArrayList<>(); + } + this.lineItemDetails.add(element); + return this; + } + + /** + * Add all elements to `lineItemDetails` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RequestedSessionCreateParams#lineItemDetails} for the field documentation. + */ + public Builder addAllLineItemDetail( + List elements) { + if (this.lineItemDetails == null) { + this.lineItemDetails = new ArrayList<>(); + } + this.lineItemDetails.addAll(elements); + 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 + * RequestedSessionCreateParams#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 RequestedSessionCreateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** The payment method for this requested session. */ + public Builder setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** The payment method data for this requested session. */ + public Builder setPaymentMethodData( + RequestedSessionCreateParams.PaymentMethodData paymentMethodData) { + this.paymentMethodData = paymentMethodData; + return this; + } + + /** The risk details for this requested session. */ + public Builder setRiskDetails(RequestedSessionCreateParams.RiskDetails riskDetails) { + this.riskDetails = riskDetails; + return this; + } + + /** Required. The details of the seller. */ + public Builder setSellerDetails(RequestedSessionCreateParams.SellerDetails sellerDetails) { + this.sellerDetails = sellerDetails; + return this; + } + + /** The setup future usage for this requested session. */ + public Builder setSetupFutureUsage( + RequestedSessionCreateParams.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + /** + * Add a key/value pair to `sharedMetadata` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * RequestedSessionCreateParams#sharedMetadata} for the field documentation. + */ + public Builder putSharedMetadata(String key, String value) { + if (this.sharedMetadata == null) { + this.sharedMetadata = new HashMap<>(); + } + this.sharedMetadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `sharedMetadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link RequestedSessionCreateParams#sharedMetadata} for the field documentation. + */ + public Builder putAllSharedMetadata(Map map) { + if (this.sharedMetadata == null) { + this.sharedMetadata = new HashMap<>(); + } + this.sharedMetadata.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class FulfillmentDetails { + @SerializedName("address") + Address address; + + /** The customer's email address. */ + @SerializedName("email") + String email; + + /** + * 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 customer's name. */ + @SerializedName("name") + String name; + + /** The customer's phone number. */ + @SerializedName("phone") + String phone; + + private FulfillmentDetails( + Address address, String email, Map extraParams, String name, String phone) { + this.address = address; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionCreateParams.FulfillmentDetails build() { + return new RequestedSessionCreateParams.FulfillmentDetails( + this.address, this.email, this.extraParams, this.name, this.phone); + } + + public Builder setAddress(RequestedSessionCreateParams.FulfillmentDetails.Address address) { + this.address = address; + return this; + } + + /** The customer's email address. */ + public Builder setEmail(String email) { + this.email = email; + 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 + * RequestedSessionCreateParams.FulfillmentDetails#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 RequestedSessionCreateParams.FulfillmentDetails#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 customer's name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The customer's phone number. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** Required. City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** Required. ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** Required. State, county, province, or region. */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionCreateParams.FulfillmentDetails.Address build() { + return new RequestedSessionCreateParams.FulfillmentDetails.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** Required. City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link RequestedSessionCreateParams.FulfillmentDetails.Address#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link RequestedSessionCreateParams.FulfillmentDetails.Address#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Address line 1, such as the street, PO Box, or company name. + */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** Required. ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** Required. State, county, province, or region. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineItemDetail { + /** + * 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 quantity of the line item. */ + @SerializedName("quantity") + Long quantity; + + /** Required. The SKU ID of the line item. */ + @SerializedName("sku_id") + String skuId; + + private LineItemDetail(Map extraParams, Long quantity, String skuId) { + this.extraParams = extraParams; + this.quantity = quantity; + this.skuId = skuId; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long quantity; + + private String skuId; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionCreateParams.LineItemDetail build() { + return new RequestedSessionCreateParams.LineItemDetail( + this.extraParams, this.quantity, this.skuId); + } + + /** + * 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 + * RequestedSessionCreateParams.LineItemDetail#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 RequestedSessionCreateParams.LineItemDetail#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 quantity of the line item. */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** Required. The SKU ID of the line item. */ + public Builder setSkuId(String skuId) { + this.skuId = skuId; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodData { + /** The billing details for the payment method data. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** The card for the payment method data. */ + @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; + + /** The type of the payment method data. */ + @SerializedName("type") + Type type; + + private PaymentMethodData( + BillingDetails billingDetails, Card card, Map extraParams, Type type) { + this.billingDetails = billingDetails; + this.card = card; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillingDetails billingDetails; + + private Card card; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionCreateParams.PaymentMethodData build() { + return new RequestedSessionCreateParams.PaymentMethodData( + this.billingDetails, this.card, this.extraParams, this.type); + } + + /** The billing details for the payment method data. */ + public Builder setBillingDetails( + RequestedSessionCreateParams.PaymentMethodData.BillingDetails billingDetails) { + this.billingDetails = billingDetails; + return this; + } + + /** The card for the payment method data. */ + public Builder setCard(RequestedSessionCreateParams.PaymentMethodData.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 + * RequestedSessionCreateParams.PaymentMethodData#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 RequestedSessionCreateParams.PaymentMethodData#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 type of the payment method data. */ + public Builder setType(RequestedSessionCreateParams.PaymentMethodData.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingDetails { + /** The address for the billing details. */ + @SerializedName("address") + Address address; + + /** The email for the billing details. */ + @SerializedName("email") + String email; + + /** + * 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 name for the billing details. */ + @SerializedName("name") + String name; + + /** The phone for the billing details. */ + @SerializedName("phone") + String phone; + + private BillingDetails( + Address address, + String email, + Map extraParams, + String name, + String phone) { + this.address = address; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionCreateParams.PaymentMethodData.BillingDetails build() { + return new RequestedSessionCreateParams.PaymentMethodData.BillingDetails( + this.address, this.email, this.extraParams, this.name, this.phone); + } + + /** The address for the billing details. */ + public Builder setAddress( + RequestedSessionCreateParams.PaymentMethodData.BillingDetails.Address address) { + this.address = address; + return this; + } + + /** The email for the billing details. */ + public Builder setEmail(String email) { + this.email = email; + 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 + * RequestedSessionCreateParams.PaymentMethodData.BillingDetails#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 + * RequestedSessionCreateParams.PaymentMethodData.BillingDetails#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 name for the billing details. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The phone for the billing details. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** Required. City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. Address line 1, such as the street, PO Box, or company name. + */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** Required. ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** Required. State, county, province, or region. */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionCreateParams.PaymentMethodData.BillingDetails.Address build() { + return new RequestedSessionCreateParams.PaymentMethodData.BillingDetails.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** Required. City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * RequestedSessionCreateParams.PaymentMethodData.BillingDetails.Address#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * RequestedSessionCreateParams.PaymentMethodData.BillingDetails.Address#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Address line 1, such as the street, PO Box, or company name. + */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** Required. ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** Required. State, county, province, or region. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** The CVC of the card. */ + @SerializedName("cvc") + String cvc; + + /** Required. The expiration month of the card. */ + @SerializedName("exp_month") + Long expMonth; + + /** Required. The expiration year of the card. */ + @SerializedName("exp_year") + Long expYear; + + /** + * 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 number of the card. */ + @SerializedName("number") + String number; + + private Card( + String cvc, Long expMonth, Long expYear, Map extraParams, String number) { + this.cvc = cvc; + this.expMonth = expMonth; + this.expYear = expYear; + this.extraParams = extraParams; + this.number = number; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String cvc; + + private Long expMonth; + + private Long expYear; + + private Map extraParams; + + private String number; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionCreateParams.PaymentMethodData.Card build() { + return new RequestedSessionCreateParams.PaymentMethodData.Card( + this.cvc, this.expMonth, this.expYear, this.extraParams, this.number); + } + + /** The CVC of the card. */ + public Builder setCvc(String cvc) { + this.cvc = cvc; + return this; + } + + /** Required. The expiration month of the card. */ + public Builder setExpMonth(Long expMonth) { + this.expMonth = expMonth; + return this; + } + + /** Required. The expiration year of the card. */ + public Builder setExpYear(Long expYear) { + this.expYear = expYear; + 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 RequestedSessionCreateParams.PaymentMethodData.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 RequestedSessionCreateParams.PaymentMethodData.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. The number of the card. */ + public Builder setNumber(String number) { + this.number = number; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("card") + CARD("card"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RiskDetails { + /** The client device metadata details for this requested session. */ + @SerializedName("client_device_metadata_details") + ClientDeviceMetadataDetails clientDeviceMetadataDetails; + + /** + * 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 RiskDetails( + ClientDeviceMetadataDetails clientDeviceMetadataDetails, Map extraParams) { + this.clientDeviceMetadataDetails = clientDeviceMetadataDetails; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ClientDeviceMetadataDetails clientDeviceMetadataDetails; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionCreateParams.RiskDetails build() { + return new RequestedSessionCreateParams.RiskDetails( + this.clientDeviceMetadataDetails, this.extraParams); + } + + /** The client device metadata details for this requested session. */ + public Builder setClientDeviceMetadataDetails( + RequestedSessionCreateParams.RiskDetails.ClientDeviceMetadataDetails + clientDeviceMetadataDetails) { + this.clientDeviceMetadataDetails = clientDeviceMetadataDetails; + 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 + * RequestedSessionCreateParams.RiskDetails#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 RequestedSessionCreateParams.RiskDetails#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 ClientDeviceMetadataDetails { + /** + * 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 radar session. */ + @SerializedName("radar_session") + String radarSession; + + /** The referrer of the client device. */ + @SerializedName("referrer") + String referrer; + + /** The remote IP address of the client device. */ + @SerializedName("remote_ip") + String remoteIp; + + /** The time on page in seconds. */ + @SerializedName("time_on_page") + Long timeOnPage; + + /** The user agent of the client device. */ + @SerializedName("user_agent") + String userAgent; + + private ClientDeviceMetadataDetails( + Map extraParams, + String radarSession, + String referrer, + String remoteIp, + Long timeOnPage, + String userAgent) { + this.extraParams = extraParams; + this.radarSession = radarSession; + this.referrer = referrer; + this.remoteIp = remoteIp; + this.timeOnPage = timeOnPage; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String radarSession; + + private String referrer; + + private String remoteIp; + + private Long timeOnPage; + + private String userAgent; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionCreateParams.RiskDetails.ClientDeviceMetadataDetails build() { + return new RequestedSessionCreateParams.RiskDetails.ClientDeviceMetadataDetails( + this.extraParams, + this.radarSession, + this.referrer, + this.remoteIp, + this.timeOnPage, + this.userAgent); + } + + /** + * 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 + * RequestedSessionCreateParams.RiskDetails.ClientDeviceMetadataDetails#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 + * RequestedSessionCreateParams.RiskDetails.ClientDeviceMetadataDetails#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 radar session. */ + public Builder setRadarSession(String radarSession) { + this.radarSession = radarSession; + return this; + } + + /** The referrer of the client device. */ + public Builder setReferrer(String referrer) { + this.referrer = referrer; + return this; + } + + /** The remote IP address of the client device. */ + public Builder setRemoteIp(String remoteIp) { + this.remoteIp = remoteIp; + return this; + } + + /** The time on page in seconds. */ + public Builder setTimeOnPage(Long timeOnPage) { + this.timeOnPage = timeOnPage; + return this; + } + + /** The user agent of the client device. */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SellerDetails { + /** + * 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 network profile for the seller. */ + @SerializedName("network_profile") + String networkProfile; + + private SellerDetails(Map extraParams, String networkProfile) { + this.extraParams = extraParams; + this.networkProfile = networkProfile; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String networkProfile; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionCreateParams.SellerDetails build() { + return new RequestedSessionCreateParams.SellerDetails( + this.extraParams, this.networkProfile); + } + + /** + * 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 + * RequestedSessionCreateParams.SellerDetails#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 RequestedSessionCreateParams.SellerDetails#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 network profile for the seller. */ + public Builder setNetworkProfile(String networkProfile) { + this.networkProfile = networkProfile; + return this; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java index c28f67a46a8..ad4cbe9e15d 100644 --- a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java +++ b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java @@ -3,6 +3,7 @@ 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; @@ -26,9 +27,47 @@ public class RequestedSessionUpdateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private RequestedSessionUpdateParams(List expand, Map extraParams) { + /** The details of the fulfillment. */ + @SerializedName("fulfillment_details") + FulfillmentDetails fulfillmentDetails; + + /** The details of the line items. */ + @SerializedName("line_item_details") + List lineItemDetails; + + /** The metadata for this requested session. */ + @SerializedName("metadata") + Map metadata; + + /** The payment method for this requested session. */ + @SerializedName("payment_method") + Object paymentMethod; + + /** The payment method data for this requested session. */ + @SerializedName("payment_method_data") + PaymentMethodData paymentMethodData; + + /** The shared metadata for this requested session. */ + @SerializedName("shared_metadata") + Map sharedMetadata; + + private RequestedSessionUpdateParams( + List expand, + Map extraParams, + FulfillmentDetails fulfillmentDetails, + List lineItemDetails, + Map metadata, + Object paymentMethod, + PaymentMethodData paymentMethodData, + Map sharedMetadata) { this.expand = expand; this.extraParams = extraParams; + this.fulfillmentDetails = fulfillmentDetails; + this.lineItemDetails = lineItemDetails; + this.metadata = metadata; + this.paymentMethod = paymentMethod; + this.paymentMethodData = paymentMethodData; + this.sharedMetadata = sharedMetadata; } public static Builder builder() { @@ -40,9 +79,29 @@ public static class Builder { private Map extraParams; + private FulfillmentDetails fulfillmentDetails; + + private List lineItemDetails; + + private Map metadata; + + private Object paymentMethod; + + private PaymentMethodData paymentMethodData; + + private Map sharedMetadata; + /** Finalize and obtain parameter instance from this builder. */ public RequestedSessionUpdateParams build() { - return new RequestedSessionUpdateParams(this.expand, this.extraParams); + return new RequestedSessionUpdateParams( + this.expand, + this.extraParams, + this.fulfillmentDetails, + this.lineItemDetails, + this.metadata, + this.paymentMethod, + this.paymentMethodData, + this.sharedMetadata); } /** @@ -96,5 +155,1305 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** The details of the fulfillment. */ + public Builder setFulfillmentDetails( + RequestedSessionUpdateParams.FulfillmentDetails fulfillmentDetails) { + this.fulfillmentDetails = fulfillmentDetails; + return this; + } + + /** + * Add an element to `lineItemDetails` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RequestedSessionUpdateParams#lineItemDetails} for the field documentation. + */ + public Builder addLineItemDetail(RequestedSessionUpdateParams.LineItemDetail element) { + if (this.lineItemDetails == null) { + this.lineItemDetails = new ArrayList<>(); + } + this.lineItemDetails.add(element); + return this; + } + + /** + * Add all elements to `lineItemDetails` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RequestedSessionUpdateParams#lineItemDetails} for the field documentation. + */ + public Builder addAllLineItemDetail( + List elements) { + if (this.lineItemDetails == null) { + this.lineItemDetails = new ArrayList<>(); + } + this.lineItemDetails.addAll(elements); + 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 + * RequestedSessionUpdateParams#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 RequestedSessionUpdateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** The payment method for this requested session. */ + public Builder setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** The payment method for this requested session. */ + public Builder setPaymentMethod(EmptyParam paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** The payment method data for this requested session. */ + public Builder setPaymentMethodData( + RequestedSessionUpdateParams.PaymentMethodData paymentMethodData) { + this.paymentMethodData = paymentMethodData; + return this; + } + + /** + * Add a key/value pair to `sharedMetadata` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * RequestedSessionUpdateParams#sharedMetadata} for the field documentation. + */ + public Builder putSharedMetadata(String key, String value) { + if (this.sharedMetadata == null) { + this.sharedMetadata = new HashMap<>(); + } + this.sharedMetadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `sharedMetadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link RequestedSessionUpdateParams#sharedMetadata} for the field documentation. + */ + public Builder putAllSharedMetadata(Map map) { + if (this.sharedMetadata == null) { + this.sharedMetadata = new HashMap<>(); + } + this.sharedMetadata.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class FulfillmentDetails { + @SerializedName("address") + Address address; + + /** The customer's email address. */ + @SerializedName("email") + Object email; + + /** + * 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 customer's name. */ + @SerializedName("name") + Object name; + + /** The customer's phone number. */ + @SerializedName("phone") + Object phone; + + /** The fulfillment option to select. */ + @SerializedName("selected_fulfillment_option") + SelectedFulfillmentOption selectedFulfillmentOption; + + private FulfillmentDetails( + Address address, + Object email, + Map extraParams, + Object name, + Object phone, + SelectedFulfillmentOption selectedFulfillmentOption) { + this.address = address; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + this.selectedFulfillmentOption = selectedFulfillmentOption; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private Object email; + + private Map extraParams; + + private Object name; + + private Object phone; + + private SelectedFulfillmentOption selectedFulfillmentOption; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.FulfillmentDetails build() { + return new RequestedSessionUpdateParams.FulfillmentDetails( + this.address, + this.email, + this.extraParams, + this.name, + this.phone, + this.selectedFulfillmentOption); + } + + public Builder setAddress(RequestedSessionUpdateParams.FulfillmentDetails.Address address) { + this.address = address; + return this; + } + + /** The customer's email address. */ + public Builder setEmail(String email) { + this.email = email; + return this; + } + + /** The customer's email address. */ + public Builder setEmail(EmptyParam email) { + this.email = email; + 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 + * RequestedSessionUpdateParams.FulfillmentDetails#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 RequestedSessionUpdateParams.FulfillmentDetails#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 customer's name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The customer's name. */ + public Builder setName(EmptyParam name) { + this.name = name; + return this; + } + + /** The customer's phone number. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + + /** The customer's phone number. */ + public Builder setPhone(EmptyParam phone) { + this.phone = phone; + return this; + } + + /** The fulfillment option to select. */ + public Builder setSelectedFulfillmentOption( + RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOption + selectedFulfillmentOption) { + this.selectedFulfillmentOption = selectedFulfillmentOption; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** Required. City, district, suburb, town, or village. */ + @SerializedName("city") + Object city; + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + @SerializedName("country") + Object 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; + + /** Required. Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + Object line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + Object line2; + + /** Required. ZIP or postal code. */ + @SerializedName("postal_code") + Object postalCode; + + /** Required. State, county, province, or region. */ + @SerializedName("state") + Object state; + + private Address( + Object city, + Object country, + Map extraParams, + Object line1, + Object line2, + Object postalCode, + Object state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object city; + + private Object country; + + private Map extraParams; + + private Object line1; + + private Object line2; + + private Object postalCode; + + private Object state; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.FulfillmentDetails.Address build() { + return new RequestedSessionUpdateParams.FulfillmentDetails.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** Required. City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** Required. City, district, suburb, town, or village. */ + public Builder setCity(EmptyParam city) { + this.city = city; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(EmptyParam 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 RequestedSessionUpdateParams.FulfillmentDetails.Address#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link RequestedSessionUpdateParams.FulfillmentDetails.Address#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Address line 1, such as the street, PO Box, or company name. + */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** + * Required. Address line 1, such as the street, PO Box, or company name. + */ + public Builder setLine1(EmptyParam line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(EmptyParam line2) { + this.line2 = line2; + return this; + } + + /** Required. ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** Required. ZIP or postal code. */ + public Builder setPostalCode(EmptyParam postalCode) { + this.postalCode = postalCode; + return this; + } + + /** Required. State, county, province, or region. */ + public Builder setState(String state) { + this.state = state; + return this; + } + + /** Required. State, county, province, or region. */ + public Builder setState(EmptyParam state) { + this.state = state; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelectedFulfillmentOption { + /** + * 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 shipping fulfillment option. */ + @SerializedName("shipping") + Shipping shipping; + + /** Required. The type of fulfillment option. */ + @SerializedName("type") + Object type; + + private SelectedFulfillmentOption( + Map extraParams, Shipping shipping, Object type) { + this.extraParams = extraParams; + this.shipping = shipping; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Shipping shipping; + + private Object type; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOption build() { + return new RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOption( + this.extraParams, this.shipping, 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 + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOption#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 + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOption#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 shipping fulfillment option. */ + public Builder setShipping( + RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOption.Shipping + shipping) { + this.shipping = shipping; + return this; + } + + /** Required. The type of fulfillment option. */ + public Builder setType(String type) { + this.type = type; + return this; + } + + /** Required. The type of fulfillment option. */ + public Builder setType(EmptyParam type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Shipping { + /** + * 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 shipping option identifer. */ + @SerializedName("shipping_option") + Object shippingOption; + + private Shipping(Map extraParams, Object shippingOption) { + this.extraParams = extraParams; + this.shippingOption = shippingOption; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object shippingOption; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOption.Shipping + build() { + return new RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOption + .Shipping(this.extraParams, this.shippingOption); + } + + /** + * 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 + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOption.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 + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOption.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; + } + + /** Required. The shipping option identifer. */ + public Builder setShippingOption(String shippingOption) { + this.shippingOption = shippingOption; + return this; + } + + /** Required. The shipping option identifer. */ + public Builder setShippingOption(EmptyParam shippingOption) { + this.shippingOption = shippingOption; + return this; + } + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineItemDetail { + /** + * 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 key of the line item. */ + @SerializedName("key") + Object key; + + /** The quantity of the line item. */ + @SerializedName("quantity") + Long quantity; + + private LineItemDetail(Map extraParams, Object key, Long quantity) { + this.extraParams = extraParams; + this.key = key; + this.quantity = quantity; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object key; + + private Long quantity; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.LineItemDetail build() { + return new RequestedSessionUpdateParams.LineItemDetail( + this.extraParams, this.key, this.quantity); + } + + /** + * 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 + * RequestedSessionUpdateParams.LineItemDetail#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 RequestedSessionUpdateParams.LineItemDetail#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 key of the line item. */ + public Builder setKey(String key) { + this.key = key; + return this; + } + + /** Required. The key of the line item. */ + public Builder setKey(EmptyParam key) { + this.key = key; + return this; + } + + /** The quantity of the line item. */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodData { + /** The billing details for the payment method data. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** The card for the payment method data. */ + @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; + + /** The type of the payment method data. */ + @SerializedName("type") + Type type; + + private PaymentMethodData( + BillingDetails billingDetails, Card card, Map extraParams, Type type) { + this.billingDetails = billingDetails; + this.card = card; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillingDetails billingDetails; + + private Card card; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.PaymentMethodData build() { + return new RequestedSessionUpdateParams.PaymentMethodData( + this.billingDetails, this.card, this.extraParams, this.type); + } + + /** The billing details for the payment method data. */ + public Builder setBillingDetails( + RequestedSessionUpdateParams.PaymentMethodData.BillingDetails billingDetails) { + this.billingDetails = billingDetails; + return this; + } + + /** The card for the payment method data. */ + public Builder setCard(RequestedSessionUpdateParams.PaymentMethodData.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 + * RequestedSessionUpdateParams.PaymentMethodData#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 RequestedSessionUpdateParams.PaymentMethodData#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 type of the payment method data. */ + public Builder setType(RequestedSessionUpdateParams.PaymentMethodData.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingDetails { + /** The address for the billing details. */ + @SerializedName("address") + Address address; + + /** The email for the billing details. */ + @SerializedName("email") + Object email; + + /** + * 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 name for the billing details. */ + @SerializedName("name") + Object name; + + /** The phone for the billing details. */ + @SerializedName("phone") + Object phone; + + private BillingDetails( + Address address, + Object email, + Map extraParams, + Object name, + Object phone) { + this.address = address; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private Object email; + + private Map extraParams; + + private Object name; + + private Object phone; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.PaymentMethodData.BillingDetails build() { + return new RequestedSessionUpdateParams.PaymentMethodData.BillingDetails( + this.address, this.email, this.extraParams, this.name, this.phone); + } + + /** The address for the billing details. */ + public Builder setAddress( + RequestedSessionUpdateParams.PaymentMethodData.BillingDetails.Address address) { + this.address = address; + return this; + } + + /** The email for the billing details. */ + public Builder setEmail(String email) { + this.email = email; + return this; + } + + /** The email for the billing details. */ + public Builder setEmail(EmptyParam email) { + this.email = email; + 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 + * RequestedSessionUpdateParams.PaymentMethodData.BillingDetails#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 + * RequestedSessionUpdateParams.PaymentMethodData.BillingDetails#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 name for the billing details. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The name for the billing details. */ + public Builder setName(EmptyParam name) { + this.name = name; + return this; + } + + /** The phone for the billing details. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + + /** The phone for the billing details. */ + public Builder setPhone(EmptyParam phone) { + this.phone = phone; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** Required. City, district, suburb, town, or village. */ + @SerializedName("city") + Object city; + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + @SerializedName("country") + Object 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; + + /** + * Required. Address line 1, such as the street, PO Box, or company name. + */ + @SerializedName("line1") + Object line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + Object line2; + + /** Required. ZIP or postal code. */ + @SerializedName("postal_code") + Object postalCode; + + /** Required. State, county, province, or region. */ + @SerializedName("state") + Object state; + + private Address( + Object city, + Object country, + Map extraParams, + Object line1, + Object line2, + Object postalCode, + Object state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object city; + + private Object country; + + private Map extraParams; + + private Object line1; + + private Object line2; + + private Object postalCode; + + private Object state; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.PaymentMethodData.BillingDetails.Address build() { + return new RequestedSessionUpdateParams.PaymentMethodData.BillingDetails.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** Required. City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** Required. City, district, suburb, town, or village. */ + public Builder setCity(EmptyParam city) { + this.city = city; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(EmptyParam 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 + * RequestedSessionUpdateParams.PaymentMethodData.BillingDetails.Address#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * RequestedSessionUpdateParams.PaymentMethodData.BillingDetails.Address#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Address line 1, such as the street, PO Box, or company name. + */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** + * Required. Address line 1, such as the street, PO Box, or company name. + */ + public Builder setLine1(EmptyParam line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(EmptyParam line2) { + this.line2 = line2; + return this; + } + + /** Required. ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** Required. ZIP or postal code. */ + public Builder setPostalCode(EmptyParam postalCode) { + this.postalCode = postalCode; + return this; + } + + /** Required. State, county, province, or region. */ + public Builder setState(String state) { + this.state = state; + return this; + } + + /** Required. State, county, province, or region. */ + public Builder setState(EmptyParam state) { + this.state = state; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** The CVC of the card. */ + @SerializedName("cvc") + Object cvc; + + /** Required. The expiration month of the card. */ + @SerializedName("exp_month") + Long expMonth; + + /** Required. The expiration year of the card. */ + @SerializedName("exp_year") + Long expYear; + + /** + * 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 number of the card. */ + @SerializedName("number") + Object number; + + private Card( + Object cvc, Long expMonth, Long expYear, Map extraParams, Object number) { + this.cvc = cvc; + this.expMonth = expMonth; + this.expYear = expYear; + this.extraParams = extraParams; + this.number = number; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object cvc; + + private Long expMonth; + + private Long expYear; + + private Map extraParams; + + private Object number; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.PaymentMethodData.Card build() { + return new RequestedSessionUpdateParams.PaymentMethodData.Card( + this.cvc, this.expMonth, this.expYear, this.extraParams, this.number); + } + + /** The CVC of the card. */ + public Builder setCvc(String cvc) { + this.cvc = cvc; + return this; + } + + /** The CVC of the card. */ + public Builder setCvc(EmptyParam cvc) { + this.cvc = cvc; + return this; + } + + /** Required. The expiration month of the card. */ + public Builder setExpMonth(Long expMonth) { + this.expMonth = expMonth; + return this; + } + + /** Required. The expiration year of the card. */ + public Builder setExpYear(Long expYear) { + this.expYear = expYear; + 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 RequestedSessionUpdateParams.PaymentMethodData.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 RequestedSessionUpdateParams.PaymentMethodData.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. The number of the card. */ + public Builder setNumber(String number) { + this.number = number; + return this; + } + + /** Required. The number of the card. */ + public Builder setNumber(EmptyParam number) { + this.number = number; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("card") + CARD("card"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } } } diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java index 1e5d4125b6f..216a38bbeb0 100644 --- a/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java @@ -200,8 +200,8 @@ public static class EmailDelivery { Map extraParams; /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ @SerializedName("payment_due") PaymentDue paymentDue; @@ -253,8 +253,8 @@ public Builder putAllExtraParam(Map map) { } /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ public Builder setPaymentDue( CollectionSettingCreateParams.EmailDelivery.PaymentDue paymentDue) { @@ -283,7 +283,7 @@ public static class PaymentDue { Map extraParams; /** - * Required. If true the payment link to hosted invocie page would be + * Required. If true the payment link to hosted invoice page would be * included in email and PDF of the invoice. */ @SerializedName("include_payment_link") @@ -351,7 +351,7 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. If true the payment link to hosted invocie page would be + * Required. If true the payment link to hosted invoice page would be * included in email and PDF of the invoice. */ public Builder setIncludePaymentLink(Boolean includePaymentLink) { diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java index 2642012da02..e5b51c5d994 100644 --- a/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java @@ -263,8 +263,8 @@ public static class EmailDelivery { Map extraParams; /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ @SerializedName("payment_due") PaymentDue paymentDue; @@ -316,8 +316,8 @@ public Builder putAllExtraParam(Map map) { } /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ public Builder setPaymentDue( CollectionSettingUpdateParams.EmailDelivery.PaymentDue paymentDue) { @@ -346,7 +346,7 @@ public static class PaymentDue { Map extraParams; /** - * Required. If true the payment link to hosted invocie page would be + * Required. If true the payment link to hosted invoice page would be * included in email and PDF of the invoice. */ @SerializedName("include_payment_link") @@ -414,7 +414,7 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. If true the payment link to hosted invocie page would be + * Required. If true the payment link to hosted invoice page would be * included in email and PDF of the invoice. */ public Builder setIncludePaymentLink(Boolean includePaymentLink) { 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 5dbf60916a1..9f73401099c 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java @@ -1757,6 +1757,9 @@ public enum LocationSource implements ApiRequestParams.EnumParam { @SerializedName("ip_address") IP_ADDRESS("ip_address"), + @SerializedName("payment_method") + PAYMENT_METHOD("payment_method"), + @SerializedName("shipping_address") SHIPPING_ADDRESS("shipping_address"); @@ -9227,9 +9230,14 @@ public static class HoldsCurrencies { @SerializedName("gbp") Gbp gbp; - private HoldsCurrencies(Map extraParams, Gbp gbp) { + /** Can hold storage-type funds on Stripe in USD. */ + @SerializedName("usd") + Usd usd; + + private HoldsCurrencies(Map extraParams, Gbp gbp, Usd usd) { this.extraParams = extraParams; this.gbp = gbp; + this.usd = usd; } public static Builder builder() { @@ -9241,10 +9249,12 @@ public static class Builder { private Gbp gbp; + private Usd usd; + /** Finalize and obtain parameter instance from this builder. */ public AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies build() { return new AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies( - this.extraParams, this.gbp); + this.extraParams, this.gbp, this.usd); } /** @@ -9283,6 +9293,13 @@ public Builder setGbp( this.gbp = gbp; return this; } + + /** Can hold storage-type funds on Stripe in USD. */ + public Builder setUsd( + AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd usd) { + this.usd = usd; + return this; + } } @Getter @@ -9366,6 +9383,88 @@ public Builder setRequested(Boolean requested) { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Usd { + /** + * 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. To request a new Capability for an account, pass true. + * There can be a delay before the requested Capability becomes active. + */ + @SerializedName("requested") + Boolean requested; + + private Usd(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd + build() { + return new AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies + .Usd(this.extraParams, this.requested); + } + + /** + * 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.Configuration.Storer.Capabilities.HoldsCurrencies.Usd#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.Configuration.Storer.Capabilities.HoldsCurrencies.Usd#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. To request a new Capability for an account, pass true. + * There can be a delay before the requested Capability becomes active. + */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } } @Getter @@ -10522,6 +10621,12 @@ public enum FeesCollector implements ApiRequestParams.EnumParam { @SerializedName("application") APPLICATION("application"), + @SerializedName("application_custom") + APPLICATION_CUSTOM("application_custom"), + + @SerializedName("application_express") + APPLICATION_EXPRESS("application_express"), + @SerializedName("stripe") STRIPE("stripe"); @@ -10814,7 +10919,10 @@ public enum Locale implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Identity { - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ @SerializedName("attestations") Attestations attestations; @@ -10890,7 +10998,10 @@ public AccountCreateParams.Identity build() { this.individual); } - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ public Builder setAttestations(AccountCreateParams.Identity.Attestations attestations) { this.attestations = attestations; return this; @@ -10983,6 +11094,13 @@ public static class Attestations { @SerializedName("persons_provided") PersonsProvided personsProvided; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** Attestations of accepted terms of service agreements. */ @SerializedName("terms_of_service") TermsOfService termsOfService; @@ -10992,11 +11110,13 @@ private Attestations( Map extraParams, OwnershipDeclaration ownershipDeclaration, PersonsProvided personsProvided, + RepresentativeDeclaration representativeDeclaration, TermsOfService termsOfService) { this.directorshipDeclaration = directorshipDeclaration; this.extraParams = extraParams; this.ownershipDeclaration = ownershipDeclaration; this.personsProvided = personsProvided; + this.representativeDeclaration = representativeDeclaration; this.termsOfService = termsOfService; } @@ -11013,6 +11133,8 @@ public static class Builder { private PersonsProvided personsProvided; + private RepresentativeDeclaration representativeDeclaration; + private TermsOfService termsOfService; /** Finalize and obtain parameter instance from this builder. */ @@ -11022,6 +11144,7 @@ public AccountCreateParams.Identity.Attestations build() { this.extraParams, this.ownershipDeclaration, this.personsProvided, + this.representativeDeclaration, this.termsOfService); } @@ -11081,6 +11204,17 @@ public Builder setPersonsProvided( return this; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + public Builder setRepresentativeDeclaration( + AccountCreateParams.Identity.Attestations.RepresentativeDeclaration + representativeDeclaration) { + this.representativeDeclaration = representativeDeclaration; + return this; + } + /** Attestations of accepted terms of service agreements. */ public Builder setTermsOfService( AccountCreateParams.Identity.Attestations.TermsOfService termsOfService) { @@ -11470,6 +11604,116 @@ public enum OwnershipExemptionReason implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration { + /** + * The time marking when the representative attestation was made. Represented as a RFC 3339 + * date & time UTC value in millisecond precision, for example: + * 2022-09-18T13:22:18.123Z. + */ + @SerializedName("date") + Instant date; + + /** + * 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 IP address from which the representative attestation was made. */ + @SerializedName("ip") + String ip; + + /** The user agent of the browser from which the representative attestation was made. */ + @SerializedName("user_agent") + String userAgent; + + private RepresentativeDeclaration( + Instant date, Map extraParams, String ip, String userAgent) { + this.date = date; + this.extraParams = extraParams; + this.ip = ip; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Instant date; + + private Map extraParams; + + private String ip; + + private String userAgent; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Identity.Attestations.RepresentativeDeclaration build() { + return new AccountCreateParams.Identity.Attestations.RepresentativeDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); + } + + /** + * The time marking when the representative attestation was made. Represented as a RFC + * 3339 date & time UTC value in millisecond precision, for example: + * 2022-09-18T13:22:18.123Z. + */ + public Builder setDate(Instant date) { + this.date = date; + 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.Identity.Attestations.RepresentativeDeclaration#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.Identity.Attestations.RepresentativeDeclaration#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 IP address from which the representative attestation was made. */ + public Builder setIp(String ip) { + this.ip = ip; + return this; + } + + /** The user agent of the browser from which the representative attestation was made. */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class TermsOfService { diff --git a/src/main/java/com/stripe/param/v2/core/AccountListParams.java b/src/main/java/com/stripe/param/v2/core/AccountListParams.java index a80c11fec53..9f6d976161c 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountListParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountListParams.java @@ -20,6 +20,12 @@ public class AccountListParams extends ApiRequestParams { @SerializedName("applied_configurations") List appliedConfigurations; + /** + * Filter by whether the account is closed. If omitted, returns only Accounts that are not closed. + */ + @SerializedName("closed") + Boolean closed; + /** * 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,8 +40,12 @@ public class AccountListParams extends ApiRequestParams { Long limit; private AccountListParams( - List appliedConfigurations, Map extraParams, Long limit) { + List appliedConfigurations, + Boolean closed, + Map extraParams, + Long limit) { this.appliedConfigurations = appliedConfigurations; + this.closed = closed; this.extraParams = extraParams; this.limit = limit; } @@ -47,13 +57,16 @@ public static Builder builder() { public static class Builder { private List appliedConfigurations; + private Boolean closed; + private Map extraParams; private Long limit; /** Finalize and obtain parameter instance from this builder. */ public AccountListParams build() { - return new AccountListParams(this.appliedConfigurations, this.extraParams, this.limit); + return new AccountListParams( + this.appliedConfigurations, this.closed, this.extraParams, this.limit); } /** @@ -82,6 +95,15 @@ public Builder addAllAppliedConfiguration(List elements) { return this; } + /** + * Filter by whether the account is closed. If omitted, returns only Accounts that are not + * closed. + */ + public Builder setClosed(Boolean closed) { + this.closed = closed; + 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 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 85613d2bbb8..b60ba785b28 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java @@ -1878,6 +1878,9 @@ public enum LocationSource implements ApiRequestParams.EnumParam { @SerializedName("ip_address") IP_ADDRESS("ip_address"), + @SerializedName("payment_method") + PAYMENT_METHOD("payment_method"), + @SerializedName("shipping_address") SHIPPING_ADDRESS("shipping_address"); @@ -9726,9 +9729,14 @@ public static class HoldsCurrencies { @SerializedName("gbp") Gbp gbp; - private HoldsCurrencies(Map extraParams, Gbp gbp) { + /** Can hold storage-type funds on Stripe in USD. */ + @SerializedName("usd") + Usd usd; + + private HoldsCurrencies(Map extraParams, Gbp gbp, Usd usd) { this.extraParams = extraParams; this.gbp = gbp; + this.usd = usd; } public static Builder builder() { @@ -9740,10 +9748,12 @@ public static class Builder { private Gbp gbp; + private Usd usd; + /** Finalize and obtain parameter instance from this builder. */ public AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies build() { return new AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies( - this.extraParams, this.gbp); + this.extraParams, this.gbp, this.usd); } /** @@ -9782,6 +9792,13 @@ public Builder setGbp( this.gbp = gbp; return this; } + + /** Can hold storage-type funds on Stripe in USD. */ + public Builder setUsd( + AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd usd) { + this.usd = usd; + return this; + } } @Getter @@ -9865,6 +9882,88 @@ public Builder setRequested(Boolean requested) { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Usd { + /** + * 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; + + /** + * To request a new Capability for an account, pass true. There can be a delay before + * the requested Capability becomes active. + */ + @SerializedName("requested") + Boolean requested; + + private Usd(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd + build() { + return new AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies + .Usd(this.extraParams, this.requested); + } + + /** + * 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.Configuration.Storer.Capabilities.HoldsCurrencies.Usd#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.Configuration.Storer.Capabilities.HoldsCurrencies.Usd#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * To request a new Capability for an account, pass true. There can be a delay before + * the requested Capability becomes active. + */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } } @Getter @@ -11052,6 +11151,12 @@ public enum FeesCollector implements ApiRequestParams.EnumParam { @SerializedName("application") APPLICATION("application"), + @SerializedName("application_custom") + APPLICATION_CUSTOM("application_custom"), + + @SerializedName("application_express") + APPLICATION_EXPRESS("application_express"), + @SerializedName("stripe") STRIPE("stripe"); @@ -11344,7 +11449,10 @@ public enum Locale implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Identity { - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ @SerializedName("attestations") Attestations attestations; @@ -11423,7 +11531,10 @@ public AccountUpdateParams.Identity build() { this.individual); } - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ public Builder setAttestations(AccountUpdateParams.Identity.Attestations attestations) { this.attestations = attestations; return this; @@ -11530,6 +11641,13 @@ public static class Attestations { @SerializedName("persons_provided") PersonsProvided personsProvided; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** Attestations of accepted terms of service agreements. */ @SerializedName("terms_of_service") TermsOfService termsOfService; @@ -11539,11 +11657,13 @@ private Attestations( Map extraParams, OwnershipDeclaration ownershipDeclaration, PersonsProvided personsProvided, + RepresentativeDeclaration representativeDeclaration, TermsOfService termsOfService) { this.directorshipDeclaration = directorshipDeclaration; this.extraParams = extraParams; this.ownershipDeclaration = ownershipDeclaration; this.personsProvided = personsProvided; + this.representativeDeclaration = representativeDeclaration; this.termsOfService = termsOfService; } @@ -11560,6 +11680,8 @@ public static class Builder { private PersonsProvided personsProvided; + private RepresentativeDeclaration representativeDeclaration; + private TermsOfService termsOfService; /** Finalize and obtain parameter instance from this builder. */ @@ -11569,6 +11691,7 @@ public AccountUpdateParams.Identity.Attestations build() { this.extraParams, this.ownershipDeclaration, this.personsProvided, + this.representativeDeclaration, this.termsOfService); } @@ -11628,6 +11751,17 @@ public Builder setPersonsProvided( return this; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + public Builder setRepresentativeDeclaration( + AccountUpdateParams.Identity.Attestations.RepresentativeDeclaration + representativeDeclaration) { + this.representativeDeclaration = representativeDeclaration; + return this; + } + /** Attestations of accepted terms of service agreements. */ public Builder setTermsOfService( AccountUpdateParams.Identity.Attestations.TermsOfService termsOfService) { @@ -12041,6 +12175,128 @@ public enum OwnershipExemptionReason implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration { + /** + * The time marking when the representative attestation was made. Represented as a RFC 3339 + * date & time UTC value in millisecond precision, for example: + * 2022-09-18T13:22:18.123Z. + */ + @SerializedName("date") + Instant date; + + /** + * 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 IP address from which the representative attestation was made. */ + @SerializedName("ip") + Object ip; + + /** The user agent of the browser from which the representative attestation was made. */ + @SerializedName("user_agent") + Object userAgent; + + private RepresentativeDeclaration( + Instant date, Map extraParams, Object ip, Object userAgent) { + this.date = date; + this.extraParams = extraParams; + this.ip = ip; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Instant date; + + private Map extraParams; + + private Object ip; + + private Object userAgent; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Identity.Attestations.RepresentativeDeclaration build() { + return new AccountUpdateParams.Identity.Attestations.RepresentativeDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); + } + + /** + * The time marking when the representative attestation was made. Represented as a RFC + * 3339 date & time UTC value in millisecond precision, for example: + * 2022-09-18T13:22:18.123Z. + */ + public Builder setDate(Instant date) { + this.date = date; + 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.Identity.Attestations.RepresentativeDeclaration#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.Identity.Attestations.RepresentativeDeclaration#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 IP address from which the representative attestation was made. */ + public Builder setIp(String ip) { + this.ip = ip; + return this; + } + + /** The IP address from which the representative attestation was made. */ + public Builder setIp(EmptyParam ip) { + this.ip = ip; + return this; + } + + /** The user agent of the browser from which the representative attestation was made. */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** The user agent of the browser from which the representative attestation was made. */ + public Builder setUserAgent(EmptyParam userAgent) { + this.userAgent = userAgent; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class TermsOfService { diff --git a/src/main/java/com/stripe/param/v2/core/EventListParams.java b/src/main/java/com/stripe/param/v2/core/EventListParams.java index b80d95056b9..be4f3b17dbd 100644 --- a/src/main/java/com/stripe/param/v2/core/EventListParams.java +++ b/src/main/java/com/stripe/param/v2/core/EventListParams.java @@ -3,7 +3,10 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +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; @@ -20,18 +23,51 @@ public class EventListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Filter for events created after the specified timestamp. */ + @SerializedName("gt") + Instant gt; + + /** Filter for events created at or after the specified timestamp. */ + @SerializedName("gte") + Instant gte; + /** The page size. */ @SerializedName("limit") Long limit; - /** Required. Primary object ID used to retrieve related events. */ + /** Filter for events created before the specified timestamp. */ + @SerializedName("lt") + Instant lt; + + /** Filter for events created at or before the specified timestamp. */ + @SerializedName("lte") + Instant lte; + + /** Primary object ID used to retrieve related events. */ @SerializedName("object_id") String objectId; - private EventListParams(Map extraParams, Long limit, String objectId) { + /** An array of up to 20 strings containing specific event names. */ + @SerializedName("types") + List types; + + private EventListParams( + Map extraParams, + Instant gt, + Instant gte, + Long limit, + Instant lt, + Instant lte, + String objectId, + List types) { this.extraParams = extraParams; + this.gt = gt; + this.gte = gte; this.limit = limit; + this.lt = lt; + this.lte = lte; this.objectId = objectId; + this.types = types; } public static Builder builder() { @@ -41,13 +77,31 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Instant gt; + + private Instant gte; + private Long limit; + private Instant lt; + + private Instant lte; + private String objectId; + private List types; + /** Finalize and obtain parameter instance from this builder. */ public EventListParams build() { - return new EventListParams(this.extraParams, this.limit, this.objectId); + return new EventListParams( + this.extraParams, + this.gt, + this.gte, + this.limit, + this.lt, + this.lte, + this.objectId, + this.types); } /** @@ -76,16 +130,66 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Filter for events created after the specified timestamp. */ + public Builder setGt(Instant gt) { + this.gt = gt; + return this; + } + + /** Filter for events created at or after the specified timestamp. */ + public Builder setGte(Instant gte) { + this.gte = gte; + return this; + } + /** The page size. */ public Builder setLimit(Long limit) { this.limit = limit; return this; } - /** Required. Primary object ID used to retrieve related events. */ + /** Filter for events created before the specified timestamp. */ + public Builder setLt(Instant lt) { + this.lt = lt; + return this; + } + + /** Filter for events created at or before the specified timestamp. */ + public Builder setLte(Instant lte) { + this.lte = lte; + return this; + } + + /** Primary object ID used to retrieve related events. */ public Builder setObjectId(String objectId) { this.objectId = objectId; return this; } + + /** + * Add an element to `types` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * EventListParams#types} for the field documentation. + */ + public Builder addType(String element) { + if (this.types == null) { + this.types = new ArrayList<>(); + } + this.types.add(element); + return this; + } + + /** + * Add all elements to `types` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * EventListParams#types} for the field documentation. + */ + public Builder addAllType(List elements) { + if (this.types == null) { + this.types = new ArrayList<>(); + } + this.types.addAll(elements); + return this; + } } } diff --git a/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountListParams.java b/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountListParams.java new file mode 100644 index 00000000000..3d7e78d1eee --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountListParams.java @@ -0,0 +1,78 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core.vault; + +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 GbBankAccountListParams 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 10. */ + @SerializedName("limit") + Long limit; + + private GbBankAccountListParams(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 GbBankAccountListParams build() { + return new GbBankAccountListParams(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 + * GbBankAccountListParams#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 GbBankAccountListParams#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; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountConfirmMicrodepositsParams.java b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountConfirmMicrodepositsParams.java new file mode 100644 index 00000000000..d2594269dce --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountConfirmMicrodepositsParams.java @@ -0,0 +1,124 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core.vault; + +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 UsBankAccountConfirmMicrodepositsParams extends ApiRequestParams { + /** + * Two amounts received through Send Microdeposits must match the input to Confirm Microdeposits + * to verify US Bank Account. + */ + @SerializedName("amounts") + List amounts; + + /** + * Descriptor code received through Send Microdeposits must match the input to Confirm + * Microdeposits to verify US Bank Account. + */ + @SerializedName("descriptor_code") + String descriptorCode; + + /** + * 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 UsBankAccountConfirmMicrodepositsParams( + List amounts, String descriptorCode, Map extraParams) { + this.amounts = amounts; + this.descriptorCode = descriptorCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List amounts; + + private String descriptorCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public UsBankAccountConfirmMicrodepositsParams build() { + return new UsBankAccountConfirmMicrodepositsParams( + this.amounts, this.descriptorCode, this.extraParams); + } + + /** + * Add an element to `amounts` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * UsBankAccountConfirmMicrodepositsParams#amounts} for the field documentation. + */ + public Builder addAmount(Long element) { + if (this.amounts == null) { + this.amounts = new ArrayList<>(); + } + this.amounts.add(element); + return this; + } + + /** + * Add all elements to `amounts` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * UsBankAccountConfirmMicrodepositsParams#amounts} for the field documentation. + */ + public Builder addAllAmount(List elements) { + if (this.amounts == null) { + this.amounts = new ArrayList<>(); + } + this.amounts.addAll(elements); + return this; + } + + /** + * Descriptor code received through Send Microdeposits must match the input to Confirm + * Microdeposits to verify US Bank Account. + */ + public Builder setDescriptorCode(String descriptorCode) { + this.descriptorCode = descriptorCode; + 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 + * UsBankAccountConfirmMicrodepositsParams#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 UsBankAccountConfirmMicrodepositsParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountListParams.java b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountListParams.java new file mode 100644 index 00000000000..b8003413924 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountListParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core.vault; + +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 UsBankAccountListParams 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 10. */ + @SerializedName("limit") + Long limit; + + /** + * Optionally filter by verification status. Mutually exclusive with {@code unverified}, {@code + * verified}, {@code awaiting_verification}, and {@code verification_failed}. + */ + @SerializedName("verification_status") + String verificationStatus; + + private UsBankAccountListParams( + Map extraParams, Long limit, String verificationStatus) { + this.extraParams = extraParams; + this.limit = limit; + this.verificationStatus = verificationStatus; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long limit; + + private String verificationStatus; + + /** Finalize and obtain parameter instance from this builder. */ + public UsBankAccountListParams build() { + return new UsBankAccountListParams(this.extraParams, this.limit, this.verificationStatus); + } + + /** + * 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 + * UsBankAccountListParams#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 UsBankAccountListParams#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; + } + + /** + * Optionally filter by verification status. Mutually exclusive with {@code unverified}, {@code + * verified}, {@code awaiting_verification}, and {@code verification_failed}. + */ + public Builder setVerificationStatus(String verificationStatus) { + this.verificationStatus = verificationStatus; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountUpdateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountUpdateParams.java new file mode 100644 index 00000000000..8c023e0b68c --- /dev/null +++ b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountUpdateParams.java @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.moneymanagement; + +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 FinancialAccountUpdateParams extends ApiRequestParams { + /** + * A descriptive name for the FinancialAccount, up to 50 characters long. This name will be used + * in the Stripe Dashboard and embedded components. + */ + @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; + + /** Metadata associated with the FinancialAccount. */ + @SerializedName("metadata") + Map metadata; + + private FinancialAccountUpdateParams( + Object displayName, Map extraParams, Map metadata) { + this.displayName = displayName; + this.extraParams = extraParams; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object displayName; + + private Map extraParams; + + private Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public FinancialAccountUpdateParams build() { + return new FinancialAccountUpdateParams(this.displayName, this.extraParams, this.metadata); + } + + /** + * A descriptive name for the FinancialAccount, up to 50 characters long. This name will be used + * in the Stripe Dashboard and embedded components. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * A descriptive name for the FinancialAccount, up to 50 characters long. This name will be used + * in the Stripe Dashboard and embedded components. + */ + 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 + * FinancialAccountUpdateParams#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 FinancialAccountUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, + * and subsequent calls add additional key/value pairs to the original map. See {@link + * FinancialAccountUpdateParams#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 + * FinancialAccountUpdateParams#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 + * FinancialAccountUpdateParams#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/testhelpers/MoneyManagementRecipientVerificationsParams.java b/src/main/java/com/stripe/param/v2/testhelpers/MoneyManagementRecipientVerificationsParams.java index cab3b84e370..172a56be36b 100644 --- a/src/main/java/com/stripe/param/v2/testhelpers/MoneyManagementRecipientVerificationsParams.java +++ b/src/main/java/com/stripe/param/v2/testhelpers/MoneyManagementRecipientVerificationsParams.java @@ -22,7 +22,9 @@ public class MoneyManagementRecipientVerificationsParams extends ApiRequestParam /** * Required. Expected match level of the RecipientVerification to be created: - * {@code match}, {@code close_match}, {@code no_match}, {@code unavailable}. + * {@code match}, {@code close_match}, {@code no_match}, {@code unavailable}. For {@code + * close_match}, the simulated response appends "close_match" to the provided name in + * match_result_details.matched_name. */ @SerializedName("match_result") MatchResult matchResult; @@ -97,7 +99,9 @@ public Builder putAllExtraParam(Map map) { /** * Required. Expected match level of the RecipientVerification to be created: - * {@code match}, {@code close_match}, {@code no_match}, {@code unavailable}. + * {@code match}, {@code close_match}, {@code no_match}, {@code unavailable}. For {@code + * close_match}, the simulated response appends "close_match" to the provided name in + * match_result_details.matched_name. */ public Builder setMatchResult( MoneyManagementRecipientVerificationsParams.MatchResult matchResult) { diff --git a/src/main/java/com/stripe/service/delegatedcheckout/RequestedSessionService.java b/src/main/java/com/stripe/service/delegatedcheckout/RequestedSessionService.java index 4179cbcb993..d9c545a606d 100644 --- a/src/main/java/com/stripe/service/delegatedcheckout/RequestedSessionService.java +++ b/src/main/java/com/stripe/service/delegatedcheckout/RequestedSessionService.java @@ -88,14 +88,6 @@ public RequestedSession create(RequestedSessionCreateParams params) throws Strip return create(params, (RequestOptions) null); } /** Creates a requested session. */ - public RequestedSession create(RequestOptions options) throws StripeException { - return create((RequestedSessionCreateParams) null, options); - } - /** Creates a requested session. */ - public RequestedSession create() throws StripeException { - return create((RequestedSessionCreateParams) null, (RequestOptions) null); - } - /** Creates a requested session. */ public RequestedSession create(RequestedSessionCreateParams params, RequestOptions options) throws StripeException { String path = "/v1/delegated_checkout/requested_sessions"; diff --git a/src/main/java/com/stripe/service/v2/billing/PricingPlanSubscriptionService.java b/src/main/java/com/stripe/service/v2/billing/PricingPlanSubscriptionService.java index d66b52c82eb..6cd752e267f 100644 --- a/src/main/java/com/stripe/service/v2/billing/PricingPlanSubscriptionService.java +++ b/src/main/java/com/stripe/service/v2/billing/PricingPlanSubscriptionService.java @@ -89,4 +89,9 @@ public PricingPlanSubscription update( options); return this.request(request, PricingPlanSubscription.class); } + + public com.stripe.service.v2.billing.pricingplansubscriptions.ComponentService components() { + return new com.stripe.service.v2.billing.pricingplansubscriptions.ComponentService( + this.getResponseGetter()); + } } diff --git a/src/main/java/com/stripe/service/v2/billing/pricingplansubscriptions/ComponentService.java b/src/main/java/com/stripe/service/v2/billing/pricingplansubscriptions/ComponentService.java new file mode 100644 index 00000000000..5275dc18ee0 --- /dev/null +++ b/src/main/java/com/stripe/service/v2/billing/pricingplansubscriptions/ComponentService.java @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.billing.pricingplansubscriptions; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.billing.PricingPlanSubscriptionComponents; +import com.stripe.net.ApiRequest; +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; + +public final class ComponentService extends ApiService { + public ComponentService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Retrieve a Pricing Plan Subscription's components. */ + public PricingPlanSubscriptionComponents retrieve(String id) throws StripeException { + return retrieve(id, (RequestOptions) null); + } + /** Retrieve a Pricing Plan Subscription's components. */ + public PricingPlanSubscriptionComponents retrieve(String id, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v2/billing/pricing_plan_subscriptions/%s/components", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + return this.request(request, PricingPlanSubscriptionComponents.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 a0d19e3ac01..3e503c30cb3 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountService.java @@ -147,19 +147,35 @@ public Account update(String id, AccountUpdateParams params, RequestOptions opti options); return this.request(request, Account.class); } - /** Removes access to the Account and its associated resources. */ + /** + * Removes access to the Account and its associated resources. Closed Accounts can no longer be + * operated on, but limited information can still be retrieved through the API in order to be able + * to track their history. + */ public Account close(String id, AccountCloseParams params) throws StripeException { return close(id, params, (RequestOptions) null); } - /** Removes access to the Account and its associated resources. */ + /** + * Removes access to the Account and its associated resources. Closed Accounts can no longer be + * operated on, but limited information can still be retrieved through the API in order to be able + * to track their history. + */ public Account close(String id, RequestOptions options) throws StripeException { return close(id, (AccountCloseParams) null, options); } - /** Removes access to the Account and its associated resources. */ + /** + * Removes access to the Account and its associated resources. Closed Accounts can no longer be + * operated on, but limited information can still be retrieved through the API in order to be able + * to track their history. + */ public Account close(String id) throws StripeException { return close(id, (AccountCloseParams) null, (RequestOptions) null); } - /** Removes access to the Account and its associated resources. */ + /** + * Removes access to the Account and its associated resources. Closed Accounts can no longer be + * operated on, but limited information can still be retrieved through the API in order to be able + * to track their history. + */ public Account close(String id, AccountCloseParams params, RequestOptions options) throws StripeException { String path = String.format("/v2/core/accounts/%s/close", ApiResource.urlEncodeId(id)); diff --git a/src/main/java/com/stripe/service/v2/core/EventService.java b/src/main/java/com/stripe/service/v2/core/EventService.java index 6a2cae51bbf..c461aa97db6 100644 --- a/src/main/java/com/stripe/service/v2/core/EventService.java +++ b/src/main/java/com/stripe/service/v2/core/EventService.java @@ -24,6 +24,14 @@ public StripeCollection list(EventListParams params) throws StripeExcepti return list(params, (RequestOptions) null); } /** List events, going back up to 30 days. */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((EventListParams) null, options); + } + /** List events, going back up to 30 days. */ + public StripeCollection list() throws StripeException { + return list((EventListParams) null, (RequestOptions) null); + } + /** List events, going back up to 30 days. */ public StripeCollection list(EventListParams params, RequestOptions options) throws StripeException { String path = "/v2/core/events"; diff --git a/src/main/java/com/stripe/service/v2/core/vault/GbBankAccountService.java b/src/main/java/com/stripe/service/v2/core/vault/GbBankAccountService.java index 76965eb88e1..47a0d415ef9 100644 --- a/src/main/java/com/stripe/service/v2/core/vault/GbBankAccountService.java +++ b/src/main/java/com/stripe/service/v2/core/vault/GbBankAccountService.java @@ -1,7 +1,9 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core.vault; +import com.google.gson.reflect.TypeToken; import com.stripe.exception.StripeException; +import com.stripe.model.v2.StripeCollection; import com.stripe.model.v2.core.vault.GbBankAccount; import com.stripe.net.ApiRequest; import com.stripe.net.ApiRequestParams; @@ -12,12 +14,47 @@ import com.stripe.net.StripeResponseGetter; import com.stripe.param.v2.core.vault.GbBankAccountCreateParams; import com.stripe.param.v2.core.vault.GbBankAccountInitiateConfirmationOfPayeeParams; +import com.stripe.param.v2.core.vault.GbBankAccountListParams; public final class GbBankAccountService extends ApiService { public GbBankAccountService(StripeResponseGetter responseGetter) { super(responseGetter); } + /** + * List objects that can be used as destinations for outbound money movement via OutboundPayment. + */ + public StripeCollection list(GbBankAccountListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + /** + * List objects that can be used as destinations for outbound money movement via OutboundPayment. + */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((GbBankAccountListParams) null, options); + } + /** + * List objects that can be used as destinations for outbound money movement via OutboundPayment. + */ + public StripeCollection list() throws StripeException { + return list((GbBankAccountListParams) null, (RequestOptions) null); + } + /** + * List objects that can be used as destinations for outbound money movement via OutboundPayment. + */ + public StripeCollection list( + GbBankAccountListParams params, RequestOptions options) throws StripeException { + String path = "/v2/core/vault/gb_bank_accounts"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } /** Create a GB bank account. */ public GbBankAccount create(GbBankAccountCreateParams params) throws StripeException { return create(params, (RequestOptions) null); diff --git a/src/main/java/com/stripe/service/v2/core/vault/UsBankAccountService.java b/src/main/java/com/stripe/service/v2/core/vault/UsBankAccountService.java index 177838d0420..18d7da5a09b 100644 --- a/src/main/java/com/stripe/service/v2/core/vault/UsBankAccountService.java +++ b/src/main/java/com/stripe/service/v2/core/vault/UsBankAccountService.java @@ -1,11 +1,13 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core.vault; +import com.google.gson.reflect.TypeToken; import com.stripe.exception.BlockedByStripeException; import com.stripe.exception.ControlledByDashboardException; import com.stripe.exception.InvalidPaymentMethodException; import com.stripe.exception.QuotaExceededException; import com.stripe.exception.StripeException; +import com.stripe.model.v2.StripeCollection; import com.stripe.model.v2.core.vault.UsBankAccount; import com.stripe.net.ApiRequest; import com.stripe.net.ApiRequestParams; @@ -14,7 +16,9 @@ import com.stripe.net.BaseAddress; import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; +import com.stripe.param.v2.core.vault.UsBankAccountConfirmMicrodepositsParams; import com.stripe.param.v2.core.vault.UsBankAccountCreateParams; +import com.stripe.param.v2.core.vault.UsBankAccountListParams; import com.stripe.param.v2.core.vault.UsBankAccountUpdateParams; public final class UsBankAccountService extends ApiService { @@ -22,6 +26,32 @@ public UsBankAccountService(StripeResponseGetter responseGetter) { super(responseGetter); } + /** List USBankAccount objects. Optionally filter by verification status. */ + public StripeCollection list(UsBankAccountListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + /** List USBankAccount objects. Optionally filter by verification status. */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((UsBankAccountListParams) null, options); + } + /** List USBankAccount objects. Optionally filter by verification status. */ + public StripeCollection list() throws StripeException { + return list((UsBankAccountListParams) null, (RequestOptions) null); + } + /** List USBankAccount objects. Optionally filter by verification status. */ + public StripeCollection list( + UsBankAccountListParams params, RequestOptions options) throws StripeException { + String path = "/v2/core/vault/us_bank_accounts"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } /** Create a USBankAccount object. */ public UsBankAccount create(UsBankAccountCreateParams params) throws StripeException, BlockedByStripeException, InvalidPaymentMethodException, @@ -118,4 +148,73 @@ public UsBankAccount archive(String id, RequestOptions options) new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); return this.request(request, UsBankAccount.class); } + /** + * Confirm microdeposits amounts or descriptor code that you have received from the Send + * Microdeposits request. Once you correctly confirm this, this US Bank Account will be verified + * and eligible to transfer funds with. + */ + public UsBankAccount confirmMicrodeposits( + String id, UsBankAccountConfirmMicrodepositsParams params) throws StripeException { + return confirmMicrodeposits(id, params, (RequestOptions) null); + } + /** + * Confirm microdeposits amounts or descriptor code that you have received from the Send + * Microdeposits request. Once you correctly confirm this, this US Bank Account will be verified + * and eligible to transfer funds with. + */ + public UsBankAccount confirmMicrodeposits(String id, RequestOptions options) + throws StripeException { + return confirmMicrodeposits(id, (UsBankAccountConfirmMicrodepositsParams) null, options); + } + /** + * Confirm microdeposits amounts or descriptor code that you have received from the Send + * Microdeposits request. Once you correctly confirm this, this US Bank Account will be verified + * and eligible to transfer funds with. + */ + public UsBankAccount confirmMicrodeposits(String id) throws StripeException { + return confirmMicrodeposits( + id, (UsBankAccountConfirmMicrodepositsParams) null, (RequestOptions) null); + } + /** + * Confirm microdeposits amounts or descriptor code that you have received from the Send + * Microdeposits request. Once you correctly confirm this, this US Bank Account will be verified + * and eligible to transfer funds with. + */ + public UsBankAccount confirmMicrodeposits( + String id, UsBankAccountConfirmMicrodepositsParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v2/core/vault/us_bank_accounts/%s/confirm_microdeposits", + ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, UsBankAccount.class); + } + /** + * Send microdeposits in order to verify your US Bank Account so it is eligible to transfer funds. + * This will start the verification process and you must Confirm Microdeposits to successfully + * verify your US Bank Account. + */ + public UsBankAccount sendMicrodeposits(String id) throws StripeException { + return sendMicrodeposits(id, (RequestOptions) null); + } + /** + * Send microdeposits in order to verify your US Bank Account so it is eligible to transfer funds. + * This will start the verification process and you must Confirm Microdeposits to successfully + * verify your US Bank Account. + */ + public UsBankAccount sendMicrodeposits(String id, RequestOptions options) throws StripeException { + String path = + String.format( + "/v2/core/vault/us_bank_accounts/%s/send_microdeposits", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); + return this.request(request, UsBankAccount.class); + } } diff --git a/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java b/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java index c2ac9e692b4..c5a8104c4d8 100644 --- a/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java +++ b/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java @@ -18,6 +18,7 @@ import com.stripe.param.v2.moneymanagement.FinancialAccountCloseParams; import com.stripe.param.v2.moneymanagement.FinancialAccountCreateParams; import com.stripe.param.v2.moneymanagement.FinancialAccountListParams; +import com.stripe.param.v2.moneymanagement.FinancialAccountUpdateParams; public final class FinancialAccountService extends ApiService { public FinancialAccountService(StripeResponseGetter responseGetter) { @@ -80,6 +81,34 @@ public FinancialAccount retrieve(String id, RequestOptions options) throws Strip new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); return this.request(request, FinancialAccount.class); } + /** Updates an existing FinancialAccount. */ + public FinancialAccount update(String id, FinancialAccountUpdateParams params) + throws StripeException { + return update(id, params, (RequestOptions) null); + } + /** Updates an existing FinancialAccount. */ + public FinancialAccount update(String id, RequestOptions options) throws StripeException { + return update(id, (FinancialAccountUpdateParams) null, options); + } + /** Updates an existing FinancialAccount. */ + public FinancialAccount update(String id) throws StripeException { + return update(id, (FinancialAccountUpdateParams) null, (RequestOptions) null); + } + /** Updates an existing FinancialAccount. */ + public FinancialAccount update( + String id, FinancialAccountUpdateParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v2/money_management/financial_accounts/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, FinancialAccount.class); + } /** Closes a FinancialAccount with or without forwarding settings. */ public FinancialAccount close(String id, FinancialAccountCloseParams params) throws StripeException, NonZeroBalanceException { diff --git a/src/main/java/com/stripe/service/v2/moneymanagement/OutboundPaymentService.java b/src/main/java/com/stripe/service/v2/moneymanagement/OutboundPaymentService.java index 6cbc880a6d5..67068134be1 100644 --- a/src/main/java/com/stripe/service/v2/moneymanagement/OutboundPaymentService.java +++ b/src/main/java/com/stripe/service/v2/moneymanagement/OutboundPaymentService.java @@ -54,14 +54,14 @@ public StripeCollection list( } /** Creates an OutboundPayment. */ public OutboundPayment create(OutboundPaymentCreateParams params) - throws StripeException, InsufficientFundsException, QuotaExceededException, - RecipientNotNotifiableException, FeatureNotEnabledException { + throws StripeException, InsufficientFundsException, FeatureNotEnabledException, + QuotaExceededException, RecipientNotNotifiableException { return create(params, (RequestOptions) null); } /** Creates an OutboundPayment. */ public OutboundPayment create(OutboundPaymentCreateParams params, RequestOptions options) - throws StripeException, InsufficientFundsException, QuotaExceededException, - RecipientNotNotifiableException, FeatureNotEnabledException { + throws StripeException, InsufficientFundsException, FeatureNotEnabledException, + QuotaExceededException, RecipientNotNotifiableException { String path = "/v2/money_management/outbound_payments"; 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 ec0ed23c6f1..ad9286985de 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -26245,6 +26245,30 @@ public void testV2BillingPricingPlanSubscriptionPostServices() throws StripeExce null); } + @Test + public void testV2BillingPricingPlanSubscriptionsComponentGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/pricing_plan_subscriptions/id_123/components", + null, + null, + com.stripe.model.v2.billing.PricingPlanSubscriptionComponents.class, + "{\"components\":[{\"pricing_plan_component\":\"pricing_plan_component\",\"type\":\"license_fee_subscription\"}],\"object\":\"v2.billing.pricing_plan_subscription_components\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.billing.PricingPlanSubscriptionComponents + pricingPlanSubscriptionComponents = + client.v2().billing().pricingPlanSubscriptions().components().retrieve("id_123"); + assertNotNull(pricingPlanSubscriptionComponents); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/billing/pricing_plan_subscriptions/id_123/components", + null, + null); + } + @Test public void testV2BillingProfileGetServices() throws StripeException { stubRequest( @@ -27209,7 +27233,7 @@ public void testV2CoreEventGetServices() throws StripeException { StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.EventListParams params = - com.stripe.param.v2.core.EventListParams.builder().setObjectId("object_id").build(); + com.stripe.param.v2.core.EventListParams.builder().build(); com.stripe.model.v2.StripeCollection stripeCollection = client.v2().core().events().list(params); @@ -27439,6 +27463,34 @@ public void testV2CoreEventDestinationPost5Services() throws StripeException { null); } + @Test + public void testV2CoreVaultGbBankAccountGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/vault/gb_bank_accounts", + null, + null, + new TypeToken< + com.stripe.model.v2.StripeCollection< + com.stripe.model.v2.core.vault.GbBankAccount>>() {}.getType(), + "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.vault.GbBankAccountListParams params = + com.stripe.param.v2.core.vault.GbBankAccountListParams.builder().build(); + + com.stripe.model.v2.StripeCollection + stripeCollection = client.v2().core().vault().gbBankAccounts().list(params); + assertNotNull(stripeCollection); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/vault/gb_bank_accounts", + params.toMap(), + null); + } + @Test public void testV2CoreVaultGbBankAccountPostServices() throws StripeException { stubRequest( @@ -27469,7 +27521,7 @@ public void testV2CoreVaultGbBankAccountPostServices() throws StripeException { } @Test - public void testV2CoreVaultGbBankAccountGetServices() throws StripeException { + public void testV2CoreVaultGbBankAccountGet2Services() throws StripeException { stubRequest( BaseAddress.API, ApiResource.RequestMethod.GET, @@ -27564,6 +27616,34 @@ public void testV2CoreVaultGbBankAccountPost4Services() throws StripeException { null); } + @Test + public void testV2CoreVaultUsBankAccountGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/vault/us_bank_accounts", + null, + null, + new TypeToken< + com.stripe.model.v2.StripeCollection< + com.stripe.model.v2.core.vault.UsBankAccount>>() {}.getType(), + "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.vault.UsBankAccountListParams params = + com.stripe.param.v2.core.vault.UsBankAccountListParams.builder().build(); + + com.stripe.model.v2.StripeCollection + stripeCollection = client.v2().core().vault().usBankAccounts().list(params); + assertNotNull(stripeCollection); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/vault/us_bank_accounts", + params.toMap(), + null); + } + @Test public void testV2CoreVaultUsBankAccountPostServices() throws StripeException { stubRequest( @@ -27573,7 +27653,7 @@ public void testV2CoreVaultUsBankAccountPostServices() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = @@ -27593,7 +27673,7 @@ public void testV2CoreVaultUsBankAccountPostServices() throws StripeException { } @Test - public void testV2CoreVaultUsBankAccountGetServices() throws StripeException { + public void testV2CoreVaultUsBankAccountGet2Services() throws StripeException { stubRequest( BaseAddress.API, ApiResource.RequestMethod.GET, @@ -27601,7 +27681,7 @@ public void testV2CoreVaultUsBankAccountGetServices() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -27624,7 +27704,7 @@ public void testV2CoreVaultUsBankAccountPost2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountUpdateParams params = @@ -27650,7 +27730,7 @@ public void testV2CoreVaultUsBankAccountPost3Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -27664,6 +27744,55 @@ public void testV2CoreVaultUsBankAccountPost3Services() throws StripeException { null); } + @Test + public void testV2CoreVaultUsBankAccountPost4Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + null, + null, + com.stripe.model.v2.core.vault.UsBankAccount.class, + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.vault.UsBankAccountConfirmMicrodepositsParams params = + com.stripe.param.v2.core.vault.UsBankAccountConfirmMicrodepositsParams.builder().build(); + + com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = + client.v2().core().vault().usBankAccounts().confirmMicrodeposits("id_123", params); + assertNotNull(usBankAccount); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + params.toMap(), + null); + } + + @Test + public void testV2CoreVaultUsBankAccountPost5Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/vault/us_bank_accounts/id_123/send_microdeposits", + null, + null, + com.stripe.model.v2.core.vault.UsBankAccount.class, + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = + client.v2().core().vault().usBankAccounts().sendMicrodeposits("id_123"); + assertNotNull(usBankAccount); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/vault/us_bank_accounts/id_123/send_microdeposits", + null, + null); + } + @Test public void testV2MoneyManagementAdjustmentGetServices() throws StripeException { stubRequest( @@ -27796,6 +27925,32 @@ public void testV2MoneyManagementFinancialAccountGet2Services() throws StripeExc @Test public void testV2MoneyManagementFinancialAccountPost2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/money_management/financial_accounts/id_123", + null, + null, + com.stripe.model.v2.moneymanagement.FinancialAccount.class, + "{\"balance\":{\"available\":{\"key\":{\"currency\":\"USD\",\"value\":35}},\"inbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":11}},\"outbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":60}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.moneymanagement.FinancialAccountUpdateParams params = + com.stripe.param.v2.moneymanagement.FinancialAccountUpdateParams.builder().build(); + + com.stripe.model.v2.moneymanagement.FinancialAccount financialAccount = + client.v2().moneyManagement().financialAccounts().update("id_123", params); + assertNotNull(financialAccount); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/money_management/financial_accounts/id_123", + params.toMap(), + null); + } + + @Test + public void testV2MoneyManagementFinancialAccountPost3Services() throws StripeException { stubRequest( BaseAddress.API, ApiResource.RequestMethod.POST, @@ -29281,7 +29436,7 @@ public void testFeatureNotEnabledErrorServices() throws StripeException { "/v2/money_management/financial_accounts", null, null, - "{\"error\":{\"type\":\"feature_not_enabled\",\"code\":\"recipient_feature_not_active\"}}", + "{\"error\":{\"type\":\"feature_not_enabled\",\"code\":\"outbound_flow_from_closed_financial_account_unsupported\"}}", 400); StripeClient client = new StripeClient(networkSpy);